AI robot programming control system for education scenario and implementation method
By combining virtual and real simulation with cognitive attribution analysis, the problem of insufficient diagnosis of discrepancies between programming logic and physical execution in existing AI robot programming control platforms for educational scenarios has been solved. This has enabled accurate diagnosis and personalized teaching guidance, thereby improving the effectiveness of programming teaching.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUNAN HUIJU INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2026-01-23
- Publication Date
- 2026-04-17
AI Technical Summary
Existing AI robot programming control platforms for educational scenarios lack in-depth analysis and feedback mechanisms between programming logic and actual physical execution of the robot. This makes it difficult to make dynamic adjustments and provide targeted guidance in complex teaching scenarios. Furthermore, when relying on hardware execution results to verify the correctness of programming logic, the uncertainty of the physical environment can easily lead to poor teaching results.
By employing virtual-real fusion simulation and cognitive attribution analysis, and constructing a task constraint space, execution deviation matrix, error attribution map, and teaching guidance repair generation module, we can achieve accurate diagnosis of the difference between programming logic and physical execution. We use dynamic time warping to quantify the spatiotemporal deviation between physical execution and code logic, and combine error gradient backpropagation technology to locate the root cause node of the anomaly and generate teaching guidance repair data.
It enhances the diagnostic depth and accuracy of robot programming teaching, provides an intuitive cognitive path from logical fallacies to physical implementation, and enables continuous iteration and personalized adaptation of teaching assessment capabilities.
Smart Images

Figure CN121583173B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of intelligent education technology and robot control, and in particular to an AI robot programming control system and its implementation method for educational scenarios. Background Technology
[0002] The rapid development of artificial intelligence and robotics has driven the demand for related practical teaching platforms in the education sector. In AI robot programming and control instruction for educational scenarios, it is typically necessary to combine hardware devices and software algorithms to help students understand key technologies such as robot control principles, programming logic, and sensor data processing. Existing teaching platforms mostly adopt embedded system architectures, integrating various sensors and actuators to provide students with experimental environments.
[0003] In related technologies, Chinese utility model patent with announcement number CN222562119U discloses an embedded artificial intelligence teaching platform, including: a main control module and sensor modules, actuator modules, power supply modules, matrix keyboards, shortcut keys, knobs, array microphones, and displays, all wirelessly connected to the main control module; the sensor modules are used to collect analog signal data, the actuator modules are used to transmit and sort preset objects, the matrix keyboards are used to receive data in multiple formats, the shortcut keys are used to initiate preset operations in a first preset scenario, the knobs are used to switch between voice and gesture modes in a second preset scenario, the array microphones are used to acquire voice in a third preset scenario, and the main control module is used to calculate the analog signal data according to the EB algorithm model to obtain control commands.
[0004] Regarding the aforementioned technologies, these teaching platforms primarily focus on the integration of hardware modules and the transmission and control of underlying signals. While they provide rich hardware interfaces and basic functions, they fall short in terms of the interactive and feedback mechanisms for the programming control system. These platforms often rely on fixed algorithm models for unidirectional control, lacking in-depth analysis and feedback mechanisms regarding the differences between student programming logic and the robot's actual physical execution. This makes it difficult to dynamically adjust and provide targeted guidance based on students' programming intentions in complex teaching scenarios. Furthermore, relying solely on hardware execution results to verify the correctness of programming logic can easily lead to poor teaching effectiveness when facing complex motion control tasks due to the uncertainty of the physical environment. Summary of the Invention
[0005] To address the aforementioned issues, this invention provides an AI robot programming control system and implementation method for educational scenarios. By employing virtual-real fusion simulation and cognitive attribution analysis, it can accurately diagnose the differences between programming logic and physical execution, thereby enhancing the relevance of programming instruction.
[0006] The above objectives can be achieved through the following approach:
[0007] An AI robot programming control system for educational scenarios includes a task constraint space construction module, used to acquire classroom task text, robot joint parameters, and joint limit parameters; perform dependency parsing and semantic role labeling on the classroom task text to construct a task logic topology graph; calculate the end-effector pose and joint force range based on the joint parameters and joint limit parameters to generate a robot reachable voxel grid; and map the task logic topology graph to the robot reachable voxel grid to generate a task constraint space. An execution deviation matrix generation module is used to receive and parse student programming instructions to generate an abstract syntax tree; concurrently perform virtual dynamics calculations and physical robot control on the student programming instructions to obtain theoretical joint sequences and measured feedback sequences, respectively; perform time alignment operations on the theoretical joint sequences and the measured feedback sequences to generate an execution deviation matrix; and an error attribution graph generation module is used to reverse map the execution deviation matrix to the abstract syntax tree. The system uses a node space similar to a syntax tree and performs backpropagation of error gradients to calculate the causal contribution of each node to the execution deviation matrix. Based on the statistical distribution of the causal contribution, it extracts abnormal root cause nodes and generates an error attribution map. A teaching guidance repair generation module is used to construct a discretized search tree for instruction parameters with the abnormal root cause nodes as root nodes. It performs random branch sampling and virtual dynamics forward calculus to calculate the convergence gradient of the state deviation of each branch path and prunes invalid branches below a preset branch threshold. Based on the execution deviation matrix, it calculates the first branch path with the minimized norm and generates teaching guidance repair data. A programming performance update module is used to present the teaching guidance repair data on an interactive terminal, collect students' modifications to the student programming instructions, construct an incremental sample set by combining the instruction sequences before and after modification with the execution deviation matrix, update the calculation parameters of the causal contribution based on the incremental sample set, and calculate the programming performance of each student.
[0008] Optionally, the task constraint space construction module includes: a task logic topology graph generation unit, used to perform predicate argument structure extraction operations on the classroom task text through semantic role annotation, map predicate features to action logic nodes, map argument features to operation object nodes, and connect the action logic nodes and the operation object nodes according to dependency parsing to generate a task logic topology graph; a reachable voxel grid solving unit, used to construct a positive kinematic transformation matrix based on the joint parameters, define a joint configuration space based on the joint limit parameters and perform a mesh traversal operation, use the positive kinematic transformation matrix to solve the pose coordinates of the end effector and verify the dynamic singularity to generate a robot reachable voxel grid; and a task constraint space generation unit, used to semantically anchor the operation object nodes and the robot reachable voxel grid, determine the target occupied voxel set, and transform the action logic nodes into spatial constraint boundaries connecting the target occupied voxel set to generate a task constraint space.
[0009] Optionally, the execution deviation matrix generation module includes: an instruction parsing and virtual computation unit, used to perform lexical and syntactic analysis on the student programming instructions to generate an abstract syntax tree, perform dynamic integral solving on the action logic corresponding to the abstract syntax tree, and generate a theoretical joint sequence; an entity driving and multi-dimensional perception unit, used to convert the abstract syntax tree into the robot's low-level motion control instructions, drive the robot's joint motors to perform physical actions, and simultaneously collect position feedback signals and current feedback signals to generate a measured feedback sequence; and a time-series warping and difference quantization unit, used to perform time axis scaling mapping on the measured feedback sequence through dynamic time planning, using the theoretical joint sequence as a reference, to calculate the Euclidean distance between the aligned theoretical state and the measured state, and form an execution deviation matrix.
[0010] Optionally, forming the execution deviation matrix includes: performing frame-by-frame state feature comparison on the theoretical joint sequence and the measured feedback sequence to construct a cost matrix, and searching for the connected trajectory with the minimum cumulative cost in the cost matrix to establish a time index mapping relationship; extracting theoretical state data and measured state data based on the time index mapping relationship, calculating the vector difference between the joint angle dimension and the torque dimension, and forming the execution deviation matrix.
[0011] Optionally, the error attribution graph generation module includes: a gradient mapping and calculation unit, used to take the values of the execution bias matrix as input to the loss function, construct differential mapping relationships along the control flow path of the abstract syntax tree, and perform chain derivative calculation to calculate the local gradient values of the instruction nodes, generating a causal contribution sequence; a statistical filtering and localization unit, used to perform numerical distribution statistics on the causal contribution sequence to construct a contribution distribution histogram, identify outlier values, and lock the instruction nodes of the outlier values as abnormal root cause nodes; and a graph construction and association unit, used to instantiate the abnormal root cause nodes as graph vertices, extract the extreme value elements in the execution bias matrix as fault phenomenon nodes, calculate the correlation coefficient between the abnormal root cause nodes and the fault phenomenon nodes as edge weights, and generate an error attribution graph.
[0012] Optionally, the system further includes: loading the task constraint space, performing a feasibility analysis on the parameter domain of the abnormal root cause node through inverse kinematics, eliminating parameter intervals that lead to kinematic singularities or exceed joint limits, generating a parameter variation feasible domain; calculating the sensitivity gradient of the execution deviation matrix to the parameter variation feasible domain, and constructing an optimization search boundary.
[0013] Optionally, the teaching guidance repair generation module includes: a constraint space search construction unit, used to load the optimized search boundary as sampling guidance, perform restricted random branch sampling operation within the parameter definition domain of the abnormal root cause node, and construct a discretized search tree of instruction parameters starting from the abnormal root cause node; a dynamics deduction and utility evaluation unit, used to perform state prediction on the branch paths of the discretized search tree of instruction parameters, calculate the norm decay value of the predicted state trajectory relative to the execution deviation matrix, and perform spatial collision detection in conjunction with the task constraint space to eliminate invalid branch paths below the branch threshold; and a counterfactual path optimization encapsulation unit, used to lock the branch path with the first norm decay value, extract the instruction parameter sequence corresponding to the branch path, and encapsulate it into teaching guidance repair data.
[0014] Optionally, the programming performance update module includes: an interactive feedback acquisition unit, used to render the teaching guidance repair data on an interactive terminal, receive the refactoring instruction code submitted by the student in response to the student programming instruction, calculate the structural edit distance of the refactoring instruction code relative to the student programming instruction, and generate feedback signal samples; an online parameter evolution unit, used to map the feedback signal samples to parameter correction gradients, construct a prediction error loss function, perform backpropagation operations to update the differential mapping relationship, and obtain an updated differential mapping; and a logical feature projection unit, used to perform dimensionality reduction mapping based on the updated differential mapping, and calculate the spatial coordinate vector of the weight features in the task feature space, and generate a programming logic convergence feature vector.
[0015] Optionally, generating feedback signal samples includes: generating abstract syntax trees for the refactoring instruction code and the student programming instruction respectively; calculating the minimum cumulative cost of node insertion, deletion and replacement operations as the structural edit distance; calculating the convergence gain magnitude of the refactoring instruction code relative to the execution bias matrix; quantizing the convergence gain magnitude as the execution bias attenuation amount; and combining the structural edit distance and the execution bias attenuation amount to generate feedback signal samples.
[0016] Based on the same inventive concept, this invention also provides an AI robot programming control implementation method for educational scenarios. The method includes: acquiring classroom task text, robot joint parameters, and joint limit parameters; performing dependency parsing and semantic role labeling on the classroom task text to construct a task logic topology graph; calculating the end-effector pose and joint force range based on the joint parameters and joint limit parameters to generate a robot reachable voxel grid; and mapping the task logic topology graph to the robot reachable voxel grid to generate a task constraint space; receiving and parsing student programming instructions to generate an abstract syntax tree; concurrently performing virtual dynamics calculations and physical robot control on the student programming instructions to obtain theoretical joint sequences and measured feedback sequences, respectively; performing time alignment operations on the theoretical joint sequences and the measured feedback sequences to generate an execution deviation matrix; and reversing the execution deviation matrix... The algorithm projects the results into the node space of the abstract syntax tree and performs backpropagation of error gradients to calculate the causal contribution of each node to the execution deviation matrix. Based on the statistical distribution of the causal contribution, it extracts the root cause nodes and generates an error attribution graph. Using the root cause nodes as root nodes, it constructs a discretized search tree for instruction parameters, performs random branch sampling and virtual dynamics forward calculus, calculates the convergence gradient of the state deviation of each branch path, and prunes invalid branches below a preset branch threshold. Based on the execution deviation matrix, it calculates the first branch path with the minimized norm and generates teaching guidance repair data. The teaching guidance repair data is presented on an interactive terminal, and the modification results of the student's programming instructions are collected. The instruction sequences before and after modification are combined with the execution deviation matrix to construct an incremental sample set. Based on the incremental sample set, the calculation parameters of the causal contribution are updated, and the programming performance of each student is calculated.
[0017] Compared with the prior art, the present invention has the following advantages:
[0018] 1. By constructing a virtual-real integrated dynamic calculation and entity execution verification mechanism, dynamic time warping is used to quantify the spatiotemporal deviation between physical execution and code logic. Combined with error gradient backpropagation technology, the abnormal root cause nodes leading to physical constraint conflicts are located on the abstract syntax tree. This overcomes the shortcomings of traditional teaching platforms that rely solely on hardware status feedback and lack logical attribution, thus improving the depth and accuracy of error diagnosis in robot programming teaching.
[0019] 2. Within the task constraint space, teaching guidance and correction data that balances physical feasibility and deviation convergence are automatically generated. Incremental samples are constructed by collecting student correction behaviors to update model weights online. This closed-loop evolutionary adaptive guidance mechanism not only provides students with an intuitive cognitive path from logical fallacies to physical realizations, but also enables continuous iteration and personalized adaptation of teaching assessment capabilities.
[0020] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures pointed out in the description, claims and drawings. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a framework diagram of an AI robot programming control system for educational scenarios according to an embodiment of the present invention.
[0023] Figure 2 This is a schematic diagram of the structure of an AI robot programming control system for educational scenarios according to an embodiment of the present invention.
[0024] Figure 3 This is a graph showing the relationship between the sampled mean of parameter variation and the norm of the execution deviation matrix in an embodiment of the present invention.
[0025] Figure 4 This is a ring-shaped cloud and rain diagram showing the distribution of convergence feature vectors of programming logic under different teaching stages in this embodiment of the invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] Reference Figure 1One embodiment of the present invention proposes an AI robot programming control system for educational scenarios, which adopts virtual-real fusion simulation and cognitive attribution analysis to achieve accurate diagnosis of the difference between programming logic and physical execution, thereby improving the pertinence of programming teaching.
[0028] like Figure 2 As shown, the system in this embodiment specifically includes:
[0029] The task constraint space construction module is used to obtain classroom task text, robot joint parameters and joint limit parameters, perform dependency parsing and semantic role labeling on the classroom task text, construct a task logic topology graph, calculate the end pose and joint force range based on the joint parameters and joint limit parameters, generate a robot reachable voxel grid, and map the task logic topology graph to the robot reachable voxel grid to generate a task constraint space.
[0030] The execution deviation matrix generation module is used to receive and parse student programming instructions to generate an abstract syntax tree, concurrently perform virtual dynamics calculations and physical robot control on the student programming instructions to obtain theoretical joint sequences and measured feedback sequences, respectively, and perform timing alignment operations on the theoretical joint sequences and the measured feedback sequences to generate an execution deviation matrix.
[0031] The error attribution graph generation module is used to back-map the execution bias matrix to the node space of the abstract syntax tree, perform error gradient backpropagation operation, calculate the causal contribution of each node to the execution bias matrix, extract abnormal root cause nodes based on the statistical distribution of the causal contribution, and generate an error attribution graph.
[0032] The teaching guidance repair generation module is used to construct a discretized search tree of instruction parameters with the abnormal root cause node as the root node, perform random branch sampling and virtual dynamic forward calculation, calculate the convergence gradient of the state deviation of each branch path, and remove invalid branches below the preset branch threshold. Based on the execution deviation matrix, the first branch path with the minimum norm is calculated to generate teaching guidance repair data.
[0033] The programming performance update module is used to present the teaching guidance repair data on the interactive terminal, collect the modification results of the students' programming instructions, construct an incremental sample set by combining the instruction sequences before and after modification with the execution deviation matrix, update the calculation parameters of the causal contribution based on the incremental sample set, and calculate the programming performance of each student.
[0034] Optionally, the task constraint space construction module includes:
[0035] The task logic topology graph generation unit is used to perform predicate argument structure extraction operation on the classroom task text through semantic role labeling, map predicate features to action logic nodes, map argument features to operation object nodes, and connect the action logic nodes and the operation object nodes according to dependency parsing to generate a task logic topology graph.
[0036] The task logic topology graph generation unit first performs sentence and word segmentation operations on the classroom task text, and then calls the semantic role labeling model to identify the predicate components and corresponding argument components in each sentence. The identified predicate components are encoded as node labels representing action types, and the identified argument components are encoded as node labels representing operated objects, target locations, or constraints. Subsequently, based on the dependency relations obtained from dependency parsing, the nodes corresponding to action types are connected to the nodes corresponding to each operated object according to subject-predicate, verb-object, and prepositional phrase relations, thereby constructing a task logic topology graph containing multiple action logic nodes and operated object nodes.
[0037] For example, in the case of a classroom task text "The robot moves the red blocks from the table to the top shelf," the task logic topology graph generation unit identifies "move" as an action predicate through semantic role labeling and maps it to an action logic node; it identifies "red blocks," "table," and "top shelf" as argument components and maps them to operation object nodes, respectively. Dependency parsing results show that "red blocks" is the agent of the action, "table" is the starting position, and "top shelf" is the target position. Therefore, the action logic node is connected to the three operation object nodes through directed edges to form a task logic topology graph that reflects the semantic structure of the classroom task.
[0038] The reachable voxel grid solving unit is used to construct a positive kinematic transformation matrix based on the joint parameters, define a joint configuration space based on the joint limit parameters and perform a mesh traversal operation, use the positive kinematic transformation matrix to solve the pose coordinates of the end effector and verify the dynamic singularity, and generate a robot reachable voxel grid.
[0039] The reachable voxel grid solving unit constructs a forward kinematic transformation link based on the link length, joint type, and relative posture parameters of each joint, mapping the joint spatial coordinates to the spatial pose representation of the end effector. Subsequently, multi-dimensional mesh discretization is performed within the physically permissible range of joint angles or displacements according to the joint limit parameters. Each set of discrete joint configurations is substituted into the forward kinematic transformation link to solve for the corresponding end effector pose coordinates. After obtaining the end effector pose coordinates, the reachable voxel grid solving unit maps the end effector position onto a three-dimensional voxel mesh, marking it as a reachable voxel. Simultaneously, during the solution process, the condition number or rank of the Jacobian matrix is detected to identify and exclude dynamic singular configurations, thereby generating a robot reachable voxel grid covering the workspace.
[0040] For example, in a six-DOF robotic arm teaching scenario, the reachable voxel grid solving unit discretizes the angle range of each joint into several sampling points with a fixed step size based on the joint limits of each rotational joint, and combines them to form a joint configuration grid. For each joint configuration, the position of the end effector in the classroom's three-dimensional coordinate system is calculated, and the small cube in which this position falls is marked as a reachable voxel. If the condition number of the Jacobian matrix exceeds the allowable range under a certain joint configuration, the voxel corresponding to that configuration is marked as unusable to avoid planning trajectories near dynamic singular positions, ultimately forming a robot reachable voxel grid that can be used for teaching task planning.
[0041] The task constraint space generation unit is used to semantically anchor the operation object node to the robot reachable voxel grid, determine the target occupied voxel set, and transform the action logic node into a spatial constraint boundary connecting the target occupied voxel set to generate a task constraint space.
[0042] The task constraint space generation unit first aligns the position of the manipulated object in the actual teaching space with the coordinate system of the robot's workspace based on the coordinate calibration results of the classroom environment. It then maps the geometric dimensions and positional range of the manipulated object into multiple voxel cells in a voxel grid, thus forming a target-occupied voxel set corresponding to each manipulated object node. Subsequently, for each action logic node in the task logic topology graph, it derives the starting and ending target-occupied voxel sets involved in the action. The connected regions and safety gap regions between the two types of voxel sets are marked as spatial constraint boundaries. Finally, the spatial constraint boundaries corresponding to all action logic nodes are merged in the reachable voxel grid, thereby generating a task constraint space that satisfies both robot kinematic constraints and classroom task semantic constraints.
[0043] Optionally, the execution deviation matrix generation module includes:
[0044] The instruction parsing and virtual computation unit is used to perform lexical and syntactic analysis on the student programming instructions to generate an abstract syntax tree, and to perform dynamic integration on the action logic corresponding to the abstract syntax tree to generate a theoretical joint sequence.
[0045] The instruction parsing and virtual computation unit first performs word segmentation, lexical classification, and statement segmentation on the student's programming instruction sequence, identifying keywords, control structure markers, and numerical parameters in each statement. Then, based on grammatical rules, it constructs an abstract syntax tree, representing loop structures, conditional statements, and basic motion instructions as different types of nodes, and establishing parent-child and sequential relationships according to the order of statement execution. Next, based on the action logic nodes in the abstract syntax tree, the instruction parsing and virtual computation unit converts the end-target pose, velocity limit, and acceleration limit corresponding to each motion instruction into the target joint state in joint space. By performing discrete-time step numerical integration on the dynamic equations, it sequentially solves for the joint angles, angular velocities, and joint torques at each time step, forming a theoretical joint sequence arranged in chronological order.
[0046] The entity driving and multi-dimensional sensing unit is used to convert the abstract syntax tree into the robot's low-level motion control instructions, drive the robot's joint motors to perform physical actions, and simultaneously collect position feedback signals and current feedback signals to generate a measured feedback sequence.
[0047] The entity-driven and multi-dimensional sensing unit maps high-level motion commands to low-level joint space control commands based on the action logic nodes and control structure in the abstract syntax tree. These control commands include the target position, target velocity, and execution time window for each joint. The entity-driven and multi-dimensional sensing unit sends joint control commands to the robot controller at fixed control cycles, driving the robot's joint motors to perform physical motion along the target trajectory. During execution, the entity-driven and multi-dimensional sensing unit collects position feedback signals such as joint angles and angular velocities in real time through the robot encoder, and collects current feedback signals from each joint motor through current sensors. The multi-dimensional feedback data collected throughout the program execution is arranged chronologically to form a measured feedback sequence.
[0048] The timing warping and difference quantization unit is used to perform time axis scaling mapping on the measured feedback sequence through dynamic time planning, with the theoretical joint sequence as a reference, to calculate the Euclidean distance between the aligned theoretical state and the measured state, and form an execution deviation matrix.
[0049] The temporal warping and differential quantization unit first represents the theoretical joint sequence and the measured feedback sequence as multi-dimensional state point sequences arranged by time index. These multi-dimensional state points include joint angles, joint angular velocities, and estimated joint forces derived from current feedback. Since the theoretical joint sequence and the measured feedback sequence may have velocity differences and local pauses on the time scale, the temporal warping and differential quantization unit employs a dynamic time programming algorithm, also known as Dynamic Time Warping (DTW), to construct a cost matrix with theoretical and measured state indices as coordinate axes. Each element in the cost matrix represents the Euclidean distance between a theoretical state and a measured state. The unit searches for the connected path with the minimum cumulative cost within this cost matrix, uses the index pair corresponding to this connected path as a time axis scaling mapping relationship, and extracts the aligned theoretical and measured states based on this mapping relationship. It calculates the vector difference between each pair of aligned states in the joint angle dimension and the torque estimation dimension, and arranges the vector differences of all time steps in chronological order to form an execution deviation matrix.
[0050] For example, when a student's programming instruction includes a conditional branch that causes the robot to pause at a certain position during actual execution, waiting for a sensor signal, but this pause is not present in the theoretical joint sequence, the timing warping and difference quantization unit automatically stretches the corresponding pause segment in the measured feedback sequence through dynamic time planning, establishing a matching relationship between it and the continuous motion segment in the theoretical joint sequence. After completing the time axis scaling mapping, the theoretical state at a certain time index is a joint configuration in uniform motion at the end of the robotic arm, while the measured state is a near-stationary joint configuration. The difference between the two in the estimated joint angles and joint torques is included in the execution deviation matrix. As the entire program execution process is fully aligned, the execution deviation matrix clearly records the magnitude of the difference between the theoretical motion trajectory and the actual execution trajectory at each time step, providing quantitative input for error attribution analysis.
[0051] Optionally, forming the execution deviation matrix includes:
[0052] A frame-by-frame state feature comparison is performed between the theoretical joint sequence and the measured feedback sequence to construct a cost matrix, and the connected trajectory with the minimum cumulative cost is searched in the cost matrix to establish a time index mapping relationship.
[0053] First, the theoretical joint sequence is represented as a sequence of theoretical state points arranged in chronological order. Each theoretical state point contains the joint angle values and estimated joint torque values for each joint. The measured feedback sequence is represented as a sequence of measured state points arranged in chronological order of sampling time. Each measured state point contains the actual joint angle values and estimated actual joint torque values calculated from current feedback for each joint. Then, a cost matrix is constructed with theoretical state indices as rows and measured state indices as columns. The value of any element in the cost matrix is calculated by the Euclidean distance between the corresponding theoretical state point and the corresponding measured state point in the joint angle dimension and the torque estimation dimension. After constructing the cost matrix, the DTW algorithm is used to search for the minimum cumulative cost connected trajectory from the start index to the end index in the cost matrix. Each pair of row and column indices on this connected trajectory is used as a time index mapping relationship between the theoretical state and the measured state.
[0054] Based on the time index mapping relationship, theoretical state data and measured state data are extracted, and the vector difference between the joint angle dimension and the torque dimension is calculated to form an execution deviation matrix.
[0055] First, based on the time index mapping relationship, theoretical state data corresponding to each theoretical time index in the connected trajectory is extracted from the theoretical joint sequence, and measured state data corresponding to each measured time index in the connected trajectory is extracted from the measured feedback sequence. Then, for each index pair on the connected trajectory, the corresponding theoretical state data and measured state data are subtracted joint-by-joint along the joint angle dimension to obtain a joint angle difference vector; and subtracted joint-by-joint along the joint torque estimation dimension to obtain a joint torque difference vector. The joint angle difference vector and the joint torque difference vector are concatenated to form the state deviation vector for that time step. All state deviation vectors for all time steps are then stacked according to the connected trajectory order to finally form the execution deviation matrix.
[0056] Optionally, the error attribution mapping generation module includes:
[0057] The gradient mapping and calculation unit is used to take the value of the execution bias matrix as the input of the loss function, construct the differential mapping relationship along the control flow path of the abstract syntax tree, and perform chain differentiation to calculate the local gradient value of the instruction node and generate a causal contribution sequence.
[0058] The gradient mapping and computation unit determines the set of time indices corresponding to each instruction node based on the start and end time indices of the execution of each instruction node in the abstract syntax tree. For each time index, the state deviation vector for that time step is extracted from the execution deviation matrix. The state deviation vector is obtained by concatenating the joint angle deviation values and the estimated torque deviation values of each joint in a predetermined order. The gradient mapping and computation unit, through the established differentiable computation graph, treats the state deviation vector of each time step as the output of the loss metric, and the instruction nodes in the abstract syntax tree as intermediate nodes in the computation graph. It performs chain-like differentiation along the control flow path from output to input to obtain the gradient value of the instruction node corresponding to each time step. For causal contribution, the node causal contribution score for each instruction node is calculated using the following formula:
[0059] ,
[0060] Among them, the node causal contribution score For the number The node causal contribution score of the instruction node is used to represent the average contribution of the instruction node to the overall execution deviation during the time period in which it participates in the execution. For the number The number of time indices corresponding to the instruction node, that is, the number of time steps that the instruction node actually participates in during execution, is obtained by counting the set of time indices of the instruction node; For time indexing The following and numbered The state deviation vector corresponding to the instruction node is obtained by concatenating the joint angle deviation value and the joint torque estimation deviation value corresponding to the time index in the execution deviation matrix in the order of joint number. Let be the Euclidean norm of the state deviation vector. The physical meaning of the Euclidean norm is the combined deviation of the angle deviations and torque estimation deviations of each joint at that time step, used to measure the overall deviation magnitude at that time step. This is achieved by analyzing the data numbered... All instruction nodes involved Sum the Euclidean norms of each time step and divide by the number of time steps. This allows us to obtain the average deviation level of the instruction node during its execution process, which can be used as a score for the node's causal contribution.
[0061] For example, in a classroom task containing 20 instructions, suppose an instruction node numbered 1 participates in 10 consecutive time steps during program execution, denoted as . The gradient mapping and computation unit sequentially reads the state deviation vectors for each of the ten time steps from the execution deviation matrix, each with a non-negative Euclidean norm value. By summing these ten Euclidean norm values and dividing by ten, the node causality contribution score of instruction node number one can be obtained. Similarly, a causal contribution score can be calculated for all other instruction nodes, thus forming a causal contribution sequence arranged by instruction node number.
[0062] The statistical filtering and positioning unit is used to perform numerical distribution statistics on the causal contribution sequence to construct a contribution distribution histogram, identify outlier values, and lock the instruction node of the outlier value as the abnormal root cause node.
[0063] The statistical screening and localization unit first traverses the causal contribution scores of all nodes in the causal contribution sequence, counting the minimum, maximum, average, and standard deviation of the node causal contribution scores, and dividing the scores into numerical intervals. It then counts the number of instruction nodes contained in each interval, thus constructing a contribution distribution histogram. Based on the contribution distribution histogram, the numerical range of the causal contribution scores of most instruction nodes can be visually observed. The statistical screening and localization unit determines an anomaly screening threshold based on the average and standard deviation of the node causal contribution scores. The sum of the average and one to two times the standard deviation is used as the anomaly screening threshold, and instruction nodes with causal contribution scores not less than this threshold are marked as candidate anomaly root cause nodes. To ensure the stability of the screening results, the anomaly screening threshold is statistically calibrated using historical data from multiple classroom experiments, ensuring that the number of candidate anomaly root cause nodes selected in each classroom task remains within a reasonable range. Finally, the statistical screening and localization unit determines the set of instruction nodes whose causal contribution scores are not less than the anomaly screening threshold as the set of anomaly root cause nodes.
[0064] The graph construction and association unit is used to instantiate the abnormal root cause node as a graph vertex, extract the extreme value elements in the execution deviation matrix as fault phenomenon nodes, calculate the correlation coefficient between the abnormal root cause node and the fault phenomenon node as edge weights, and generate an error attribution graph.
[0065] The graph construction and association unit first instantiates each abnormal root cause node in the abnormal root cause node set as a root cause vertex in the error attribution graph. Simultaneously, it iterates through the state deviation vectors of all time steps in the execution deviation matrix, selecting components whose joint angle deviation values or joint torque estimation deviation values reach a pre-set amplitude threshold. The joint numbers and time indices corresponding to these components are then instantiated as fault phenomenon nodes. For any pair of abnormal root cause nodes and fault phenomenon nodes, the graph construction and association unit counts the time index set of execution in which the abnormal root cause node participates and the time index corresponding to the fault phenomenon node. It then counts the number of intersection time steps in the intersection of these two time index sets and calculates the proportion of the number of intersection time steps to the total number of time steps of the fault phenomenon node. This proportion is used as the association score between the abnormal root cause node and the fault phenomenon node. The higher the association score, the higher the degree to which the abnormal root cause node participated in execution during the time period when the fault phenomenon occurred, and the stronger the causal association. The graph construction and association unit uses the association score as the edge weight to establish weighted connections between the corresponding abnormal root cause nodes and fault phenomenon nodes in the error attribution graph, thereby forming an error attribution graph that can reflect the association between program logic nodes and physical fault phenomena.
[0066] For example, in a classroom task, the graph construction and association unit identifies a state deviation time series for a fault phenomenon node, "Joint two-torque estimation deviation exceeds the limit value," which lasts for 10 time steps. For a root cause node, "Repeatedly raising the robot arm height," if the instruction node is in the execution state for 8 out of these 10 time steps, the association score is calculated as 8 divided by 10, resulting in 0.8. Based on this, the graph construction and association unit establishes a weighted edge with a weight of 0.8 between the "Repeatedly raising the robot arm height" instruction node and the "Joint two-torque estimation deviation exceeds the limit value" fault phenomenon node in the error attribution graph, indicating a strong correlation between the instruction node and the fault phenomenon.
[0067] Optionally, the system further includes:
[0068] Load the task constraint space, perform feasibility analysis on the parameter domain of the abnormal root cause node through inverse kinematics, eliminate parameter intervals that lead to kinematic singularity or exceed joint limits, and generate a parameter variation feasible domain.
[0069] First, the target-occupied voxel set corresponding to the root cause node in the task constraint space, and the end-effector pose range associated with the target-occupied voxel set, are read. The command parameters associated with the root cause node are defined as a set of parameter vectors to be analyzed. These parameter vectors may contain components such as end-effector pose offset, motion time scaling factor, or velocity coefficient, and an initial value range is set for each component. Then, multi-dimensional mesh sampling is performed within the parameter domain at a fixed step size. For each sampled parameter vector, an inverse kinematics algorithm is called to solve for the corresponding joint angle configuration. For each set of joint angle configurations, it is determined whether any joint angle exceeds the allowable range based on the joint limit parameters. Simultaneously, a Jacobian matrix is constructed based on the joint angle configuration and link parameters, and the condition number or rank of the Jacobian matrix is calculated to identify the existence of kinematically singular configurations. If the joint angle configuration corresponding to a certain sampled parameter vector has joint over-limit or the Jacobian matrix condition number exceeds the allowable upper limit, then the parameter interval where the sampled parameter vector is located is marked as an infeasible interval and is removed; the parameter intervals covered by the remaining sampled parameter vectors are merged to form a feasible region of parameter variation that only contains joint limit constraints and does not produce kinematic singularities.
[0070] For example, in the scenario of an anomaly root cause node controlling the lifting end effector height of a six-DOF educational robotic arm, the target height offset of the end effector is set within the range of -0.1 meters to +0.1 meters, and one-dimensional grid sampling is performed in increments of 0.02 meters. For each height offset sample value, the inverse kinematics algorithm is called to solve for the six joint angles, and it is checked whether the six joint angles are within the joint limits. Simultaneously, the condition number of the Jacobian matrix is calculated. If the joint angle configuration corresponding to a certain height offset sample value causes the end effector height to approach the robotic arm's limit workspace, resulting in a joint angle exceeding the limit or a sharp increase in the condition number of the Jacobian matrix, then the height offset sample value and its neighboring intervals are marked as infeasible intervals. After repeating the above process for all sample values, a parameter variation feasible region consisting of multiple continuous or discrete intervals can be obtained. This parameter variation feasible region is used to guide the optimization search for the lifting height parameters.
[0071] Calculate the sensitivity gradient of the execution bias matrix with respect to the feasible region of parameter variation, and construct the optimization search boundary.
[0072] Using the feasible region of parameter variation as the sampling range, multiple sampling points are taken for each parameter component or parameter vector of the anomaly root cause node, and the corresponding execution bias matrix change is calculated at each sampling point. First, the parameter vector currently used by the anomaly root cause node is selected as the baseline parameter vector, and the norm value of the execution bias matrix under the baseline parameter vector is recorded. Then, within the feasible region of parameter variation, the parameters are shifted in each parameter dimension according to the step size to obtain a set of neighborhood parameter vectors. For each neighborhood parameter vector, the virtual dynamics calculation, time series normalization, and difference quantization process are re-executed to calculate the corresponding norm value of the execution bias matrix. The difference between the norm value of the execution bias matrix under the neighborhood parameter vector and the norm value of the execution bias matrix under the baseline parameter vector is taken as the sensitivity estimate value on that neighborhood parameter vector. By traversing multiple neighborhood parameter vectors in the feasible region of parameter variation, a set of sensitivity estimates distributed in the feasible region of parameter variation is obtained, and the changing trend of the sensitivity estimates is statistically analyzed in each parameter dimension. The parameter value interval with large changes in sensitivity estimates is marked as the optimization search boundary. The optimized search boundary indicates the region within the feasible domain of parameter variation where the execution deviation matrix is most sensitive to parameter changes, providing a concentrated search boundary range for sampling in the discretized search tree of instruction parameters, such as... Figure 3 As shown in the figure, the horizontal axis represents the mean of parameter variation sampling at each sampling point, the vertical axis represents the change in the norm of the execution bias matrix at the corresponding sampling point, the vertical error bars represent the standard deviation of the change in the norm of the execution bias matrix obtained from multiple repeated experiments at that sampling point, the gray levels of the scatter points from light to dark represent the changing trend of the node causal contribution score from low to high, and the black solid line is the fitted line obtained by linear regression on all sampling points, which is used to illustrate that the norm of the execution bias matrix decreases monotonically as the mean of parameter variation sampling increases and that there is a linear negative correlation between the two.
[0073] For example, in the scenario of raising the end height, multiple height offset sampling points are selected within the feasible region of parameter variation. When the height offset is zero, the current execution deviation matrix norm is recorded as a baseline. At other sampling points, the dynamic simulation and execution deviation matrix formation process are rerun, the corresponding execution deviation matrix norm is calculated, and subtracted from the baseline norm to obtain the sensitivity estimate for each height offset sampling point. If the calculation results show that the execution deviation matrix norm decreases with increasing height offset in the range of +0.04 m to +0.08 m, while the execution deviation matrix norm changes less in the range of -0.04 m to -0.08 m, then the height offset range of +0.04 m to +0.08 m can be marked as the optimization search boundary. When constructing the discretized search tree for command parameters, parameter sampling and branch expansion will be prioritized within this optimization search boundary, thereby improving the efficiency of finding parameter combinations that reduce execution deviation.
[0074] Optionally, the teaching guidance repair generation module includes:
[0075] The constrained space search construction unit is used to load the optimized search boundary as a sampling guide, perform constrained random branch sampling operation within the parameter definition domain of the abnormal root cause node, and construct a discretized search tree of instruction parameters starting from the abnormal root cause node.
[0076] The constraint space search construction unit first loads the feasible domain of parameter mutation and the optimization search boundary. It marks the priority value intervals of each parameter component within the optimization search boundary as high-priority sampling intervals, and marks the parameter intervals within the feasible domain of parameter mutation but outside the optimization search boundary as ordinary sampling intervals. Hierarchical random sampling is performed within the parameter domain of the anomaly root cause node. For each candidate parameter vector, the constraint space search construction unit adds a child node to the instruction parameter discretization search tree starting from the anomaly root cause node, recording the corresponding instruction parameter value and the parameter change relationship with the parent node in this child node. When the search depth has not reached the maximum search layer, the constraint space search construction unit continues to perform the same restricted random sampling within the parameter neighborhood of the current node, thereby expanding outward from the anomaly root cause node to form a multi-layer instruction parameter discretization search tree.
[0077] The dynamics deduction and utility evaluation unit is used to predict the execution state of the branch paths of the discretized search tree of the instruction parameters, calculate the norm decay value of the predicted state trajectory relative to the execution deviation matrix, and combine the task constraint space execution space collision detection to eliminate invalid branch paths below the branch threshold.
[0078] The dynamics deduction and utility evaluation unit reads the parameter change operations recorded along each branch path in the discretized search tree of instruction parameters, from the root node to the current leaf node, and superimposes them to obtain the complete instruction parameter sequence corresponding to that branch path. While keeping the instruction parameters of non-abnormal root nodes unchanged, this instruction parameter sequence is replaced in the student programming instruction sequence, and the aforementioned virtual dynamics calculation and execution deviation matrix generation process is invoked to obtain the branch prediction execution deviation matrix. Using the original execution deviation matrix as a benchmark, the dynamics deduction and utility evaluation unit calculates the norm decay value corresponding to each branch path, which is used to measure the degree of improvement of that branch path in terms of overall execution deviation. The norm decay value of the branch path is calculated using the following formula:
[0079] ,
[0080] in, For the number The norm decay value of the branch path is used to represent the amount by which the branch path reduces the overall execution deviation; The original execution deviation matrix is calculated from the student programming instruction sequence through virtual dynamics calculation, time warping, and difference quantification processes. The Frobenius norm of the original execution bias matrix is obtained by summing the squares of all elements in the original execution bias matrix and taking the square root. Its physical meaning is the comprehensive bias at all time steps and all joint dimensions. For application number The branch prediction execution deviation matrix is obtained after the instruction parameter sequence corresponding to the branch path. This matrix is obtained through the same calculation process as the original execution deviation matrix. Perform the Frobenius norm of the bias matrix for branch prediction. If This indicates that the branch path can reduce execution deviation, and the larger the value, the more significant the reduction in overall deviation. This indicates that the branch path did not bring improvement or increased execution deviation. After calculating the norm decay value, the feasibility of the branch path is also verified through the task constraint space. The predicted state trajectory corresponding to the branch prediction execution deviation matrix is mapped to a voxel grid in the task constraint space, and it is checked whether the end effector trajectory and joint configuration trajectory cross the obstacle voxel or exceed the boundary of the task constraint space; if there is a collision or boundary violation, the branch path is marked as an infeasible path and removed. For the remaining feasible branch paths, the norm decay values of all feasible branch paths are sorted, and the value corresponding to the 50th or 75th quantile is selected as the branch threshold according to the sorting result. Branch paths with norm decay values less than the branch threshold are considered invalid branch paths and are removed from the instruction parameter discretization search tree. Only efficient branch paths with norm decay values greater than or equal to the branch threshold are retained to enter the next stage.
[0081] For example, in a classroom task, the dynamics deduction and utility evaluation unit calculates the norm decay value of 20 feasible branch paths and sorts them from largest to smallest. If the value corresponding to the 10th position in the sorting result is selected as the branch threshold, the first 10 branch paths are retained as efficient branch paths, while the last 10 branch paths are pruned because their norm decay values are lower than the branch threshold. Simultaneously, if during the calculation process it is found that some branch paths, although having large norm decay values, have predicted state trajectories that traverse obstacle voxels in the task constraint space, these branch paths will be preferentially eliminated and will not participate in the branch threshold calculation or subsequent selection.
[0082] The counterfactual path selection and encapsulation unit is used to lock the branch path with the first norm decay value, extract the instruction parameter sequence corresponding to the branch path, and encapsulate it into teaching guidance repair data.
[0083] In the efficient branch path set, the branches are sorted from largest to smallest norm decay value, and the branch path with the largest norm decay value is selected as the target counterfactual path. Parameter change records at each level are read sequentially from the root node to the leaf node along the target counterfactual path. These records are then organized into a sequence of instruction parameters arranged in the program execution order and aligned with the instruction position indices in the original student programming instruction sequence. For each parameter modification, the corresponding instruction line number and original parameter value are determined. Based on this, teaching guidance repair data is generated. This data includes at least the instruction line number, the original parameter value, the corrected parameter value, and the corresponding norm decay value.
[0084] Optionally, the programming performance update module includes:
[0085] The interactive feedback acquisition unit is used to render the teaching guidance repair data on the interactive terminal, receive the refactoring instruction code submitted by the student in response to the student programming instruction, calculate the structural edit distance of the refactoring instruction code relative to the student programming instruction, and generate feedback signal samples.
[0086] After reading the instructional guidance and repairing the data, students modify the original student programming instruction sequence according to the prompts, forming reconstructed instruction code. The interactive feedback acquisition unit receives the reconstructed instruction code and, following the same lexical and syntactic analysis process as the instruction parsing and virtual computation unit, generates corresponding abstract syntax trees for both the original student programming instruction sequence and the reconstructed instruction code. The interactive feedback acquisition unit treats the two abstract syntax trees as ordered tree structures composed of instruction nodes and control structure nodes, defining three basic editing operations: node insertion, node deletion, and node replacement. Each type of editing operation corresponds to a specific cost, and a dynamic programming algorithm is used to search for the minimum cumulative editing cost to transform the original abstract syntax tree into the reconstructed abstract syntax tree. This minimum cumulative editing cost is taken as the structural edit distance between the original student programming instruction sequence and the reconstructed instruction code. The interactive feedback acquisition unit combines the structural edit distance with the corresponding execution deviation matrix change, instruction line number, and time index to form a feedback signal sample used to drive parameter updates.
[0087] For example, in a classroom task, the original student programming instruction sequence contains 15 lines of code. After reading the instructional guidance repair data, the student modified lines 10 and 11, adjusting the parameter values to those recommended in the instructional guidance repair data. After parsing the original student programming instruction sequence and the reconstructed instruction code into abstract syntax trees (ASTs), the interactive feedback acquisition unit found that the difference between the two ASTs was concentrated only on the parameter nodes corresponding to lines 10 and 11. The dynamic programming algorithm calculated that only two node replacement operations were needed to convert the original AST into a reconstructed AST, therefore the structural edit distance was 2. Combining this with the information that the Frobenius norm of the execution bias matrix decreased from 10 to 7.5 between the two execution biases, the interactive feedback acquisition unit recorded the structural edit distance of 2 and the execution bias attenuation of 2.5 as feedback signal samples for updating the calculation.
[0088] The parameter online evolution unit is used to map the feedback signal samples to parameter correction gradients, construct a prediction error loss function, perform backpropagation operations to update the differential mapping relationship, and obtain the updated differential mapping.
[0089] First, the gradient mapping and the differential mapping relationship constructed in the computation unit are read. The differential mapping relationship represents the mapping strength between the instruction node features and the execution bias matrix using a set of trainable parameters. The structural edit distance and execution bias decay in the feedback signal samples are regarded as external supervision signals, and a target response value is constructed for each instruction node participating in the update. For example, the target response value of an instruction node with a small structural edit distance and a large execution bias decay should be close to a high causal contribution level; the target response value of an instruction node with a large structural edit distance and a small execution bias decay should be close to a low causal contribution level. Based on the current differential mapping relationship, the predicted causal contribution score of each instruction node is calculated, and the difference between the predicted causal contribution score and the target response value derived from the feedback signal samples is used as the prediction error to construct a prediction error loss function. A gradient descent-type optimization algorithm is executed on the prediction error loss function to calculate the parameter correction gradient of each trainable parameter in the differential mapping relationship, and the trainable parameters are incrementally updated within the allowed parameter range according to the set learning rate to obtain the updated differential mapping.
[0090] For example, in a mini-batch update process containing three feedback signal samples, the structural edit distance and execution bias attenuation corresponding to each feedback signal sample are obtained from the interactive feedback acquisition unit. Based on empirical rules, samples with "smaller structural edit distance and larger execution bias attenuation" are assigned as positive samples with a target response value close to 1, and samples with "larger structural edit distance and smaller execution bias attenuation" are assigned as negative samples with a target response value close to 0. The online parameter evolution unit calculates the predicted causal contribution score of the instruction node corresponding to these three samples using the current differential mapping relationship. It obtains the prediction error by comparing the difference between the predicted causal contribution score and the target response value, and then performs an iterative update on the weight parameters in the differential mapping relationship based on the prediction error. As the classroom task progresses, the online parameter evolution unit receives new feedback signal samples multiple times and performs online updates, allowing the differential mapping relationship to gradually adapt to the programming modification behavior of different students, achieving continuous evolution of the error attribution strategy.
[0091] The logical feature projection unit is used to perform dimensionality reduction mapping based on the updated differential mapping, and calculate the spatial coordinate vector of the weight features in the task feature space to generate the programming logic convergence feature vector.
[0092] After the online parameter evolution unit completes the differential mapping update, it first extracts a set of weighted features to describe the importance of instruction nodes from the updated differential mapping. These weighted feature sets are differentiated by student or by classroom task. The weighted feature set is considered as a set of data points in a high-dimensional parameter space, which is then mapped to a lower-dimensional task feature space. The logical feature projection unit can use feature covariance analysis to calculate the covariance matrix of the weighted feature set and perform eigenvalue decomposition on the covariance matrix, using these feature directions as basis vectors for the task feature space. Then, the logical feature projection unit uses these basis vectors to perform a linear projection operation on each sample in the weighted feature set, obtaining the spatial coordinate vector of that sample in the task feature space. For each student, the logical feature projection unit defines its corresponding spatial coordinate vector as the programming logic convergence feature vector, representing the convergence position of the student's programming logic behavior across multiple tasks in the task feature space.
[0093] For example, in multiple classroom tasks throughout a semester, the logical feature projection unit can periodically extract the weight feature vector corresponding to a student from the updated differential mapping and assemble these weight feature vectors into a time series. By calculating the covariance matrix and performing eigenvalue decomposition on the set of weight feature vectors of all students within the same time period, several principal feature directions with large eigenvalues can be obtained. The logical feature projection unit uses these principal feature directions to project the weight feature vector of each student onto a two-dimensional or three-dimensional task feature space to obtain the programming logic convergence feature vector. For beginners, the programming logic convergence feature vector may be distributed in a scattered region in the task feature space; as the number of classroom tasks increases and the teaching guidance repair data is continuously used, the logical feature projection unit can observe the trend of a student's programming logic convergence feature vector gradually clustering towards a certain region, thus providing a quantitative basis for differentiated instruction and difficulty adjustment, such as... Figure 4 As shown, each sector corresponds to a classroom task sample. The cloud plot, box plot, and scatter plot within the sector represent the sample distribution of the convergence feature vector norm of the programming logic of that classroom task under a certain teaching stage. Different gray levels distinguish four teaching stages: student initial programming submission, entity execution and deviation collection, teaching guidance repair generation, and student reconstruction instruction update. The outer arc segment is used to identify the statistical significance of each teaching stage relative to the global average level.
[0094] Optionally, the generated feedback signal samples include:
[0095] An abstract syntax tree is generated for the refactoring instruction code and the student programming instruction respectively, and the minimum cumulative cost of node insertion, deletion and replacement operations is calculated as the structure edit distance;
[0096] First, lexical and syntactic analysis are performed on the student programming instructions and refactored instruction code, respectively, parsing them into corresponding abstract syntax trees (ASTs). Each AST consists of instruction nodes representing basic instructions, loop control nodes representing loop structures, and condition control nodes representing conditional branch structures. The execution order of instructions is characterized by parent-child and sibling relationships. The device generating feedback signal samples treats the original AST as the source tree and the refactored AST as the target tree, defining three basic editing operations: node insertion, node deletion, and node replacement. A fixed non-negative cost is assigned to each editing operation; for example, the cost of a single node insertion operation is set to 1, the cost of a single node deletion operation is set to 1, and the cost of a single node replacement operation is set to 1. Subsequently, the device generating feedback signal samples searches for a set of editing operation sequences in the mapping space of "source tree node → target tree node" using a dynamic programming algorithm. Under this operation sequence, the original AST can be gradually transformed into the refactored AST, and the cumulative sum of the costs of all editing operations is minimized. The minimum cumulative cost is defined as the structural edit distance, which is used to quantify the scale of structural changes made to the refactoring instruction code relative to the student programming instructions.
[0097] The convergence gain magnitude of the reconstructed instruction code relative to the execution bias matrix is calculated, and the convergence gain magnitude is quantized into an execution bias attenuation amount. The structure edit distance and the execution bias attenuation amount are combined to generate a feedback signal sample.
[0098] The original execution deviation matrix is calculated by timing warping and differential quantization units after the student programming instructions run in both the physical robot and virtual computation environments. The reconstructed execution deviation matrix is calculated by the reconstructed instruction code through the same process. The device for generating feedback signal samples calculates the Frobenius norm for both the original and reconstructed execution deviation matrices. The Frobenius norm of the original execution deviation matrix is denoted as the original deviation norm, and the Frobenius norm of the reconstructed execution deviation matrix is denoted as the reconstructed deviation norm. The convergence gain is defined as the difference between the original deviation norm and the reconstructed deviation norm, i.e., "original deviation norm minus reconstructed deviation norm". A non-negative difference indicates that the reconstructed instruction code has achieved convergence improvement in overall deviation compared to the student programming instructions. To quantify the convergence gain amplitude into a comparable dimensionless index, the device generating feedback signal samples divides the convergence gain amplitude by the original deviation norm, assuming the original deviation norm is greater than 0, obtaining a ratio between 0 and 1, denoted as the execution deviation attenuation. When the original deviation norm equals 0, it indicates that the original execution deviation matrix is unbiased, and the execution deviation attenuation is directly set to 0. The closer the execution deviation attenuation is to 1, the greater the attenuation ratio of the execution deviation relative to the initial state in this reconstruction, and the more significant the convergence effect. When generating feedback signal samples, the device combines the aforementioned structural edit distance and execution deviation attenuation to form a feedback signal sample record for the same reconstruction instruction code. This feedback signal sample includes at least the following information: the structural edit distance value, the execution deviation attenuation value, the instruction line number where the modification occurred, and the corresponding time index range. Based on these fields, a prediction error loss function is constructed in the parameter online evolution unit, and parameter updates are performed.
[0099] Based on the same inventive concept, this invention also provides a method for implementing AI robot programming control in educational scenarios, the method comprising:
[0100] The system acquires classroom task text, robot joint parameters, and joint limit parameters. It performs dependency parsing and semantic role labeling on the classroom task text, constructs a task logic topology graph, calculates the end-effector pose and joint force range based on the joint parameters and joint limit parameters, generates a robot reachable voxel grid, and maps the task logic topology graph to the robot reachable voxel grid to generate a task constraint space.
[0101] The system receives and parses student programming instructions to generate an abstract syntax tree, concurrently performs virtual dynamics calculations and physical robot control on the student programming instructions to obtain theoretical joint sequences and measured feedback sequences, and performs timing alignment operations on the theoretical joint sequences and the measured feedback sequences to generate an execution deviation matrix.
[0102] The execution bias matrix is back-mapped to the node space of the abstract syntax tree, and the error gradient backpropagation operation is performed to calculate the causal contribution of each node to the execution bias matrix. Based on the statistical distribution of the causal contribution, the abnormal root cause nodes are extracted to generate an error attribution graph.
[0103] A discretized search tree of instruction parameters is constructed with the abnormal root cause node as the root node. Random branch sampling and virtual dynamic forward calculation are performed to calculate the convergence gradient of the state deviation of each branch path. Invalid branches below the preset branch threshold are removed. The first branch path with the minimum norm is calculated based on the execution deviation matrix to generate teaching guidance repair data.
[0104] The teaching guidance repair data is presented on the interactive terminal, the modification results of the student's programming instructions are collected, the instruction sequences before and after modification are constructed with the execution deviation matrix to form an incremental sample set, the calculation parameters of the causal contribution are updated based on the incremental sample set, and the programming performance of each student is calculated.
[0105] It should be noted that the formulas described above, through the principle of dimensional consistency and mathematical standardization methods (such as normalization, dimensionless parameter conversion, or unit system unification), can translate physical quantities with different properties into unitless standard values or parameters that can be superimposed in the same dimension. This eliminates the interference of different dimensions on the computational logic, allowing the formulas to retain the original data distribution characteristics while possessing mathematical rationality and adaptability to objective laws. These are conventional technical methods and will not be elaborated further. The electrical connections between the various units described above do not necessarily represent direct or indirect connections; any indirect connection method is applicable to the embodiments of this invention as long as it achieves the purpose of this invention. The above descriptions are merely exemplary embodiments of this invention and should not be construed as limiting the scope of this invention.
[0106] All equivalent changes and modifications made in accordance with the teachings of this invention are still within the scope of this invention. Those skilled in the art will readily conceive of other embodiments of this invention upon considering the specification and the disclosure of practical truth. This application is intended to cover any variations, uses, or adaptations of this invention that follow the general principles of this invention and include common knowledge or conventional techniques in the art not described herein.
Claims
1. An AI robot programming control system for educational scenarios, characterized in that, The system includes: The task constraint space construction module is used to obtain classroom task text, robot joint parameters and joint limit parameters, perform dependency parsing and semantic role labeling on the classroom task text, construct a task logic topology graph, calculate the end pose and joint force range based on the joint parameters and joint limit parameters, generate a robot reachable voxel grid, and map the task logic topology graph to the robot reachable voxel grid to generate a task constraint space. The execution deviation matrix generation module is used to receive and parse student programming instructions to generate an abstract syntax tree, concurrently perform virtual dynamics calculations and physical robot control on the student programming instructions to obtain theoretical joint sequences and measured feedback sequences, respectively, and perform timing alignment operations on the theoretical joint sequences and the measured feedback sequences to generate an execution deviation matrix. The error attribution graph generation module is used to back-map the execution bias matrix to the node space of the abstract syntax tree, perform error gradient backpropagation operation, calculate the causal contribution of each node to the execution bias matrix, extract abnormal root cause nodes based on the statistical distribution of the causal contribution, and generate an error attribution graph. The teaching guidance repair generation module is used to construct a discretized search tree of instruction parameters with the abnormal root cause node as the root node, perform random branch sampling and virtual dynamic forward calculation, calculate the convergence gradient of the state deviation of each branch path, and remove invalid branches below the preset branch threshold. Based on the execution deviation matrix, the first branch path with the minimum norm is calculated to generate teaching guidance repair data. The programming performance update module is used to present the teaching guidance repair data on the interactive terminal, collect the modification results of the students' programming instructions, construct an incremental sample set by combining the instruction sequences before and after modification with the execution deviation matrix, update the calculation parameters of the causal contribution based on the incremental sample set, and calculate the programming performance of each student.
2. The AI robot programming control system for educational scenarios according to claim 1, characterized in that, The task constraint space construction module includes: The task logic topology graph generation unit is used to perform predicate argument structure extraction operation on the classroom task text through semantic role labeling, map predicate features to action logic nodes, map argument features to operation object nodes, and connect the action logic nodes and the operation object nodes according to dependency parsing to generate a task logic topology graph. The reachable voxel grid solving unit is used to construct a positive kinematic transformation matrix based on the joint parameters, define a joint configuration space based on the joint limit parameters and perform a mesh traversal operation, use the positive kinematic transformation matrix to solve the pose coordinates of the end effector and verify the dynamic singularity, and generate a robot reachable voxel grid. The task constraint space generation unit is used to semantically anchor the operation object node to the robot reachable voxel grid, determine the target occupied voxel set, and transform the action logic node into a spatial constraint boundary connecting the target occupied voxel set to generate a task constraint space.
3. The AI robot programming control system for educational scenarios according to claim 1, characterized in that, The execution deviation matrix generation module includes: The instruction parsing and virtual computation unit is used to perform lexical and syntactic analysis on the student programming instructions to generate an abstract syntax tree, and to perform dynamic integration on the action logic corresponding to the abstract syntax tree to generate a theoretical joint sequence. The entity driving and multi-dimensional sensing unit is used to convert the abstract syntax tree into the robot's low-level motion control instructions, drive the robot's joint motors to perform physical actions, and simultaneously collect position feedback signals and current feedback signals to generate a measured feedback sequence. The timing warping and difference quantization unit is used to perform time axis scaling mapping on the measured feedback sequence through dynamic time planning, with the theoretical joint sequence as a reference, to calculate the Euclidean distance between the aligned theoretical state and the measured state, and form an execution deviation matrix.
4. The AI robot programming control system for educational scenarios according to claim 3, characterized in that, The formation of the execution deviation matrix includes: A frame-by-frame state feature comparison is performed between the theoretical joint sequence and the measured feedback sequence to construct a cost matrix, and the connected trajectory with the minimum cumulative cost is searched in the cost matrix to establish a time index mapping relationship. Based on the time index mapping relationship, theoretical state data and measured state data are extracted, and the vector difference between the joint angle dimension and the torque dimension is calculated to form an execution deviation matrix.
5. The AI robot programming control system for educational scenarios according to claim 1, characterized in that, The error attribution mapping module includes: The gradient mapping and calculation unit is used to take the value of the execution bias matrix as the input of the loss function, construct the differential mapping relationship along the control flow path of the abstract syntax tree, and perform chain differentiation to calculate the local gradient value of the instruction node and generate a causal contribution sequence. The statistical filtering and positioning unit is used to perform numerical distribution statistics on the causal contribution sequence to construct a contribution distribution histogram, identify outlier values, and lock the instruction node of the outlier value as the abnormal root cause node. The graph construction and association unit is used to instantiate the abnormal root cause node as a graph vertex, extract the extreme value elements in the execution deviation matrix as fault phenomenon nodes, calculate the correlation coefficient between the abnormal root cause node and the fault phenomenon node as edge weights, and generate an error attribution graph.
6. The AI robot programming control system for educational scenarios according to claim 1, characterized in that, The system also includes: Load the task constraint space, perform feasibility analysis on the parameter domain of the abnormal root cause node through inverse kinematics, eliminate parameter intervals that lead to kinematic singularity or exceed joint limits, and generate a parameter variation feasible domain. Calculate the sensitivity gradient of the execution bias matrix with respect to the feasible region of parameter variation, and construct the optimization search boundary.
7. The AI robot programming control system for educational scenarios according to claim 6, characterized in that, The teaching guidance repair and generation module includes: The constrained space search construction unit is used to load the optimized search boundary as a sampling guide, perform constrained random branch sampling operation within the parameter definition domain of the abnormal root cause node, and construct a discretized search tree of instruction parameters starting from the abnormal root cause node. The dynamics deduction and utility evaluation unit is used to predict the execution state of the branch paths of the discretized search tree of the instruction parameters, calculate the norm decay value of the predicted state trajectory relative to the execution deviation matrix, and combine the task constraint space execution space collision detection to eliminate invalid branch paths below the branch threshold. The counterfactual path selection and encapsulation unit is used to lock the branch path with the first norm decay value, extract the instruction parameter sequence corresponding to the branch path, and encapsulate it into teaching guidance repair data.
8. The AI robot programming control system for educational scenarios according to claim 5, characterized in that, The programming performance update module includes: The interactive feedback acquisition unit is used to render the teaching guidance repair data on the interactive terminal, receive the refactoring instruction code submitted by the student in response to the student programming instruction, calculate the structural edit distance of the refactoring instruction code relative to the student programming instruction, and generate feedback signal samples. The parameter online evolution unit is used to map the feedback signal samples to parameter correction gradients, construct a prediction error loss function, perform backpropagation operations to update the differential mapping relationship, and obtain the updated differential mapping. The logical feature projection unit is used to perform dimensionality reduction mapping based on the updated differential mapping, and calculate the spatial coordinate vector of the weight features in the task feature space to generate the programming logic convergence feature vector.
9. The AI robot programming control system for educational scenarios according to claim 8, characterized in that, The generated feedback signal samples include: An abstract syntax tree is generated for the refactoring instruction code and the student programming instruction respectively, and the minimum cumulative cost of node insertion, deletion and replacement operations is calculated as the structure edit distance; The convergence gain magnitude of the reconstructed instruction code relative to the execution bias matrix is calculated, and the convergence gain magnitude is quantized into an execution bias attenuation amount. The structure edit distance and the execution bias attenuation amount are combined to generate a feedback signal sample.
10. A method for implementing AI robot programming control in educational scenarios, applied to an AI robot programming control system for educational scenarios as described in any one of claims 1-9, characterized in that, The method includes: The system acquires classroom task text, robot joint parameters, and joint limit parameters. It performs dependency parsing and semantic role labeling on the classroom task text, constructs a task logic topology graph, calculates the end-effector pose and joint force range based on the joint parameters and joint limit parameters, generates a robot reachable voxel grid, and maps the task logic topology graph to the robot reachable voxel grid to generate a task constraint space. The system receives and parses student programming instructions to generate an abstract syntax tree, concurrently performs virtual dynamics calculations and physical robot control on the student programming instructions to obtain theoretical joint sequences and measured feedback sequences, and performs timing alignment operations on the theoretical joint sequences and the measured feedback sequences to generate an execution deviation matrix. The execution bias matrix is back-mapped to the node space of the abstract syntax tree, and the error gradient backpropagation operation is performed to calculate the causal contribution of each node to the execution bias matrix. Based on the statistical distribution of the causal contribution, the abnormal root cause nodes are extracted to generate an error attribution graph. A discretized search tree of instruction parameters is constructed with the abnormal root cause node as the root node. Random branch sampling and virtual dynamic forward calculation are performed to calculate the convergence gradient of the state deviation of each branch path. Invalid branches below the preset branch threshold are removed. The first branch path with the minimum norm is calculated based on the execution deviation matrix to generate teaching guidance repair data. The teaching guidance repair data is presented on the interactive terminal, the modification results of the student's programming instructions are collected, the instruction sequences before and after modification are constructed with the execution deviation matrix to form an incremental sample set, the calculation parameters of the causal contribution are updated based on the incremental sample set, and the programming performance of each student is calculated.
Citation Information
Patent Citations
Embedded artificial intelligence teaching platform
CN222562119U
Interaction method and device based on virtual character, storage medium and computer equipment
CN112199002A
Online teaching system integrating artificial intelligence and virtual reality technology
CN115731751A