Method and system for virtual scene-based industrial control code generation, debugging and optimization

CN122924741APending Publication Date: 2026-10-16NAT INST OF INTELLIGENT ROBOTICS SHENYANG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611107411.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-24
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0003]1.开发周期长、成本高:代码编写与调试完全在物理设备上进行,新车型导入的现场调试常需6-8周,期间停线成本高昂

Benefits of technology

[0044] 1. Efficiency Improvement: Placing a large amount of debugging work in a virtual environment can reduce on-site debugging time by more than 70%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122924741A_ABST
    Figure CN122924741A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of industrial automation and digital manufacturing, and discloses a method and system for generating, debugging and optimizing industrial control codes based on a virtual scene, and relates to the technical field of intelligent manufacturing and industrial software. The method comprises the following steps: constructing a high-fidelity virtual process scene; automatically generating initial control codes according to process logic and device behaviors in the virtual scene; simulating, debugging and logically verifying the control codes in the virtual scene, identifying potential conflicts and performance bottlenecks; and automatically optimizing and iterating the control code parameters based on debugging data and optimization algorithms. The system integrates virtual debugging, code automatic generation and intelligent optimization in a closed loop, is especially suitable for complex process systems such as automobile welding production lines, and can significantly shorten the development cycle and reduce the physical debugging risk and cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial automation and digital manufacturing technology, specifically relating to a method and system for developing process control code based on virtual simulation technology, which is particularly suitable for the development, debugging and optimization of complex process control programs such as robot welding and assembly in the fields of automobile manufacturing and aerospace. Background Technology

[0002] With the development of intelligent manufacturing, production line control systems are becoming increasingly complex. Taking automotive body-in-white welding lines as an example, they typically involve dozens of robots, hundreds of welding points, and complex logistics systems, placing extremely high demands on the reliability of control code. Traditional control code development heavily relies on engineers' experience, employing an "offline programming-on-site debugging" model, which presents the following bottlenecks.

[0003] 1. Long development cycle and high cost: Code writing and debugging are carried out entirely on physical equipment. On-site debugging for new models often takes 6-8 weeks, during which downtime costs are high.

[0004] 2. High safety risks: On-site debugging may lead to equipment collisions, product damage, or even personal injury accidents due to program errors.

[0005] 3. Optimization difficulties: The optimization of process parameters (such as welding current, robot speed, and overall cycle time) relies on trial and error, making it difficult to systematically find the global optimal solution, which affects production quality and efficiency.

[0006] In existing technologies, virtual debugging technology verifies some logic in advance in a virtual environment using digital twins, but code generation still requires manual completion or relies on simple templates, lacking an automated code generation and intelligent optimization closed loop that deeply interacts with the virtual scene. Other solutions focus on specific stages, such as automating the generation of CAE simulation solder joint models, but do not address the issue of efficient development of the control code itself. Therefore, there is an urgent need for a technical solution that can connect the entire process from virtual scene to high-quality control code. Summary of the Invention

[0007] The purpose of this invention is to overcome the shortcomings of the prior art and provide an integrated method and system that can quickly and automatically generate process control code in a virtual environment and complete debugging and optimization, so as to significantly shorten the process development cycle, improve code quality, and reduce dependence on physical equipment and debugging risks.

[0008] The core of this invention lies in constructing a closed-loop system covering the entire process of code generation and virtual debugging optimization. In contrast, traditional on-site debugging relies entirely on physical equipment for pure hardware debugging, which cannot intervene during the code writing stage and lacks a feedback loop for overall optimization. Existing virtual debugging technologies focus on verifying the logical correctness of existing code in a virtual environment, but do not include the code generation stage. Existing code generation technologies mainly focus on converting models or requirement descriptions into initial code, and their functionality stops at the generation stage, without involving subsequent debugging and optimization.

[0009] In terms of interactivity, this invention enables bidirectional real-time interaction between the virtual scene and the control code. Any modifications the user makes to the code can be dynamically verified in the virtual simulation in real time, and the feedback from the simulation environment can also drive code adjustments in reverse. In traditional on-site debugging, the relationship between code and physical equipment is unidirectional; the equipment runs passively after the code is issued, and the debugging process relies on manual observation and intervention. Although existing virtual debugging technologies can use code to drive virtual scenes, the feedback path is relatively limited, usually only providing preset measurement values ​​or status displays, making it difficult to form a closed-loop interaction. Existing code generation technologies are often unidirectional and static; the generation process is basically unaffected by external environmental feedback, and users cannot interact with the virtual scene during the generation process.

[0010] In summary, the solution of this invention is significantly different from existing technical approaches in terms of functional completeness, real-time interactivity, and intelligent optimization, forming a closed-loop solution from generation to deployment.

[0011] The technical solution of this invention is as follows: a method for generating, debugging, and optimizing industrial control code based on a virtual scene, comprising the following steps:

[0012] The client constructs a virtual scene and configures its parameters. It then starts the server to generate control code and runs and debugs the virtual scene locally.

[0013] On the server side, based on the client's startup request, information tables are generated by parsing the parameter configuration, and PLC code and robot code are generated by mapping and translating through the code instruction library.

[0014] The client is configured to perform the following steps:

[0015] The virtual scene building module builds scenes based on the 3D models of the equipment. Scenes are divided into equipment level, workstation level, process level and production line level, and there is a hierarchical relationship between adjacent levels. Among them, the equipment level is a single device, the workstation level is composed of multiple devices, the process level is composed of multiple workstations, and the production line level is composed of multiple processes.

[0016] The 3D model attribute and process logic relationship configuration module configures equipment parameters based on the functional characteristics of the 3D model, including: kinematic and dynamic attributes, equipment status interaction signals, and logical timing task sequences.

[0017] The code automatic generation interactive module starts the server-side code logic rule generation engine module, which processes the information table generated by the scene logic relationship parsing engine module, and downloads the resulting PLC code and robot code to the client.

[0018] The simulation and debugging module controls the overall operation and debugging of the production line by generating PLC code and robot code in a virtual scene;

[0019] The code deployment module downloads and deploys the generated PLC code and robot code to the actual equipment.

[0020] The server is configured to perform the following steps:

[0021] The scene logic relationship parsing engine module generates an information table based on the configuration information of all devices in the scene, including device type, device parameters, spatial position relationship between devices, and logical temporal task sequence between devices. The fields of the information table include: workstation number, workstation name, process name, motion pair type, action type, description keyword, code instruction mapping, actuator type, and parameter extraction.

[0022] The code logic rule generation engine module parses the information table generated by the engine module according to the scene logic relationship, and generates PLC code and robot code through code instruction library mapping and translation.

[0023] The simulation debugging result optimization module optimizes the simulation results based on those from the client-side simulation debugging module.

[0024] The simulation debugging result optimization module is configured to perform the following steps:

[0025] To address the cycle time bottlenecks discovered during debugging, optimization algorithms are used to automatically adjust the state data, including the robot's motion speed and acceleration, or to reorganize the parallel task sequence. The PLC code and robot code are then regenerated and simulated and verified through the scene logic relationship parsing engine module and the code logic rule generation engine module until the production cycle time requirements are met.

[0026] Welding quality is assessed by constructing a welding quality prediction model. The welding quality prediction model collects welding equipment status information from virtual sensors in the virtual scene device. The welding equipment parameters include electrode wear, current, voltage, and resistance. The model then predicts the welding quality to determine the weld quality. If the weld quality meets the set requirements, the current welding equipment parameters are updated in the client's simulation debugging module. The code is then regenerated and simulated for verification through the scene logic relationship parsing engine module and the code logic rule generation engine module.

[0027] Systems for generating, debugging, and optimizing industrial control code based on virtual scenarios include:

[0028] The client is used to build virtual scenes and configure parameters. It starts the server to generate control code and runs and debugs the virtual scene locally.

[0029] The server-side component is used to generate information tables based on client-side startup requests, according to parameter configurations, and to generate PLC and robot codes through code instruction library mapping and translation.

[0030] The client includes:

[0031] The virtual scene building module is used to build scenes based on the 3D model of the equipment. Scenes are divided into equipment level, workstation level, process level and production line level, and there is a relationship between adjacent levels. Among them, the equipment level is a single equipment, the workstation level is composed of multiple equipment, the process level is composed of multiple workstations, and the production line level is composed of multiple processes.

[0032] The 3D model attribute and process logic relationship configuration module is used to configure equipment parameters according to the functional characteristics of the 3D model, including: kinematic and dynamic attributes, equipment status interaction signals, and logical timing task sequences.

[0033] The code auto-generation interactive module is used to start the server-side code logic rule generation engine module, which processes the information table generated by the scene logic relationship parsing engine module, and downloads the resulting PLC code and robot code to the client.

[0034] The simulation debugging module is used to control the overall operation and debugging of the production line in a virtual scene through the generated PLC code and robot code;

[0035] The code deployment module is used to download and deploy the generated PLC code and robot code to real devices.

[0036] The server includes:

[0037] The scene logic relationship parsing engine module is used to generate an information table based on the configuration information of all devices in the scene, including device type, device parameters, spatial position relationship between devices, and logical temporal task sequence between devices. The fields of the information table include: workstation number, workstation name, process name, motion pair type, action type, description keyword, code instruction mapping, actuator type, and parameter extraction.

[0038] The code logic rule generation engine module is used to parse the information table generated by the engine module according to the scene logic relationship, and generate PLC code and robot code through code instruction library mapping and translation.

[0039] The simulation debugging result optimization module is used to optimize based on the simulation debugging results of the client simulation debugging module.

[0040] The simulation debugging result optimization module includes:

[0041] The cycle time optimization module is used to address cycle time bottlenecks discovered during debugging. It uses optimization algorithms to automatically adjust state data, including the robot's motion speed and acceleration, or to reorganize the parallel task sequence. This allows the PLC code and robot code to be regenerated and simulated and verified sequentially through the scene logic relationship parsing engine module and the code logic rule generation engine module until the production cycle time requirements are met.

[0042] The welding quality assessment module is used to evaluate welding quality by constructing a welding quality prediction model. The welding quality prediction model uses virtual sensors in the virtual scene device to collect welding equipment status information. The welding equipment parameters include electrode wear, current, voltage, and resistance. The model predicts the welding quality to determine the weld quality. If the weld quality meets the set requirements, the current welding equipment parameters are updated in the client's simulation debugging module. The module then regenerates the code through the scene logic relationship parsing engine module and the code logic rule generation engine module and performs simulation verification.

[0043] The present invention has the following beneficial effects and advantages:

[0044] 1. Efficiency Improvement: Placing a large amount of debugging work in a virtual environment can reduce on-site debugging time by more than 70%.

[0045] 2. Quality and Safety: Exhaustively test various operating conditions in a virtual environment to eliminate collision risks in advance and generate more robust code.

[0046] 3. Process optimization: Utilizing massive simulation data in virtual scenarios, algorithms automatically optimize process parameters to improve overall performance, equipment lifespan, and energy efficiency.

[0047] 4. Accumulate experience: It can accumulate the company's 3D model dataset (equipment, workstations, production lines, etc.), accumulate solution experience, and standardize the company's process code to reduce personnel learning costs. Attached Figure Description

[0048] Figure 1 This is a schematic diagram of the system of the present invention;

[0049] Figure 2 This is a flowchart of the method of the present invention;

[0050] Figure 3 This is a flowchart of the code logic relationship detection and reconstruction process for this invention. Detailed Implementation

[0051] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments, specifically a welding scenario for an automotive body-in-white.

[0052] A method and system for rapidly generating, debugging, and optimizing process control code based on a virtual scenario, comprising:

[0053] Client-side modules include: virtual scene building module, 3D model process logic relationship configuration module, automatic code generation module, simulation debugging module, and code deployment module.

[0054] Server-side: Scene logic relationship parsing engine module, code logic rule generation engine module, simulation debugging result optimization module, and enterprise-related dataset accumulation module.

[0055] The client includes:

[0056] The virtual scene building module allows users to import new 3D CAD models or search for existing 3D CAD models from the history to build scenes. Scenes can be divided into equipment level, workstation level, process level, and production line level. Equipment level refers to a single device, such as a robot. Workstation level consists of multiple devices, such as multiple robot devices working simultaneously. Process level consists of multiple workstations. Production line level consists of multiple processes.

[0057] The 3D model attribute and process logic relationship configuration module allows users to configure parameters according to the functional characteristics of the model. For example, kinematic and dynamic attributes, equipment status signals, and logical timing task sequences can be added to equipment such as robots, welding guns, fixtures, and conveyor lines.

[0058] The code automatic generation interactive module starts the server-side code logic rule generation engine module, processes the logic relationship matrix generated by the scene logic relationship parsing engine module, generates PLC code, robot code, etc., and downloads them to the client for subsequent simulation and debugging.

[0059] The simulation and debugging module combines the generated client PLC code and robot code in a virtual scene to control the overall operation and debugging of the equipment production line.

[0060] The code deployment module downloads and deploys the generated code to hardware devices.

[0061] The server includes:

[0062] The scene logic relationship parsing engine module decomposes the relationships in the scene, such as the device type, device parameters, spatial position relationship between devices, and logical timing task sequence of devices, to obtain a detailed logical relationship matrix and generate an information table. The fields of the information table include workstation number, workstation name, process name, motion pair type, action type, descriptive keywords, code instruction mapping, actuator type, parameter extraction and other information.

[0063] The code logic rule generation engine module, based on the scene logic relationship, parses the information table generated by the engine module and combines it with the code instruction library mapping to generate detailed PLC and robot code execution logic.

[0064] The simulation debugging result optimization module optimizes based on the simulation debugging results, such as execution logic errors (missing status signals, etc.), timing conflicts (such as multiple robots entering the same workspace, etc.), and performance indicators (such as cycle time, equipment parameters, etc.).

[0065] The enterprise-related dataset accumulation module accumulates standardized 3D CAD models, workstations, process information, etc., and optimizes parameter test sets, which can be quickly reused in subsequent scenarios.

[0066] A method and system for rapidly generating, debugging, and optimizing process control code based on a virtual scenario, comprising the following steps:

[0067] The client imports or reuses existing models and configures the process logic relationships of the models. The server parses and translates the logic relationship matrix based on the process logic relationships to generate a code logic matrix. The client automatically generates code based on the code generation engine and the code logic matrix. The generated code can be simulated, debugged, and run in the scenario to run the production line equipment model. The server optimizes based on the simulation and debugging results. The client iteratively generates new code and then deploys the code to the hardware device for operation. The server accumulates historical case experience.

[0068] Example

[0069] A method and system for rapidly generating, debugging, and optimizing process control code based on a virtual scenario, comprising the following steps:

[0070] The first step is to construct a virtual welding scene: import and lay out the 3D CAD model of the welding line, creating models for equipment such as robots, welding guns, fixtures, and conveyor lines, and adding kinematic and dynamic attributes to each piece of equipment to build a digital twin. Then, based on the process flow, define the logical timing sequence of tasks for each piece of equipment and workstation in the virtual scene, for example, "Robot A moves to position P1 -> executes welding point W1 -> returns to standby position," forming an XML file containing equipment type, equipment parameters, spatial relationships between equipment, and the logical timing sequence of tasks.

[0071] The second step involves automatically generating initial welding control code: The system scene logic relationship parsing engine module parses the XML format file generated in the previous step, extracting field content to obtain information such as workstation number, workstation name, process name, kinematic pair type, action type, descriptive keywords, code instruction mapping, actuator type, and parameters. The workstation number, workstation name, actuator type, and parameters are derived from equipment type, equipment parameters, and spatial relationships between equipment; the process name, kinematic pair type, action type, descriptive keywords, and code instruction mapping are derived from the logical timing task sequence. The descriptive keywords are used to identify process information and are standardized, structured metadata tags. The code instruction mapping represents the mapping relationship between the current process step and the control code. Based on the built-in PLC and robot code template library (such as PLC structured data conforming to the IEC61131-3 standard) and welding process knowledge base (containing standard current, voltage, and time parameter ranges corresponding to different plate thicknesses), initial control code capable of driving equipment in the virtual scene is automatically generated. For example, for weld point W1, the system will automatically generate a code segment containing robot motion instructions (MoveL to target coordinates), welding start instructions (WeldOn), and preset welding parameters (current = 8kA, time = 0.2s).

[0072] The third step is debugging and verification in a virtual environment: The virtual environment and the generated PLC and robot control code are run synchronously in the simulation engine. The system detects in real time logical errors (e.g., the robot not reaching the target position but already sending a welding signal to the welding torch), timing conflicts (e.g., two robots entering the same workspace, causing collisions, stopping work, etc.) and performance indicators (e.g., cycle time, output, equipment utilization not meeting design requirements). All I / O signals, equipment motion trajectories, and virtual sensor data are recorded as debugging data.

[0073] The fourth step is control code optimization based on simulation data: For cycle time bottlenecks discovered during debugging, optimization algorithms (such as genetic algorithms) can automatically adjust the robot's movement speed and acceleration, or reorganize the parallel task sequence, regenerate the code, and verify it through simulation until the production cycle time requirements are met. For welding quality, the system can connect to a welding quality prediction model. This model uses virtual sensors in the virtual scene to collect and input information such as "plate gap," "electrode wear," "current," "voltage," and "resistance" to predict weld quality and the risk of incomplete welds. The optimization algorithm then fine-tunes parameters such as "welding current," "welding voltage," and "pressure" in the code accordingly, generating optimized code that ensures quality while reducing energy consumption.

[0074] Step 5, Code Iteration and Deployment: The optimized control code, which has finally passed virtual verification, is downloaded to the physical PLC and robot controller with one click. Real-time data collected during the physical production process (such as actual welding current and weld quality inspection results) can be fed back to the virtual system to update and calibrate the model, enabling continuous iterative optimization.

[0075] like Figure 1 The diagram shown is a schematic of the system of the present invention. The system of the present invention can adopt a C / S architecture or a B / S architecture. It takes the virtual scene and the attributes and process logic relationships of each model in the scene as input, and automatically generates code based on the scene logic relationship parsing engine, the code logic rule generation engine and the code generation engine. The automatically generated code is combined with the equipment in the virtual scene for virtual simulation debugging. Based on the results of the debugging process, the process is optimized and the code is iteratively generated. Finally, the completed code is deployed to the actual scene. The system form depends on the actual needs.

[0076] The virtual scene building module allows users to import new 3D CAD models or search for existing 3D CAD models from the history to build scenes. Scenes can be divided into equipment level, workstation level, process level, and production line level. Equipment level refers to a single device, such as a robot. Workstation level consists of multiple devices, such as multiple robot devices working simultaneously. Process level consists of multiple workstations. Production line level consists of multiple processes.

[0077] The 3D model attribute and process logic relationship configuration module allows users to configure parameters according to the functional characteristics of the model. For example, kinematic and dynamic attributes, status signals, and task sequences can be added to equipment such as robots, welding guns, fixtures, and conveyor lines.

[0078] The automatic code generation module automatically generates PLC code, robot code, etc., based on the code generation engine and code execution logic matrix.

[0079] The simulation and debugging module combines the generated PLC code and robot code in a virtual scene to control the overall operation of the equipment production line.

[0080] The code deployment module downloads and deploys the generated code to hardware devices.

[0081] The scene logic relationship parsing engine module decomposes the relationships in the scene, such as device type, device parameters, spatial location relationships, and task sequences, to obtain a detailed logic relationship matrix.

[0082] The code logic rule generation engine module, based on the logical relationship matrix parsed from the scene's logical relationships, translates it into a detailed code logic matrix.

[0083] The simulation debugging result optimization module optimizes based on the simulation debugging results, such as execution logic errors (missing status signals, etc.), timing conflicts (such as multiple robots entering the same workspace, etc.), and performance indicators (such as cycle time, equipment parameters, etc.).

[0084] The enterprise-related dataset accumulation module accumulates standardized 3D CAD models, workstations, process information, etc., and optimizes parameter test sets, which can be quickly reused in subsequent scenarios.

[0085] The invention will be described in detail below using specific examples from automotive body-in-white welding scenarios:

[0086] The first step is to construct a virtual welding scene: import and lay out the 3D CAD model of the welding line, including models of equipment such as robots, welding guns, fixtures, and conveyor lines, and add kinematic and dynamic attributes to each piece of equipment to create a digital twin. Then, according to the process flow, define the task sequence of each piece of equipment and workstation in the virtual scene, such as "Robot A moves to position P1 -> executes welding point W1 -> returns to standby position".

[0087] The second step is to automatically generate initial welding control code: The system parses the process task defined in the previous step and, based on the built-in code template library (such as PLC structured data conforming to IEC 61131-3 standard) and welding process knowledge base (containing standard current, voltage, and time parameter ranges corresponding to different plate thicknesses), automatically generates initial control code that can drive the equipment in the virtual scene. For example, for weld point W1, the system will automatically generate a code segment containing robot motion instructions (MoveL to target coordinates), welding start instructions (WeldOn), and preset welding parameters (current = 8kA, time = 0.2s).

[0088] The third step is to debug and verify in a virtual environment: The virtual environment and the generated PLC / robot control code are run synchronously in the simulation engine. The system detects logic errors (such as issuing a welding signal before the robot is in position), timing conflicts (such as two robots entering the same workspace), and performance indicators (such as cycle time) in real time. All I / O signals, equipment motion trajectories, and virtual sensor data are recorded as debugging data.

[0089] The fourth step is control code optimization based on simulation data: For cycle time bottlenecks discovered during debugging, optimization algorithms (such as genetic algorithms) can automatically adjust the robot's movement speed and acceleration, or reorganize the parallel task sequence, regenerate the code, and verify it through simulation until the production cycle time requirements are met. For welding quality, the system can connect to a welding quality prediction model. This model predicts the risk of incomplete welds based on simulated data such as "plate gap" and "electrode wear" in the virtual scene. The optimization algorithm then fine-tunes parameters such as welding current and pressure in the code accordingly, generating optimized code that ensures quality while reducing energy consumption.

[0090] Step 5, Code Iteration and Deployment: The optimized control code, which has finally passed virtual verification, is downloaded to the physical PLC and robot controller with one click. Real-time data collected during the physical production process (such as actual welding current and weld quality inspection results) can be fed back to the virtual system to update and calibrate the model, enabling continuous iterative optimization.

[0091] like Figure 2 The diagram shown is a flowchart of the method of the present invention. The specific steps are as follows:

[0092] Step S201: Construct a virtual scene. Existing device models can be imported or reused for layout in the virtual scene.

[0093] Step S202: Configure the functional attributes and process logic relationships of the models in the scene;

[0094] Step S203: Analyze the logical relationships of the configured process tasks, translate them into code execution logic, and then automatically generate the code;

[0095] Step S204: Run the generated control code, perform simulation debugging in conjunction with the virtual scene, and obtain relevant feedback results;

[0096] Step S205: Perform overall optimization based on the feedback results obtained;

[0097] Step S206: The code is iteratively optimized and finally deployed to the actual production environment.

[0098] like Figure 3 The diagram shown is a flowchart of the automatic code generation process of this invention. The specific steps are as follows:

[0099] Step S301: Analyze the relationship between the 3D model attributes in the virtual scene and the process logic of each device;

[0100] Step S302: Generate the device logic relationship matrix in the scene;

[0101] Step S303: Translate the device logic relationship matrix to generate the code execution logic matrix;

[0102] Step S304: Automatically generate control code using the code generation engine.

Claims

1. A method for generating, debugging, and optimizing industrial control code based on virtual scenarios, characterized in that, Includes the following steps: The client constructs a virtual scene and configures its parameters. It then starts the server to generate control code and runs and debugs the virtual scene locally. On the server side, based on the client's startup request, information tables are generated by parsing the parameter configuration, and PLC code and robot code are generated by mapping and translating through the code instruction library.

2. The method for generating, debugging, and optimizing industrial control code based on a virtual scene according to claim 1, characterized in that, The client is configured to perform the following steps: The virtual scene building module builds scenes based on the 3D models of the equipment. Scenes are divided into equipment level, workstation level, process level and production line level, and there is a hierarchical relationship between adjacent levels. Among them, the equipment level is a single device, the workstation level is composed of multiple devices, the process level is composed of multiple workstations, and the production line level is composed of multiple processes. The 3D model attribute and process logic relationship configuration module configures equipment parameters based on the functional characteristics of the 3D model, including: kinematic and dynamic attributes, equipment status interaction signals, and logical timing task sequences. The code automatic generation interactive module starts the server-side code logic rule generation engine module, which processes the information table generated by the scene logic relationship parsing engine module, and downloads the resulting PLC code and robot code to the client. The simulation and debugging module controls the overall operation and debugging of the production line by generating PLC code and robot code in a virtual scene; The code deployment module downloads and deploys the generated PLC code and robot code to the actual equipment.

3. The method for generating, debugging, and optimizing industrial control code based on a virtual scene according to claim 1, characterized in that, The server is configured to perform the following steps: The scene logic relationship parsing engine module generates an information table based on the configuration information of all devices in the scene, including device type, device parameters, spatial position relationship between devices, and logical temporal task sequence between devices. The fields of the information table include: workstation number, workstation name, process name, motion pair type, action type, description keyword, code instruction mapping, actuator type, and parameter extraction. The code logic rule generation engine module parses the information table generated by the engine module according to the scene logic relationship, and generates PLC code and robot code through code instruction library mapping and translation. The simulation debugging result optimization module optimizes the simulation results based on those from the client-side simulation debugging module.

4. The method for generating, debugging, and optimizing industrial control code based on a virtual scene according to claim 3, characterized in that, The simulation debugging result optimization module is configured to perform the following steps: To address the cycle time bottlenecks discovered during debugging, optimization algorithms are used to automatically adjust the state data, including the robot's motion speed and acceleration, or to reorganize the parallel task sequence. The PLC code and robot code are then regenerated and simulated and verified through the scene logic relationship parsing engine module and the code logic rule generation engine module until the production cycle time requirements are met. Welding quality is assessed by constructing a welding quality prediction model. The welding quality prediction model collects welding equipment status information from virtual sensors in the virtual scene device. The welding equipment parameters include electrode wear, current, voltage, and resistance. The model then predicts the welding quality to determine the weld quality. If the weld quality meets the set requirements, the current welding equipment parameters are updated in the client's simulation debugging module. The code is then regenerated and simulated for verification through the scene logic relationship parsing engine module and the code logic rule generation engine module.

5. A system for generating, debugging, and optimizing industrial control code based on virtual scenarios, characterized in that, include: The client is used to build virtual scenes and configure parameters. It starts the server to generate control code and runs and debugs the virtual scene locally. The server-side component is used to generate information tables based on client-side startup requests, according to parameter configurations, and to generate PLC and robot codes through code instruction library mapping and translation.

6. The system for generating, debugging, and optimizing industrial control code based on a virtual scene according to claim 5, characterized in that, The client includes: The virtual scene building module is used to build scenes based on the 3D model of the equipment. Scenes are divided into equipment level, workstation level, process level and production line level, and there is a relationship between adjacent levels. Among them, the equipment level is a single equipment, the workstation level is composed of multiple equipment, the process level is composed of multiple workstations, and the production line level is composed of multiple processes. The 3D model attribute and process logic relationship configuration module is used to configure equipment parameters according to the functional characteristics of the 3D model, including: kinematic and dynamic attributes, equipment status interaction signals, and logical timing task sequences. The code auto-generation interactive module is used to start the server-side code logic rule generation engine module, which processes the information table generated by the scene logic relationship parsing engine module, and downloads the resulting PLC code and robot code to the client. The simulation debugging module is used to control the overall operation and debugging of the production line in a virtual scene through the generated PLC code and robot code; The code deployment module is used to download and deploy the generated PLC code and robot code to real devices.

7. The system for generating, debugging, and optimizing industrial control code based on a virtual scene according to claim 5, characterized in that, The server includes: The scene logic relationship parsing engine module is used to generate an information table based on the configuration information of all devices in the scene, including device type, device parameters, spatial position relationship between devices, and logical temporal task sequence between devices. The fields of the information table include: workstation number, workstation name, process name, motion pair type, action type, description keyword, code instruction mapping, actuator type, and parameter extraction. The code logic rule generation engine module is used to parse the information table generated by the engine module according to the scene logic relationship, and generate PLC code and robot code through code instruction library mapping and translation. The simulation debugging result optimization module is used to optimize based on the simulation debugging results of the client simulation debugging module.

8. The system for generating, debugging, and optimizing industrial control code based on a virtual scene according to claim 5, characterized in that, The simulation debugging result optimization module includes: The cycle time optimization module is used to address cycle time bottlenecks discovered during debugging. It uses optimization algorithms to automatically adjust state data, including the robot's motion speed and acceleration, or to reorganize the parallel task sequence. This allows the PLC code and robot code to be regenerated and simulated and verified sequentially through the scene logic relationship parsing engine module and the code logic rule generation engine module until the production cycle time requirements are met. The welding quality assessment module is used to evaluate welding quality by constructing a welding quality prediction model. The welding quality prediction model uses virtual sensors in the virtual scene device to collect welding equipment status information. The welding equipment parameters include electrode wear, current, voltage, and resistance. The model predicts the welding quality to determine the weld quality. If the weld quality meets the set requirements, the current welding equipment parameters are updated in the client's simulation debugging module. The module then regenerates the code through the scene logic relationship parsing engine module and the code logic rule generation engine module and performs simulation verification.