Code generation method and apparatus and electronic device
By constructing and training structured text code data sets that comply with international standards in the field of industrial control, the problem of the existing technology being unable to generate codes that comply with IEC61131-3 standards is solved, and large-scale scenario-based codes are realized to automatically generate model and output structured text language codes that comply with standards, and convert them into functional block diagrams, improving the development efficiency of industrial control applications.
Patent Information
- Application Number
- PCT/CN2024/105943
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-18
- Filing Date
- 2024-07-17
- Publication Date
- 2025-03-27
AI Technical Summary
The existing scenario-based automatic code generation model based on large models cannot generate a dedicated language that complies with international standards in the field of industrial control, especially the functional block diagram of the IEC61131-3 standard.
By constructing a structured text code data set that conforms to the preset International Standard Language of Industrial Control, and using this data set to train the model, structured text code that conforms to the International Standard Language of Industrial Control. Then, convert the structured text code into a function block graphic program.
The scenario-based automatic generation model of large-model scenario code can output structured text language codes that meet international standards in the field of industrial control and convert them into functional block diagrams, solving the problem that the existing technology cannot generate codes that comply with the IEC61131-3 standard, and improving the development efficiency of industrial control applications.
Smart Images

Figure CN2024105943_27032025_PF_FP_ABST
Abstract
Description
Code generation method and device, and electronic device
[0001] Related applications
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on September 18, 2023, with application number 202311203144.2 and application name “Code generation method and device, electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of industrial control, and in particular, to a code generation method and device, an electronic device, and a non-transitory computer-readable storage medium. Background Art
[0004] Currently, scenario-based code generation models based on large models are all designed for general-purpose, text-based languages such as C / C++ / JAVA / Python. They do not yet address specialized languages that comply with international standards for industrial control (e.g., IEC61131-3). Industrial control specialized languages protect standard programs such as text and graphics, and their accessible data sets are extremely limited. For graphical programs, since the storage descriptions are not directly expressible and comprehensible, there are currently no models that can directly output function block diagrams that comply with the IEC61131-3 standard.
[0005] Summary of the Invention
[0006] The exemplary embodiments of this application are intended to provide a code generation method and apparatus, an electronic device, and a non-transitory computer-readable storage medium to address the problem that current large-scale scenario-based automatic code generation models cannot generate specialized languages that comply with international standards in the industrial control field.
[0007] According to one aspect of the present application, a code generation method is proposed, comprising constructing a structured text code dataset that conforms to a preset industrial control international standard language; using the structured text code dataset to train a preset model; and using the trained model to generate structured text code that conforms to the industrial control international standard language based on user input data.
[0008] In one embodiment, the model comprises Chatglm-6B, Llama2-7B and / or CodeT5+ model.
[0009] In one embodiment, constructing a structured text code data set that complies with a preset industrial control international standard language includes: generating a structured text algorithm library based on an industrial control program asset library in the industrial control international standard language.
[0010] In one embodiment, the structured text algorithm library includes functions and function block codes defined in accordance with the IEC 61131-3 standard.
[0011] In one embodiment, constructing a structured text code data set that conforms to a preset industrial control international standard language includes: using a preset conversion tool to generate a structured text code data set that conforms to the industrial control international standard language, wherein the conversion tool is configured to convert C language into a structured text language that conforms to the industrial control international standard language.
[0012] In one embodiment, the code generation method further comprises: converting the generated structured text code conforming to the industrial control international standard language into a function block graphic program.
[0013] In one embodiment, converting the generated text code that conforms to the industrial control international standard language into a function block graphic program includes: constructing a code block mapping table corresponding to the four arithmetic operations, logical operations, shift operations, loop statements and / or flow control statements of the structured text code, the code mapping table including a function mapping table and / or a function block mapping table; parsing the structured text code to generate a syntax tree; traversing the syntax tree, and converting the four arithmetic operations, logical operations, shift operations, loop statements and / or flow control statements in the structured text code into function block symbols and data connection topology diagrams according to the constructed code block mapping table.
[0014] According to one aspect of the present application, a code generation device that conforms to an international standard language for industrial control is proposed, comprising: a structured text code data set construction unit, configured to construct a structured text code data set that conforms to a preset international standard language for industrial control; a model training unit, configured to train a preset model using the structured text code data set; and a structured text code generation unit, configured to generate structured text code that conforms to the international standard language for industrial control using the trained model based on user input data.
[0015] According to one aspect of the present application, an electronic device is provided, comprising: a processor; and
[0016] A memory stores a computer program, which, when executed by the processor, causes the processor to execute the code generation method as described in any of the previous embodiments.
[0017] According to one aspect of the present application, a non-transitory computer-readable storage medium is provided, on which computer-readable instructions are stored. When the instructions are executed by a processor, the processor executes the code generation method as described in any of the previous embodiments.
[0018] According to an embodiment of the present application, a structured text code dataset that complies with international standards in the field of industrial control is first constructed, and the constructed structured text code dataset is used to train a scenario-based code automatic generation model based on a large model (that is, an open source low-parameter large model), so that the scenario-based code automatic generation model based on the large model can output structured text language code that complies with the standards.
[0019] It should be understood that the foregoing general description and the following detailed description are merely illustrative and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. By describing the exemplary embodiments in detail with reference to the accompanying drawings, the above and other objects, features and advantages of the present application will become more apparent.
[0021] FIG1 shows a flow chart of a code generation method according to an exemplary embodiment of the present application.
[0022] FIG2 shows a schematic diagram of the structure of a model operation system according to an exemplary embodiment of the present application.
[0023] FIG3 shows a flow chart of another code generation method according to an exemplary embodiment of the present application.
[0024] FIG4 shows a flow chart of a method for converting a structured text code conforming to an international standard language for industrial control into a function block graphic program according to an exemplary embodiment of the present application.
[0025] FIG5 shows a schematic diagram of converting a structured text FOR statement into a function block diagram according to an exemplary embodiment of the present application.
[0026] FIG6 shows a schematic diagram of converting a structured text IF statement into a function block diagram according to an exemplary embodiment of the present application.
[0027] FIG7 shows a block diagram of a code generation device that complies with an international standard language for industrial control according to an exemplary embodiment of the present application.
[0028] FIG8 shows an electronic device according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be embodied in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art. Identical figures in the drawings represent identical or similar parts, and thus repeated description thereof will be omitted.
[0030] The described features, structures or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of these specific details, or other modes, components, materials, devices or operations may be employed. In these cases, well-known structures, methods, devices, implementations, materials or operations will not be shown or described in detail.
[0031] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0032] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a specific order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0033] As previously mentioned, scenario-based automatic code generation models based on large models are all oriented towards general-purpose, text-based languages such as C / C++ / JAVA / Python. Currently, scenario-based automatic code generation models based on large models have not yet achieved code generation capabilities for specialized languages that meet international standards in the industrial control field. To this end, this application proposes a code generation method and apparatus, electronic equipment, and non-transitory computer-readable storage medium.
[0034] According to an embodiment of the present application, a structured text code dataset that complies with international standards in the field of industrial control is first constructed, and the constructed structured text code dataset is used to train a scenario-based code automatic generation model based on a large model, so that the scenario-based code automatic generation model based on a large model supports the output of structured text language code that complies with the standards.
[0035] According to other embodiments of the present application, by constructing a code block mapping table corresponding to the four arithmetic operations, logical operations and / or shift operations of the structured text code, the standard-compliant structured text language code output by the scenario-based code automatic generation model based on the large model can be converted into a graphical function block diagram that complies with international standards in the field of industrial control.
[0036] According to other embodiments, the development efficiency of industrial control applications is improved by compiling, running, and verifying the generated structured text code and / or graphical function block diagram.
[0037] The specific embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0038] FIG1 shows a method flow chart of a code generation method according to an exemplary embodiment of the present application. The following takes FIG1 as an example to describe in detail a code generation method according to an exemplary embodiment of the present application.
[0039] As shown in FIG. 1 , in step S101 , a structured text code data set conforming to a preset industrial control international standard language is constructed.
[0040] In one embodiment, based on an existing industrial control program asset library that complies with an international industrial control standard language, a structured text algorithm library that complies with a preset international industrial control standard language is formed, wherein the structured text algorithm library includes function and function block codes that comply with the IEC61131-3 standard definition.
[0041] According to some other embodiments, a structured text code data set conforming to a preset industrial control international standard language is generated using a preset conversion tool, wherein the conversion tool is configured to convert C language into a structured text language conforming to the industrial control international standard language.
[0042] In a specific embodiment, a conversion tool is first developed to convert C language into structured text language; then, keyword mapping and statement equivalence conversion are used to convert the open source C code into a structured text language that conforms to the preset industrial control international standard language, thereby forming an open source industrial control standard language code library.
[0043] Since structured text does not support dynamic memory allocation, in a specific embodiment, first, the code involving dynamic memory allocation is modified to static allocation and then converted into structured text code.
[0044] Step S103: training a preset model using the structured text code dataset.
[0045] According to an embodiment of the present application, the model in step S103 includes an open source low-parameter large model, for example, a conversational language model Chatglm-6B, Llama2-7B and / or CodeT5+ model that supports question and answer.
[0046] In step S103, in one embodiment, model training is performed on the open source low-parameter large model, and the trained model is deployed to the server.
[0047] Specifically, we use a prompt optimization method to train an open-source, low-parameter, and large-scale model. That is, by designing and optimizing a set of prompts, we enable the pre-trained model to perform a specific task.
[0048] Step S105 , generating structured text code that complies with the industrial control international standard language using the trained model according to the user's input data.
[0049] According to an embodiment of the present application, in step S105, a human-computer interaction interface is used to obtain the user's input prompt content, and the obtained input prompt content is sent to the model trained in step S103. The model trained in step S103 is used to push the user's input prompt content and generate a structured text code that conforms to the industrial control international standard language.
[0050] In a specific embodiment, the model trained in step S103 can run on a single GPU or multiple GPUs and support parallel reasoning, as shown in FIG2 .
[0051] The model execution system structure diagram shown in Figure 2 uses a BS architecture. The prompt content entered by the user on the client is submitted to the service process on the server. The service process uses a multi-threaded mode of first-come, first-served mode to process multiple user inputs and calls the model trained in step S103 for inference. The results are then returned to the client.
[0052] According to the embodiment shown in Figure 1, a structured text code dataset that complies with international standards in the field of industrial control is first constructed, and the constructed structured text code dataset is used to train a scenario-based code automatic generation model based on a large model (that is, an open source low-parameter large model) so that the scenario-based code automatic generation model based on the large model can output structured text language code that complies with the standards.
[0053] FIG3 shows a method flow chart of another code generation method according to an example embodiment of the present application. In addition to steps S101 to S105, the code generation method shown in FIG3 also includes step S107. For the sake of brevity, only the differences between the embodiment shown in FIG3 and FIG1 will be described below, and a detailed description of the similarities will be omitted.
[0054] In this embodiment, in step S107 , the structured text code generated in step S105 and conforming to the industrial control international standard language is converted into a function block graphic program.
[0055] According to the embodiment shown in FIG3 , by converting the standard structured text language code into a graphical function block diagram that complies with the international standard in the field of industrial control, the guided generation function of the graphical program that complies with the international standard language for industrial control is realized.
[0056] Figure 4 shows a flow chart of a method for converting structured text code in accordance with an international standard language for industrial control into a function block graphical program according to an exemplary embodiment of the present application. As shown in Figure 4 , the above step S107 includes sub-steps S1071 to S1073 .
[0057] In sub-step S1071, a code block mapping table corresponding to the four arithmetic operations, logical operations, shift operations, loop statements and / or flow control statements of the structured text code is constructed, wherein the code block mapping table includes a function mapping table and / or a function block mapping table.
[0058] For example, the four arithmetic operation symbols +, -, *, / , and MOD are converted using the standard function symbols ADD, SUB, MUL, DIV, and MOD in sequence to establish a code block mapping table corresponding to the four arithmetic operation symbols.
[0059] For another example, the AND, OR, XOR, and NOT logical operators are converted in sequence using the AND, OR, XOR, and NOT standard functions to establish a code block mapping table corresponding to the logical operators.
[0060] For another example, the comparison operators <, >, <=, >=, =, and <> are converted using the LT, GT, LE, GE, EQ, and NE standard functions in sequence to establish a code block mapping table corresponding to the comparison operators.
[0061] Another example is converting loop statements using the "label + jump symbol + function subgraph" structure. Specifically, as shown in Figure 5, for a FOR statement, the graph segments are divided according to the initial value assignment of the loop indicator variable, the self-increment or self-decrement of the loop statement, the loop statement block execution, and the loop exit judgment. For a WHILE loop statement, it can be converted to a FOR statement first and then converted.
[0062] For another example, for flow control statements, such as IF-ELSE-END_IF statements, a logic diagram is first formed for each IF-ELSEIF expression, with the output of the expression logic diagram being a BOOL value. Next, a jump priority diagram is constructed for each IF-ELSEIF branch expression, as shown in Figure 6. If the IF branch condition is met, execution jumps to the graphical program corresponding to the IF statement block. If the IF branch condition is not met, and the ELSEIF1 branch condition is met, execution jumps to the graphical program corresponding to ELSEIF1, and so on. If all branch conditions are not met, execution jumps to the graphical program corresponding to the ELSE branch. For SWITCH-CASE statements, these can be converted to IF-ELSE-END_IF statements before conversion.
[0063] In sub-step S1073, the structured text code is parsed to generate a syntax tree.
[0064] It should be noted that the method for generating a syntax tree is not limited here, and any method for parsing structured text code and generating a syntax tree is applicable to the embodiments described in this application.
[0065] In sub-step S1075, the syntax tree is traversed and, based on the constructed code block mapping table, the arithmetic operations, logical operations, shift operations, loop statements, and / or flow control statements in the structured text code are converted into a topological diagram of function block symbols and data connections. The data refers to the output of a function / function block symbol after operation, which is passed to the input of other function / function block symbols, and refers to the topological connection relationship between symbols.
[0066] In some embodiments, in sub-step S1075, the syntax tree generated in sub-step S1073 is traversed in depth-first order.
[0067] According to the embodiment shown in FIG4 , a syntax tree is generated by parsing a structured text, and the syntax tree is traversed in depth-first order. According to the code block mapping table corresponding to the four arithmetic operations, logical operations, and shift operation symbols of the constructed structured text, basic binary operations and ternary operations are converted into function block symbols and data connection topology diagrams. Labels + jump symbols + function subgraphs are used to convert loop statements, and BREAK, EXIT, and CONTINUE symbols are used to convert process control statements, thereby realizing the guided generation function of a graphic program that conforms to the international standard language for industrial control.
[0068] According to other embodiments of the present application, after obtaining the structured text code shown in FIG1 or the functional block diagram program shown in FIG3 , a debugger can be compiled and run to confirm the correctness of the program's functionality. If fine-tuning is required, the input prompt content can be adjusted and all or part of the steps of FIG1 or FIG3 can be repeated.
[0069] According to the embodiments of the present application, the development efficiency of industrial control applications is improved by compiling, running, and verifying the generated structured text code and / or graphical function block diagram.
[0070] The embodiments of the present application are described above mainly from the perspective of methods. Those skilled in the art should readily appreciate that, in conjunction with the operations or steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Those skilled in the art may use different methods to implement the described functions for each specific operation or method, and such implementation should not be considered beyond the scope of this application.
[0071] The following describes the device embodiments of the present application. For details not described in the device embodiments of the present application, reference can be made to the method embodiments of the present application.
[0072] FIG7 shows a block diagram of a code generation device that conforms to an international standard language for industrial control according to an exemplary embodiment of the present application. The code generation device shown in FIG7 includes a structured text code data set construction unit 701, a model training unit 703, and a structured text code generation unit 705. Specifically, the structured text code data set construction unit 701 is configured to construct a structured text code data set that conforms to a preset international standard language for industrial control; the model training unit 703 is configured to train a preset model using the structured text code data set; and the structured text code generation unit 705 is configured to generate structured text code that conforms to the international standard language for industrial control using the trained model based on user input data.
[0073] FIG8 shows an electronic device according to an exemplary embodiment of the present application. The electronic device 200 according to this embodiment of the present application is described below with reference to FIG8. The electronic device 200 shown in FIG8 is merely an example and should not limit the functionality and scope of use of the embodiments of the present application.
[0074] As shown in FIG8 , electronic device 200 is implemented as a general-purpose computing device. Components of electronic device 200 may include, but are not limited to, at least one processing unit 210, at least one storage unit 220, a bus 230 connecting various system components (including storage unit 220 and processing unit 210), and a display unit 240.
[0075] The storage unit stores program codes that can be executed by the processing unit 210, so that the processing unit 210 performs the methods described in this specification according to various exemplary embodiments of the present application. For example, the processing unit 210 can perform the method shown in FIG1 .
[0076] The storage unit 220 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 2201 and / or a cache memory unit 2202 , and may further include a read-only memory unit (ROM) 2203 .
[0077] The storage unit 220 may also include a program / utility 2204 having a set (at least one) of program modules 2205, such program modules 2205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0078] Bus 230 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0079] The electronic device 200 can also communicate with one or more external devices 300 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 200, and / or any device that enables the electronic device 200 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 250. Furthermore, the electronic device 200 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 260. The network adapter 260 can communicate with other modules of the electronic device 200 via the bus 230. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with the electronic device 200, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0080] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software or by combining software with necessary hardware. The technical solution according to the embodiment of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the embodiment of the present application.
[0081] The software product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0082] Computer-readable storage media may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program configured to be used by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0083] Program code configured to perform the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a standalone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0084] The computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the computer-readable medium implements the aforementioned functions.
[0085] Those skilled in the art will appreciate that the modules described above can be distributed in the device according to the description of the embodiment, or can be modified accordingly to be used in one or more devices that are different from the embodiment. The modules of the above embodiment can be combined into one module or further divided into multiple submodules.
[0086] According to an embodiment of the present application, a computer program is provided, including a computer program or instructions. When the computer program or instructions are executed by a processor, the method described above can be executed.
[0087] The embodiments of the present application are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only configured to help understand the method and core ideas of the present application. At the same time, changes or modifications made by those skilled in the art based on the ideas of the present application, the specific implementation methods and the scope of application of the present application, all fall within the scope of protection of the present application. In summary, the contents of this specification should not be understood as limiting the present application.
Claims
1. A code generation method, comprising: Construct a structured text code data set that conforms to the preset international standard language for industrial control; Using the structured text code dataset to train a preset model; as well as According to the user's input data, the trained model is used to generate structured text code that conforms to the industrial control international standard language.
2. The code generation method according to claim 1, wherein: The model includes: Chatglm-6B, Llama2-7B, and / or CodeT5+ models.
3. The code generation method according to claim 1, wherein: Constructing a structured text code data set that conforms to the preset industrial control international standard language includes: Based on the industrial control program asset library of the industrial control international standard language, a structured text algorithm library is generated.
4. The code generation method according to claim 3, wherein: The structured text algorithm library includes functions and function block codes that comply with the IEC61131-3 standard definition.
5. The code generation method according to claim 1, wherein: Constructing a structured text code data set that conforms to the preset industrial control international standard language includes: A structured text code data set conforming to the industrial control international standard language is generated by using a preset conversion tool, wherein the conversion tool is configured to convert the C language into a structured text language conforming to the industrial control international standard language.
6. The code generation method according to claim 1, wherein: Also includes: The generated structured text code conforming to the industrial control international standard language is converted into a function block graphic program.
7. The code generation method according to claim 6, wherein: Converting the generated text code conforming to the industrial control international standard language into a function block graphic program includes: Constructing a code block mapping table corresponding to the four arithmetic operations, logical operations, shift operations, loop statements and / or flow control statements of the structured text code, wherein the code block mapping table includes a function mapping table and / or a function block mapping table; Parsing the structured text code to generate a syntax tree; and The syntax tree is traversed, and according to the constructed code block mapping table, the four arithmetic operations, logical operations, shift operations, loop statements and / or flow control statements in the structured text code are converted into function block symbols and data connection topology diagrams.
8. A code generation device that complies with the international standard language for industrial control, wherein: include: A structured text code data set construction unit, configured to construct a structured text code data set that complies with a preset industrial control international standard language; A model training unit, configured to train a preset model using the structured text code data set; The structured text code generating unit is configured to generate structured text codes conforming to the industrial control international standard language using the trained model according to the user's input data.
9. An electronic device, comprising: processor; as well as A memory storing a computer program, which, when executed by the processor, enables the processor to execute the code generation method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor, causes the processor to execute the code generation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
PLC programming system based on artificial intelligence
CN112255962A
Code generation method and device
CN116719520A
Low-code DSL language development method and device
CN116755667A
Code generation method and device and electronic equipment
CN117215561A
Cited By
Structured text code generation and review method
CN120743231A