Internet of Things simulation automatic error correction system based on large language model, medium and product
By using an IoT simulation automatic error correction system based on a large language model, combined with a display module, a user code module, and an AI dialogue module, real-time error diagnosis and intelligent error correction of IoT programs are realized. This solves the problems of low error detection efficiency, inaccurate error correction, and insufficient support for complex scenarios in existing tools, thereby improving development efficiency and user experience.
Patent Information
- Application Number
- CN202511981170.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-03-20
AI Technical Summary
Existing IoT simulation tools are inefficient in error detection and correction, struggle to accurately pinpoint error points, lack support for complex scenarios, and cannot achieve hardware-software collaborative diagnostics.
An automatic error correction system for IoT simulation based on a large language model is adopted. Through the collaborative work of a display module, a user code module, and an AI dialogue module, real-time error diagnosis and intelligent error correction are achieved. The display module provides a visual interactive interface, the user code module processes circuit diagrams and code data, and the AI dialogue module performs multimodal correlation analysis and intent reasoning based on the large language model to generate accurate correction suggestions.
It improves the efficiency of IoT development and user experience, can accurately locate and correct errors in complex scenarios, provides interactive error correction suggestions, and enhances the accuracy of hardware-software collaborative diagnosis and the system's adaptability.
Smart Images

Figure CN121706722A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of Internet of Things (IoT) simulation, and in particular relates to an automatic error correction system, medium and product for IoT simulation based on a large language model. Background Technology
[0002] With the development of IoT technology, IoT simulation tools are widely used in teaching and research. These tools provide visual circuit design interfaces and code programming environments, supporting users to quickly build and verify IoT application prototypes.
[0003] However, existing IoT simulation tools have significant shortcomings in error detection and correction. Users need to check pin connections, logic errors, or syntax problems, which is not only time-consuming but also prone to omissions. Traditional tools can only provide simple "compilation error" or "simulation anomaly" prompts, and cannot accurately locate specific error points or provide effective correction suggestions. For non-standard programs built by users, existing tools lack the ability to understand the design intent and find it difficult to assess whether the program meets the expected goals. They also have limited capabilities in error correlation analysis between circuit diagrams and code, making it difficult to achieve hardware-software co-diagnosis.
[0004] In related technologies, existing research has attempted error detection using methods such as rule matching and static analysis. For example, hardware connections are verified using a pre-defined circuit rule base, code defects are analyzed using compiler technology, or runtime anomalies are identified based on log analysis. However, these methods are often limited to single-modality error detection and rely on fixed rule templates, making them difficult to adapt to complex and ever-changing application scenarios. This situation needs further improvement. Summary of the Invention
[0005] This application provides an automatic error correction system, medium, and product for IoT simulation based on a large language model, which addresses the problems of low error detection efficiency, inaccurate error correction feedback, insufficient support for complex scenarios, and lack of multimodal collaboration in existing IoT simulation tools. The system achieves real-time error diagnosis and intelligent error correction for IoT programs through the collaborative work of a display module, a user code module, and an AI dialogue module.
[0006] Firstly, this application provides an automatic error correction system for IoT simulation based on a large language model, including: The display module, user code module, and AI dialogue module interact via a data bus; The display module is used to provide a visual interactive interface; The user code module is bidirectionally connected to the display module and is used to collect IoT program data input by the user in the display module in real time, and transmit the processed data to the AI dialogue module. The IoT program data includes circuit diagram data and code data. The AI dialogue module is bidirectionally connected to the display module and the user code module, respectively, and is used to receive the IoT program data, perform error diagnosis, interactive error correction and generate correction suggestions based on the large language model; The AI dialogue module includes an error diagnosis unit and an intent reasoning unit. The error diagnosis unit uses multimodal correlation analysis to determine coupling errors between the circuit diagram and the code by combining the hardware connection relationship of the circuit diagram data with the logical execution path of the code data. When the IoT program data does not match the preset target scenario, the intent reasoning unit extracts key operations from the user code and verifies whether the coordination between the circuit diagram data and the code data meets the user's design goals.
[0007] By adopting the above technical solution, this application employs a system architecture that connects a display module, a user code module, and an AI dialogue module via a data bus. The display module provides a visual interactive interface, the user code module collects and processes circuit diagram and code data in real time, and the AI dialogue module generates error diagnosis and correction suggestions based on a large language model. The AI dialogue module includes an error diagnosis unit and an intent reasoning unit. The former uses multimodal correlation analysis to determine coupling errors between the circuit diagram and code, while the latter extracts key operations to verify whether the hardware-software synergy meets the user's design goals. This application achieves fully automatic error detection and intelligent error correction for IoT programs; solves the problem of difficult cross-modal error detection through multimodal correlation analysis; overcomes the bottleneck of insufficient support for complex non-standard scenarios based on intent reasoning; and provides interactive error correction and accurate correction suggestions, significantly improving the efficiency of IoT development and user experience. In conjunction with some implementations of the first aspect, in some implementations, the visual interactive interface of the display module includes a circuit diagram editing area and a code editing area; The circuit diagram editing area includes a component library and a canvas area. The component library provides draggable sensor components, actuator components, and connecting wire components, while the canvas area supports component drag-and-drop and connection operations. The code editing area provides the ability to switch between block-based programming tools and text-based programming tools; It also includes real-time interaction with the AI dialogue module, marking errors in the circuit diagram editing area and the code editing area based on the error diagnosis results, and displaying error correction suggestions.
[0008] By adopting the above technical solution, this application sets up circuit diagram editing and code editing areas in the display module, and configures dedicated interactive functions for each area: the circuit diagram editing area provides a draggable component library and a canvas area that supports component operation; the code editing area supports switching between block-based and text-based programming, and can also interact with the AI dialogue module in real time and mark errors; the visual drag-and-drop and block-based programming lower the barrier to entry; the real-time error marking and the visual display of error correction suggestions make the error location clear at a glance, and can intuitively understand the correction solution, thus improving development efficiency and learning experience. In conjunction with some implementations of the first aspect, in some implementations, the processing of IoT program data by the user code module includes: The circuit diagram data is processed into a device list, connection relationships, and pin configuration information, wherein the device list includes hardware type and model, the connection relationships include the connection method between pins, and the pin configuration information includes communication protocol and address; The code data is processed into an intermediate representation, wherein graphical code is converted into an abstract syntax tree, and text code is converted into a syntax tree and a symbol table; Collect output logs, sensor values, and actuator status generated during simulation.
[0009] By adopting the above technical solution, this application performs structured processing of IoT program data through the user code module: the circuit diagram data is subdivided into a device list containing detailed hardware information, connection relationships, and pin configuration information; the code data is uniformly converted into standard intermediate representations such as abstract syntax trees; and running data during the simulation process is collected in real time. This achieves standardized preprocessing and unified representation of IoT program data, facilitating in-depth analysis by the AI dialogue module; through detailed hardware information extraction and structured code representation, the accuracy of error detection is improved; and the collection of simulation running data supports the identification of dynamic errors, enabling the system to more comprehensively understand and diagnose various errors in the program. In conjunction with some implementations of the first aspect, in some implementations, the IoT program data further includes simulation data, and the multimodal correlation analysis of the error diagnosis unit includes: The pin connection compatibility and power supply configuration are verified based on the circuit diagram data to obtain the hardware test results; The software detection results are obtained by verifying the integrity of function calls and the correctness of program logic based on the code data. The simulation data is used to verify the rationality of the sensor input values and actuator output values, and the simulation detection results are obtained. The cause of the error is determined based on the correlation between the hardware test results, the software test results, and the simulation test results.
[0010] By adopting the above technical solution, this application performs multi-dimensional detection of IoT program data through an error diagnosis unit: verifying pin connections and power configuration at the hardware level, analyzing function calls and program logic at the software level, evaluating the rationality of sensor and actuator values at the operational level, and finally performing correlation analysis based on the detection results of the three levels to determine the cause of the error; achieving comprehensive error detection from static code analysis to dynamic operation monitoring; improving the accuracy of error location through multi-level cross-validation; and discovering complex errors that are difficult to identify from a single dimension based on correlation analysis. In conjunction with some implementations of the first aspect, in some implementations, the processing flow of the intent reasoning unit includes: Based on the code data, key operation statements and control logic are extracted to obtain the code intent result; Based on the analysis of the code intent results, the hardware configuration in the circuit diagram data is obtained to obtain the hardware support results; Based on the correspondence between the code intent result and the hardware support result, and combined with the simulation data to verify the actual output, the target matching result is obtained; When the target matching result shows a mismatch, a correction suggestion is generated by combining the code intent result and the hardware support result, and automatic correction is executed after waiting for user confirmation.
[0011] By adopting the above technical solution, this application constructs a complete reasoning chain from code intent understanding to hardware support assessment, and then to target matching verification through the intent reasoning unit: First, key operations and control logic are extracted from the code to understand the user's intent; then, the degree of hardware configuration support for these intents is assessed; finally, simulation data is used to verify whether the actual output meets expectations, and targeted correction suggestions are generated when mismatches are found; intelligent understanding and verification of user design goals are achieved; through bidirectional analysis of code intent and hardware support, hardware-software mismatch problems can be accurately identified; target matching verification based on actual running data ensures the reliability of correction suggestions; the automatic correction function simplifies the user's error correction operation and improves development efficiency. In conjunction with some implementations of the first aspect, in some implementations, the error diagnosis unit further includes a knowledge graph module, used for: Construct a domain knowledge graph, which includes standard connection patterns of IoT hardware components, calling dependencies of software functions, and standard patterns of hardware-software interaction. Based on the domain knowledge graph, the circuit diagram data and the code data are preprocessed to obtain a hardware-software association mapping table; The correspondence between the circuit diagram data and the code data is determined based on the hardware-software association mapping table.
[0012] By adopting the above technical solution, this application introduces a knowledge graph module into the error diagnosis unit, constructing a domain knowledge graph that includes hardware standard connections, software call dependencies, and hardware-software interaction patterns. Based on this, circuit diagram data and code data are preprocessed to generate a hardware-software association mapping table. The domain knowledge provided by the knowledge graph enhances the accuracy and reliability of error diagnosis. Pre-setting standard patterns allows for the identification of design deviations that do not conform to best practices. The establishment of the hardware-software association mapping table enables systematic analysis of cross-level errors, avoiding the limitations of traditional methods that treat hardware and software errors in isolation. Furthermore, the introduction of the knowledge graph provides a continuously expandable knowledge base for the system. In conjunction with some implementations of the first aspect, in some implementations, the error diagnosis unit further includes a knowledge update module, used for: The error cause, correction suggestions, and user confirmation results are stored in the error case library, and the domain knowledge graph is updated online based on the error case library; The online updates include: Based on the standard connection mode of IoT hardware components, connection constraint rules for common error modes are constructed. Based on the call dependencies of software functions, an exception propagation model for function calls is established; Based on the standard model of hardware-software interaction, a diagnostic rule base for hardware-software collaborative errors is formed.
[0013] By adopting the above technical solution, this application realizes the dynamic accumulation of error cases and online updating of the knowledge graph by setting a knowledge update module in the error diagnosis unit: the error causes, correction suggestions and user feedback in actual diagnosis are stored in the case library, and the connection constraint rules, anomaly propagation model and collaborative error diagnosis rules are updated accordingly; an adaptive learning error diagnosis system is established; through the continuous accumulation and analysis of error cases, the system can continuously optimize and enrich its diagnostic knowledge base. Secondly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a system, cause the system to perform the functions described in the first aspect and any possible implementation thereof. Thirdly, embodiments of this application provide a computer program product that, when run on a system, enables the system to perform the functions described in the first aspect and any possible implementation thereof. One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. This application provides an automatic error correction system for IoT simulation based on a large language model. The system architecture employs a data bus connecting a display module, a user code module, and an AI dialogue module. The display module provides a visual interactive interface, the user code module collects and processes circuit diagram and code data in real time, and the AI dialogue module performs error diagnosis and generates correction suggestions based on the large language model. The AI dialogue module includes an error diagnosis unit and an intent reasoning unit. The former determines coupling errors between the circuit diagram and code through multimodal correlation analysis, while the latter verifies whether the hardware-software synergy meets the user's design goals. This system solves the problems of cross-modal error detection and support for complex scenarios, provides more accurate correction suggestions, and improves the efficiency of IoT development.
[0014] 2. This application provides an automatic error correction system for IoT simulation based on a large language model. This application sets up circuit diagram editing and code editing areas in the display module, and configures dedicated interactive functions for each area: the circuit diagram editing area provides a draggable component library and a canvas area that supports component operation; the code editing area supports switching between block-based and text-based programming, and can also interact with the AI dialogue module in real time and mark errors; the use threshold is reduced through visual drag-and-drop and block-based programming; the real-time error marking and the visual display of error correction suggestions make the error location clear at a glance and the correction solution can be understood intuitively, improving development efficiency and learning experience.
[0015] 3. This application provides an automatic error correction system for IoT simulation based on a large language model. The application introduces a knowledge graph module into the error diagnosis unit, constructing a domain knowledge graph that includes hardware standard connections, software call dependencies, and hardware-software interaction patterns. Based on this, circuit diagram data and code data are preprocessed to generate a hardware-software association mapping table. The domain knowledge provided by the knowledge graph improves the accuracy and reliability of error diagnosis. Through the pre-setting of standard patterns, design deviations that do not conform to best practices can be identified. Based on the establishment of the hardware-software association mapping table, a systematic analysis of cross-level errors is achieved, avoiding the limitations of traditional methods that treat hardware and software errors separately. At the same time, the introduction of the knowledge graph also provides a continuously expandable knowledge base for the system. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of a module of an automatic error correction system for Internet of Things simulation based on a large language model, as described in an embodiment of this application.
[0017] Figure 2 This is a schematic diagram of the display interface of an automatic error correction system for Internet of Things simulation based on a large language model, as described in an embodiment of this application. Detailed Implementation
[0018] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.
[0019] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more. In the field of IoT education and development, simulation tools have become an important means for learners and developers to verify design solutions. Existing simulation tools such as Tinkercad Circuits provide a visual circuit design environment, Mind+ supports a graphical programming interface, and the Arduino IDE provides a code programming and compilation environment. These tools enable users to quickly build and verify IoT application prototypes without relying on physical hardware. However, as IoT application scenarios become increasingly complex, the limitations of existing tools in error detection and correction are becoming increasingly apparent.
[0020] In related technologies, error detection mainly relies on manual review or simple rule matching, which is not only inefficient but also prone to missing problems. Some tools use static code analysis for syntax checking or use preset rules to verify hardware connections, but these methods are often limited to single-dimensional error detection. Furthermore, existing tools generally lack cross-modal error correlation analysis capabilities, making it difficult to detect software anomalies caused by hardware problems or improper hardware configurations due to software logic defects. More importantly, these tools lack the ability to understand user design intent and cannot provide effective error correction support for non-standard application scenarios.
[0021] This application is primarily applied to IoT education and training, development and debugging scenarios, especially for simple sensor control systems built by beginners and complex IoT applications designed by developers. In these application scenarios, users often encounter problems such as hardware connection errors, code logic defects, and hardware-software incompatibility. To solve these technical problems, this application provides an automatic error correction system for IoT simulation based on a large language model. An embodiment is described below, combined with… Figure 1This application describes an automatic error correction system for Internet of Things (IoT) simulation based on a large language model, as described in the following embodiments: Please see Figure 1 This is a schematic diagram of a module of an automatic error correction system for Internet of Things simulation based on a large language model, as described in an embodiment of this application.
[0022] The IoT simulation automatic error correction system based on a large language model provided in this application includes a display module, a user code module, and an AI dialogue module, which interact through a data bus.
[0023] Specifically, the display module provides a visual interactive interface. This interface includes a circuit diagram editing area and a code editing area, as shown in the reference... Figure 2 The circuit diagram editing area features a component library and a canvas area. The component library provides draggable sensor components, actuator components, and connecting wire components. These components can be common IoT devices, such as temperature and humidity sensors, LEDs, and relays. Sensor components typically have specific interfaces and functions; for example, a temperature and humidity sensor can collect ambient temperature and humidity data. Its construction may involve using a high-precision sensing chip, protected by a specific package, and with corresponding pins for connection. Actuator components are used to implement specific actions; for example, an LED emits light, and a relay controls the on / off state of a circuit. Their construction may include different power specifications and control methods. Connecting wire components are used to connect various devices. They can be made of metal wires with good conductivity and may have different thicknesses and lengths depending on different connection requirements. The canvas area supports drag-and-drop component operations and connection, allowing users to freely build circuit diagrams on the canvas according to their needs. The code editing area offers switching between block-based and text-based programming tools. The block-based tool is suitable for beginners, allowing users to combine code by dragging and dropping different block modules. These modules can represent different functions, such as data reading and logical judgment. Their construction features standardized interfaces for easy assembly. The text-based programming tool provides more advanced programming functions, allowing users to directly write code, such as using the Arduino C++ language. Text-based programming tools typically include code editing and syntax highlighting. It also allows real-time interaction with the AI dialogue module, marking errors in both the circuit diagram and code editing areas based on error diagnosis results and displaying correction suggestions. Error markings can use different colors, such as red for incorrect connections and yellow for abnormal code blocks, visually indicating the location of errors. Correction suggestions are displayed in natural language for easy understanding and operation. Through the collaborative work of these functional areas, the display module provides users with a convenient and intuitive operating environment, enabling them to easily build circuit diagrams and write code, while simultaneously obtaining error information and correction suggestions in a timely manner.
[0024] Specifically, the user code module and the display module are bidirectionally connected, used to collect IoT program data input by the user in the display module in real time, and transmit the processed data to the AI dialogue module. The user code module processes IoT program data in several ways. For circuit diagram data, it is processed into a device list, connection relationships, and pin configuration information. The device list includes hardware type and model, such as listing the model of the Arduino board and the type of sensor used. Connection relationships include the connection methods between pins, such as which pin of a sensor is connected to which pin of the Arduino board. Pin configuration information includes communication protocols and addresses; for example, if the sensor uses the I2C communication protocol, its address is a specific value. For code data, the graphical code is converted into an Abstract Syntax Tree (AST). An AST is a tree structure that clearly represents the syntactic structure of the code, facilitating subsequent analysis and processing. Text code is converted into a syntax tree and a symbol table. The syntax tree is used to analyze the syntactic structure of the code, and the symbol table is used to record information such as variables and functions used in the code. In addition, simulation data such as output logs, sensor values, and actuator states generated during simulation execution are also collected. The user code module provides comprehensive and accurate data support for the AI dialogue module by collecting and processing this data, enabling the AI dialogue module to better diagnose and analyze errors.
[0025] Specifically, the AI dialogue module is bidirectionally connected to both the display module and the user code module. It receives IoT program data and performs error diagnosis, interactive error correction, and generates correction suggestions based on a large language model. The AI dialogue module includes an error diagnosis unit and an intent reasoning unit.
[0026] The error diagnosis unit uses multimodal correlation analysis, combining the hardware connection relationships in the circuit diagram data with the logical execution paths in the code data, to determine coupling errors between the circuit diagram and the code. Specifically, it verifies pin connection matching and power supply configuration correctness based on the circuit diagram data to obtain hardware detection results. For example, it checks whether the sensor's power pins are connected to the correct power supply voltage and whether the pin connections of each device meet design requirements. It verifies function call integrity and program logic correctness based on the code data to obtain software detection results. For example, it checks whether the sensor's read function is called correctly in the code and whether the logical judgments are reasonable. It verifies the reasonableness of sensor input values and actuator output values based on simulation data to obtain simulation detection results. For example, it checks whether the data collected by the sensor is within a reasonable range and whether the actuator's action meets expectations. Then, based on the correlation between the hardware detection results, software detection results, and simulation detection results, the cause of the error is determined.
[0027] Multimodal correlation analysis refers to the comprehensive analysis of data across three dimensions: hardware, software, and simulation. Hardware connectivity includes the physical connections between components and signal transmission paths; logical execution paths refer to the control flow and data direction during program execution; and coupling errors refer to system anomalies caused by mismatches between hardware configuration and software logic, such as code calling unconnected sensor ports or hardware connection methods that do not conform to the communication protocols defined in the program.
[0028] In the first implementation, the system quantifies the results of hardware detection, software detection, and simulation detection into reliability scores. Hardware detection calculates the connection accuracy based on component specifications, software detection evaluates code quality scores through static analysis, and simulation detection calculates the anomaly rate of runtime data. The system calculates a comprehensive score by weighted averaging the scores from the three dimensions and determines the error level based on a preset threshold. In the second implementation, the system constructs an association graph containing hardware nodes, software nodes, and runtime status nodes. It calculates the association strength between nodes using graph analysis algorithms and uses path tracing to determine the error propagation chain, thereby identifying the root cause error.
[0029] Understandably, the parameter thresholds required for the above judgments are determined based on a large amount of experimental data and expert experience. For example, the reliability threshold for hardware connections refers to the standard values in the component specifications, allowing for an error range of ±5%; the quality score for software testing is based on programming standards and best practices to set a baseline; and the anomaly judgment of simulation data is determined within a reasonable range in conjunction with the specific application scenario.
[0030] When IoT program data does not match a preset target scenario, the intent reasoning unit extracts key operations from the user's code and verifies whether the coordination between the circuit diagram data and the code data meets the user's design goals. The specific processing flow is as follows: Key operation statements and control logic are extracted from the code data to obtain the code intent result. For example, the key operation "When the temperature is greater than 30℃, turn on the LED light" is extracted from the code. Based on the code intent result, the hardware configuration in the circuit diagram data is analyzed to obtain the hardware support result. For example, it checks whether a temperature sensor and an LED light exist in the circuit diagram, and whether their connections can support the operation. Based on the correspondence between the code intent result and the hardware support result, the actual output is verified using simulation data to obtain the target matching result. When the target matching result shows a mismatch, a correction suggestion is generated based on the code intent result and the hardware support result, and automatic correction is executed after user confirmation. By understanding and analyzing user intent, the intent reasoning unit can accurately locate and solve problems even in non-preset scenarios, enhancing the system's flexibility and adaptability.
[0031] Code intent results refer to the user design goals and control strategies extracted from the program; hardware support results indicate the degree to which the existing hardware configuration supports the achievement of the design goals; and goal matching results reflect the degree to which the actual operating effect of the system matches the expected goals. Key operations refer to program statements that can express the user's core design intent, such as conditional judgments and control outputs; while synergy describes the matching relationship between hardware configuration and software logic.
[0032] In the first implementation, the system employs a hierarchical evaluation strategy. First, semantic information is extracted from code comments and variable names using natural language processing techniques, combined with program structure analysis to obtain an intent feature vector. Then, the matching rate between hardware configuration and intent requirements is calculated, including metrics such as component type matching and performance parameter matching. Finally, actual running data is compared with the expected goals to evaluate the implementation effect. The second implementation is based on scenario template matching. The system maintains a standard template library for common application scenarios, infers user intent by calculating the similarity between the current design and the templates, and generates optimization suggestions based on best practices in the templates.
[0033] The keyword weights for intent extraction are set based on word frequency statistics in the Internet of Things (IoT) field; the scoring criteria for hardware support are determined with reference to equipment specifications and engineering experience; and the threshold for judging target matching degree is set according to the specific requirements and fault tolerance needs of the application scenario.
[0034] Furthermore, the error diagnosis unit also includes a knowledge graph module for constructing a domain knowledge graph. This domain knowledge graph includes standard connection patterns of IoT hardware components, call dependencies of software functions, and standard hardware-software interaction patterns. Based on the domain knowledge graph, circuit diagram data and code data are preprocessed to obtain a hardware-software association mapping table. This mapping table is used to determine the correspondence between circuit diagram data and code data. The knowledge graph module, through the integration and analysis of domain knowledge, provides a deeper basis for error diagnosis, improving its accuracy. The error diagnosis unit also includes a knowledge update module for storing error causes, correction suggestions, and user confirmation results in an error case library. Based on this error case library, the domain knowledge graph is updated online. Online updates include: constructing connection constraint rules for common error patterns based on the standard connection patterns of IoT hardware components; establishing an anomaly propagation model for function calls based on call dependencies of software functions; and forming a diagnostic rule library for hardware-software collaborative errors based on the standard hardware-software interaction patterns.
[0035] The implementation principle of this embodiment is as follows: A display module provides users with an intuitive operating interface, facilitating circuit diagram construction and code writing. The user code module is responsible for collecting and processing the IoT program data input by the user, providing a rich data source for the AI dialogue module. Based on a large language model, the AI dialogue module, through an error diagnosis unit and an intent reasoning unit, performs in-depth analysis and processing of the IoT program data, achieving accurate error diagnosis, interactive error correction, and the generation of correction suggestions. Multiple modules interact through a data bus, forming an organic whole and improving the system's collaborative capabilities. Compared with existing technologies, this system effectively solves problems such as low error detection efficiency, inaccurate error correction feedback, insufficient support for complex scenarios, and lack of multimodal collaboration in existing IoT simulation tools. It achieves an upgrade from "passive error prompting" to "active diagnosis + correction," providing a more efficient and intelligent error detection and correction solution for IoT teaching, research, and other fields.
[0036] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the system described in the above embodiments; or it may exist independently and not assembled into the system. The storage medium carries one or more computer programs that, when executed by a system processor, cause the system to perform the functions described in the above embodiments.
[0037] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0038] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0039] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0040] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. An automatic error correction system for IoT simulation based on a large language model, characterized in that, include: The display module, user code module, and AI dialogue module interact via a data bus; The display module is used to provide a visual interactive interface; The user code module is bidirectionally connected to the display module and is used to collect IoT program data input by the user in the display module in real time, and transmit the processed data to the AI dialogue module. The IoT program data includes circuit diagram data and code data. The AI dialogue module is bidirectionally connected to the display module and the user code module, respectively, and is used to receive the IoT program data, perform error diagnosis, interactive error correction and generate correction suggestions based on the large language model; The AI dialogue module includes an error diagnosis unit and an intent reasoning unit. The error diagnosis unit uses multimodal correlation analysis to determine coupling errors between the circuit diagram and the code by combining the hardware connection relationship of the circuit diagram data with the logical execution path of the code data. When the IoT program data does not match the preset target scenario, the intent reasoning unit extracts key operations from the user code and verifies whether the coordination between the circuit diagram data and the code data meets the user's design goals.
2. The system according to claim 1, characterized in that, The visual interactive interface of the display module includes a circuit diagram editing area and a code editing area; The circuit diagram editing area includes a component library and a canvas area. The component library provides draggable sensor components, actuator components, and connecting wire components, while the canvas area supports component drag-and-drop and connection operations. The code editing area provides the ability to switch between block-based programming tools and text-based programming tools; It also includes real-time interaction with the AI dialogue module, marking errors in the circuit diagram editing area and the code editing area based on the error diagnosis results, and displaying error correction suggestions.
3. The system according to claim 1, characterized in that, The user code module processes IoT program data including: The circuit diagram data is processed into a device list, connection relationships, and pin configuration information, wherein the device list includes hardware type and model, the connection relationships include the connection method between pins, and the pin configuration information includes communication protocol and address; The code data is processed into an intermediate representation, wherein graphical code is converted into an abstract syntax tree, and text code is converted into a syntax tree and a symbol table; Collect output logs, sensor values, and actuator status generated during simulation.
4. The system according to claim 1, characterized in that, The IoT program data also includes simulation data, and the multimodal correlation analysis of the error diagnosis unit includes: The pin connection compatibility and power supply configuration are verified based on the circuit diagram data to obtain the hardware test results; The software detection results are obtained by verifying the integrity of function calls and the correctness of program logic based on the code data. The simulation data is used to verify the rationality of the sensor input values and actuator output values, and the simulation detection results are obtained. The cause of the error is determined based on the correlation between the hardware test results, the software test results, and the simulation test results.
5. The system according to claim 4, characterized in that, The processing flow of the intent reasoning unit includes: Based on the code data, key operation statements and control logic are extracted to obtain the code intent result; Based on the analysis of the code intent results, the hardware configuration in the circuit diagram data is obtained to obtain the hardware support results; Based on the correspondence between the code intent result and the hardware support result, and combined with the simulation data to verify the actual output, the target matching result is obtained; When the target matching result shows a mismatch, a correction suggestion is generated by combining the code intent result and the hardware support result, and automatic correction is executed after waiting for user confirmation.
6. The system according to claim 1, characterized in that, The error diagnosis unit also includes a knowledge graph module, used for: Construct a domain knowledge graph, which includes standard connection patterns of IoT hardware components, calling dependencies of software functions, and standard patterns of hardware-software interaction. Based on the domain knowledge graph, the circuit diagram data and the code data are preprocessed to obtain a hardware-software association mapping table; The correspondence between the circuit diagram data and the code data is determined based on the hardware-software association mapping table.
7. The system according to claim 6, characterized in that, The error diagnosis unit also includes a knowledge update module, used for: The error cause, correction suggestions, and user confirmation results are stored in the error case library, and the domain knowledge graph is updated online based on the error case library; The online updates include: Based on the standard connection mode of IoT hardware components, connection constraint rules for common error modes are constructed. Based on the call dependencies of software functions, an exception propagation model for function calls is established; Based on the standard model of hardware-software interaction, a diagnostic rule base for hardware-software collaborative errors is formed.
8. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on the system, the system performs the functions required by any one of claims 1-7.
9. A computer program product, characterized in that, When the computer program product is run on the system, it causes the system to perform the functions required by any one of claims 1-7.