A method, system and medium for automatically correcting programming assignments

Through neural network model and deep learning technology, the feature data of the programming job is calculated and matched with the correct answer template. Combined with clustering processing, the problem of low automatic correction efficiency of graphical programming jobs is solved, and efficient and accurate automatic correction effect is achieved.

CN113793112BActive Publication Date: 2024-12-13SHENZHEN DIANMAO TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202110866914.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-29
Publication Date
2024-12-13
Estimated Expiration
2041-07-29

AI Technical Summary

Technical Problem

In the existing online children's programming courses, students' programming homework correction mainly relies on manual labor. The diversity of graphical programming homework leads to inefficient automatic correction, which makes it difficult to meet the needs of efficient automatic correction.

Method used

The neural network model is used to calculate the feature data of the programming job and match the feature with the correct answer template. The confidence data is obtained through deep learning training to confirm the correction results. The correct answer template is updated in combination with clustering processing to improve the efficiency of automatic correction.

Benefits of technology

It improves the efficiency of homework correction in programming teaching, realizes efficient automatic correction of diversified programming assignments, and enhances the accuracy and coverage of automatic correction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113793112B_ABST
    Figure CN113793112B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system and medium for automatically correcting programming homework, the method comprising: obtaining a programming homework to be corrected; inputting the programming homework into a preset neural network model, calculating and outputting feature data of the programming homework; performing feature matching on the feature data of the programming homework and a set of correct answer templates, and outputting corresponding confidence data; and confirming the correction result of the programming homework according to the confidence data. The embodiment of the present invention calculates the feature data of the programming homework through a neural network model, and obtains corresponding confidence data after performing feature matching on the feature data and the correct answer template, and combines deep learning training with the confidence data obtained by feature matching to perform efficient automatic correction of programming homework, thereby improving the efficiency of homework correction in the programming teaching process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of graphical programming technology, and in particular to a method, system and medium for automatically correcting programming assignments. Background Art

[0002] In current online children's programming courses, the grading of students' after-school programming homework still mainly relies on manual grading. This is mainly because graphical programming homework is composed of graphical building block code blocks representing various variables and operations. Students have a high degree of freedom in operation. One homework usually corresponds to multiple implementation methods. The existing automatic grading only provides a few correct answers for accurate comparison, which makes the automatic grading inefficient and difficult to meet the needs of efficient automatic grading of diversified programming homework. Summary of the invention

[0003] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide a method, system and medium for automatic correction of programming assignments, aiming to improve the efficiency of automatic correction of programming assignments.

[0004] The technical solution of the present invention is as follows:

[0005] A method for automatically correcting programming homework, comprising the following steps:

[0006] Get programming assignments to be graded;

[0007] Inputting the programming operation into a preset neural network model, and calculating and outputting characteristic data of the programming operation;

[0008] Perform feature matching on the feature data of the programming task and the set of correct answer templates, and output corresponding confidence data;

[0009] The correction result of the programming task is confirmed according to the confidence data.

[0010] In the method for automatically correcting programming homework, the feature matching of the feature data of the programming homework with the correct answer template set and outputting corresponding confidence data includes:

[0011] The feature data of the programming job is input into a preset matching model, and the confidence data between the programming job and the preset template category is output. The matching model is trained based on all the correct answer templates obtained in the correct answer template set.

[0012] In the method for automatically correcting programming assignments, before inputting the characteristic data of the programming assignments into a preset matching model, the method further includes:

[0013] Marking all correct answer templates obtained in the correct answer template set into categories, and marking each correct answer template as a corresponding preset template category;

[0014] Inputting each correct answer template into the neural network model respectively, and calculating and outputting feature training data of each correct answer template;

[0015] The matching model is constructed, and the matching model is trained according to the preset template category and the feature training data of each correct answer template until the matching model meets a preset convergence condition.

[0016] In the method for automatically correcting programming assignments, confirming the correction result of the programming assignment to be corrected according to the confidence data includes:

[0017] If there is confidence data greater than or equal to the confidence threshold, the correction result of the programming job is qualified;

[0018] If the confidence data are all less than the confidence threshold, the correction result of the programming job is unqualified;

[0019] Classifying the programming assignments with unqualified correction results into a set of pending assignments;

[0020] The set of to-be-processed assignments is clustered, new correct answer templates are extracted and classified into the set of correct answer templates, and then feature matching is continued until all correct answers are matched from all programming assignments to be corrected.

[0021] In the method for automatically correcting programming assignments, before inputting the programming assignments into a preset neural network model and calculating and outputting characteristic data of the programming assignments, the method further includes:

[0022] The programming operations are serialized according to preset rules.

[0023] In the method for automatically correcting programming assignments, the step of serializing the programming assignments according to preset rules includes:

[0024] Get the combination of building blocks in programming assignments;

[0025] Parse the combination of building block code blocks in a preset order to obtain the building block type and building block data corresponding to each building block code block;

[0026] The building block type and building block data are serialized according to preset rules to generate a corresponding serialized array.

[0027] In the automatic correction method for programming homework, the step of parsing the combination of building block code blocks in a preset order to obtain the building block type and building block data corresponding to each building block code block includes:

[0028] Obtaining the splicing timing of the combination of building block code blocks;

[0029] Each building block code block is parsed in turn according to the splicing sequence to obtain building block types and building block data arranged in the splicing sequence.

[0030] In the method for automatically correcting programming homework, the step of generating a corresponding serialized array after serializing the building block type and building block data according to a preset rule includes:

[0031] Convert the building block type and building block data into corresponding coding data according to a preset coding mapping library, wherein the coding mapping library is used to store the mapping relationship between the building block type and building block data and the coding data;

[0032] Encapsulating the encoded data according to a preset data structure to obtain a one-dimensional array corresponding to each building block code block;

[0033] The one-dimensional arrays are superimposed in a splicing time sequence to generate a two-dimensional serialized array corresponding to the combination of the building block code blocks.

[0034] Another embodiment of the present invention further provides a system for automatically correcting programming assignments, the system comprising at least one processor; and

[0035] a memory communicatively connected to the at least one processor; wherein,

[0036] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned automatic correction method for programming homework.

[0037] Another embodiment of the present invention further provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the above-mentioned method for automatic correction of programming jobs.

[0038] Beneficial effects: The present invention discloses a method, system and medium for automatically correcting programming homework. Compared with the prior art, the embodiments of the present invention calculate the feature data of programming homework through a neural network model, and obtain corresponding confidence data after feature matching the feature data with the correct answer template. The confidence data obtained by combining deep learning training and feature matching can be used to automatically correct programming homework efficiently, thereby improving the efficiency of homework correction in the programming teaching process. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0040] Figure 1 A flowchart of a preferred embodiment of the method for automatically correcting programming assignments provided by the present invention;

[0041] Figure 2 A schematic diagram of a combination of building block code blocks in a programming job to be processed in an application embodiment of the method for automatically correcting programming jobs provided by the present invention;

[0042] Figure 3 A flowchart of characteristic data calculation in an application embodiment of the method for automatically correcting programming assignments provided by the present invention;

[0043] Figure 4 A flow chart of template matching in an embodiment of an automatic correction method for programming assignments provided by the present invention;

[0044] Figure 5 A schematic diagram of functional modules of a preferred embodiment of the automatic correction device for programming homework provided by the present invention;

[0045] Figure 6 This is a schematic diagram of the hardware structure of a preferred embodiment of the automatic correction system for programming homework provided by the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. The embodiments of the present invention are described below in conjunction with the accompanying drawings.

[0047] See also Figure 1 , Figure 1 The flowchart of the preferred embodiment of the method for automatically correcting programming assignments provided by the present invention is as follows. Figure 1 As shown, it includes the following steps:

[0048] S100, obtaining programming homework to be corrected;

[0049] S200, inputting the programming operation into a preset neural network model, and calculating and outputting feature data of the programming operation;

[0050] S300, performing feature matching on the feature data of the programming task and a set of correct answer templates, and outputting corresponding confidence data;

[0051] S400: confirming the correction result of the programming task according to the confidence data.

[0052] In this embodiment, when a user is learning programming on, for example, an online programming education platform, he or she inputs the programming assignment to be corrected in the corresponding code editing area according to the assignment requirements. At this time, the online programming education platform can automatically obtain the programming assignment to be corrected submitted by the user. The specific programming assignment to be corrected can be a programming assignment to be corrected submitted historically or a programming assignment to be corrected submitted in real time. This embodiment does not limit this. In particular, this embodiment can be described as a programming assignment in the form of graphical programming, that is, the programming assignment contains multiple encapsulated building block code blocks with corresponding functions. Of course, in other embodiments, the programming assignment can also be in other forms such as text, which is not limited in this embodiment.

[0053] After obtaining the programming homework to be corrected, feature extraction is performed through a pre-built and trained neural network model, and feature data of the programming homework to be corrected is calculated and output. The neural network model can be a VGG neural network, which has the advantages of simple structure, wide feature degree, and the ability to extract more feature information. Of course, neural network models with other structures can also be used in other embodiments, and this embodiment does not limit it. Specifically, the training process of the neural network model is to train the neural network model according to the pre-collected corrected training samples, so that the neural network model reaches the preset convergence condition, that is, the model training is completed. The corrected training samples contain a variety of graphical programming jobs with different combinations and annotations, which are input into the neural network model. The output value of the feature extraction of the corrected training samples by the neural network model reversely adjusts the weight parameters until the model converges. That is to say, the trained neural network model can accurately identify and extract the feature data corresponding to the building block code blocks contained in the programming homework, providing a reliable data basis for subsequent automatic correction.

[0054] After the feature data of the programming homework to be corrected is extracted, it is feature matched with the correct answer template set, and the corresponding confidence data is calculated and output. For example, at the beginning of automatic correction, at least one correct answer template can be preset and its feature data can be extracted through the neural network model and saved in the correct answer template set. Later, during automatic correction, the feature data of the programming homework to be corrected is matched with the template feature data contained in the correct answer template set, and the correction result of the programming homework to be corrected is further confirmed based on the calculated output confidence data. This embodiment obtains a neural network model and feature matching processing by combining deep learning training, and converts the abstract graphical comparison during the automatic correction of programming homework into an accurate feature data match, which effectively improves the efficiency of automatic correction of homework in the process of graphical programming teaching.

[0055] In one embodiment, the feature matching of the feature data of the programming task with the correct answer template set and outputting corresponding confidence data includes:

[0056] The feature data of the programming job is input into a preset matching model, and the confidence data between the programming job and the preset template category is output. The matching model is trained based on all the correct answer templates obtained in the correct answer template set.

[0057] In this embodiment, when performing feature matching, the feature data of the programming job is classified and matched through a preset matching model, and the matching model is trained based on the correct answer template obtained in the correct answer template set, that is, a matching model is pre-trained through the obtained correct answer template, and the matching model is used to output corresponding confidence data after feature matching of the input programming job with the preset template category. The confidence data represents the similarity between the feature data of the programming job and the feature data corresponding to the preset template category. The sum of the confidence data of the same programming job for all preset template categories is 1, that is, the matching model can match the similarity between the output programming job and each preset template category to achieve efficient feature matching processing of the feature data of the input programming job.

[0058] In one embodiment, before inputting the characteristic data of the programming operation into a preset matching model, the method further includes:

[0059] Marking all correct answer templates obtained in the correct answer template set into categories, and marking each correct answer template as a corresponding preset template category;

[0060] Inputting each correct answer template into the neural network model respectively, and calculating and outputting feature training data of each correct answer template;

[0061] The matching model is constructed, and the matching model is trained according to the preset template category and the feature training data of each correct answer template until the matching model meets a preset convergence condition.

[0062] In this embodiment, before performing feature matching, a matching model for classification matching is first constructed and trained, and all correct answer templates obtained in the correct answer template set are first labeled with categories, and each correct answer template is respectively labeled as a corresponding preset template category, and feature training data of each correct answer template is calculated through a preset neural network model, thereby forming a classification training sample of the matching model, that is, the classification training sample of the matching model is the feature training data that has been labeled with categories, and the matching model is trained with the classification training sample until the matching model meets the preset convergence adjustment, that is, the model training is completed, and the matching model that has completed the model training can accurately classify and match the feature data of the programming job, obtain the confidence data between the programming job and each preset template category, and realize efficient and accurate end-to-end feature matching.

[0063] Optionally, since the correct answer template set may be dynamically updated according to the grading process to meet the grading needs of diverse implementation forms, matching model training and classification matching can be carried out simultaneously. After the model training of the matching model is initially completed, training can be continued based on the feature training data and preset template categories contained in the dynamically updated correct answer template set to obtain an updated matching model, thereby improving the template coverage when performing feature matching on the feature data of the programming job, ensuring that grading errors will not occur due to omissions during feature matching, and improving the reliability of automatic grading.

[0064] The step of confirming the correction result of the programming job to be corrected according to the confidence data includes:

[0065] If there is confidence data greater than or equal to the confidence threshold, the correction result of the programming job is qualified;

[0066] If the confidence data are all less than the confidence threshold, the correction result of the programming job is unqualified.

[0067] In this embodiment, after performing feature matching to obtain confidence data corresponding to each preset template category, if there is confidence data greater than or equal to the confidence threshold, it means that the current programming job to be corrected matches the preset template category corresponding to the confidence data, and the correction result of the programming job is confirmed to be qualified. Therefore, the correction result of the programming job is confirmed to be qualified. The specific confidence threshold can be flexibly set according to the actual correction needs and the coverage rate of the correct answer template set, and this embodiment does not limit this; if it does not exist, that is, the confidence data is all less than the confidence threshold, it means that there is no template category in the current preset template category that matches the programming job to be corrected. At this time, the correction result of the programming job is confirmed to be unqualified and marked as an unknown work for subsequent processing. By adopting a confidence threshold and an adjustable confidence threshold, the coverage rate of the correct answer template can be flexibly adjusted according to the correction needs, so that it is possible to judge whether the programming job is correct without completely accurate matching, thereby effectively improving the efficiency of automatic correction of programming jobs.

[0068] In one embodiment, if the confidence data are all less than the confidence threshold, then the correction result of the programming job is unqualified, and the method may further include:

[0069] Classifying the programming assignments with unqualified correction results into a set of pending assignments;

[0070] The set of to-be-processed assignments is clustered, new correct answer templates are extracted and classified into the set of correct answer templates, and then feature matching is continued until all correct answers are matched from all programming assignments to be corrected.

[0071] In this embodiment, if the current programming homework to be corrected is marked as an unknown work after feature matching, it will be included in the set of homework to be processed, and the set of homework to be processed will be further clustered. A new correct answer template is extracted from the set of homework to be processed and included in the set of correct answer templates. That is, although there may be multiple implementation combinations of the correct answers for the same homework, the programming homework to be corrected may not be successfully matched with the existing set of correct answer templates during the initial matching, but the total number of correct answers is theoretically determined, and the correct answer homework has commonalities, so different correct answer templates have certain logical connections, for example For example, the key execution steps in different correct answer templates are the same, and the remaining execution steps are in reverse order, etc. Therefore, in this embodiment, after feature matching, clustering operations are performed on unknown works according to the matching results, and new correct answer templates are gradually obtained to update the correct answer template set, and further feature matching is continued through the updated correct answer template set. The above matching, set classification and clustering processes are repeated continuously to form a virtuous cycle of matching and clustering, until all correct answer templates are clustered to match all correct answers from all programming assignments to be corrected, thereby effectively improving the coverage and efficiency of automatic correction of programming assignments.

[0072] The clustering process of the set of pending jobs, extracting new correct answer templates and classifying them into the set of correct answer templates, and then continuing feature matching, includes:

[0073] Performing clustering processing on the set of jobs to be processed according to a preset clustering algorithm;

[0074] Determine whether there is a pending job category that meets the preset clustering criteria;

[0075] If yes, extract a new correct answer template from the pending job category that meets the preset clustering standard and classify it into the correct answer template set;

[0076] The updated correct answer template set is used to continue to match the programming assignments to be corrected.

[0077] In this embodiment, a clustering operation is performed on the set of pending works that cannot be successfully matched during the matching process. The pending work set is clustered using a preset clustering algorithm, such as K-means clustering, mean shift clustering, density-based clustering, and the like. Since the correct answer jobs have commonalities, preset clustering standards can be set according to the requirements of the current job. During the clustering process, it is determined whether there are pending job categories in the pending work set that meet the preset clustering standards. If so, the work closest to the preset clustering standards is extracted as a new correct answer template and included in the correct answer template set. The updated correct answer template set is used to continue to match the programming jobs to be corrected. Specifically, the existing correct answer template can be used as the initial clustering center, and for each pending job sample in the pending job set, the distance between each pending job sample and each initial clustering center is calculated respectively. When the distance between the pending job sample and any initial clustering center is less than the preset distance, it is deemed to meet the preset clustering standard, and the pending job sample that meets the preset clustering standard is assigned to the pending job category corresponding to the initial clustering center with the smallest distance. The pending job sample closest to the initial clustering center is extracted from each pending job category as the new correct answer template, that is, the pending job category corresponds to the correct answer template that has been obtained, which represents the job category similar to each correct answer template, and the work most similar to the corresponding correct answer template is further extracted from each pending job category as the new correct answer template, so as to update the correct answer template set to improve the coverage of the correct answer template set.

[0078] That is to say, after performing feature matching, this embodiment also obtains a new correct answer template by clustering the set of jobs to be processed, thereby updating the correct answer template set to increase the coverage of the correct answer template set during correction and matching. After repeating this process, the correct answers can be gradually matched from all the programming jobs to be corrected, and the correct answer template set corresponding to the current job can be gradually improved, effectively improving the coverage and efficiency of subsequent job corrections.

[0079] The extracting a new correct answer template from the pending job category that meets the preset clustering standard and classifying it into the correct answer template set specifically includes:

[0080] Cluster centers are extracted for the job categories to be processed that meet the preset clustering standard, and the extracted cluster centers are used as new correct answer templates and included in the correct answer template set.

[0081] In this embodiment, when extracting a new correct answer template, cluster centers are extracted for the pending job categories that meet the preset clustering criteria, and the extracted cluster centers are used as new correct answer templates. That is, after the categories are divided according to the distance between each pending job sample and each initial cluster center according to the principle of minimum distance, the pending job categories corresponding to each initial cluster center are obtained. At this time, the cluster centers are recalculated for the pending job samples contained in each pending job category, and the average value of the distance between the pending job samples in the pending job category and the initial cluster center is calculated. The pending job samples with the distance closest to the average value are used as the cluster centers of the pending job category. The pending job samples serving as the cluster centers are the works in the corresponding pending job categories that are closest to the correct answer template, ensuring that each time a new correct answer template is extracted from the pending job set, the job closest to the preset clustering standard, that is, the job that best meets the correct answer requirements, is selected to ensure the accuracy of the correct answer template set.

[0082] Optionally, each time a new correct answer template is extracted from the set of pending jobs, the new correct answer template is removed from the set of pending jobs to avoid repeated extraction during subsequent clustering algorithms, which would result in other correct jobs being unable to be successfully extracted and affect the coverage of the correct answer template set.

[0083] Optionally, before inputting the programming operation into a preset neural network model and calculating and outputting feature data of the programming operation, the method may further include:

[0084] The programming operations are serialized according to preset rules.

[0085] In this embodiment, since the graphical programming work is a building block combination composed of multiple building block code blocks, it is impossible to automatically identify the code data represented by each building block code block combination. In order to realize automatic identification of code data to improve subsequent matching and clustering efficiency, before job matching, the programming job to be corrected is first vectorized and the graphical programming job is converted into an accurate digitally quantified programming job, thereby realizing automatic identification of the programming job, providing a reliable data basis for efficient and accurate automatic correction.

[0086] Optionally, the serializing the programming jobs according to a preset rule includes:

[0087] Get the combination of building blocks in programming homework;

[0088] Parse the combination of building block code blocks in a preset order to obtain the building block type and building block data corresponding to each building block code block;

[0089] The building block type and building block data are serialized according to preset rules to generate a corresponding serialized array.

[0090] In this embodiment, the specific serialization process is to first obtain the combination of building block code blocks in the programming homework to be corrected, such as Figure 2 As shown, the programming homework to be corrected is a building block code block combination formed by superimposing multiple building block code blocks, and each building block code block is encapsulated with code that implements corresponding functions, such as JavaScript code, etc.; after the building block code block combination is obtained, it is parsed in a preset order. Since different building block code blocks in the obtained building block code block combination have a certain temporal relationship, the building block code block combination is parsed in a preset order to obtain the building block type and building block data corresponding to each building block code block arranged in a preset order, ensuring that the function and data represented by each building block code block are obtained without affecting the logical relationship between the building block code blocks, and then the building block type and building block data obtained by the analysis are serialized according to preset rules to generate a serialized array corresponding to the building block code block combination, so that the graphical building block code block combination can be converted into an easily recognizable quantized array form when automatically correcting the programming homework, which can realize automatic recognition of the building block code blocks and improve the recognition efficiency and accuracy of the building block code blocks.

[0091] Specifically, the building block type may be one or more of a constant building block, a variable building block and / or an operation building block, that is, the acquired building block code block combination may include one or more of an event building block, a control building block, a constant building block, a variable building block and an operation building block, and the corresponding function is realized by combining a plurality of different types of building block code blocks, wherein the operation building block may further include, for example, a function building block, a calculation building block, an appearance building block, a sound building block, etc., which may be set according to actual needs, and this embodiment does not limit this. The building block data is an input parameter on the building block code block, for example, taking the control building block as an example, if the current control building block is "wait 0.5 seconds", its building block data is "0.5", of course, when the building block code block does not have an input parameter, the building block data may be empty, such as the control building block of "repeat execution", etc.

[0092] Optionally, the works included in the initial correct answer template set are also serialized and subjected to neural network model feature extraction according to preset rules, so that intuitive and accurate quantitative matching can be performed directly during subsequent job matching, effectively improving matching efficiency and accuracy.

[0093] Optionally, parsing the building block code block combination in a preset order to obtain the building block type and building block data corresponding to each building block code block includes:

[0094] Obtaining the splicing timing of the combination of building block code blocks;

[0095] Each building block code block is parsed in turn according to the splicing sequence to obtain building block types and building block data arranged in the splicing sequence.

[0096] In this embodiment, the combination of building block code blocks in the programming job to be corrected is input by the user. The specific user can directly select the encapsulated building block code block in the preset building block library, and perform building block code editing operations such as dragging, splicing, and combining in the code editing area, so as to obtain the building block code block combination with the corresponding splicing timing. Since in the graphic programming scene, all building block code blocks are stacked and placed sequentially, there is a natural sequence relationship in the timing. By obtaining the splicing timing of the building block code block combination, the stacking order when the user edits and inputs can be obtained, and then each building block code block is parsed in turn according to the splicing timing to obtain the building block type and building block data arranged according to the splicing timing, so as to parse and restore the functions and data of the stacked building block code blocks in order, to ensure that the functions and data corresponding to the building block code blocks will not have logical timing errors during the subsequent serialization processing, and improve the accuracy of building block code block recognition.

[0097] Optionally, the generating a corresponding serialized array after serializing the building block type and building block data according to a preset rule includes:

[0098] Convert the building block type and building block data into corresponding coding data according to a preset coding mapping library, wherein the coding mapping library is used to store the mapping relationship between the building block type and building block data and the coding data;

[0099] Encapsulating the encoded data according to a preset data structure to obtain a one-dimensional array corresponding to each building block code block;

[0100] The one-dimensional arrays are superimposed in a splicing time sequence to generate a two-dimensional serialized array corresponding to the combination of the building block code blocks.

[0101] In this embodiment, when performing serialization processing, all the building block types and building block data arranged in splicing time sequence are first encoded in sequence and then converted into corresponding coded data respectively. Specifically, one-to-one data conversion can be performed according to a preset coding mapping library. The coding mapping library stores the mapping relationship between the building block type and the coded data, and the mapping relationship between the building block data and the coded data. After searching the corresponding building block type and building block data in the coding mapping library, the corresponding coded data can be obtained, thereby realizing convenient and fast data conversion. After that, the digitized coded data is packaged according to the preset data structure to obtain a one-dimensional array corresponding to each building block code. That is, in this embodiment, each building block code block is converted into a one-dimensional array. After obtaining the one-dimensional array corresponding to each building block code, all the one-dimensional arrays are superimposed in the splicing sequence to generate a two-dimensional serialized array. The two-dimensional serialized array corresponds to the building block code block combination, and has the same splicing sequence and encoding data corresponding to the building block type and building block data. Through the two-dimensional serialized array, the graphical building block code block combination can be converted into quantized two-dimensional encoding data, which realizes the vectorization processing of the graphical programming works, facilitates the subsequent accurate building block code recognition and review, and is conducive to the automatic review of the graphical programming works.

[0102] Optionally, before the generating a corresponding serialized array by serializing the building block type and building block data according to a preset rule, the method further includes:

[0103] The code mapping library is obtained by predefining type code data corresponding to all building block types and action code data corresponding to building block data.

[0104] In this embodiment, the building block types and building block data included in all building block code blocks in the building block library are encoded and defined in advance and stored to obtain the encoding mapping library to achieve accurate data conversion. Specifically, the encoding mapping library can be in the form of a mapping table, as shown in Table 1, which shows the type encoding data corresponding to some building block types so that in subsequent serialization processing, the type encoding data corresponding to each building block type and the action encoding data corresponding to the building block data can be directly searched and called, thereby ensuring uniformity and accuracy during each serialization processing.

[0105] Table 1

[0106]

[0107]

[0108] Optionally, the first data bit of the one-dimensional array is type coding data, and the remaining data bits are action coding data and / or preset space characters.

[0109] In this embodiment, the converted coded data is encapsulated according to a preset data structure, so that each to-be-processed building block code representing a variable, constant or operation is quantized into a serialized one-dimensional array in a unified data format. The data structure is shown in Table 2. The length of each row of data can be fixed to N bits, and N can be based on the actual building block situation and can meet the longest requirement. The first bit is the type coding data, and the last few bits are the action coding data. If they cannot be used in full, they can be replaced by preset space characters such as 0.

[0110] Table 2

[0111]

[0112] Please refer to Figure 2 The serialization process in the automatic correction method for programming homework provided by the present invention is described by taking a specific application example. Figure 2 As shown, in this embodiment, the building block code block combinations are repeated execution, next action, and waiting for 0.5 seconds according to the splicing timing, and the corresponding building block types are repeated execution, action, and waiting (in seconds), and the corresponding building block data are no data, action coding data corresponding to the next action, and 0.5. Therefore, after encapsulating the coding data corresponding to the building block type and the building block data according to the above preset data structure, the building block code block can be serialized and converted into a two-dimensional serialized array as shown in Table 3, realizing the conversion from graphical to digital, achieving the purpose of automatically identifying graphical programming works, and providing accurate recognition results for automatic correction of graphical programming works.

[0113] Table 3

[0114]

[0115] Specifically, in order to better understand the implementation process of the automatic correction method for programming homework provided by the present invention, the following is combined with Figure 3 and Figure 4 , a specific application example is given to illustrate the process of correcting programming homework:

[0116] In this embodiment, the automatic correction of programming homework is divided into two processes: Figure 3 The feature calculation process shown in FIG. 1 is to obtain the homework to be corrected and then serialize it so that the graphic programming work is converted into vector data that can be used for calculation. Then the serialized data is input into the pre-trained VGG neural network for calculation, and the feature data of the homework to be corrected is output. Then, the following steps are performed: Figure 4The template matching process shown is a step-by-step iterative and recursive process. First, the feature data of the homework to be corrected that was previously calculated and output is obtained. Then, the feature data of the homework to be corrected is matched with the existing correct answer template set to obtain a number of confidence data with the same number of correct answer templates. The correct answer templates initially included in the correct answer template set are also subjected to the same serialization processing and feature extraction to achieve accurate matching calculation. Then, it is determined whether there is data greater than or equal to the confidence threshold in the several confidence data. If so, the homework to be corrected is marked as the correct answer and included in the correct answer template set. If not, it is included in the unknown result work. The K-means algorithm is further used to cluster the unknown result work set to determine whether there are works that meet the clustering criteria in the results. If so, the cluster center is selected from the work set that meets the clustering criteria as the new correct answer template, and the new template that is successfully clustered is included in the correct answer template set, and is removed from the unknown result work set. The job matching is continued through the updated correct answer template set, and the above matching, collection, and clustering processes are repeated to gradually match and detect the correct job from all the jobs, and gradually improve the correct answer template of the current job, effectively improving the coverage and efficiency of subsequent work matching and correction.

[0117] It can be seen from the above method embodiments that the method for automatic grading of programming homework provided by the present invention calculates the feature data of programming homework through a neural network model, and obtains corresponding confidence data after feature matching of the feature data with the correct answer template. The confidence data obtained by combining deep learning training and feature matching can be used to automatically and efficiently correct programming homework, thereby improving the efficiency of homework grading in the programming teaching process.

[0118] It should be noted that there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.

[0119] Another embodiment of the present invention provides a programming homework automatic correction device, such as Figure 5 As shown, the device 1 comprises:

[0120] An acquisition module 11 is used to acquire programming homework to be corrected;

[0121] A feature calculation module 12, used to input the programming operation into a preset neural network model, and calculate and output feature data of the programming operation;

[0122] A matching module 13, used for matching the feature data of the programming task with the correct answer template set, and outputting corresponding confidence data;

[0123] The output module 14 is used to confirm the correction result of the programming operation according to the confidence data.

[0124] The acquisition module 11, feature calculation module 12, matching module 13 and output module 14 are connected in sequence. For specific implementation, please refer to the corresponding method embodiments above, which will not be described again here.

[0125] Furthermore, the feature calculation module 12 is specifically used for:

[0126] The feature data of the programming job is put into a preset matching model, and the confidence data between the programming job and the preset template category is output. The matching model is trained based on all the correct answer templates obtained in the correct answer template set.

[0127] Furthermore, the automatic correction device for programming homework also includes:

[0128] A labeling module, used to label all correct answer templates obtained in the correct answer template set, and label each correct answer template as a corresponding preset template category;

[0129] An input module, used to input each correct answer template into the neural network model, calculate and output feature training data of each correct answer template;

[0130] The training module is used to construct the matching model and train the matching model according to the preset template category and the feature training data of each correct answer template until the matching model meets the preset convergence condition.

[0131] Furthermore, the output module 14 is used for:

[0132] If there is confidence data greater than or equal to the confidence threshold, outputting the correction result of the programming job as qualified;

[0133] If the confidence data are all less than the confidence threshold, the correction result of the programming job is output as unqualified.

[0134] Furthermore, the output module 14 further includes:

[0135] A classification unit, used for classifying the programming assignments marked as unknown works with unqualified correction results into a set of pending assignments;

[0136] The clustering unit is used to cluster the set of pending jobs, extract new correct answer templates and classify them into the set of correct answer templates, and then continue to perform feature matching until all correct answers are matched from all programming jobs to be corrected.

[0137] Furthermore, the automatic correction device for programming homework also includes:

[0138] The serialization module is used to serialize the programming operations according to preset rules.

[0139] Furthermore, the serialization module includes:

[0140] An acquisition unit, used for acquiring a combination of building block code blocks in a programming task;

[0141] A parsing unit, used to parse the combination of building block code blocks in a preset order to obtain a building block type and building block data corresponding to each building block code block;

[0142] The serialization unit is used to generate a corresponding serialization array after serialization according to the building block type and building block data according to preset rules.

[0143] Furthermore, the parsing unit comprises:

[0144] A timing acquisition subunit, used to acquire the splicing timing of the combination of the building block code blocks;

[0145] The parsing subunit is used to parse each building block code block in sequence according to the splicing sequence to obtain the building block type and building block data arranged in the splicing sequence.

[0146] Furthermore, the serialization unit comprises:

[0147] A conversion subunit, used to convert the building block type and building block data into corresponding coded data according to a preset coding mapping library, wherein the coding mapping library is used to store a mapping relationship between the building block type and building block data and the coded data;

[0148] A data encapsulation subunit, used to encapsulate the coded data according to a preset data structure to obtain a one-dimensional array corresponding to each building block code block;

[0149] The sequence superposition subunit is used to superimpose the one-dimensional arrays in a splicing time sequence to generate a two-dimensional serialized array corresponding to the combination of the building block code blocks.

[0150] Another embodiment of the present invention provides a system for automatically correcting programming assignments. Figure 6 As shown, the system 10 includes:

[0151] One or more processors 110 and memory 120, Figure 6 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0152] The processor 110 is used to complete various control logics of the system 10, and it can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration.

[0153] The memory 120 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the automatic correction method for programming homework in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the system 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, the automatic correction method for programming homework in the above method embodiment is implemented.

[0154] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created according to the use of the system 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the system 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0155] One or more units are stored in the memory 120, and when executed by one or more processors 110, the automatic correction method for programming homework in any of the above method embodiments is executed, for example, the above described Figure 1 The method comprises steps S100 to S400.

[0156] An embodiment of the present invention provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, for example, to execute the above-described Figure 1 The method comprises steps S100 to S400.

[0157] As an example, non-volatile storage media can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) as external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0158] In summary, the present invention discloses a method, system and medium for automatically correcting programming homework. The method obtains the programming homework to be corrected; inputs the programming homework into a preset neural network model, calculates and outputs the feature data of the programming homework; performs feature matching on the feature data of the programming homework with a set of correct answer templates, and outputs corresponding confidence data; and confirms the correction result of the programming homework according to the confidence data. The embodiment of the present invention calculates the feature data of the programming homework through a neural network model, and obtains the corresponding confidence data after feature matching on the feature data with the correct answer template. The confidence data obtained by combining deep learning training and feature matching can be used to automatically correct the programming homework efficiently, thereby improving the efficiency of homework correction in the programming teaching process.

[0159] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium, and the computer program can include the processes of the above-mentioned method embodiments when executed. The storage medium can be a memory, a disk, a floppy disk, a flash memory, an optical storage device, etc.

[0160] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for automatically correcting programming assignments. It is characterized in that The steps include: Obtaining a programming assignment to be corrected, wherein the programming assignment to be corrected is a combination of building block code blocks formed by stacking a plurality of building block code blocks and having a corresponding splicing time sequence, and each building block code block is encapsulated with a code that realizes a corresponding function; Inputting the programming operation into a preset neural network model, and calculating and outputting characteristic data of the programming operation; Perform feature matching on the feature data and the correct answer template set, and output corresponding confidence data; confirming the correction result of the programming assignment according to the confidence data; The step of confirming the correction result of the programming operation according to the confidence data includes: If there is confidence data greater than or equal to the confidence threshold, the correction result of the programming job is qualified; If the confidence data are all less than the confidence threshold, the correction result of the programming job is unqualified; Classifying the programming assignments with unqualified correction results into a set of pending assignments; Clustering the set of homework to be processed, extracting new correct answer templates and classifying them into the set of correct answer templates, and then continuing to perform feature matching until all correct answers are matched from all programming homework to be corrected; The clustering process of the set of pending jobs, extracting new correct answer templates and classifying them into the set of correct answer templates, and then continuing feature matching, includes: Using the existing correct answer template as the initial cluster center, clustering the set of pending jobs according to a preset clustering algorithm; Determine whether there is a pending job category that meets the preset clustering criteria; If yes, extract the to-be-processed job sample closest to the initial cluster center from the to-be-processed job category that meets the preset clustering standard as a new correct answer template and include it in the correct answer template set; Continue to match the programming assignments to be corrected using the updated set of correct answer templates; Before inputting the programming operation into a preset neural network model and calculating and outputting the characteristic data of the programming operation, the method further includes: Serializing the programming operations according to preset rules; The serializing the programming operations according to preset rules includes: Obtaining a combination of building block code blocks in the programming operation; Parse the combination of building block code blocks in a preset order to obtain the building block type and building block data corresponding to each building block code block; Generate a corresponding serialized array after serializing the building block type and building block data according to preset rules; The step of parsing the building block code block combination in a preset order to obtain the building block type and building block data corresponding to each building block code block includes: Obtaining the splicing timing of the combination of building block code blocks; Parsing each building block code block in turn according to the splicing sequence to obtain building block types and building block data arranged in the splicing sequence; The step of generating a corresponding serialized array after serializing the building block type and building block data according to a preset rule includes: Convert the building block type and building block data into corresponding coding data according to a preset coding mapping library, wherein the coding mapping library is used to store the mapping relationship between the building block type and building block data and the coding data; Encapsulating the encoded data according to a preset data structure to obtain a one-dimensional array corresponding to each building block code block; The one-dimensional arrays are superimposed in a splicing time sequence to generate a two-dimensional serialized array corresponding to the combination of the building block code blocks.

2. The method for automatically correcting programming assignments according to claim 1, It is characterized in that The feature matching of the feature data of the programming task with the correct answer template set and outputting corresponding confidence data includes: The feature data of the programming job is input into a preset matching model, and the confidence data between the programming job and the preset template category is output. The matching model is trained based on all the correct answer templates obtained in the correct answer template set.

3. The method for automatically correcting programming assignments according to claim 2, It is characterized in that Before inputting the characteristic data of the programming operation into a preset matching model, the method further includes: Marking all correct answer templates obtained in the correct answer template set into categories, and marking each correct answer template as a corresponding preset template category; Inputting each correct answer template into the neural network model respectively, and calculating and outputting feature training data of each correct answer template; The matching model is constructed, and the matching model is trained according to the preset template category and the feature training data of each correct answer template until the matching model meets a preset convergence condition.

4. An automatic marking system for programming homework, It is characterized in that The system includes at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for automatically correcting programming homework according to any one of claims 1 to 3.

5. A non-volatile computer-readable storage medium, It is characterized in that The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the method for automatically correcting programming assignments according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Online automatic correction method and system for paper homework

    CN110110714A

  • Homework correction method and device based on image recognition, storage medium and server

    CN110490180A

  • Template-based homework correction method and device, computer equipment and storage medium

    CN111680480A

  • Automatic homework correcting method and device, electronic equipment and storage medium

    CN111753767A

  • No-ground truth short answer scoring

    US20200020243A1