Industrial robot controller native program generation, verification, fault processing and import method and system based on large language model

CN122816615APending Publication Date: 2026-09-25HUNAN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611290871.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0009]本发明提供了一种基于大语言模型的工业机器人控制器原生程序生成、核验、故障处理、导入方法及系统,以解决现有的工业机器人控制器原生程序在通过大语言模型生成的过程中,生成程序后出现异常来源不明导致修正不当的问题

Benefits of technology

本发明提供的基于大语言模型的工业机器人控制器原生程序生成、核验、故障处理、导入方法,通过具有版本标识的工业机器人领域约束信息,对大语言模型的程序生成过程进行约束,使生成的控制器原生源程序符合工业机器人控制器对应的程序结构、指令格式、内部程序标识规则和文件命名规则,有利于提高生成程序与工业机器人控制器之间的适配性;通过将生成的控制器原生源程序原样保存为首次输出文件,并使后续文件封装、编译和程序修正过程不直接修改所述首次输出文件,从而形成稳定的首次生成内容基准,避免首次生成结果被后续处理过程覆盖;通过以首次输出文件或者修正输出文件为来源,创建仅进行文件级处理的运行副本,并采用同一数字摘要算法对源文件和对应运行副本进行一致性核验,仅在数字摘要一致时允许调用厂商专用编译工具,从而能够发现文件复制、重命名、存放或组织过程中引入的程序内容变化,保证实际参与编译的运行副本与对应源文件内容一致。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122816615A_ABST
    Figure CN122816615A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of industrial robot programming, and discloses an industrial robot controller native program generation, verification, fault processing and import method and system based on a large language model, which comprises the following steps: inputting industrial robot task description, industrial robot controller information and industrial robot field constraint information into a large language model to generate a controller native source program; verifying through a verification method, and compiling and processing faults when the verification is consistent; the verification method comprises calculating a digital digest, and judging whether the program content is consistent according to a digital digest comparison result; the fault processing method comprises determining a fault category according to a preset classification rule, and differentially processing according to the fault type; thereafter, an executable program of the controller that meets preset import conditions is imported; the application solves the problem that the source of an exception after program generation by the large language model is unknown, leading to improper correction; aims to distinguish fault types, separate import and execution, and realize controllable import and consistency verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial robot programming technology, and in particular to a method and system for generating, verifying, troubleshooting, and importing native programs for industrial robot controllers based on a large language model. Background Technology

[0002] Industrial robots typically consist of a robot body, controller, teach pendant, and end effector, and can be used with offline programming software and industrial robot simulation software. Different industrial robot manufacturers usually use their own defined programming languages, program structures, motion commands, coordinate and posture representation methods, and specify corresponding native source program formats and executable program formats for the controller. The internal program identifiers, external file names, program segment structures, point data, controller model, software version, and compilation configurations in the source program must also meet corresponding compatibility requirements. Therefore, whether an industrial robot program can be received and used by an industrial robot controller depends not only on the program text itself, but also on the manufacturer's proprietary tools, controller configuration, and program import method.

[0003] Current industrial robot programming methods mainly include teach-in programming and offline programming. Teach-in programming typically involves an operator recording the robot's position point by point and writing control logic using a teach pendant. When production tasks, movement points, or process requirements change frequently, repeated programming, point setting, and debugging are necessary, resulting in a significant workload. Offline programming, on the other hand, allows for the creation of industrial robot and workstation models on a computer, enabling trajectory planning, program generation, and simulation verification. Post-processing can then generate programs suitable for specific industrial robot platforms.

[0004] However, different brands, models, and controller versions vary in program file structure, instruction format, program naming, compilation configuration, and communication interface. Results generated from generic trajectory data, intermediate representations, or generic program code may still require format conversion, file encapsulation, and manufacturer-specific compilation according to the requirements of the industrial robot controller to form an executable program that can be received by the industrial robot controller.

[0005] With the development of artificial intelligence and large language model technology, existing technologies can generate industrial robot task plans, motion sequences, or program code based on natural language task descriptions. However, industrial robot programs generated by large language models may exhibit issues such as incomplete program structure, instruction formats that do not meet the requirements of the target controller, point or motion parameters exceeding preset ranges, and inconsistencies between internal program identifiers and external file names. For industrial robot controllers with proprietary source program and executable program formats, the controller's native source program generated by large language models typically requires file saving, file encapsulation, and vendor-specific compilation before it can be converted into an executable controller program.

[0006] During the above processing, program exceptions may be caused by various reasons. For example, incorrect configuration of vendor-specific compilation tools, software version mismatch, missing dependency files, or incorrect call paths may prevent the compilation process from completing normally; external file names, internal program identifiers, or file organization methods that do not meet the controller requirements may prevent the program from being compiled or loaded correctly; program structure, instructions, point data, or control logic that do not conform to the target controller rules may lead to errors in the program content. The handling methods for these exceptions are not the same.

[0007] Existing program correction methods may directly regenerate or modify the program based on the error message after detecting compilation, loading, or verification anomalies. However, when the anomaly is actually caused by the compilation environment, filename, or file encapsulation, modifying the program text cannot eliminate the corresponding fault and may even alter the content of the initially generated program, resulting in a lack of clear consistency verification between subsequent files actually compiled and the initial generated result. Therefore, it is necessary to identify the source of the anomaly before program correction and to distinguish program content correction from compilation environment processing, file naming processing, and file encapsulation processing.

[0008] Furthermore, transferring the controller's executable program to the industrial robot controller typically requires configuring the controller address, computer network parameters, communication interface, authentication information, and target storage location. Successful file transfer, controller receiving the program, the program becoming visible in the teach pendant, obtaining manual execution confirmation, and actual execution by the industrial robot each represent different processing states. The automatic transfer or import of the program into the industrial robot controller does not automatically indicate that the industrial robot has started execution. Failure to record these states separately may lead to confusion between the program import status and the actual execution status of the industrial robot. Therefore, it is evident that existing industrial robot controller native programs, during the generation process using large language models, suffer from issues where the source of anomalies is unknown, leading to improper correction. Summary of the Invention

[0009] This invention provides a method and system for generating, verifying, troubleshooting, and importing native programs for industrial robot controllers based on a large language model, in order to solve the problem that existing native programs for industrial robot controllers generate programs through a large language model, resulting in unclear sources of anomalies and improper correction.

[0010] To achieve the above objectives, the present invention employs the following technical solution:

[0011] In a first aspect, the present invention provides a method for generating native programs for industrial robot controllers based on a large language model, comprising: S101. Obtain the industrial robot task description, industrial robot controller information, and industrial robot domain constraint information with version identifier; S102. Input the industrial robot task description, industrial robot controller information and industrial robot domain constraint information into the large language model, and generate the controller native source program containing internal program identifiers through the large language model using the native language rules of the industrial robot controller. S103. Save the controller's original source program as the first output file; S104. Parse the internal program identifier in the first output file, and create a running copy of the first output file based on the internal program identifier; S105. Verify the initial output file and the running copy. If the verification is consistent, output a compilation-allowed state and compile the program. If the verification is inconsistent, output a compilation-prohibited state and stop the current compilation process to handle the fault. S106. When compiling the program, the manufacturer's dedicated compilation tool corresponding to the industrial robot controller is called to convert the running copy into an executable program for the controller, and the compiler tool identifier, controller configuration, calling parameters, return status, log information and the generated executable program information are recorded.

[0012] Optionally, the industrial robot task description includes the target action, starting conditions, motion mode, motion speed, termination method, and necessary points; The process of obtaining the industrial robot task description includes steps for performing a completeness check on the target action, starting conditions, motion mode, motion speed, termination method, and necessary points.

[0013] Optionally, the industrial robot field constraint information includes at least the native source program structure rules, instruction format, internal program identification rules, external file naming rules, reference program, allowed points or parameters, prohibited items, and unverified items corresponding to the industrial robot controller.

[0014] Optionally, in S104, parsing the internal program identifier in the initial output file and creating a running copy corresponding to the initial output file based on the internal program identifier includes: Parse the internal program identifier in the initial output file, generate an external file name based on the internal program identifier and external file naming rules, and create a running copy from the initial output file by changing only the external file name, storage location, or file organization method but without changing the content of the program text.

[0015] Secondly, the present invention also provides a method for verifying the native program of an industrial robot controller based on a large language model, applicable to the generation method described in any of the first aspects, the verification method comprising: A native source program for the controller containing internal program identifiers is generated using the native language rules of the industrial robot controller through a large language model; the native source program for the controller is saved as the first output file; the internal program identifiers in the first output file are parsed, and a running copy corresponding to the first output file is created based on the internal program identifiers; The same digital digest algorithm is used to calculate the digital digests of the initial output file and the running copy, and the consistency of the program content between the two is determined based on whether the digital digests are consistent. If the digital digests of the two files are consistent, the initial output file and the running copy are determined to be in a consistent state; if the digital digests of the two files are inconsistent, the initial output file and the running copy are determined to be in an inconsistent state.

[0016] Thirdly, embodiments of this application provide a method for handling faults in the native program of an industrial robot controller based on a large language model. Following the generation method described in any of the first aspects, the method further includes the following fault handling steps: S107. When handling faults, first determine the fault category according to the preset classification rules, wherein the fault category includes at least compilation environment faults, file naming or packaging faults, and program content faults. S108. Perform differentiated processing according to the fault category as follows: If the compilation environment failure is determined, the corresponding processing information is output. The compilation environment failure is repaired according to the processing information. After receiving the status of completion of compilation environment repair, the vendor-specific compilation is re-executed using the original running copy with the program content unchanged. At this time, no program rewrite instructions or program content correction information are sent to the large language model. If the failure is due to file naming or encapsulation, a new running copy is created using the initial output file as the source, and the file consistency verification is re-executed; at this time, no program rewrite instructions or program content correction information are sent to the large language model. If the program content is faulty and a confirmation result of the program content fault is obtained, perform the program content fault correction operation.

[0017] Optionally, in S107, determining the fault category specifically includes: The process of generating the described method involves collecting runtime copy creation records, compilation records, log information, program file information, and compilation environment information. Based on the collected information, the fault category is determined according to the following preset classification rules: When the build tools are not started, the version or configuration is invalid, runtime dependencies are missing, the path is incorrect, or the controller configuration file is invalid, the fault category is determined to be a build environment fault. When the external file name, internal program identifier, or file organization does not meet the requirements of the industrial robot controller, the fault category is determined to be a file naming or encapsulation fault. When the program structure, instructions, points, data, or logic do not conform to the industrial robot task description or the native language rules of the industrial robot controller, the fault category is determined to be a program content fault. When the fault category cannot be determined according to the above-mentioned preset classification rules, the fault classification manual confirmation result is received, and the program content fault correction operation is performed only when the fault category is a program content fault and the program content fault confirmation result is obtained.

[0018] Optionally, in S108, the correction operation for program content faults specifically includes: The confirmed program error information is input into the large language model, which combines the industrial robot task description and industrial robot domain constraint information to generate the corrected controller native source program. Save the corrected controller source code as a corrected output file, mark the corresponding generation round, and do not overwrite the original initial output file; Parse the internal program identifiers in the corrected output file and create a running copy corresponding to the corrected output file; The same digital digest algorithm is used to verify the consistency between the corrected output file and the corresponding running copy. After the verification is passed, the vendor's dedicated compilation tool is called to execute the compilation.

[0019] Fourthly, embodiments of this application provide a method for importing native programs of an industrial robot controller based on a large language model. Following the industrial robot controller native program fault handling method described in any of the third aspects, the method further includes the following import method operation steps: S109. After the controller executable program meets the preset import conditions, in response to the import trigger conditions, based on the industrial robot controller address and communication configuration information, the controller executable program is automatically transmitted through the communication interface supported by the industrial robot controller; the file transmission status, controller reception status, program visibility status, manual execution confirmation status, and actual execution status are recorded respectively; no industrial robot motion start command is output during the controlled import process, and program selection, necessary reset, operation mode switching, and industrial robot start are implemented by manual operation procedures independent of the transmission of the controller executable program; The file transfer status, controller receiving status, program visibility status, manual execution confirmation status and actual execution status are recorded separately. If any status lacks corresponding evidence, it is recorded as unconfirmed, and the success of the next status is not inferred from the previous status. The preset import conditions include at least the successful compilation of the manufacturer-specific code and the generation of the corresponding controller executable program; when setting the industrial robot simulation verification step, the preset import conditions also include the industrial robot simulation verification status of the controller executable program being passed.

[0020] Fifthly, embodiments of this application provide a system for generating, verifying, troubleshooting, and importing native programs for industrial robot controllers based on a large language model, including: The task input module is used to receive the industrial robot task description and industrial robot controller information, and to structure the target action, starting conditions, position, motion mode, motion speed and termination mode in the industrial robot task description. The domain constraint management module is used to retrieve the industrial robot domain constraint information corresponding to the industrial robot controller according to the version identifier. The large language model native program generation module is used to input industrial robot task description, industrial robot controller information and industrial robot domain constraint information into the large language model to generate controller native source program containing internal program identifiers; it is also used to generate corrected controller native source program based on confirmed program content fault and error information. The initial output saving module is used to save the controller's original source program generated by the large language model for the first time as the initial output file, and subsequent processing modules do not directly modify the initial output file; it is also used to save the corrected controller's original source program as a corrected output file that is distinct from the original generation round; The runtime copy encapsulation module is used to parse the internal program identifiers in the source file, generate an external file name according to the file naming rules of the industrial robot controller, and create a runtime copy based on the source file. The creation of the runtime copy only performs file-level processing and does not change the program content in the source file. The digital digest consistency verification module is used to calculate the digital digests of the source file and its corresponding running copy using the same digital digest algorithm, and outputs the compilation status as allowed or prohibited based on the digital digest comparison results. The manufacturer-specific compilation module is used to respond to the allowed compilation state, call the manufacturer-specific compilation tool corresponding to the industrial robot controller, convert the running copy into the controller executable program, and record relevant information about the compilation process and output files; The fault handling module is used to classify exceptions during the creation or compilation of the runtime copy into at least three categories: compilation environment faults, file naming or encapsulation faults, and program content faults, based on the runtime copy creation record, compilation record, log information, program file information, and compilation environment information. When the fault category cannot be reliably determined, it receives the fault classification manual confirmation result and determines the fault category accordingly. The fault handling control module is used to perform differentiated control for different fault categories: In the event of a compilation environment fault, the vendor-specific compilation module is controlled to recompile using the original runtime copy after the environment is repaired; in the event of a file naming or packaging fault, the runtime copy packaging module is controlled to rebuild the runtime copy using the first output file as the source, and the digital digest consistency verification module is controlled to redo the verification; neither compilation environment faults nor file naming or packaging faults trigger the large language model rewriting program; when a program content fault is found and a confirmation result is obtained, the large language model native program generation module is controlled to generate a corrected output file, and the runtime copy creation, consistency verification, and compilation process are controlled in sequence. The controlled import and status recording module is used to automatically transmit the controller executable program through the communication interface supported by the industrial robot controller after the preset import conditions are met, based on the address and communication configuration of the industrial robot controller, obtain the transmission return information, and record the file transmission status, controller reception status and program visibility status respectively. The controlled import and status recording module does not output industrial robot motion start commands. The preset import conditions include at least the successful compilation of the manufacturer-specific code and the generation of the corresponding controller executable program; The manual confirmation module is used to receive manual confirmation results for fault classification, program content fault confirmation results, simulation verification manual confirmation results, and manual confirmation results before actual execution. The evidence chain management module is used to associate and save task descriptions, constraint versions, initial output files, running copies, digital digests, compilation records, fault categories, corrected output files, and controlled import status by task number and generation round. The industrial robot simulation verification module is used to load the controller's executable program into the industrial robot simulation environment, run according to preset verification conditions after being triggered by manual operation, and record the loading status, movement segment reachability status, blocking alarm, program end status, final position, and manual confirmation result. The preset import conditions also include that the industrial robot simulation verification status of the controller executable program is passed.

[0021] Beneficial effects: The present invention provides a method for generating, verifying, troubleshooting, and importing native programs for industrial robot controllers based on a large language model. This method constrains the program generation process of the large language model by using industrial robot domain constraint information with version identifiers, ensuring that the generated native source program conforms to the program structure, instruction format, internal program identification rules, and file naming rules of the industrial robot controller. This improves the compatibility between the generated program and the industrial robot controller. By saving the generated native source program as an initial output file and preventing subsequent file encapsulation, compilation, and program correction processes from directly modifying the initial output file, a stable initial generation content benchmark is formed, preventing the initial generation result from being overwritten by subsequent processing. Furthermore, by creating a running copy based on either the initial or corrected output file, and using the same digital digest algorithm to verify the consistency between the source file and the corresponding running copy, the method only allows the use of vendor-specific compilation tools when the digital digests match. This enables the detection of program content changes introduced during file copying, renaming, storage, or organization, ensuring that the running copy actually involved in compilation is consistent with the content of the corresponding source file.

[0022] Anomalies occurring during the runtime copy creation process and vendor-specific compilation are categorized into compilation environment failures, file naming or packaging failures, and program content failures. Different handling methods are employed for each failure category. Compilation environment failures and file naming or packaging failures do not trigger program regeneration by the large language model; only confirmed program content failures receive selective feedback, thereby reducing invalid program rewriting due to inaccurate fault source identification. The corrected controller native source program is saved as a corrected output file distinct from the original generation round, while the initial output file is retained, ensuring that the initial generation result, subsequent corrected results, corresponding runtime copies, and... Compilation records can be linked according to task number and generation round, which is beneficial for tracing the source of program generation, correction process and fault handling cause; by recording file transfer status, controller receiving status, program visibility status, manual execution confirmation status and actual execution status separately, and without directly inferring the success of the next status based on the previous status; at the same time, the controlled import process does not output industrial robot motion start command, so that the automatic transmission of the controller executable program is separated from the industrial robot's program selection, necessary reset, operation mode switching and motion start, thereby avoiding the mistaken belief that the industrial robot has actually executed when the program is successfully transmitted or the program is visible. Attached Figure Description

[0023] Figure 1 This is a schematic diagram of the overall structure of the industrial robot controller native program generation, verification, fault handling, and import system based on a large language model according to the present invention. Figure 2This is a schematic diagram of the overall process of the method for generating, verifying, handling faults, and importing native programs for industrial robot controllers based on a large language model according to the present invention. The industrial robot task description is obtained through text input or by converting voice commands into text form through speech recognition. Figure 3 This is a schematic diagram of the process for saving the first output file, creating a copy, and verifying the consistency of the digital digest in this invention. Figure 4 This is a schematic diagram illustrating the classification, processing, and selective feedback process for compilation environment failures, file naming or packaging failures, and program content failures in this invention. Figure 5 This is a flowchart illustrating the manufacturer-specific compilation, optional industrial robot simulation verification, and manual confirmation processes of this invention. Figure 6 This is a schematic diagram illustrating the process of controlling the import of the executable program by the controller of the present invention and separating and recording the file transfer status, controller receiving status, program visibility status, manual execution confirmation status and actual execution status. In the diagram, 101 is the task input module; 102 is the domain constraint management module; 103 is the large language model native program generation module; 104 is the initial output saving module; 105 is the runtime copy encapsulation module; 106 is the digital digest consistency verification module; 107 is the vendor-specific compilation module; 108 is the fault handling module; 109 is the fault handling control module; 110 is the industrial robot simulation verification module; 111 is the manual confirmation module; 112 is the controlled import and status recording module; 113 is the evidence chain management module; 201 is the initial output file; 202 is the internal program identifier; 203 is the... 204. Running a copy; 205. Digital digest consistency comparison result; 206. Compilation allowed; 207. Compilation prohibited; 208. Controller executable program; 209. Compilation environment repair completed; 300. Corrected output file; 301. Compilation environment failure; 302. File naming or packaging failure; 303. Program content failure; 304. Fault classification manual confirmation result; 305. Program content failure confirmation result; 401. File transfer status; 402. Controller receiving status; 403. Program visible status; 404. Manual execution confirmation status; 405. Actual execution status. Detailed Implementation

[0024] The technical solution of the present invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms "an" or "a" and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms "connected" or "linked" and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up," "down," "left," "right," etc., are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship also changes accordingly.

[0026] like Figure 1 As shown, the system of the present invention mainly includes a task input module 101, a domain constraint management module 102, a large language model native program generation module 103, an initial output saving module 104, a running copy encapsulation module 105, a digital digest consistency verification module 106, a vendor-specific compilation module 107, a fault handling module 108, a fault handling control module 109, and a controlled import and status recording module 112.

[0027] The task input module 101 and the domain constraint management module 102 provide the large language model native program generation module 103 with the industrial robot task description, industrial robot controller information, and industrial robot domain constraint information with version identifiers, respectively. The large language model native program generation module 103 generates the controller's native source program, and the first output saving module 104 saves the first generated program as is. The runtime copy encapsulation module 105 creates a runtime copy for actual compilation, and the digital digest consistency verification module 106 performs content consistency verification on the source file and the corresponding runtime copy. After the verification is passed, the manufacturer-specific compilation module 107 generates the controller executable program.

[0028] When an error occurs during copy creation or vendor-specific compilation, the fault handling module 108 determines the fault category, and the fault handling control module 109 performs corresponding processing according to the fault category. Controller executable programs that meet preset import conditions can directly enter the controlled import and status recording module 112, or they can enter the controlled import and status recording module 112 after passing through the optional industrial robot simulation verification module 110 and manual confirmation module 111. The evidence chain management module 113 can associate and save the processing records of each stage according to the task number and generation round.

[0029] like Figure 2As shown, the method of the present invention includes task and constraint information acquisition, controller native source program generation, initial output file saving, running copy creation, file consistency verification, vendor-specific compilation, fault classification, classification processing and selective feedback, and controlled import of controller executable program.

[0030] After successful manufacturer-specific compilation, the controller executable program can enter the optional industrial robot simulation verification and manual confirmation process, or directly enter the controlled import process if no simulation verification step is set. If manufacturer-specific compilation fails, it enters the fault classification and classification handling process, and returns to the corresponding step for re-execution after completing the corresponding handling.

[0031] like Figure 3 As shown, the controller's original source program generated for the first time by the large language model is saved as the first output file 201, and the internal program identifier 202 in the first output file 201 is parsed. Based on the internal program identifier 202 and the file naming rules of the industrial robot controller, a running copy 203 is created using the first output file 201 as the source, without changing the program content during the creation process.

[0032] The same digital digest algorithm is used to calculate the digital digests of the initial output file 201 and the running copy 203, respectively, to form a digital digest consistency comparison result 204. When the digital digests match, the output state 205 is allowed to compile; when the digital digests do not match, the output state 206 is prohibited to compile, and the current compilation process is stopped.

[0033] like Figure 4 As shown, the fault categories include compilation environment faults (301), file naming or packaging faults (302), and program content faults (303). When the fault category cannot be reliably determined according to the preset classification rules, the fault classification manual confirmation result (304) is received.

[0034] For compilation environment failure 301, after receiving the compilation environment repair completion status 208, a vendor-specific compilation is performed again using a running copy with unchanged program content. For file naming or packaging failure 302, a running copy is recreated using the initial output file 201 as the source, and file consistency verification is performed again. Neither of these two types of failures triggers a large language model rewrite program.

[0035] For program content fault 303, the corresponding error information is only fed back to the large language model when the program content fault confirmation result 305 is in a confirmed state, and the generated corrected program is saved as a corrected output file 209. The corrected output file 209 is distinct from the original generation round and does not overwrite the first output file 201. Subsequently, a corresponding running copy is created using the corrected output file 209 as the source, and verification and compilation are performed again.

[0036] like Figure 5 As shown, the executable program 207 for the controller is generated by the manufacturer's proprietary compilation of the running copy 203. The executable program 207 can be loaded into the industrial robot simulation environment and, upon receiving control input corresponding to manual operation, will run according to preset verification conditions.

[0037] The industrial robot simulation verification module 110 records verification information such as program loading status, motion segment reachability status, blocking alarm, program termination status, and final position. The manual confirmation module 111 receives the corresponding manual confirmation results. The simulation verification results only indicate the basic executability of the controller executable program 207 under the current simulation model and preset conditions. They do not indicate that the physical industrial robot has actually executed the program, nor do they automatically trigger program transmission or start the industrial robot's movement.

[0038] like Figure 6 As shown, the controlled import and status recording module 112 transmits the controller executable program 207 through the communication interface supported by the industrial robot controller according to the address and communication configuration information of the industrial robot controller, and records the file transmission status 401, the controller receiving status 402 and the program visibility status 403 respectively.

[0039] The manual execution confirmation state 404 is determined by the manual confirmation module 111 based on the manual confirmation result, while the actual execution state 405 is determined by the independent manual operation process and the industrial robot's operation results. These states are recorded separately; the success of a previous state does not guarantee the success of a subsequent state. For example, successful file transfer does not mean the program has been correctly received by the industrial robot controller, and the program being visible in the controller or teach pendant does not mean the industrial robot has actually executed the program.

[0040] The controlled import and status recording module 112 does not output industrial robot motion start commands. Program selection, necessary resets, operating mode switching, and industrial robot startup are implemented by manual operation procedures independent of the program transmission process.

[0041] Example 1 This embodiment takes the generation, compilation, and verification of native FANUC (Fuji Automatic Numerical Control) programs as an example. The specific steps are as follows: Step 1: This implementation takes the FANUC M-1iA / 0.5A industrial robot as an example. The LS program is used as the native source program of the controller, and the MakeTP tool is used to convert the LS program into an executable program of the TP controller.

[0042] Step 2: Based on the existing runnable LS program and the corresponding teach pendant display data, establish domain constraint data with version identifiers. The domain constraint data includes program structure, internal program identifiers, file naming rules, allowed instructions, verified points, and prohibited items.

[0043] Step 3: Input the industrial robot task description, target controller information, and domain constraint data into the large language model to generate a complete LS program. Save the initial generated content as the initial output file, for example, first_output.LS. Subsequent processing will not directly modify this file.

[0044] Step 4: Parse the / PROG field in the initial output file to obtain the internal program identifier, and create a running copy with the same name from the initial output file. For example, if the internal program identifier is L1_01, create L1_01.LS. The program content is not modified during the creation process.

[0045] Step 5: Calculate the digital digests of the initial output file and the running copy using the SHA-256 algorithm. Compilation is allowed if the digests match; compilation is stopped if the digests do not match, and relevant files and verification records are retained.

[0046] Step 6: After successful verification, use the MakeTP tool to convert the running copy into a TP file and record the compilation results and output file information. Successful compilation yields the controller executable program.

[0047] Step 7: When the external file name is inconsistent with the internal program identifier and causes a loading or compilation exception, the exception is identified as a file naming or encapsulation failure, and is handled by recreating a running copy without triggering the large language model to modify the program content.

[0048] Example 2 This embodiment takes fault handling and selective feedback as an example. The specific steps are as follows: Step 1: When an error occurs during copy creation or vendor-specific compilation, the fault is classified into compilation environment fault, file naming or packaging fault, and program content fault.

[0049] Step 2: For compilation environment failures such as the compilation tool failing to start, missing runtime environment, invalid configuration file, or incorrect execution path, after external environment repair is completed, recompile using the original runtime copy without triggering the large language model rewrite program.

[0050] Step 3: For file naming or packaging failures where the file name, internal program identifier, target directory, or file organization method does not meet the requirements, recreate the running copy using the initial output file as the source and perform digital digest verification again.

[0051] Step 4: For program content faults such as program structure, instruction format, point expression, or program logic errors, the corresponding error information can only be fed back to the large language model and the corrected controller native source program can only be generated after the program content fault confirmation result is obtained.

[0052] Step 5: Save the corrected program as a new corrected output file, and re-run the copy creation, digital digest verification, and vendor-specific compilation. The original initial output file is retained and not overwritten.

[0053] Step 6: When the fault category cannot be reliably determined, the manual confirmation module provides the manual confirmation result of the fault classification. Only when it is finally confirmed as a program content fault is program correction information allowed to be sent to the large language model.

[0054] Example 3 This embodiment takes the controlled import and manual independent startup of the TP program as an example. The specific steps are as follows: Step 1: Establish a network connection between the computer and the industrial robot controller, and configure them within a network address range that allows them to communicate with each other. After the communication test is successful, save the controller address, authentication information, and target storage location.

[0055] Step 2: Set the LS source program monitoring directory and TP file output directory on the computer. When a new or modified LS file is detected, call the MakeTP tool to compile it and write the successfully compiled TP file to the output directory.

[0056] Step 3: The controlled import program monitors the TP file output directory. When a new TP file is detected and the corresponding compilation status is successful, the TP file is transferred via FTP or other communication interfaces supported by the industrial robot controller.

[0057] Step 4: After the transfer is complete, record the file transfer status, controller reception status, and program visibility status. Operators can view the imported program in the teach pendant program list and confirm its visibility.

[0058] Step 5: The controlled import program is only responsible for file monitoring, program transfer, and status recording; it does not output industrial robot motion start commands. Program selection, necessary resets, operating mode switching, and industrial robot startup are performed independently by authorized operators.

[0059] Step 6: After the industrial robot is actually running, separately record the manual execution confirmation status and the actual execution status. The completion of program transmission or program visibility alone does not presume that the industrial robot has actually executed the commands.

[0060] The following data compares the methods for generating, verifying, troubleshooting, and importing the native program for the industrial robot controller proposed in this application with traditional manual programming and direct programming using a large language model. All three methods used the same industrial robot platform, trajectory tasks, and trajectory acceptance conditions. The tests included four types of trajectory tasks, with three formal trials for each type, for a total of 12 trials across all methods. The test results are shown below: Compared to traditional manual programming, the method described in this application significantly improves the reliability of the first compilation and reduces program modifications. During programming testing, the method of this invention was used for 12 programming tests, and all 12 tests were successful on the first MakeTP compilation, achieving a 100% first-compilation success rate. In contrast, manual programming, in the same 12 tests, only achieved a 4-times first-compilation success rate, a success rate of 33.3%. Furthermore, the method of this invention required 0 revisions in the 12 tests, while manual programming required 29 revisions, averaging 2.42 revisions per test.

[0061] Compared to traditional manual programming, the method of this invention significantly shortens the program creation and verification time. The average completion time of the method of this invention is 65.58 s, while that of manual programming is 991.50 s. Under the experimental conditions, the average time is reduced by 93.39%, and the completion speed is increased by approximately 15.12 times.

[0062] Furthermore, compared to directly using a large language model generation program, the accuracy of the trajectory task using the method of this invention is improved from 25.0% to 100.0%. In contrast, the method using the large language model generation program only succeeded 3 times and failed 9 times in 12 trials, with an accuracy of 25.0% and a failure rate of 75.0%. The method of this invention, however, succeeded in all 12 trials, achieving an accuracy of 100.0% and a failure rate of 0%, representing an improvement of 75 percentage points in accuracy. Specific data are shown in Table 1 below.

[0063] Table 1: Results of Traditional Manual Programming and Programming Directly Using Large Language Models

[0064] The above implementation uses FANUC LS program, TP program, MakeTP tool, ROBOGUIDE simulation environment, and FTP communication as examples. For other industrial robot platforms, the program format, compilation tools, simulation environment, and communication interface can be replaced according to the requirements of the target controller.

[0065] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. A method for generating native programs for industrial robot controllers based on a large language model, characterized in that, include: S101. Obtain the industrial robot task description, industrial robot controller information, and industrial robot domain constraint information with version identifier; S102. Input the industrial robot task description, industrial robot controller information and industrial robot domain constraint information into the large language model, and generate the controller native source program containing internal program identifiers through the large language model using the native language rules of the industrial robot controller. S103. Save the controller's original source program as the first output file; S104. Parse the internal program identifier in the first output file, and create a running copy of the first output file based on the internal program identifier; S105. Verify the initial output file and the running copy. If the verification is consistent, output a compilation-allowed state and compile the program. If the verification is inconsistent, output a compilation-prohibited state and stop the current compilation process to handle the fault. S106. When compiling the program, the manufacturer's dedicated compilation tool corresponding to the industrial robot controller is called to convert the running copy into an executable program for the controller, and the compiler tool identifier, controller configuration, calling parameters, return status, log information and the generated executable program information are recorded.

2. The method for generating native programs for industrial robot controllers based on a large language model according to claim 1, characterized in that, The industrial robot task description includes the target action, starting conditions, motion mode, motion speed, termination method, and necessary points; The process of obtaining the industrial robot task description includes steps for performing a completeness check on the target action, starting conditions, motion mode, motion speed, termination method, and necessary points.

3. The method for generating native programs for industrial robot controllers based on a large language model according to claim 1, characterized in that, The constraints in the industrial robot field include at least the native source program structure rules, instruction format, internal program identification rules, external file naming rules, reference programs, allowed points or parameters, prohibited items, and unverified items corresponding to the industrial robot controller.

4. The method for generating native programs for industrial robot controllers based on a large language model according to claim 3, characterized in that, In S104, the internal program identifier in the initial output file is parsed, and a running copy corresponding to the initial output file is created based on the internal program identifier, including: Parse the internal program identifier in the initial output file, generate an external file name based on the internal program identifier and external file naming rules, and create a running copy from the initial output file by changing only the external file name, storage location, or file organization method but without changing the content of the program text.

5. A method for verifying native programs of industrial robot controllers based on large language models, applicable to the generation method described in any one of claims 1-4, characterized in that, The verification method includes: A native source program for the controller containing internal program identifiers is generated using the native language rules of the industrial robot controller through a large language model; the native source program for the controller is saved as the first output file; the internal program identifiers in the first output file are parsed, and a running copy corresponding to the first output file is created based on the internal program identifiers; The same digital digest algorithm is used to calculate the digital digests of the initial output file and the running copy, and the consistency of the program content between the two is determined based on whether the digital digests are consistent. If the digital digests of the two files are consistent, the initial output file and the running copy are determined to be in a consistent state; if the digital digests of the two files are inconsistent, the initial output file and the running copy are determined to be in an inconsistent state.

6. A method for handling faults in the native program of an industrial robot controller based on a large language model, characterized in that, The generation method according to any one of claims 1-4 further includes the following fault handling steps: S107. When handling faults, first determine the fault category according to the preset classification rules, wherein the fault category includes at least compilation environment faults, file naming or packaging faults, and program content faults. S108. Perform differentiated processing according to the fault category as follows: If the compilation environment failure is determined, the corresponding processing information is output. The compilation environment failure is repaired according to the processing information. After receiving the status of completion of compilation environment repair, the vendor-specific compilation is re-executed using the original running copy with the program content unchanged. At this time, no program rewrite instructions or program content correction information are sent to the large language model. If the failure is due to file naming or encapsulation, a new running copy is created using the initial output file as the source, and the file consistency verification is re-executed; at this time, no program rewrite instructions or program content correction information are sent to the large language model. If the program content is faulty and a confirmation result of the program content fault is obtained, perform the program content fault correction operation.

7. The method for handling native program faults in industrial robot controllers based on a large language model according to claim 6, characterized in that, In S107, determining the fault category specifically includes: The process of generating the described method involves collecting runtime copy creation records, compilation records, log information, program file information, and compilation environment information. Based on the collected information, the fault category is determined according to the following preset classification rules: When the build tools are not started, the version or configuration is invalid, runtime dependencies are missing, the path is incorrect, or the controller configuration file is invalid, the fault category is determined to be a build environment fault. When the external file name, internal program identifier, or file organization does not meet the requirements of the industrial robot controller, the fault category is determined to be a file naming or encapsulation fault. When the program structure, instructions, points, data, or logic do not conform to the industrial robot task description or the native language rules of the industrial robot controller, the fault category is determined to be a program content fault. When the fault category cannot be determined according to the above-mentioned preset classification rules, the fault classification manual confirmation result is received, and the program content fault correction operation is performed only when the fault category is a program content fault and the program content fault confirmation result is obtained.

8. The method for handling native program faults in industrial robot controllers based on a large language model according to claim 6 or 7, characterized in that, In S108, the specific correction operations for program content faults include: The confirmed program error information is input into the large language model, which combines the industrial robot task description and industrial robot domain constraint information to generate the corrected controller native source program. Save the corrected controller source code as a corrected output file, mark the corresponding generation round, and do not overwrite the original initial output file; Parse the internal program identifiers in the corrected output file and create a running copy corresponding to the corrected output file; The same digital digest algorithm is used to verify the consistency between the corrected output file and the corresponding running copy. After the verification is passed, the vendor's dedicated compilation tool is called to execute the compilation.

9. A method for importing native programs into an industrial robot controller based on a large language model, characterized in that, Following the industrial robot controller native program fault handling method according to any one of claims 6-8, the following import method operation steps are also included: S109. After the controller executable program meets the preset import conditions, in response to the import trigger conditions, based on the industrial robot controller address and communication configuration information, the controller executable program is automatically transmitted through the communication interface supported by the industrial robot controller; the file transmission status, controller reception status, program visibility status, manual execution confirmation status, and actual execution status are recorded respectively; no industrial robot motion start command is output during the controlled import process, and program selection, necessary reset, operation mode switching, and industrial robot start are implemented by manual operation procedures independent of the transmission of the controller executable program; The file transfer status, controller receiving status, program visibility status, manual execution confirmation status and actual execution status are recorded separately. If any status lacks corresponding evidence, it is recorded as unconfirmed, and the success of the next status is not inferred from the previous status. The preset import conditions include at least the successful compilation of the manufacturer-specific code and the generation of the corresponding controller executable program; when setting the industrial robot simulation verification step, the preset import conditions also include the industrial robot simulation verification status of the controller executable program being passed.

10. A system for generating, verifying, handling faults, and importing native programs for industrial robot controllers based on a large language model, characterized in that... include: The task input module is used to receive the industrial robot task description and industrial robot controller information, and to structure the target action, starting conditions, position, motion mode, motion speed and termination mode in the industrial robot task description. The domain constraint management module is used to retrieve the industrial robot domain constraint information corresponding to the industrial robot controller according to the version identifier. The large language model native program generation module is used to input industrial robot task description, industrial robot controller information and industrial robot domain constraint information into the large language model to generate controller native source program containing internal program identifiers; it is also used to generate corrected controller native source program based on confirmed program content fault and error information. The initial output saving module is used to save the controller's original source program generated for the first time by the large language model as the initial output file, and subsequent processing modules do not directly modify the initial output file; It is also used to save the corrected controller source program as a corrected output file that is distinct from the original generation round; The runtime copy encapsulation module is used to parse the internal program identifiers in the source file, generate an external file name according to the file naming rules of the industrial robot controller, and create a runtime copy based on the source file. The creation of the runtime copy only performs file-level processing and does not change the program content in the source file. The digital digest consistency verification module is used to calculate the digital digests of the source file and its corresponding running copy using the same digital digest algorithm, and outputs the compilation status as allowed or prohibited based on the digital digest comparison results. The manufacturer-specific compilation module is used to respond to the allowed compilation state, call the manufacturer-specific compilation tool corresponding to the industrial robot controller, convert the running copy into the controller executable program, and record relevant information about the compilation process and output files; The fault handling module is used to classify exceptions during the creation or compilation of the runtime copy into at least three categories: compilation environment faults, file naming or encapsulation faults, and program content faults, based on the runtime copy creation record, compilation record, log information, program file information, and compilation environment information. When the fault category cannot be reliably determined, it receives the fault classification manual confirmation result and determines the fault category accordingly. The fault handling control module is used to perform differentiated control for different fault categories: In the event of a compilation environment failure, after the environment is repaired, the vendor-specific compilation module is controlled to recompile using the original running copy; In the event of a file naming or encapsulation failure, the control module for encapsulating the running copy will rebuild the running copy using the initial output file as the source, and the control module for verifying the consistency of the digital digest will redo the verification. Compilation environment failures and file naming or encapsulation failures do not trigger the large language model rewriting program; when the program content is faulty and a confirmation result is obtained, the large language model native program generation module is controlled to generate a corrected output file, and the creation of the runtime copy, consistency verification and compilation process are controlled in sequence. The controlled import and status recording module is used to automatically transmit the controller executable program through the communication interface supported by the industrial robot controller after the preset import conditions are met, based on the address and communication configuration of the industrial robot controller, obtain the transmission return information, and record the file transmission status, controller reception status and program visibility status respectively. The controlled import and status recording module does not output industrial robot motion start commands. The preset import conditions include at least the successful compilation of the manufacturer-specific code and the generation of the corresponding controller executable program; The manual confirmation module is used to receive manual confirmation results for fault classification, program content fault confirmation results, simulation verification manual confirmation results, and manual confirmation results before actual execution. The evidence chain management module is used to associate and save task descriptions, constraint versions, initial output files, running copies, digital digests, compilation records, fault categories, corrected output files, and controlled import status by task number and generation round. The industrial robot simulation verification module is used to load the controller's executable program into the industrial robot simulation environment, run according to preset verification conditions after being triggered by manual operation, and record the loading status, movement segment reachability status, blocking alarm, program end status, final position, and manual confirmation result. The preset import conditions also include that the industrial robot simulation verification status of the controller executable program is passed.