A smart correction method and system for C language programs

CN122653618APending Publication Date: 2026-08-28贵州电子科技职业学院
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610769338.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-31
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

该类系统在执行批改任务时,通常仅能识别完全一致的代码表述,对于程序算法逻辑相同但变量命名、代码风格或语句顺序存在差异的正确答案,容易产生误判,从而降低了批改结果的准确性

Benefits of technology

[0018] 1. By extracting semantic feature vectors from the code instead of performing simple string matching, this invention can effectively identify correct answers with correct algorithm logic but different code expressions, significantly reducing the false positive rate; the dimensional design of the semantic feature vectors and the reasonable configuration of the weight ratio of each feature ensure the accuracy and reliability of the scoring results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122653618A_ABST
    Figure CN122653618A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computer-aided teaching, in particular to an intelligent correction method and system for C language programs. The system comprises the following technical solutions: obtaining a C language source code file to be corrected and performing lexical analysis to generate a token sequence; performing syntax analysis on the token sequence to construct an abstract syntax tree structure; extracting a semantic feature vector containing a control flow graph feature, a data flow graph feature and a function call relationship feature based on the abstract syntax tree; performing cosine similarity calculation on the semantic feature vector and a pre-stored standard answer semantic feature library to obtain a semantic matching degree score; and performing weighted summation on the semantic matching degree score according to a preset weight proportion to generate a final score result. The application can significantly reduce the misjudgment rate, realize stable operation across platforms and meet the high-concurrency correction demand of 80 to 200 code files per second.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer technology, and more specifically, relates to an intelligent grading method and system for C language programs. Background Technology

[0002] With the widespread application of computer technology in education, program-based homework grading and assessment systems have gradually become an important part of teaching aids. Existing automated grading systems mostly employ pre-defined answer comparison logic, automating scoring by matching student-submitted source code with standard answers at the character level. When performing grading tasks, these systems typically can only recognize completely identical code expressions. For correct answers with the same algorithmic logic but differences in variable naming, coding style, or statement order, misjudgments are easily made, thus reducing the accuracy of the grading results.

[0003] Furthermore, most existing grading systems rely on specific compilation environment configurations, facing compatibility challenges when deployed across platforms. When users use different operating systems or compiler versions, the system struggles to guarantee the consistency and stability of grading results. Simultaneously, some grading systems suffer from low efficiency when handling large-scale grading tasks due to a lack of effective resource scheduling mechanisms, failing to meet the high-frequency grading needs of real-world teaching scenarios.

[0004] In the practice of grading C programs, because C allows for multiple equivalent implementations, traditional grading methods based on exact string matching cannot effectively identify different student code expressions assuming the algorithmic logic is correct. This limitation restricts the promotion and application of automated grading systems in programming education. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention provides a technical solution: an intelligent grading method for C language programs, comprising the following steps: obtaining the C language source code file to be graded, and performing lexical analysis on the source code to generate a token sequence; performing syntactic analysis on the token sequence to construct an abstract syntax tree structure; extracting semantic feature vectors from the code based on the abstract syntax tree, wherein the semantic feature vectors include control flow graph features, data flow graph features, and function call relationship features; calculating the cosine similarity between the extracted semantic feature vectors and a pre-stored standard answer semantic feature library to obtain a semantic matching score; and weighting and summing the semantic matching scores according to a preset weight ratio to generate a final scoring result.

[0006] Furthermore, the semantic feature vector has a dimension of 64 to 128, and a deep neural network model is used for feature extraction. Among them, the control flow graph features account for a weight ratio of 0.35 to 0.45, the data flow graph features account for a weight ratio of 0.25 to 0.35, and the function call relationship features account for a weight ratio of 0.20 to 0.30.

[0007] Furthermore, the formula for calculating the similarity is:

[0008]

[0009] in, The feature vector of the code to be corrected is the first one. Dimensional value, The first eigenvector represents the standard answer. Dimensional value, This represents the total dimension of the eigenvectors.

[0010] Furthermore, it also includes code standardization processing steps, which include: anonymizing variable names in the source code and uniformly replacing user-defined identifiers with temporary names; and removing comments from the source code to eliminate the impact of code style differences on the correction results.

[0011] Furthermore, it also includes a compilation environment adaptation layer, which encapsulates three compiler interfaces: GCC, Clang, and MSVC. By dynamically detecting the operating system type and compiler version, it automatically selects the corresponding compiler for code compilation. The compilation environment adaptation layer runs in Docker containers, with each container allocated 2 to 4 CPU cores and 4GB to 8GB of memory resources.

[0012] Furthermore, it also includes a distributed batching scheduling module, which distributes tasks based on message queues and uses a weighted round-robin algorithm to allocate batching tasks to multiple worker nodes. Each worker node is configured with a batching task queue depth of 50 to 100 tasks. When the queue is full, a task overflow handling mechanism is triggered to reallocate the excess tasks to idle nodes.

[0013] An intelligent grading system implementing the above method includes: a source code input module for receiving C language source code files submitted by students and performing format verification; a feature extraction module configured with an abstract syntax tree analyzer and a deep neural network feature extractor for extracting semantic feature vectors of the code; a feature matching module storing a standard answer semantic feature library and configured with a cosine similarity calculation unit; and a scoring result output module for outputting a grading report with detailed scoring reasons.

[0014] Furthermore, the source code input module is also equipped with a format verification unit, which can identify the file extensions (.c, .h) of C language source files and detect the file encoding format.

[0015] Furthermore, the feature extraction module also includes a code normalization processing unit, which performs variable name anonymization, code indentation standardization, and comment removal on the source code.

[0016] Furthermore, the system also includes a result visualization module, which generates a control flow graph comparison diagram and a data flow graph comparison diagram, and highlights the areas of difference between the student code and the standard answer using color marking.

[0017] Compared with the prior art, the present invention has the following beneficial effects:

[0018] 1. By extracting semantic feature vectors from the code instead of performing simple string matching, this invention can effectively identify correct answers with correct algorithm logic but different code expressions, significantly reducing the false positive rate; the dimensional design of the semantic feature vectors and the reasonable configuration of the weight ratio of each feature ensure the accuracy and reliability of the scoring results.

[0019] 2. By combining the compilation environment adaptation layer with Docker container technology, this invention enables cross-platform operation of the code modification process, ensuring the consistency and stability of modification results under different operating systems and different compiler versions.

[0020] 3. Through the collaborative work of the distributed grading scheduling module and the message queue mechanism, this invention can efficiently handle large-scale grading tasks, with a task throughput of 80 to 200 code files per second, effectively meeting the high-frequency grading needs in teaching scenarios.

[0021] 4. By preprocessing the source code through a code standardization unit, the impact of differences in variable naming and coding style on the scoring is eliminated, allowing the scoring results to focus more on evaluating the correctness of the program's algorithm. Attached Figure Description

[0022] Figure 1 This is a flowchart illustrating the intelligent grading method for C language programs.

[0023] Figure 2 This is a schematic diagram of the functional module structure of the intelligent grading system;

[0024] Figure 3 This is a flowchart of the task processing for the distributed batch editing and scheduling module. Detailed Implementation

[0025] The present invention will be described in detail below with reference to specific embodiments.

[0026] Example 1: Intelligent Grading Method for C Language Programs

[0027] This embodiment provides an intelligent grading method for C language programs. This method adopts a technical approach that combines semantic feature vector extraction and similarity calculation, which can effectively identify correct answers where the algorithm logic is correct but the code expression is different.

[0028] Reference Figure 1 The flowchart shown illustrates the intelligent grading method provided in this embodiment, which includes the following steps:

[0029] Step S201: Obtain the C language source code file to be graded and perform format verification. The source code input module receives the C language source code file submitted by the student. This module is equipped with a format verification unit that can identify the file extension (.c, .h) of the C language source file and detect the file encoding format. When non-UTF-8 encoding or illegal characters are detected, the system automatically triggers a format conversion or error message process to ensure that the source code file processed subsequently conforms to the preset specifications.

[0030] Step S202: Perform lexical analysis on the source code to generate a token sequence. The lexical analyzer scans the source code text one by one, segmenting it into token units such as identifiers, keywords, operators, constants, and delimiters, and records the line number and column number information of each token. During the C language lexical analysis process, the analyzer needs to identify preprocessor directives (such as #define, #include), macro definition expansion, and conditional compilation directives, and distinguish them from ordinary code tokens.

[0031] Step S203: Perform syntactic analysis on the token sequence to construct an abstract syntax tree (AST) structure. The parser uses the LR parsing method to construct the parsing table, reducing the token sequence to grammatical productions from the bottom up, ultimately generating an AST structure. In this AST structure, program statements are represented as tree nodes, with parent and child nodes reflecting the relationships between syntactic components. For example, an if statement is represented in the AST as a conditional expression node as a child node attached to the conditional statement parent node.

[0032] Step S204: Extract semantic feature vectors from the code based on the abstract syntax tree. This step uses a deep neural network model for feature extraction, generating semantic feature vectors ranging from 64 to 128 dimensions. This embodiment uses a 96-dimensional feature vector, specifically containing three types of features:

[0033] The first category is control flow graph features, with a weight ratio of 0.40. Control flow graph (CFG) features describe the topological structure of the program execution path, including basic block partitioning, conditional branching, loop depth, and function call entry and exit points. This embodiment uses a graph convolutional network (GCN) to extract features from the control flow graph, mapping each basic block to a 56-dimensional feature vector.

[0034] The second category is data flow graph features, with a weight ratio of 0.30. Data flow graph (DFG) features describe the paths of data transmission and transformation within a program, including variable definition and usage relationships, array reference chains, pointer operation chains, and function parameter passing relationships. This embodiment uses a bidirectional long short-term memory network (Bi-LSTM) to extract features from the data flow graph, mapping each data flow path to a 24-dimensional feature vector.

[0035] The third category is function call relationship features, with a weight of 0.30. Function call relationship features describe the call hierarchy and dependency structure between functions, including function call graphs, recursive call chains, cross-file call relationships, and library function usage. This embodiment uses an attention-enhanced Transformer model to extract features from the function call graph, mapping each function node to a 16-dimensional feature vector.

[0036] Combining the above three types of features, the semantic feature vector The calculation formula is: in, Represents the eigenvectors of the control flow graph. Represents the feature vector of the data flow graph. This represents a feature vector indicating function call relationships.

[0037] Step S205: Code Normalization Processing. Before feature extraction, the code normalization processing unit in the feature extraction module preprocesses the source code to eliminate the impact of code style differences on the correction results. Specific processing operations include:

[0038] Variable name anonymization: All user-defined identifiers in the source code are uniformly replaced with temporary names in the form of "var_1" and "var_2". This process preserves the scope and type information of the identifiers but eliminates specific naming differences. During the replacement process, the code standardization unit maintains an identifier mapping table for name restoration when generating subsequent correction reports.

[0039] Comment removal: Regular expressions are used to match and delete line comments ( / / ) and block comments ( / ** / ) in C. This process only preserves the logical structure of the code and does not affect the extraction results of semantic feature vectors.

[0040] Step S206: Calculate the cosine similarity between the extracted semantic feature vectors and the pre-stored standard answer semantic feature library to obtain a semantic matching score. The feature matching module stores the standard answer semantic feature library, which contains standard answer feature vectors for different questions. The similarity calculation uses the cosine similarity algorithm, and its formula is: in, The feature vector of the code to be corrected is the first one. Dimensional value, The first eigenvector represents the standard answer. Dimensional value, This represents the total dimension of the feature vectors. In this embodiment, .

[0041] Step S207: The semantic matching scores are weighted and summed according to a preset weight ratio to generate the final score. This step calculates the semantic matching scores using a preset weight ratio. For questions with multiple scoring dimensions (such as grammatical correctness, algorithm efficiency, and code standardization), the semantic matching scores for each dimension are weighted and summed according to preset weights to generate the final score.

[0042] In this embodiment, when the semantic matching score is greater than or equal to 0.85, it is determined to be the correct answer; when the score is between 0.60 and 0.85, it is determined to be partially correct and modification suggestions are generated; when the score is less than 0.60, it is determined to be incorrect and an error type analysis is given.

[0043] Example 2: Compilation Environment Adaptation Layer and Distributed Scheduling Module

[0044] This embodiment, based on Embodiment 1, further illustrates the specific implementation of the compilation environment adaptation layer and the distributed batch editing scheduling module.

[0045] The compilation environment adaptation layer encapsulates the interfaces of three mainstream C language compilers: GCC, Clang, and MSVC. It dynamically detects the operating system type and compiler version, automatically selecting the appropriate compiler for code compilation and execution. The architecture of the compilation environment adaptation layer includes a compiler abstract interface layer, a platform detection unit, a compilation option configuration unit, and a compilation result parsing unit.

[0046] The compiler abstract interface layer defines a unified compilation interface specification, including three standard methods: compile, link, and execute. Each compiler adapter implements this interface specification, mapping the specific parameters and behavior patterns of different compilers to a unified calling method.

[0047] The platform detection unit executes automatically upon system startup, acquiring the operating system type (Windows, Linux, macOS) and version information, and simultaneously detecting the installed compilers and their version numbers. The detection results are stored in structured data format for use by the compiler option configuration unit.

[0048] The compilation option configuration unit dynamically generates compilation commands suitable for the current environment based on the platform's detection results and the question requirements (compilation options for the standard answer). This unit supports specifying the compilation standard (C89, C99, C11, etc.), optimization level (-O0 to -O3), warning level, and additional user-defined compilation options.

[0049] The compilation result parsing unit performs structured parsing of the warnings and error messages output by the compiler, extracting error location information (file name, line number, column number) and error cause description into a standardized format to facilitate the subsequent generation of batch reports.

[0050] The compilation environment adaptation layer runs in Docker containers, with each container allocated 2 to 4 CPU cores and 4GB to 8GB of memory. The container images come pre-installed with both GCC and Clang compilers; the MSVC compiler is used in Windows environments. This embodiment uses the Kubernetes container orchestration system for container management, ensuring that containers receive the necessary computing resources by setting resource limits and resource requests.

[0051] When the container starts, the system automatically mounts the problem data volume and the student code submission data volume. Compile and execute.

[0052] Once completed, the execution results (output files, runtime error information) within the container are transmitted to the result processing module via a shared volume or message queue.

[0053] Technical implementation of the distributed batch grading scheduling module:

[0054] The distributed batch grading scheduling module distributes tasks based on a message queue and uses a weighted round-robin algorithm to allocate grading tasks to multiple worker nodes. The module's architecture includes a task receiver, a message queue server, a worker node pool, and a scheduling controller.

[0055] The task receiver receives grading requests from the front-end system, encapsulates the requests into task messages, and pushes them to the message queue. The task message contains information such as the storage path of the student's submitted code, the question identifier, the standard answer identifier, and the expected grading criteria.

[0056] The message queue server is implemented using RabbitMQ and supports persistent queues, message acknowledgment mechanisms, and priority queues. Queues are divided into high-priority queues (for real-time batch modification requests) and low-priority queues (for batch modification tasks) to ensure that critical tasks are processed first.

[0057] The worker node pool contains multiple distributed batch modification worker nodes, each configured with a batch modification task queue depth of 50 to 100 tasks. When a worker node's task queue is full, a task overflow handling mechanism is triggered, reallocating the excess tasks to idle nodes. The scheduling controller monitors the load status and task processing speed of each worker node in real time and dynamically adjusts the task allocation weights.

[0058] The weighted round-robin algorithm works as follows: each worker node is assigned an initial weight based on its processing capabilities (number of CPU cores, memory capacity, historical throughput), and the scheduler periodically updates the weight values. During the round-robin allocation process, the scheduler sequentially assigns tasks to each worker node, with the allocation probability proportional to the node's weight.

[0059] In this embodiment, the distributed batch processing scheduling module can achieve a processing capacity of 80 to 200 code files per second. The system supports horizontal scaling, and its processing capacity can be further improved by increasing the number of worker nodes.

[0060] Example 3: Complete Architecture of the Intelligent Grading System

[0061] This embodiment details the complete architecture of the intelligent grading system that implements the above method and the interaction between its modules.

[0062] Reference Figure 2 The system architecture diagram shown indicates that the intelligent grading system provided by this invention includes the following core modules:

[0063] Source Code Input Module 101: This module is deployed on the web server and provides a RESTful API interface for student clients to call. Students submit source code files via web forms or API calls. Source Code Input Module 101 performs format validation on the files, including file size detection (single file not exceeding 1MB), file type detection (only .c and .h files are accepted), and code line count detection (not exceeding 5000 lines). Validated source code files are uploaded to a distributed file system (such as HDFS or MinIO) and a unique Content Identifier (CID) is generated.

[0064] Feature extraction module 102: This module is equipped with an abstract syntax tree analyzer and a deep neural network feature extractor. Feature extraction module 102 obtains source code files from a distributed file system and sequentially performs three processing stages: code normalization preprocessing, abstract syntax tree construction, and semantic feature vector extraction. The extracted semantic feature vectors are stored in a feature database in binary format, and a feature vector index is generated to support fast retrieval.

[0065] Feature matching module 103: This module stores a standard answer semantic feature library and is equipped with a cosine similarity calculation unit. The standard answer semantic feature library is pre-built by the question management module, storing one or more standard answer feature vectors for each question (supporting multiple solutions to a single question). Feature matching module 103 receives the code feature vector to be graded output by feature extraction module 102, performs a similarity search in the standard answer semantic feature library, and returns the N standard answers with the highest matching degree and their similarity scores.

[0066] Scoring Result Output Module 104: This module outputs a grading report with detailed scoring reasons. The report includes the total score, scores for each dimension, semantic matching score, compilation result (compilation success / failure / warning), and detailed modification suggestions. The scoring result output module 104 returns the grading report to the front-end system in JSON format, and also supports the generation and download of PDF reports.

[0067] Code standardization processing unit 1021: This unit is embedded as a submodule of feature extraction module 102, and is responsible for anonymizing variable names, standardizing code indentation, and removing comments from the source code. This unit maintains an identifier mapping table database for name restoration when generating the correction report.

[0068] Results Visualization Module 105: This module generates a control flow graph comparison diagram and a data flow graph comparison diagram, and highlights the differences between the student code and the standard answer using color marking. Results Visualization Module 105 uses the Graphviz graphical visualization tool to generate the control flow graph and data flow graph, identifies the differences in the AST structure between the student code and the standard answer through a comparison algorithm, and marks missing nodes in red, redundant nodes in green, and differing nodes in yellow.

[0069] Compilation Environment Adaptation Layer 106: This layer encapsulates the interfaces of three compilers: GCC, Clang, and MSVC, and runs in a Docker container. The Compilation Environment Adaptation Layer 106 receives compilation requests from the feature extraction module 102 or the scoring result output module 104, dynamically selects the appropriate compiler to perform the compilation and execution operations, and returns the compilation results to the calling module.

[0070] Distributed batch grading scheduling module 107: This module distributes tasks based on message queues and uses a weighted round-robin algorithm to allocate grading tasks to multiple worker nodes. Integrated into the system's backend services, distributed batch grading scheduling module 107 is responsible for coordinating the allocation and execution of large-scale grading tasks.

[0071] Example 4: A typical application scenario for the grading process

[0072] This embodiment uses a C language array sorting problem as an example to explain in detail the application process of the method of the present invention in a real grading scenario.

[0073] Problem statement: Write a C program to sort 10 integer elements in ascending order.

[0074] Example of a standard answer (implemented using bubble sort):

[0075]

[0076] Example of student answer submission (using selection sort):

[0077]

[0078] Using existing string matching methods, the matching rate between the student's submitted answer and the standard answer is less than 30%, and the answer will be misjudged as incorrect.

[0079] The intelligent grading method provided by this invention has the following grading process:

[0080] The first step is for the source code input module 101 to receive the C language source code files submitted by students, perform format verification, and then upload them to the distributed file system.

[0081] The second step involves the feature extraction module 102 standardizing the source code by replacing variable names such as "arr", "n", "data", and "length" with temporary names such as "var_1" and "var_2", while also removing comments.

[0082] The third step involves the lexical analyzer performing lexical analysis on the normalized source code to generate a token sequence, and the syntax analyzer performing syntax analysis on the token sequence to construct an abstract syntax tree structure.

[0083] The fourth step involves a deep neural network feature extractor extracting semantic feature vectors based on an abstract syntax tree. Although the student code uses selection sort and the standard answer uses bubble sort, both algorithms share the same control flow graph structure (two nested loops), the same data flow graph characteristics (array element swapping operations), and the same function call relationships (only calling the printf library function). Therefore, their semantic feature vectors are highly similar.

[0084] In the fifth step, the feature matching module 103 calculates the cosine similarity between the student code feature vector and the standard answer feature vector. In this example, the semantic matching score reaches 0.91.

[0085] Step 6: The scoring result output module 104 generates the final scoring result: a total score of 100 points, a semantic matching score of 91 points, and is determined to be the correct answer. The grading report shows that the two sorting algorithms are functionally equivalent and provides algorithm complexity analysis as extended learning material.

[0086] The above correction process shows that the present invention can effectively identify correct answers with correct algorithm logic but different implementation methods, and significantly reduce the false judgment rate.

[0087] Example 5: Cross-platform deployment and large-scale batch testing

[0088] This embodiment verifies the stability of the present invention in cross-platform deployment scenarios and its processing efficiency in large-scale batch modification tasks.

[0089] Cross-platform deployment testing:

[0090] The test environment was configured with three heterogeneous platforms: the first group was Ubuntu 20.04 + GCC 9.3, the second group was Windows 10 + MSVC 2019, and the third group was macOS 11 + Clang 12.0. Each environment deployed the same Docker containerized intelligent grading system and used the same standard answer semantic feature library.

[0091] The test sample consisted of 1000 C language program source codes submitted by students, covering 10 different types of questions. Each source code was graded in three different environments, and the compilation results and scores were recorded.

[0092] Test results show that the consistency rate of compilation results (consistency in judging the same code as successful / failed compilation) reached 99.7% across the three environments, and the consistency rate of scoring results reached 98.5%. The minor differences in scoring results mainly stem from the precision deviation in floating-point calculations, which can be completely eliminated by introducing a tolerance mechanism (similarity score tolerance ±0.02).

[0093] Large-scale batch performance testing:

[0094] The test environment was configured with 1 scheduling node and 8 worker nodes, each worker node being allocated 4 CPU cores and 8GB of memory. The test task was batch-editing 10,000 C language source codes.

[0095] The test results are as follows: total processing time 165 seconds, average throughput 60.6 tasks / second, peak throughput 120 tasks / second. The task allocation balance (the ratio of the standard deviation to the average of the task completion times of each worker node) is 4.8%, indicating that the weighted round-robin algorithm can effectively achieve balanced task allocation.

[0096] Comparative tests show that, compared with existing systems based on single-node serial grading, the processing efficiency of this invention is improved by about 6 times, which can meet the high-frequency and high-concurrency grading needs in teaching scenarios.

[0097] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An intelligent grading method for C language programs, characterized in that, Includes the following steps: Obtain the C language source code file to be corrected, and perform lexical analysis on the source code to generate a token sequence; The token sequence is parsed to construct an abstract syntax tree structure; Based on the abstract syntax tree, semantic feature vectors of the code are extracted, wherein the semantic feature vectors include control flow graph features, data flow graph features, and function call relationship features; The extracted semantic feature vectors are compared with the pre-stored standard answer semantic feature library using cosine similarity calculation to obtain a semantic matching score. The semantic matching scores are then weighted and summed according to a preset weight ratio to generate the final score result.

2. The intelligent grading system for C language programs as described in claim 1, characterized in that, The steps for constructing the abstract syntax tree structure include: performing lexical analysis on the source code to generate a token sequence; performing syntactic analysis on the token sequence to construct the abstract syntax tree; and performing semantic analysis on the abstract syntax tree to extract type information and scope information.

3. The intelligent grading system for C language programs as described in claim 1, characterized in that, The semantic feature vector has a dimension of 64 to 128, and a deep neural network model is used for feature extraction. Among them, the control flow graph features account for 0.35 to 0.45 of the weight, the data flow graph features account for 0.25 to 0.35 of the weight, and the function call relationship features account for 0.20 to 0.30 of the weight.

4. The intelligent grading system for C language programs as described in claim 1, characterized in that, The formula for calculating the cosine similarity is: in, The feature vector of the code to be corrected is the first one. Dimensional value, The first eigenvector represents the standard answer. Dimensional value, This represents the total dimension of the eigenvectors.

5. The intelligent grading system for C language programs as described in claim 1, characterized in that, It also includes code standardization processing steps, which include: anonymizing variable names in the source code and uniformly replacing user-defined identifiers with temporary names; and removing comments from the source code to eliminate the impact of code style differences on the correction results.

6. The intelligent grading system for C language programs as described in claim 1, characterized in that, It also includes a compilation environment adaptation layer, which encapsulates the interfaces of three compilers: GCC, Clang, and MSVC. By dynamically detecting the operating system type and compiler version, it automatically selects the corresponding compiler for code compilation. The compilation environment adaptation layer runs in Docker containers, with each container allocated 2 to 4 CPU cores and 4GB to 8GB of memory resources.

7. The intelligent grading system for C language programs as described in claim 1, characterized in that, It also includes a distributed batching scheduling module, which distributes tasks based on message queues and uses a weighted round-robin algorithm to allocate batching tasks to multiple working nodes. Each working node is configured with a batching task queue depth of 50 to 100 tasks. When the queue is full, a task overflow handling mechanism is triggered to reallocate the excess tasks to idle nodes.

8. An intelligent grading system for C language programs, used to implement the intelligent grading method for C language programs as described in any one of claims 1-7, characterized in that, include: The source code input module is used to receive C language source code files submitted by students and perform format validation. The feature extraction module is equipped with an abstract syntax tree analyzer and a deep neural network feature extractor, which are used to extract semantic feature vectors from the code. The feature matching module stores a standard answer semantic feature library and is equipped with a cosine similarity calculation unit; the scoring result output module is used to output a grading report with detailed scoring reasons.

9. The intelligent grading system for C language programs as described in claim 8, characterized in that, The feature extraction module also includes a code normalization processing unit, which performs variable name anonymization, code indentation standardization, and comment removal on the source code.

10. The intelligent grading system for C language programs as described in claim 8, characterized in that, It also includes a result visualization module, which generates a control flow graph comparison diagram and a data flow graph comparison diagram, and highlights the differences between the student code and the standard answer using color marking. The source code input module is equipped with a format verification unit, which can identify the file extension of C language source files and detect the file encoding format; when non-UTF-8 encoding or illegal characters are detected, the system automatically triggers the format conversion or error prompt process.