CN113793112A - Automatic correcting method, system and medium for programming operation - Google Patents

Automatic correcting method, system and medium for programming operation Download PDF

Info

Publication number
CN113793112A
CN113793112A CN202110866914.6A CN202110866914A CN113793112A CN 113793112 A CN113793112 A CN 113793112A CN 202110866914 A CN202110866914 A CN 202110866914A CN 113793112 A CN113793112 A CN 113793112A
Authority
CN
China
Prior art keywords
data
building block
programming
correct answer
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110866914.6A
Other languages
Chinese (zh)
Inventor
李天驰
孙悦
乔伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Dianmao Technology Co Ltd
Original Assignee
Shenzhen Dianmao Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Dianmao Technology Co Ltd filed Critical Shenzhen Dianmao Technology Co Ltd
Priority to CN202110866914.6A priority Critical patent/CN113793112A/en
Publication of CN113793112A publication Critical patent/CN113793112A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/20Education
    • G06Q50/205Education administration or guidance
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09BEDUCATIONAL OR DEMONSTRATION APPLIANCES; APPLIANCES FOR TEACHING, OR COMMUNICATING WITH, THE BLIND, DEAF OR MUTE; MODELS; PLANETARIA; GLOBES; MAPS; DIAGRAMS
    • G09B7/00Electrically-operated teaching apparatus or devices working with questions and answers
    • G09B7/02Electrically-operated teaching apparatus or devices working with questions and answers of the type wherein the student is expected to construct an answer to the question which is presented or wherein the machine gives an answer to the question presented by a student

Abstract

The invention discloses a method, a system and a medium for automatically correcting programming operation, wherein the method comprises the following steps: acquiring a programming job to be corrected; inputting the programming operation into a preset neural network model, and calculating and outputting characteristic data of the programming operation; carrying out feature matching on the feature data of the programming operation and a correct answer template set, and outputting corresponding confidence data; and confirming the correction result of the programming job according to the confidence coefficient data. The embodiment of the invention calculates the characteristic data of the programming operation through the neural network model, obtains the corresponding confidence coefficient data after carrying out characteristic matching on the characteristic data and the correct answer template, and carries out efficient automatic correction on the programming operation by combining the confidence coefficient data obtained by deep learning training and characteristic matching, thereby improving the efficiency of operation correction in the programming teaching process.

Description

Automatic correcting method, system and medium for programming operation
Technical Field
The invention relates to the technical field of graphical programming, in particular to a method, a system and a medium for automatically correcting programming operation.
Background
In the current online programming course for children, the student's programming homework correction after class mainly depends on manual correction, mainly because the graphical programming homework is formed by the combination of graphical building block code blocks representing various variables and operations, the degree of freedom of student operation is higher, a homework can generally correspond to multiple implementation modes, the existing automatic correction only provides a small number of correct answers for accurate comparison, so that the efficiency of automatic correction is low, and the requirement of high-efficiency automatic correction of diversified programming homework is difficult to meet.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, the present invention provides a method, a system and a medium for automatically modifying a programming job, which aims to improve the efficiency of automatically modifying the programming job.
The technical scheme of the invention is as follows:
an automatic batch modification method for programming operation comprises the following steps:
acquiring a programming job to be corrected;
inputting the programming operation into a preset neural network model, and calculating and outputting characteristic data of the programming operation;
carrying out feature matching on the feature data of the programming operation and a correct answer template set, and outputting corresponding confidence data;
and confirming the correction result of the programming job according to the confidence coefficient data.
In the method for automatically correcting programming jobs, the performing feature matching on the feature data of the programming jobs and a correct answer template set, and outputting corresponding confidence data includes:
inputting the feature data of the programming operation into a preset matching model, and outputting confidence coefficient data between the programming operation and a preset template category, wherein the matching model is obtained by training based on all correct answer templates obtained from the correct answer template set.
In the method for automatically correcting a programming job, before inputting the feature data of the programming job into a preset matching model, the method further includes:
performing category marking on all correct answer templates obtained in the correct answer template set, and respectively 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;
and constructing the matching model, and training the matching model according to the preset template type and the feature training data of each correct answer template until the matching model meets a preset convergence condition.
In the method for automatically correcting a programming job, the determining a correction result of the programming job to be corrected according to the confidence data includes:
if the confidence coefficient data which is greater than or equal to the confidence coefficient threshold exists, the correction result of the programming operation is qualified;
if the confidence coefficient data are all smaller than the confidence coefficient threshold value, the correction result of the programming operation is unqualified;
the programming jobs with the modification results being unqualified are classified into a job set to be processed;
and clustering the job set to be processed, extracting a new correct answer template, classifying the new correct answer template into the correct answer template set, and continuing to perform feature matching until all correct answers are matched from all the programming jobs to be corrected.
In the method for automatically correcting programming operation, before inputting the programming operation into a preset neural network model and calculating and outputting characteristic data of the programming operation, the method further includes:
and carrying out serialization processing on the programming operation according to a preset rule.
In the automatic correcting method for programming jobs, the serializing the programming jobs according to preset rules includes:
acquiring a building block code block combination in programming operation;
analyzing the building block code block combination according to a preset sequence to obtain a building block type and building block data corresponding to each building block code block;
and serializing according to the building block type and the building block data according to a preset rule to generate a corresponding serialized array.
In the automatic correcting method for programming operation, analyzing the building block code block combination according to a preset sequence to obtain a building block type and building block data corresponding to each building block code block, the method includes:
acquiring a splicing time sequence of the building block code block combination;
and analyzing each building block code block in sequence according to the splicing time sequence to obtain the building block types and building block data arranged according to the splicing time sequence.
In the automatic correcting method for programming operation, the generating of the corresponding serialized array after the serialization is performed according to the building block type and the building block data according to the preset rule includes:
respectively converting the building block type and the building block data into corresponding coded data according to a preset coding mapping library, wherein the coding mapping library is used for storing the mapping relation between the building block type, the building block data and the coded data;
packaging the coded data according to a preset data structure to obtain a one-dimensional array corresponding to each building block code block;
and superposing the one-dimensional arrays according to a splicing time sequence to generate a two-dimensional serialized array corresponding to the building block code block combination.
The invention also provides a system for automatically correcting the programming job, which comprises at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described method of automatic modification of programming jobs.
Another embodiment of the present invention also provides a non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the above-described method for automatically approving a programmed job.
Has the advantages that: compared with the prior art, the embodiment of the invention calculates the characteristic data of the programming operation through a neural network model, obtains the corresponding confidence coefficient data after carrying out characteristic matching on the characteristic data and a correct answer template, and carries out efficient automatic correction on the programming operation by combining the confidence coefficient data obtained by deep learning training and characteristic matching, thereby improving the efficiency of operation correction in the programming teaching process.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flowchart illustrating a preferred embodiment of a method for automatically modifying a programming job according to the present invention;
FIG. 2 is a schematic diagram of a combination of block codes in a to-be-processed programming job in an embodiment of an automatic modification method for programming jobs according to the present invention;
FIG. 3 is a flowchart of feature data calculation in an embodiment of the method for automatically modifying a programming job according to the present invention;
FIG. 4 is a flowchart of template matching in an embodiment of a method for automatic batch modification of programming jobs according to the present invention;
FIG. 5 is a functional block diagram of an automatic program modification apparatus according to a preferred embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware structure of an automatic program modification system according to a preferred embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and clearer, the present invention is described in further detail below. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart illustrating an automatic program modification method according to a preferred embodiment of the present invention. As shown in fig. 1, it includes the following steps:
s100, obtaining a programming job to be corrected;
s200, inputting the programming operation into a preset neural network model, and calculating and outputting characteristic data of the programming operation;
s300, performing feature matching on the feature data of the programming operation and a correct answer template set, and outputting corresponding confidence data;
and S400, confirming the correction result of the programming job according to the confidence coefficient data.
In this embodiment, when a user performs programming learning on, for example, an online programming education platform, a to-be-modified programming job is input in a corresponding code editing area according to a job requirement, at this time, the online programming education platform may automatically obtain the to-be-modified programming job submitted by the user, specifically, the to-be-modified programming job may be a historical submission of the to-be-modified programming job, or may be a real-time submission of the to-be-modified programming job.
After the programming operation to be corrected is obtained, feature extraction is carried out through a pre-constructed and trained neural network model, and feature data of the programming operation to be corrected is calculated and output, wherein the neural network model can be a VGG neural network, and has the advantages of simple structure, wide feature degree, capability of extracting more feature information and the like, although neural network models with other structures can be adopted in other embodiments, the embodiment does not limit the neural network models; specifically, the training process of the neural network model is to train the neural network model according to a pre-collected correction training sample, so that model training is completed when the neural network model reaches a preset convergence condition, the correction training sample comprises a plurality of graphical programming operations with labels in different combination forms, the graphical programming operations are input into the neural network model, and output value reverse regulator weight parameters for feature extraction of the correction training sample according to the neural network model are input until the model converges, that is, the trained neural network model can accurately identify and extract feature data corresponding to the building block code blocks contained in the programming operations, and a reliable data base is provided for subsequent automatic correction.
Extracting the feature data of the programming operation to be corrected, performing feature matching on the feature data and a correct answer template set, calculating and outputting corresponding confidence data, for example, at least one correct answer template can be preset at the initial time of automatic correction, the characteristic data of the correct answer template is extracted through a neural network model and stored in a correct answer template set, and subsequently, matching the feature data of the programming operation to be corrected with the template feature data contained in the correct answer template set, and further confirming to obtain the correction result of the programming operation to be corrected according to the calculated and output confidence data, and converting abstract graphical contrast during automatic correction of the programming operation into accurate characteristic data matching by combining deep learning training to obtain a neural network model and characteristic matching processing, thereby effectively improving the efficiency of automatic correction of the operation in the graphical programming teaching process.
In one embodiment, the performing feature matching on the feature data of the programming job and the correct answer template set and outputting corresponding confidence data includes:
inputting the feature data of the programming operation into a preset matching model, and outputting confidence coefficient data between the programming operation and a preset template category, wherein the matching model is obtained by training based on all correct answer templates obtained from the correct answer template set.
In the embodiment, during the feature matching, the feature data of the programming operation is classified and matched through a preset matching model, and the matching model is trained based on the obtained correct answer templates in the correct answer template set, the matching model is obtained by pre-training the obtained correct answer template, the matching model is used for outputting corresponding confidence coefficient data after carrying out feature matching on the input programming operation and the preset template type, the confidence coefficient data represents the similarity between the feature data of the programming operation and the feature data corresponding to the preset template type, the sum of the confidence coefficient data of the same programming operation aiming at all the preset template types is 1, the similarity between the output programming operation and each preset template category can be matched through the matching model, so that efficient feature matching processing of the feature data of the input programming operation is realized.
In one embodiment, before inputting the characteristic data of the programming job into the preset matching model, the method further comprises:
performing category marking on all correct answer templates obtained in the correct answer template set, and respectively 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;
and constructing the matching model, and training the matching model according to the preset template type and the feature training data of each correct answer template until the matching model meets a preset convergence condition.
In the embodiment, before feature matching, a matching model for classification matching is constructed and trained, all correct answer templates obtained in a correct answer template set are labeled according to categories, each correct answer template is labeled into a corresponding preset template category, and feature training data of each correct answer template is obtained through calculation of a preset neural network model, so that a classification training sample of the matching model is formed, namely the classification training sample of the matching model is the feature training data subjected to category labeling, the matching model is trained through the classification training sample until the matching model meets preset convergence regulation, the model training is completed, the matching model subjected to model training can accurately classify and match the feature data of programming operation, and confidence data between the programming operation and each preset template category is obtained, and the efficient and accurate end-to-end feature matching is realized.
Optionally, the correct answer template set may be dynamically updated according to a modification process to meet modification requirements of diversified implementation forms, so that matching model training and classification matching may be performed simultaneously, after model training of the matching model is completed for the first time, training may be continued according to feature training data included in the dynamically updated correct answer template set and a preset template category to obtain an updated matching model, thereby improving a template coverage rate when feature matching is performed on feature data of a programming job, ensuring that modification errors due to omission are not caused when feature matching is performed, and improving reliability of automatic modification.
The confirming the correction result of the programming job to be corrected according to the confidence coefficient data comprises the following steps:
if the confidence coefficient data which is greater than or equal to the confidence coefficient threshold exists, the correction result of the programming operation is qualified;
and if the confidence coefficient data are all smaller than the confidence coefficient threshold value, the correction result of the programming operation is unqualified.
In this embodiment, after the feature matching is performed to obtain the confidence data corresponding to each preset template category, if the confidence data greater than or equal to the confidence threshold exists, it is indicated that the current programming job to be modified is matched with the preset template category corresponding to the confidence data, and the modification result of the programming job is determined to be qualified, so that the modification result of the programming job is determined to be qualified, and specifically, the confidence threshold may be flexibly set according to the actual modification requirement and the coverage rate of the correct answer template set, which is not limited in this embodiment; if the confidence data do not exist, namely the confidence data are all smaller than the confidence threshold, the template category which is not matched with the programming operation to be corrected does not exist in the current preset template categories, at the moment, the correction result of the programming operation is determined to be unqualified, the unknown work is marked to be left for subsequent treatment, and by adopting the confidence threshold and the adjustable confidence threshold, the coverage rate of the correct answer template can be flexibly adjusted according to the correction requirement, so that whether the programming operation is correct can be judged without complete accurate matching, and the automatic correction efficiency of the programming operation is effectively improved.
In an embodiment, after the modifying result of the programming job is not qualified if the confidence data are all smaller than the confidence threshold, the method may further include:
the programming jobs with the modification results being unqualified are classified into a job set to be processed;
and clustering the job set to be processed, extracting a new correct answer template, classifying the new correct answer template into the correct answer template set, and continuing to perform feature matching until all correct answers are matched from all the programming jobs to be corrected.
In this embodiment, if the current programming job to be modified is marked as an unknown work after feature matching, the current programming job to be modified is classified into a job set to be processed, the job set to be processed is further clustered, a new correct answer template is extracted from the job set to be processed and classified into the correct answer template set, that is, although correct answers of the same job can be combined in multiple ways, the programming job to be modified may not be successfully matched with the existing correct answer template set during initial matching, but the total number of correct answers is theoretically determined, and correct answer jobs have commonality, so that different correct answer templates have certain logical relation, for example, key execution steps in different correct answer templates are the same, and the remaining execution steps have reverse orders, and so on, in this embodiment, clustering operation is performed on the unknown work according to matching results after feature matching, and obtaining new correct answer templates step by step to update the correct answer template set, further continuing to perform feature matching through the updated correct answer template set, and continuously repeating the matching, set entering and clustering processes to form a virtuous cycle of matching and clustering until all correct answer templates are obtained by clustering, so that all correct answers can be matched from all programming jobs to be corrected, and the coverage rate and the efficiency of automatic correction of the programming jobs are effectively improved.
The clustering processing is carried out on the job set to be processed, a new correct answer template is extracted and is included in a correct answer template set, and then feature matching is continuously carried out, and the method comprises the following steps:
clustering the to-be-processed operation set according to a preset clustering algorithm;
judging whether the types of the jobs to be processed meeting the preset clustering standard exist or not;
if yes, extracting a new correct answer template from the to-be-processed operation type meeting the preset clustering standard and classifying the new correct answer template into the correct answer template set;
and continuing to perform job matching on the program job to be approved through the updated correct answer template set.
In this embodiment, a clustering operation is performed on a set of to-be-processed works which cannot be successfully matched temporarily in a matching process, a clustering process is performed on the set of to-be-processed works through a preset clustering algorithm, such as a K-means (K-means) clustering algorithm, a mean shift clustering algorithm, a density-based clustering algorithm, and other clustering algorithms, because correct answer jobs have commonality, a preset clustering standard can be set according to requirements of current jobs, whether a type of to-be-processed job meeting the preset clustering standard exists in the set of to-be-processed jobs is judged during the clustering process, if so, a work closest to the preset clustering standard is extracted from the set of to serve as a new correct answer template and is included in the set of correct answer templates, and the to-be-batched programming jobs are continuously matched through the updated set of correct answer templates. Specifically, the existing correct answer template may be used as an initial clustering center, the distance between each to-be-processed job sample and each initial clustering center is calculated for each to-be-processed job sample in the to-be-processed job set, when the distance between the to-be-processed job sample and any one of the initial clustering centers is smaller than a preset distance, the to-be-processed job sample satisfying the preset clustering standard is considered to satisfy the preset clustering standard, the to-be-processed job sample satisfying the preset clustering standard is allocated to the to-be-processed job class corresponding to the initial clustering center having the smallest distance, the to-be-processed job sample closest to the initial clustering center is extracted from each to-be-processed job class as a new correct answer template, that is, the to-be-processed job class corresponds to the obtained correct answer template, which represents a job class similar to each correct answer template, and a work most similar to the corresponding correct answer template is further extracted from each to-be-processed job class as a new correct answer template, thereby obtaining a new correct answer template And updating the correct answer template set to improve the coverage rate of the correct answer template set.
That is to say, in this embodiment, after the feature matching is performed, a new correct answer template is obtained after a clustering operation is performed on the to-be-processed job set, so that the correct answer template set is updated to increase the coverage rate of the correct answer template set during the correction matching, and after the process is continuously repeated, correct answers can be gradually matched from all the to-be-corrected programming jobs, and the correct answer template set corresponding to the current job is gradually improved, so that the coverage rate and efficiency of the subsequent job correction are effectively improved.
The extracting a new correct answer template from the to-be-processed job category meeting the preset clustering standard and classifying the extracted correct answer template into the correct answer template set specifically comprises:
and extracting the clustering centers of the to-be-processed operation categories meeting the preset clustering standard, and taking the extracted clustering centers as new correct answer templates and classifying the new correct answer templates into the correct answer template set.
In the embodiment, when a new correct answer template is extracted, cluster centers of to-be-processed operation types meeting a preset cluster standard are extracted, the extracted cluster centers are used as the new correct answer template, namely, after the types are divided according to the distance between each to-be-processed operation sample and each initial cluster center according to the distance minimum principle, the to-be-processed operation types corresponding to each initial cluster center are obtained, at the moment, the cluster centers are recalculated aiming at the to-be-processed operation samples contained in each to-be-processed operation type, the average value of the distances between the to-be-processed operation samples in the to-be-processed operation types and the initial cluster centers is calculated, the to-be-processed operation sample closest to the average value is used as the cluster center of the to-be-processed operation type, and the to-be-processed operation sample used as the cluster center is the product closest to the correct answer template in the corresponding to-processed operation type, and ensuring that the operation closest to the preset clustering standard, namely the operation most meeting the requirement of the correct answer, is selected when a new correct answer template is extracted from the operation set to be processed each time, and ensuring the accuracy of the correct answer template set.
Optionally, after a new correct answer template is extracted from the to-be-processed job set each time, the new correct answer template is removed from the to-be-processed job set, so that repeated extraction in a subsequent clustering algorithm is avoided, which may cause that other correct jobs cannot be successfully extracted, and the coverage rate of the correct answer template set is affected.
Optionally, before inputting the programming operation into a preset neural network model and calculating and outputting the characteristic data of the programming operation, the method may further include:
and carrying out serialization processing on the programming operation according to a preset rule.
In this embodiment, since the graphical programming product is a building block combination formed by splicing a plurality of building block code blocks, the code data represented by each building block code block combination cannot be automatically identified, and in order to achieve automatic identification of the code data to improve subsequent matching and clustering efficiency, before performing operation matching, the to-be-modified programming operation is vectorized, the graphical programming operation is converted into an accurate digitally quantized programming operation, and further, automatic identification of the programming operation is achieved, and a reliable data base is provided for efficient and accurate automatic batch modification.
Optionally, the serializing the programming job according to a preset rule includes:
acquiring a building block code block combination in programming operation;
analyzing the building block code block combination according to a preset sequence to obtain a building block type and building block data corresponding to each building block code block;
and serializing according to the building block type and the building block data according to a preset rule to generate a corresponding serialized array.
In this embodiment, a specific serialization processing procedure is to first obtain a building block code block combination in a programming operation to be modified, as shown in fig. 2, where the programming operation to be modified is a building block code block combination formed by stacking a plurality of building block code blocks, and each building block code block is encapsulated with a code for implementing a corresponding function, such as a JavaScript code; the building block code block combinations are analyzed according to a preset sequence after being obtained, because different building block code blocks in the obtained building block code block combinations have a certain time sequence relation, the building block code block combinations are analyzed according to the preset sequence to obtain building block types and building block data corresponding to each building block code block arranged according to the preset sequence, the functions and data represented by each building block code block are obtained while the logic relation between the building block code blocks is not influenced, and then the building block types and the building block data obtained through analysis are serialized according to a preset rule to generate a serialized array corresponding to the building block code block combinations, so that the graphical building block code block combinations can be converted into quantized array forms which are easy to identify when the programming operation is automatically changed, and the automatic identification of the building block code blocks can be realized, the identification efficiency and accuracy of the building block code blocks are improved.
Specifically, the type of the building block may be one or more of a constant block, a variable block, and/or an operation block, that is, the obtained building block code block combination may include one or more of an event block, a control block, a constant block, a variable block, and an operation block, and corresponding functions are implemented by combinations of multiple different types of building code blocks, where the operation block may further include, for example, a function block, an operation block, an appearance block, a sound block, and the like, and may be specifically set according to actual needs, which is not limited in this embodiment. The block data is an input parameter on the block code block, for example, taking a control block as an example, if the current control block is "wait for 0.5 second", the block data is "0.5", and of course, when there is no input parameter in the block code block, the block data may be null, for example, a "repeatedly executed" control block, and the like.
Optionally, the works contained in the initial correct answer template set are also subjected to serialization processing and neural network model feature extraction according to a preset rule, so that visual and accurate quantitative matching can be directly performed in the subsequent operation matching process, and the matching efficiency and accuracy are effectively improved.
Optionally, parsing the building block code block combination according to a preset sequence to obtain a building block type and building block data corresponding to each building block code block, includes:
acquiring a splicing time sequence of the building block code block combination;
and analyzing each building block code block in sequence according to the splicing time sequence to obtain the building block types and building block data arranged according to the splicing time sequence.
In this embodiment, the building block code block combination in the to-be-modified programming operation is input by a user, and a specific user may directly select a packaged building block code block in a preset building block library, and perform building block code editing operations such as dragging, splicing, combining, and the like in a code editing area, so as to obtain a building block code block combination with a corresponding splicing time sequence. In a graphic programming scene, all the building block code blocks are sequentially stacked, so that a natural sequence relation exists in a time sequence, the stacking sequence during user editing input can be obtained by obtaining the splicing time sequence of the building block code block combination, then each building block code block is sequentially analyzed according to the splicing time sequence, building block types and building block data which are arranged according to the splicing time sequence are obtained, and therefore the stacked building block code blocks are sequentially subjected to function and data analysis and restoration, the condition that logic time sequence errors do not occur to functions and data corresponding to the building block code blocks during subsequent serialization processing is guaranteed, and the building block code block identification accuracy is improved.
Optionally, the generating a corresponding serialization array after serialization according to the building block type and the building block data according to a preset rule includes:
respectively converting the building block type and the building block data into corresponding coded data according to a preset coding mapping library, wherein the coding mapping library is used for storing the mapping relation between the building block type, the building block data and the coded data;
packaging the coded data according to a preset data structure to obtain a one-dimensional array corresponding to each building block code block;
and superposing the one-dimensional arrays according to a splicing time sequence to generate a two-dimensional serialized array corresponding to the building block code block combination.
In this embodiment, when performing serialization processing, sequentially encoding all the building block types and building block data arranged according to a splicing time sequence, and then respectively converting the encoded building block types and the building block data into corresponding encoded data, specifically, performing one-to-one data conversion according to a preset encoding mapping library, where the encoding mapping library stores the mapping relationship between the building block types and the encoded data, and the mapping relationship between the building block data and the encoded data, and searching the corresponding building block types and building block data in the encoding mapping library to obtain the corresponding encoded data, so as to implement convenient and fast data conversion, and then packaging the digitized encoded data according to a 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 correspondingly converted into a one-dimensional array, and after obtaining the one-dimensional array corresponding to each building block code, and then, superposing all the one-dimensional arrays according to the splicing time sequence to generate a two-dimensional serialized array, wherein the two-dimensional serialized array corresponds to the building block code block combination, has the same splicing time sequence and coded data which corresponds to the building block type and the building block data one to one, and can convert the graphical building block code block combination into quantized two-dimensional coded data, so that the vectorization processing of the graphical programming product is realized, the subsequent accurate identification and audit of the building block code are conveniently realized, and the automatic audit of the graphical programming product is favorably realized.
Optionally, before generating a corresponding serialized array after serializing according to the building block type and the building block data according to a preset rule, the method further includes:
and predefining type coding data corresponding to all the building block types and action coding data corresponding to the building block data to obtain the coding mapping library.
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, defined and stored in advance, and the encoding mapping library is obtained to implement accurate data conversion, specifically, the encoding mapping library may adopt a form of a mapping table, as shown in table 1, it shows type encoding data corresponding to some building block types, so that when subsequent serialization processing is performed, type encoding data corresponding to each building block type and motion encoding data corresponding to the building block data may be directly searched and called, and uniformity and accuracy during each serialization processing are ensured.
TABLE 1
Figure BDA0003187757480000151
Figure BDA0003187757480000161
Optionally, the first data bit of the one-dimensional array is type encoding data, and the remaining data bits are motion encoding data and/or preset null characters.
In this embodiment, the encoded data obtained by conversion is encapsulated according to a preset data structure, so that each to-be-processed building block code representing a variable, a constant or an operation is quantized into a serialized one-dimensional array in a unified data format, the data structure is as shown in table 2, the length of each row of data can be fixed to be N bits, N can meet the longest requirement according to the actual building block condition, the first bit is type encoded data, the last bits are motion encoded data, and if the data cannot be fully used, a preset vacancy character such as 0 can be used instead.
TABLE 2
Figure BDA0003187757480000162
Referring to fig. 2, a sequence process of the automatic program modification method according to the present invention is described with reference to an embodiment, as shown in fig. 2, the building block code block combination in this embodiment is repeatedly executed, next action, and waits for 0.5 second according to the splicing sequence, the corresponding building block type is repeatedly executed, acted and waited (taking seconds as a unit), the corresponding building block data is no data, action coded data corresponding to the next action and 0.5, therefore, after the coded data corresponding to the building block type and the building block data are packaged according to the preset data structure, the building block code blocks can be converted into a two-dimensional serialized array shown in the table 3 after being serialized, the conversion from imaging to digitalization is realized, the purpose of automatically identifying the graphical programming works is achieved, and accurate identification results are provided for automatic correction of the graphical programming works and the like.
TABLE 3
Figure BDA0003187757480000171
Specifically, to better understand the implementation process of the programming job automatic modification method provided by the present invention, the following describes the programming job modification process by referring to fig. 3 and 4 by way of specific application embodiments:
in this embodiment, the programming job is automatically modified into two processes, a feature calculation process shown in fig. 3 is performed first, the job to be modified is obtained and then serialized, so that the graphic programming work is converted into vector data which can be used for calculation, the serialized data is input into a VGG neural network which is trained in advance to be calculated, the feature data of the job to be modified is output, a template matching process shown in fig. 4 is performed, which is a process of iterative recursion step by step, the feature data of the job to be modified which is calculated and output before is obtained first, the feature data of the job to be modified and an existing correct answer template set are subjected to feature matching calculation to obtain a plurality of data which are the same as the number of correct answer templates, and the correct answer templates initially included in the correct answer template set are subjected to the same serialization processing and feature extraction to realize accurate matching calculation, then judging whether data which is larger than or equal to a confidence coefficient threshold exists in the plurality of confidence coefficient data, if so, marking the job to be changed into a correct answer and entering the correct answer into a correct answer template set, and if not, entering the correct answer template set into an unknown result work set; and further clustering the unknown result work set by using a K-means and other clustering algorithms, judging whether a work meeting the clustering standard exists in the result, if so, selecting a clustering center from the work set meeting the clustering standard as a new correct answer template, classifying the new template which is successfully clustered into the correct answer template set, removing the new template from the unknown result work set, continuing to perform work matching through the updated correct answer template set, repeating the matching, gathering and clustering processes, namely gradually detecting correct work from all the works, and gradually improving the correct answer template of the current work, thereby effectively improving the coverage rate and the efficiency of the matching and correction of subsequent works.
According to the method, the characteristic data of the programming operation are calculated through the neural network model, the characteristic data are matched with the correct answer template to obtain the corresponding confidence coefficient data, the confidence coefficient data obtained by deep learning training and characteristic matching are combined to carry out efficient automatic correction on the programming operation, and the efficiency of operation correction in the programming teaching process is improved.
It should be noted that, a certain order does not necessarily exist between the above steps, and those skilled in the art can understand, according to the description of the embodiments of the present invention, that in different embodiments, the above steps may have different execution orders, that is, may be executed in parallel, may also be executed interchangeably, and the like.
Another embodiment of the present invention provides an automatic modifying apparatus for programming job, as shown in fig. 5, the apparatus 1 includes:
the acquiring module 11 is used for acquiring a programming job to be corrected;
the characteristic calculation module 12 is configured to input the programming operation into a preset neural network model, and calculate and output characteristic data of the programming operation;
the matching module 13 is used for performing feature matching on the feature data of the programming operation and a correct answer template set and outputting corresponding confidence data;
and the output module 14 is used for confirming the correction result of the programming job according to the confidence coefficient data.
The obtaining module 11, the feature calculating module 12, the matching module 13, and the output module 14 are connected in sequence, and for a specific implementation, reference is made to the corresponding method embodiment described above, which is not described herein again.
Further, the feature calculation module 12 is specifically configured to:
and inputting the feature data of the programming operation into a preset matching model, and outputting confidence coefficient data between the programming operation and a preset template category, wherein the matching model is obtained by training based on all correct answer templates obtained from the correct answer template set.
Further, the automatic program job modifying apparatus further includes:
the labeling module is used for performing category labeling on all correct answer templates obtained in the correct answer template set and labeling each correct answer template as a corresponding preset template category;
the input module is used for respectively inputting each correct answer template into the neural network model and calculating and outputting the feature training data of each correct answer template;
and the training module is used for constructing the matching model and training the matching model according to the preset template categories and the characteristic training data of the correct answer templates until the matching model meets a preset convergence condition.
Further, the output module 14 is configured to:
if the confidence coefficient data which is more than or equal to the confidence coefficient threshold exists, outputting the correction result of the programming operation as qualified;
and if the confidence coefficient data are all smaller than the confidence coefficient threshold value, outputting the correction result of the programming operation as unqualified.
Further, the output module 14 further includes:
the classification unit is used for classifying the programming jobs marked as unknown works, the modification results of which are unqualified, into a job set to be processed;
and the clustering unit is used for clustering the to-be-processed job set, extracting a new correct answer template, classifying the new correct answer template into the correct answer template set, and then continuing to perform feature matching until all correct answers are matched from all to-be-corrected programming jobs.
Further, the automatic program job modifying apparatus further includes:
and the serialization module is used for carrying out serialization processing on the programming operation according to a preset rule.
Further, the serialization module comprises:
the obtaining unit is used for obtaining building block code block combinations in programming operation;
the analysis unit is used for analyzing the building block code block combination according to a preset sequence to obtain a building block type and building block data corresponding to each building block code block;
and the serialization unit is used for generating a corresponding serialization array after serialization is carried out according to the building block type and the building block data according to a preset rule.
Further, the parsing unit includes:
a time sequence obtaining subunit, configured to obtain a splicing time sequence of the building block code block combination;
and the analysis subunit is used for analyzing each building block code block in sequence according to the splicing time sequence to obtain the building block types and the building block data which are arranged according to the splicing time sequence.
Further, the serialization unit includes:
the conversion subunit is used for respectively converting the building block type and the building block data into corresponding coded data according to a preset coding mapping library, and the coding mapping library is used for storing the mapping relationship between the building block type and the building block data and the coded data;
the data packaging subunit is used for packaging the coded data according to a preset data structure to obtain a one-dimensional array corresponding to each building block code block;
and the sequence superposition subunit is used for superposing the one-dimensional arrays according to a splicing time sequence to generate a two-dimensional serialized array corresponding to the building block code block combination.
Another embodiment of the present invention provides an automatic modifying system for programming job, as shown in fig. 6, the system 10 includes:
one or more processors 110 and a memory 120, where one processor 110 is illustrated in fig. 6, the processor 110 and the memory 120 may be connected by a bus or other means, and fig. 6 illustrates a connection by a bus as an example.
Processor 110 is used to implement various control logic for system 10, which may 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, an ARM (Acorn RISC machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Also, the processor 110 may be any conventional processor, microprocessor, or state machine. Processor 110 may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP, and/or any other such configuration.
The memory 120 is a non-volatile computer-readable storage medium, and can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions corresponding to the programming job automatic modification method in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the system 10 by executing the nonvolatile software programs, instructions and units stored in the memory 120, that is, implements the program job automatic correction method in the above method embodiment.
The memory 120 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the system 10, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 120 optionally includes memory located remotely from processor 110, which may be connected to system 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more units are stored in the memory 120, which when executed by the one or more processors 110, perform the method for automatic program job modification in any of the above-described method embodiments, e.g., performing the above-described method steps S100-S400 in fig. 1.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer-executable instructions for execution by one or more processors, e.g., to perform method steps S100-S400 of fig. 1 described above.
By way of 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), which acts as external cache memory. By way of illustration and not limitation, RAM is available 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 memory of the operating environment described herein are intended to comprise one or more of these and/or any other suitable types of memory.
In summary, in the method, system and medium for automatically modifying a programming job disclosed in the present invention, the method obtains the programming job to be modified; inputting the programming operation into a preset neural network model, and calculating and outputting characteristic data of the programming operation; carrying out feature matching on the feature data of the programming operation and a correct answer template set, and outputting corresponding confidence data; and confirming the correction result of the programming job according to the confidence coefficient data. The embodiment of the invention calculates the characteristic data of the programming operation through the neural network model, obtains the corresponding confidence coefficient data after carrying out characteristic matching on the characteristic data and the correct answer template, and carries out efficient automatic correction on the programming operation by combining the confidence coefficient data obtained by deep learning training and characteristic matching, thereby improving the efficiency of operation correction in the programming teaching process.
Of course, it will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by instructing relevant hardware (such as a processor, a controller, etc.) through a computer program, which may be stored in a non-volatile computer-readable storage medium, and the computer program may include the processes of the above method embodiments when executed. The storage medium may be a memory, a magnetic disk, a floppy disk, a flash memory, an optical memory, etc.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (10)

1. An automatic correcting method for programming operation is characterized by comprising the following steps:
acquiring a programming job to be corrected;
inputting the programming operation into a preset neural network model, and calculating and outputting characteristic data of the programming operation;
performing feature matching on the feature data and a correct answer template set, and outputting corresponding confidence coefficient data;
and confirming the correction result of the programming job according to the confidence coefficient data.
2. The method according to claim 1, wherein the performing feature matching on the feature data of the programming job and the correct answer template set and outputting corresponding confidence level data comprises:
inputting the feature data of the programming operation into a preset matching model, and outputting confidence coefficient data between the programming operation and a preset template category, wherein the matching model is obtained by training based on all correct answer templates obtained from the correct answer template set.
3. The method according to claim 2, wherein before inputting the characteristic data of the programming job into the preset matching model, the method further comprises:
performing category marking on all correct answer templates obtained in the correct answer template set, and respectively 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;
and constructing the matching model, and training the matching model according to the preset template type and the feature training data of each correct answer template until the matching model meets a preset convergence condition.
4. The method of claim 2, wherein the validating the approval of the programming job based on the confidence data comprises:
if the confidence coefficient data which is greater than or equal to the confidence coefficient threshold exists, the correction result of the programming operation is qualified;
if the confidence coefficient data are all smaller than the confidence coefficient threshold value, the correction result of the programming operation is unqualified;
the programming jobs with the modification results being unqualified are classified into a job set to be processed;
and clustering the job set to be processed, extracting a new correct answer template, classifying the new correct answer template into the correct answer template set, and continuing to perform feature matching until all correct answers are matched from all the programming jobs to be corrected.
5. The method according to claim 1, wherein before inputting the programming job into a preset neural network model and calculating and outputting the characteristic data of the programming job, the method further comprises:
and carrying out serialization processing on the programming operation according to a preset rule.
6. The automatic correction method for programming jobs according to claim 5, wherein the serializing the programming jobs according to preset rules comprises:
acquiring a building block code block combination in the programming operation;
analyzing the building block code block combination according to a preset sequence to obtain a building block type and building block data corresponding to each building block code block;
and serializing according to the building block type and the building block data according to a preset rule to generate a corresponding serialized array.
7. The automatic correcting method for programming operation according to claim 6, wherein the analyzing the combination of the block code blocks according to the preset sequence to obtain the block type and the block data corresponding to each block code block comprises:
acquiring a splicing time sequence of the building block code block combination;
and analyzing each building block code block in sequence according to the splicing time sequence to obtain the building block types and building block data arranged according to the splicing time sequence.
8. The method of claim 7, wherein the generating a corresponding serialized array after serializing according to the building block type and building block data according to a predetermined rule comprises:
respectively converting the building block type and the building block data into corresponding coded data according to a preset coding mapping library, wherein the coding mapping library is used for storing the mapping relation between the building block type, the building block data and the coded data;
packaging the coded data according to a preset data structure to obtain a one-dimensional array corresponding to each building block code block;
and superposing the one-dimensional arrays according to a splicing time sequence to generate a two-dimensional serialized array corresponding to the building block code block combination.
9. An automatic program job modification system, comprising at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method for automatic program job modification according to any one of claims 1-8.
10. A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the method for automatic program job modification according to any one of claims 1-8.
CN202110866914.6A 2021-07-29 2021-07-29 Automatic correcting method, system and medium for programming operation Pending CN113793112A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110866914.6A CN113793112A (en) 2021-07-29 2021-07-29 Automatic correcting method, system and medium for programming operation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110866914.6A CN113793112A (en) 2021-07-29 2021-07-29 Automatic correcting method, system and medium for programming operation

Publications (1)

Publication Number Publication Date
CN113793112A true CN113793112A (en) 2021-12-14

Family

ID=79181453

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110866914.6A Pending CN113793112A (en) 2021-07-29 2021-07-29 Automatic correcting method, system and medium for programming operation

Country Status (1)

Country Link
CN (1) CN113793112A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110490180A (en) * 2019-07-05 2019-11-22 平安国际智慧城市科技股份有限公司 Work correction method, apparatus, storage medium and server based on image recognition
CN111680480A (en) * 2020-04-24 2020-09-18 平安国际智慧城市科技股份有限公司 Template-based job approval method and device, computer equipment and storage medium
CN111753767A (en) * 2020-06-29 2020-10-09 广东小天才科技有限公司 Method and device for automatically correcting operation, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110490180A (en) * 2019-07-05 2019-11-22 平安国际智慧城市科技股份有限公司 Work correction method, apparatus, storage medium and server based on image recognition
CN111680480A (en) * 2020-04-24 2020-09-18 平安国际智慧城市科技股份有限公司 Template-based job approval method and device, computer equipment and storage medium
CN111753767A (en) * 2020-06-29 2020-10-09 广东小天才科技有限公司 Method and device for automatically correcting operation, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US20210382937A1 (en) Image processing method and apparatus, and storage medium
WO2020078236A1 (en) Two-dimensional code generation method and apparatus, storage medium and electronic device
CN109992664B (en) Dispute focus label classification method and device, computer equipment and storage medium
US10013636B2 (en) Image object category recognition method and device
CN109635108B (en) Man-machine interaction based remote supervision entity relationship extraction method
CN111259625A (en) Intention recognition method, device, equipment and computer readable storage medium
CN105320945A (en) Image classification method and apparatus
CN111651992A (en) Named entity labeling method and device, computer equipment and storage medium
CN110647885B (en) Test paper splitting method, device, equipment and medium based on picture identification
CN112560964A (en) Method and system for training Chinese herbal medicine pest and disease identification model based on semi-supervised learning
CN112232116A (en) Facial expression recognition method and device and storage medium
US20200320440A1 (en) System and Method for Use in Training Machine Learning Utilities
CN111680480A (en) Template-based job approval method and device, computer equipment and storage medium
WO2023134447A1 (en) Data processing method and related device
CN113656547A (en) Text matching method, device, equipment and storage medium
CN114647713A (en) Knowledge graph question-answering method, device and storage medium based on virtual confrontation
CN113568965A (en) Method and device for extracting structured information, electronic equipment and storage medium
US20200349323A1 (en) Technique for generating and utilizing virtual fingerprint representing text data
US20130177247A1 (en) Method and apparatus for sequencing off-line character from natural scene
CN109101984B (en) Image identification method and device based on convolutional neural network
CN113254649A (en) Sensitive content recognition model training method, text recognition method and related device
CN112989829A (en) Named entity identification method, device, equipment and storage medium
CN113793112A (en) Automatic correcting method, system and medium for programming operation
CN113778406A (en) Programming operation correcting method, device, system and medium based on template matching
CN112749530B (en) Text encoding method, apparatus, device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination