Auxiliary programming teaching method and system based on large model

By constructing a test data set of programming code and using the first and second models to generate programming teaching related information, the problem of inaccurate answers to large language models in programming teaching is solved, and the high accuracy and high controllability of programming teaching solutions is achieved.

CN120125394APending Publication Date: 2025-06-10BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510197968.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

The prior art is difficult to effectively utilize large language models to improve the accuracy of answers in programming teaching, and large models are prone to diverting attention in long contexts, resulting in loss of core information and degradation of answering capabilities.

Method used

By building a test data set of programming code, select the first and second models, and generate information such as intelligent question review, correct code or pseudo-code based on the prompt word template. The first large model is responsible for the generation of intelligent question review information, and the second large model is responsible for the generation of correct code or pseudo-code. It continues to perform other tasks based on the output results of both to improve the accuracy and controllability of the answer.

Benefits of technology

While ensuring the basic capabilities of large models, it reduces its context burden, improves the high accuracy and controllability of task execution, reduces process costs, improves response speed, and significantly improves the accuracy of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120125394A_ABST
    Figure CN120125394A_ABST
Patent Text Reader

Abstract

The invention discloses an auxiliary programming teaching method and system based on a large model. The method comprises the steps that a programming code test data set is constructed, the large model is selected, and a cue word template is constructed; collecting a user code error correction problem and an error code, generating an intelligent review, correct code or pseudo code cue word, inputting the intelligent review cue word into the first large model to obtain intelligent review information, and inputting the correct code or pseudo code cue word into the second large model to obtain a correct code or pseudo code; generating a detailed guidance cue word, and inputting the first large model to obtain detailed guidance information; generating a key dial cue word, and inputting the key dial cue word into the first large model to obtain key dial information; and generating knowledge point cues, inputting the knowledge point cues into the first large model to obtain knowledge point information, and sequentially pushing intelligent examination questions, key dials, detailed guidance, correct codes or pseudo codes and knowledge points to the user according to user cognitive logic. The invention relates to the field of artificial intelligence, a large model can be applied to digital programming teaching, and the accuracy of the model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an auxiliary programming teaching method and system based on a large model, and relates to the field of artificial intelligence technology. Background Art

[0002] Digital education is a national key strategy. Effectively promoting the development of digital education can not only help students better master programming skills, stimulate innovative thinking, but also provide students with a personalized and efficient programming learning experience, and lower the threshold of programming learning.

[0003] In current programming teaching in large and medium-sized schools, there are two aspects of requirements:

[0004] 1. The programming foundations of students are different, and teachers need to provide support at different levels. Especially for students with weak foundations, one-on-one tutoring is more needed to help them solve various problems encountered in the programming process;

[0005] 2. Teachers' resources are very limited and they cannot pay attention to every student. At the same time, a large amount of teachers' energy is wasted on helping students find and discover some basic programming problems.

[0006] The serious mismatch between requirements and resources directly leads some students to give up seeking help from teachers and then give up programming learning, while teachers are more than willing but unable to solve the current problems.

[0007] In recent years, large language models have gradually come into the public eye. However, although the functions of large language models are powerful, they are not absolutely accurate and often have "hallucinations". It may be restricted by training data, resulting in inaccurate or misleading results when completing tasks.

[0008] Therefore, how to apply large model technology to digital programming teaching and effectively improve the accuracy of large model answers has become a key technical issue that technical personnel focus on. Summary of the Invention

[0009] In view of this, the purpose of the present invention is to provide an auxiliary programming teaching method and system based on a large model, which can apply large model technology to digital programming teaching and effectively improve the accuracy of large model answers.

[0010] To achieve the above purpose, the present invention provides an auxiliary programming teaching method based on a large model, including:

[0011] Step 1: Construct a test data set for programming code, and use the test data set to select the first large model, the second large model and construct all prompt templates;

[0012] Step 2: Collect the code correction problems and error codes input by the user, and then, based on the selected prompt template, generate the prompts for intelligent question review and the prompts for correct code or pseudo-code respectively. Then input the prompts for intelligent question review into the first large model to obtain the corresponding intelligent question review information, and at the same time input the prompts for correct code or pseudo-code into the second large model to obtain the corresponding correct code or pseudo-code information. Save the intelligent question review, and correct code or pseudo-code information output by the first and second large models;

[0013] Step 3: Based on the selected prompt template, generate the prompts for detailed guidance, and then input the prompts for detailed guidance into the first large model to obtain the corresponding detailed guidance information. Save the detailed guidance information output by the first large model;

[0014] Step 4: Based on the selected prompt template, generate the prompts for key points guidance according to the detailed guidance information obtained in Step 3, and then input the prompts for key points guidance into the first large model to obtain the corresponding key points guidance information. Save the key points guidance information output by the first large model;

[0015] Step 5: Based on the selected prompt template, generate the prompts for knowledge points, and then input the prompts for knowledge points into the first large model to obtain the corresponding knowledge point information. Save the knowledge point information output by the first large model,

[0016] While performing Steps 2 to 5, there are also:

[0017] Step A: According to the user's cognitive logic, sequentially push and display the intelligent question review, key points guidance, detailed guidance, correct code or pseudo-code, and knowledge point information to the user.

[0018] To achieve the above object, the present invention also provides an auxiliary programming teaching system based on a large model, including:

[0019] A pre-testing device for constructing a test data set for programming code and using the test data set to select the first large model, the second large model, and construct all prompt templates;

[0020] A first information device for collecting the code correction problems and error codes input by the user, and then, based on the selected prompt template, generating the prompts for intelligent question review and the prompts for correct code or pseudo-code respectively. Then input the prompts for intelligent question review into the first large model to obtain the corresponding intelligent question review information, and at the same time input the prompts for correct code or pseudo-code into the second large model to obtain the corresponding correct code or pseudo-code information. Save the intelligent question review, and correct code or pseudo-code information output by the first and second large models;

[0021] A second information device, which is used to generate a prompt for detailed guidance based on a selected prompt template, then input the prompt for detailed guidance into a first large model to obtain corresponding detailed guidance information, save the detailed guidance information, and then notify a third information device;

[0022] A third information device, which is used to generate a prompt for key points based on a selected prompt template and according to the detailed guidance information output by the second information device, then input the prompt for key points into the first large model to obtain corresponding key point information, save the key point information, and then notify a fourth information device;

[0023] A fourth information device, which is used to generate a prompt for knowledge points based on a selected prompt template, then input the prompt for knowledge points into the first large model to obtain corresponding knowledge point information, and save the knowledge point information;

[0024] An information push device, which is used to sequentially push and display intelligent question review, key point guidance, detailed guidance, correct code or pseudo-code, and knowledge point information to the user according to the user's cognitive logic.

[0025] To achieve the above object, the present invention also provides a computing device, including:

[0026] A memory and a processor;

[0027] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the auxiliary programming teaching method based on the large model are implemented.

[0028] To achieve the above object, the present invention also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the steps of the auxiliary programming teaching method based on the large model are implemented.

[0029] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention simultaneously executes the tasks of intelligent question review and correct code or pseudocode generation through the first large model and the second large model, and then uses the output results of the first large model and the second large model to continue executing other tasks. In this way, while ensuring the basic capabilities of the large model, it can reduce its context burden, ensure high precision and high controllability in task execution, significantly reduce the password consumption flowing through this link, improve the response speed, and effectively reduce the process cost. If the result of the previous step is correct, the accuracy of the answer output by the large model in the subsequent steps will be extremely high. To quantitatively compare the actual performance of the prompt words, the present invention also collects, cleans, and specifically processes the actual homework submission code data of various programming courses in colleges and universities, constructs a complete set of test data sets, and through repeated optimization, can obtain the optimal prompt word templates and large model selection schemes for different problems, thereby achieving a significant improvement in the answer accuracy rate. At the same time, it also supports flexible replacement of the test data sets, prompt words, and large model selections, and will be regularly tested according to the characteristics of the problems and the development of the large models, and the prompt word templates and model selections will be iteratively updated as needed to ensure the best use effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 is a flowchart of a large model-based auxiliary programming teaching method shown in an exemplary embodiment of the present invention.

[0031] Figure 2 is shown in an exemplary embodiment of the present invention Figure 1 specific step flowchart of step A.

[0032] Figure 3 is a schematic structural diagram of a large model-based auxiliary programming teaching system shown in an exemplary embodiment of the present invention.

[0033] Figure 4 is a schematic structural diagram of a computer device shown in an exemplary embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0034] The present invention will be further described in detail below in conjunction with the accompanying drawings through specific embodiments. Similar elements in different embodiments are denoted by related similar element numbers. In the following embodiments, many detailed descriptions are provided to enable a better understanding of the present application. However, those skilled in the art can easily recognize that some of the features can be omitted in different situations, or can be replaced by other elements, materials, or methods. In some cases, some operations related to the present application are not shown or described in the specification, which is to avoid overwhelming the core part of the present application with excessive descriptions. For those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations based on the descriptions in the specification and the general technical knowledge in the art.

[0035] In addition, the features, operations, or characteristics described in the specification can be combined in any appropriate manner to form various embodiments. At the same time, the steps or actions in the method description can also be reordered or adjusted in an obvious manner by those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for clearly describing a certain embodiment and do not mean a necessary sequence, unless it is stated that a certain sequence must be followed.

[0036] The serial numbers assigned to the components herein, such as "first", "second", "third", "fourth", etc., are only used to distinguish the described objects and do not have any sequential or technical meaning. The terms "connected" and "coupled" used in the present application, unless otherwise specified, both include direct and indirect connections (couplings).

[0037] The technical solutions provided by the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.

[0038] It should be noted that although large models are powerful, they are not absolutely accurate and often have "hallucinations". They may be restricted by training data, resulting in inaccurate or misleading answers. To solve this problem, the present invention uses a large language model to generate answer information step by step, thereby assisting in solving programming Q&A problems. Since it involves multiple information inputs such as the code to be processed, problem descriptions, static analysis feedback, etc., the code to be processed is often very long and contains a lot of irrelevant content. The key error points usually cannot be directly logically deduced by combining the problem description and are often hidden among several or even several lines of characters. And the ability to detect them generally directly determines the key capabilities of the product, which leads to the problem of uneven information density and weight in the context. It has been proven by practice that large models are extremely prone to attention shift when facing long contexts, resulting in the loss of core information and the decline of key capabilities. In practical applications, it is also necessary to consider that the capabilities and specializations of basic large models vary, and their correctness, return speed, etc. for answering code-related questions are also different. Therefore, the present invention simultaneously executes the core tasks that determine the overall accuracy rate and require high capabilities, namely intelligent question review and the generation task of correct code or pseudocode, through the first large model and the second large model, and then uses the output results of the first large model and the second large model to continue to execute other tasks (obtaining key point prompts, detailed guidance, knowledge points, etc.). In the specific process, the second large model directly generates correct code or pseudocode according to the given target function description and error code. While ensuring the basic capabilities of the large model, it can not only reduce its context burden, ensure the high accuracy and high controllability of its task execution, but also greatly reduce the password consumption flowing through this link, improve the response speed, and effectively reduce the process cost; at the same time, the first large model directly generates intelligent question review information, and then continues to calculate the detailed guidance, key point prompts and knowledge points of this problem according to the correct code or pseudocode information output by the second large model. The ability requirement for this step model is relatively low. If the result of the previous step is correct, the accuracy rate of the answer output by the large model in the subsequent steps will be extremely high.

[0039] As Figure 1 shown, an auxiliary programming teaching method based on a large model according to the present invention includes:

[0040] Step 1: Construct a test data set for programming code, and use the test data set to select the first large model, the second large model, and construct all prompt templates;

[0041] Step 2: Collect the code correction problems and error codes input by the user, and then, based on the selected prompt template, generate the prompts for intelligent question review and the prompts for correct code or pseudo-code respectively. Then input the prompts for intelligent question review into the first large model to obtain the corresponding intelligent question review information, and at the same time input the prompts for correct code or pseudo-code into the second large model to obtain the corresponding correct code or pseudo-code information. Save the intelligent question review, and correct code or pseudo-code information output by the first and second large models;

[0042] The correct code or pseudo-code can be selected and set by the teacher according to actual business needs;

[0043] Step 3: Based on the selected prompt template, generate the prompts for detailed guidance, and then input the prompts for detailed guidance into the first large model to obtain the corresponding detailed guidance information. Save the detailed guidance information output by the first large model;

[0044] Step 4: Based on the selected prompt template, generate the prompts for key points guidance according to the detailed guidance information obtained in Step 3, and then input the prompts for key points guidance into the first large model to obtain the corresponding key points guidance information. Save the key points guidance information output by the first large model;

[0045] Step 5: Based on the selected prompt template, generate the prompts for knowledge points, and then input the prompts for knowledge points into the first large model to obtain the corresponding knowledge point information. Save the knowledge point information output by the first large model,

[0046] While performing Steps 2 to 5, there are also:

[0047] Step A: Push and display the intelligent question review, key points guidance, detailed guidance, correct code or pseudo-code, and knowledge point information to the user according to the user's cognitive logic.

[0048] The first large model and the second large model in the present invention can be the same or different, and are scheduled according to the best principle. For example, the first large model is a basic large model with strong capabilities, but high costs and slow response speeds, and the second large model is a large model with weak capabilities, but low costs and fast response speeds, so as to achieve the best balance among accuracy, cost, and response time.

[0049] For the convenience of technicians' understanding, the intelligent question review, key points guidance, detailed guidance, correct code or pseudo-code, and knowledge points in the present invention are respectively explained:

[0050] 1. Intelligent problem review analyzes and interprets the user's questions and error codes overall. For example, it reads the questions, points out the intention of the code, and the general solution ideas for this type of problem. For example, the intention of this code is to sort an array from smallest to largest through the bubble sort algorithm. At this step, only interpretation is done, without picking out or correcting mistakes. If the user still doesn't understand, they can choose to display "Key Point Hints".

[0051] 2. Key Point Hints macroscopically point out what mistakes there are in the user's code, requiring all mistakes to be covered, but very macroscopically, just touching on the surface, so that students can discover specific mistakes by themselves. For example: there is a problem with the use of pointers / array subscript out of bounds / confusing the concepts of assignment and comparison / an infinite loop appears, etc. If the user still doesn't understand, they can choose to display "Detailed Guidance".

[0052] 3. Detailed Guidance points out what mistakes exist in the specific code, requiring all mistakes to be covered. For example, at a certain place, == should be used, but = is wrongly used / at a certain place, it should be i++, instead of ++i / at a certain place, a while loop should be used, instead of a for loop. If the user still doesn't understand, they can choose to display "Correct Code or Pseudocode".

[0053] 4. Correct Code or Pseudocode is the correct code or pseudocode output by the large model after modifying the error code. Students can also choose to view the comparison of the code before and after modification, with the different content highlighted. At the same time, they can also, according to actual needs, only display the pseudocode.

[0054] 5. Knowledge Points summarize and generalize the knowledge points involved in the user's question. After students click, they can directly view the summary of the knowledge points. If they think there are deficiencies in knowledge learning, they can continue to view the detailed knowledge graph, and further can enter the school's intelligent courses for learning through links.

[0055] All the prompt word templates of the present invention can further include: the prompt word template for intelligent problem review, the prompt word template for correct code or pseudocode, the prompt word template for detailed guidance, the prompt word template for key point hints, and the prompt word template for knowledge points. In this way:

[0056] In step two, based on the prompt word template for intelligent problem review and the prompt word template for correct code or pseudocode respectively, the code correction problem input by the user and the error code are constructed and generated into the prompt word for intelligent problem review and the prompt word for correct code or pseudocode.

[0057] In step three, according to the prompt word template for detailed guidance, the code correction problem input by the user, the error code, and the correct code or pseudocode information are constructed and generated into the prompt word for detailed guidance.

[0058] In step 4, according to the prompt word template of key point guidance, generate the prompt word of key point guidance by constructing the code correction problem input by the user, error code, correct code or pseudo-code information, and detailed guidance information.

[0059] In step 5, according to the prompt word template of knowledge points, generate the prompt word of knowledge points by constructing the code correction problem input by the user, error code, and correct code or pseudo-code information.

[0060] While generating step-by-step answer information for the user through the first and second large models in steps 2 to 5, as an optional implementation method, in step A, according to the user's cognitive logic, the order of information pushed and displayed to the user can be as follows: a. Intelligent question review -> b. Key point guidance -> c. Detailed guidance -> d. Correct code or pseudo-code -> e. Knowledge points (teaching resources can be linked). As Figure 2 shown, step A can further include:

[0061] Step A1: Extract the saved intelligent question review information and push and display it to the user.

[0062] Step A2: Detect whether the user performs a specified operation on the key point guidance information. If so, extract the saved key point guidance information and push and display it to the user, and then continue to the next step; if not, end this process.

[0063] The user's specified operation on the key point guidance information can be to click the "Need key point guidance" button on the interaction interface.

[0064] Step A3: Detect whether the user performs a specified operation on the detailed guidance information. If so, extract the saved detailed guidance information and push and display it to the user, and then continue to the next step; if not, end this process.

[0065] The user's specified operation on the detailed guidance information can be to click the "Need detailed guidance" button on the interaction interface.

[0066] Step A4: Detect whether the user performs a specified operation on the correct code or pseudo-code information. If so, extract the saved correct code or pseudo-code information and push and display it to the user, and then continue to the next step; if not, end this process.

[0067] The user's specified operation on the correct code or pseudo-code information can be to click the "Need correct code or pseudo-code" button on the interaction interface. Step A4 can also set a timer, and when the timer reaches a certain time, push the correct code or pseudo-code information to the user, so as to require the user to think for X seconds before showing the correct code or pseudo-code to them.

[0068] Step A5: Detect whether the user performs a specified operation on the knowledge point information. If so, extract the saved knowledge point information, push and display it to the user, and end this process; if not, end this process.

[0069] The user's specified operation on the knowledge point information can be clicking the "Need Knowledge Points" button on the interaction interface.

[0070] To ensure the correctness of the content returned by the large model, the present invention also designs different prompt templates for different problem categories, and in the process of designing the prompts, adopts a method of quantitatively analyzing and enhancing based on the data set to effectively guarantee the positive effect of the prompts.

[0071] Currently, in fields such as code generation, there are widely recognized general data sets such as HumanEval, which contain a description of the problem and a verification set for verifying whether the generated code is correct. However, in the field of code repair, compared with the code generation task, in the context of the code repair task, it is necessary to provide code containing errors. Different from the situation of simply giving prompts, practice shows that once error code is given, some large language models are difficult to identify error fragments, easily leading to instances of over-generation or random modification, which indicates that the code generation ability of the large model is not completely equivalent to its problem correction ability. Due to the problem of the operation transparency of the large language model, its internal mechanism is not yet clear, but it is completely feasible and persuasive to conduct black-box verification on its performance. And a data set containing error code and widely recognized in the relevant field has not appeared yet. To quantitatively compare the actual performance of the prompts, the present invention constructs a complete test data set by collecting, cleaning, and specifically processing the actual homework submission code data of various programming courses in colleges and universities. Further as an optional implementation manner, step one can further include:

[0072] Step 11: Obtain a number of homework question data from various programming languages and programming courses from colleges and universities. The homework question data can include question descriptions, submission situations, combinations of correct and incorrect codes actually submitted by users for this question, and corresponding groups of test input and output use cases for the questions, etc., and group and clean them according to the programming languages to remove interfering or contaminated data, and then perform random screening to form a test data set for programming code;

[0073] For example, the homework question data can be obtained from the online program evaluation system of colleges and universities. After step 11, the generated data set includes ten groups of experimental exercises, each group containing a problem description, corresponding test cases, correct source code, and an incorrect code version, and has specific descriptions and records of knowledge point situations, etc.;

[0074] Step 12: Select multiple large models and construct multiple prompt templates, and select multiple test sample data from the test dataset. Then, for each test sample data, generate corresponding prompts based on the error code and the target function description in the test sample data using different prompt templates. Next, input the prompts into different large models to obtain their respective corresponding corrected codes. Finally, compare the corrected codes obtained based on different prompt templates and large models with the target function codes of the test sample data to select the corresponding large model and prompt template. Here, the target function description is a text segment that describes the specific function that the program is expected to execute without errors, representing the correct behavior expected of the program. The error code is a version of the correct code that contains one or more errors, such as syntax errors, logical errors, or other problems that prevent the code from functioning properly.

[0075] In step 12, comparing the corrected codes and the target function codes obtained based on different prompt templates and large models may further include:

[0076] Step 121: Compare the corrected code with the target function code to determine whether the corrected code implements the same function as the target function code, and check the correctness of the corrected code and whether it complies with the coding standards. A program online evaluation system or an equivalent automatic code evaluation tool can be used.

[0077] Step 122: Send the corrected code and the target function code to the compiler for compilation and execution respectively, and check whether the execution results are consistent.

[0078] Through repeated tuning, the optimal prompt template and large model selection scheme for different problems can be obtained, achieving a significant improvement in the answer accuracy rate. At the same time, it also supports flexible replacement of the test dataset, prompts, and large model selection. It can be periodically tested according to the characteristics of the problem and the development of large models, and the prompt template and model selection can be iteratively updated as needed to ensure the best use effect.

[0079] As Figure 3 shown, an assisted programming teaching system based on a large model according to the present invention includes:

[0080] A pre-testing device for constructing a test dataset of programming codes and using the test dataset to select a first large model, a second large model, and construct all prompt templates;

[0081] The first information device is used to collect the code correction problems and error codes input by the user, and then based on the selected prompt word templates, generate the prompt words for intelligent question review and the prompt words for correct code or pseudo-code respectively. Then, the prompt words for intelligent question review are input into the first large model to obtain the corresponding intelligent question review information, and at the same time, the prompt words for correct code or pseudo-code are input into the second large model to obtain the corresponding correct code or pseudo-code information, and save the intelligent question review and correct code or pseudo-code information output by the first and second large models;

[0082] The second information device is used to generate the prompt words for detailed guidance based on the selected prompt word templates, and then input the prompt words for detailed guidance into the first large model to obtain the corresponding detailed guidance information, save the detailed guidance information, and then notify the third information device;

[0083] The third information device is used to generate the prompt words for key points based on the selected prompt word templates and according to the detailed guidance information output by the second information device, and then input the prompt words for key points into the first large model to obtain the corresponding key point information, save the key point information, and then notify the fourth information device;

[0084] The fourth information device is used to generate the prompt words for knowledge points based on the selected prompt word templates, and then input the prompt words for knowledge points into the first large model to obtain the corresponding knowledge point information, and save the knowledge point information;

[0085] The information push device is used to push and display the intelligent question review, key point guidance, detailed guidance, correct code or pseudo-code, and knowledge point information to the user according to the user's cognitive logic.

[0086] The first large model and the second large model in the present invention may be the same or different, and are scheduled according to the best principle.

[0087] Further as an optional implementation manner, all the prompt word templates of the present invention may include: the prompt word template for intelligent question review, the prompt word template for correct code or pseudo-code, the prompt word template for detailed guidance, the prompt word template for key point guidance, and the prompt word template for knowledge points, so that:

[0088] The first information device respectively constructs and generates the prompt words for intelligent question review and the prompt words for correct code or pseudo-code based on the prompt word template for intelligent question review and the prompt word template for correct code or pseudo-code from the code correction problems and error codes input by the user,

[0089] The second information device constructs and generates the prompt words for detailed guidance according to the prompt word template for detailed guidance from the code correction problems and error codes input by the user and the correct code or pseudo-code information,

[0090] The third information device constructs a prompt word for key points according to the prompt word template for key points, using the code correction problem, error code, correct code or pseudo-code information, and detailed guidance information input by the user.

[0091] The fourth information device constructs a prompt word for knowledge points according to the prompt word template for knowledge points, using the code correction problem, error code, correct code or pseudo-code information input by the user.

[0092] Furthermore, as an optional implementation, the order of the information sequentially pushed and displayed to the user by the information push device can be as follows: a. Intelligent question review -> b. Key point prompt -> c. Detailed guidance -> d. Correct code or pseudo-code -> e. Knowledge points. The information push device further includes:

[0093] An intelligent question review push unit, which is used to extract the saved intelligent question review information, push and display it to the user, and then notify the key point prompt push unit;

[0094] A key point prompt push unit, which is used to detect whether the user performs a specified operation on the key point prompt information. If so, it extracts the saved key point prompt information, pushes and displays it to the user, and then notify the detailed guidance push unit;

[0095] A detailed guidance push unit, which is used to detect whether the user performs a specified operation on the detailed guidance information. If so, it extracts the saved detailed guidance information, pushes and displays it to the user, and then notify the correct code or pseudo-code push unit;

[0096] A correct code or pseudo-code push unit, which is used to detect whether the user performs a specified operation on the correct code or pseudo-code information. If so, it extracts the saved correct code or pseudo-code information, pushes and displays it to the user, and then notify the knowledge point push unit;

[0097] A knowledge point push unit, which is used to detect whether the user performs a specified operation on the knowledge point information. If so, it extracts the saved knowledge point information, pushes and displays it to the user.

[0098] Furthermore, as an optional implementation, the correct code or pseudo-code push unit also sets a timer, and pushes the correct code or pseudo-code information to the user after the timer reaches a certain time.

[0099] Furthermore, as an optional implementation, the pre-test device may further include:

[0100] The test dataset unit obtains a number of assignment question data from various programming languages and programming courses in colleges and universities. The assignment question data may include question descriptions, submission situations, combinations of correct and incorrect codes actually submitted by users for this question, various groups of test input and output cases corresponding to the questions, etc. It is grouped and cleaned according to programming languages to remove interfering or contaminated data, and then randomly screened to form a test dataset for programming codes;

[0101] The model and prompt selection unit selects multiple large models and constructs multiple prompt templates, and selects multiple test sample data from the test dataset. Then, for each test sample data, corresponding prompts are generated by constructing the incorrect code and the target function description based on different prompt templates. Next, the prompts are input into different large models to obtain their respective corresponding corrected codes. Finally, the corrected codes obtained based on different prompt templates and large models are compared with the target function codes of the test sample data to select the corresponding large models and prompt templates.

[0102] Among them, the model and prompt selection unit further includes:

[0103] The code evaluation component compares the obtained corrected code with the target function code, determines whether the corrected code realizes the same function as the target function code, and checks the correctness of the corrected code and whether it conforms to the coding standard;

[0104] The code running component sends the obtained corrected code and the target function code into the compiler for compilation and running respectively, and checks whether the running results are consistent.

[0105] See Figure 4 , Figure 4 is a structural block diagram of a computing device 400 shown in an exemplary embodiment of this specification. The components of the computing device 400 include but are not limited to a memory 410 and a processor 420. The processor 420 is connected to the memory 410 through a bus 430, and the database 450 is used to store data.

[0106] The computing device 400 further includes an access device 440, which enables the computing device 400 to communicate via one or more networks 460. Examples of such networks include the Public Switched Telephone Network (PSTN), local area network (LAN), wide area network (WAN), personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of wired or wireless network interfaces (e.g., network interface card (NIC)), such as IEEE 802.11 wireless local area network (WLAN) wireless interface, Worldwide Interoperability for Microwave Access (WiMAX) interface, Ethernet interface, Universal Serial Bus (USB) interface, cellular network interface, Bluetooth interface, Near Field Communication (NFC) interface, and so on.

[0107] In one embodiment of the present specification, the above components of the computing device 400 and Figure 4 other components not shown may also be connected to each other, for example, via a bus. It should be understood that Figure 4 the block diagram of the computing device shown is for illustrative purposes only and is not a limitation on the scope of the present specification. Those skilled in the art can add or replace other components as needed.

[0108] The computing device 400 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 400 can also be a mobile or stationary server or cloud server, etc.

[0109] The processor 420 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-described large model-based assisted programming teaching method.

[0110] The above is a schematic solution of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above-mentioned large model-based assisted programming teaching method belong to the same concept. For the details not described in detail in the technical solution of the computing device, reference can be made to the description of the technical solution of the above-mentioned large model-based assisted programming teaching method.

[0111] An embodiment of this specification also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the steps of the above-mentioned large model-based assisted programming teaching method are implemented.

[0112] The above is a schematic solution of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the above-mentioned large model-based assisted programming teaching method belong to the same concept. For the details not described in detail in the technical solution of the storage medium, reference can be made to the description of the technical solution of the above-mentioned large model-based assisted programming teaching method or system.

[0113] An embodiment of this specification also provides a computer program. When the computer program is executed on a computer, the computer is made to execute the steps of the above-mentioned large model-based assisted programming teaching method.

[0114] The above is a schematic solution of a computer program according to this embodiment. It should be noted that the technical solution of this computer program and the technical solution of the above-mentioned large model-based assisted programming teaching method belong to the same concept. For the details not described in detail in the technical solution of the computer program, reference can be made to the description of the technical solution of the above-mentioned large model-based assisted programming teaching method or system.

[0115] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0116] The computer instructions include computer program code, which may be in the form of source code, object code, executable files, or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0117] The foregoing is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A large model-based auxiliary programming teaching method, characterized in that: Included are: Step 1: construct a test data set of programming codes, and use the test data set to select the first largest model, the second largest model, and construct all prompt word templates; Step 2: Collect the code error correction questions and error codes input by the user, and then generate prompt words for intelligent question review and prompt words for correct code or pseudo code based on the selected prompt word template, and then input the prompt words for intelligent question review into the first large model to obtain corresponding intelligent question review information, and at the same time input the prompt words for correct code or pseudo code into the second large model to obtain corresponding correct code or pseudo code information, and save the intelligent question review and correct code or pseudo code information output by the first and second large models; Step 3: Generate prompt words for detailed guidance based on the selected prompt word template, then input the prompt words for detailed guidance into the first large model to obtain corresponding detailed guidance information, and save the detailed guidance information output by the first large model; Step 4: Based on the selected prompt word template, generate prompt words for key points according to the detailed guidance information obtained in step 3, then input the prompt words for key points into the first large model to obtain corresponding key point information, and save the key point information output by the first large model; Step 5: Generate prompt words for knowledge points based on the selected prompt word template, then input the prompt words for knowledge points into the first large model to obtain corresponding knowledge point information, and save the knowledge point information output by the first large model. While executing steps 2 to 5, you must also: Step A: According to the user's cognitive logic, intelligent question review, key points, detailed guidance, correct code or pseudocode, and knowledge point information are pushed and displayed to the user in sequence.

2. The method according to claim 1, characterized in that The prompt word templates include: prompt word templates for intelligent question review, prompt word templates for correct code or pseudo code, prompt word templates for detailed guidance, prompt word templates for key points, and prompt word templates for knowledge points. In step 2, based on the prompt word template of intelligent question review and the prompt word template of correct code or pseudo code, the code error correction question and the error code input by the user are constructed to generate prompt words for intelligent question review and prompt words for correct code or pseudo code. In step 3, according to the prompt word template of detailed guidance, the code correction question and the error code, correct code or pseudo code information input by the user are constructed to generate prompt words of detailed guidance. In step 4, according to the prompt word template of the key point, the code correction question and error code, correct code or pseudo code information, and detailed guidance information entered by the user are constructed to generate the prompt word of the key point. In step 5, according to the prompt word template of the knowledge point, the code correction question and the error code, correct code or pseudo code information input by the user are constructed to generate the prompt word of the knowledge point.

3. The method according to claim 1, characterized in that In step A, according to the user's cognitive logic, the order of information pushed and displayed to the user is as follows: a. Intelligent question review -> b. Key points -> c. Detailed guidance -> d. Correct code or pseudocode -> e. Knowledge points. Step A further comprises: Step A1, extracting the saved intelligent question review information, and pushing and displaying it to the user; Step A2: Detect whether the user performs a specified operation on the key information. If yes, extract the saved key information, push and display it to the user, and then proceed to the next step; if no, this process ends; Step A3: Detect whether the user performs a specified operation on the detailed guidance information. If yes, extract the saved detailed guidance information, push and display it to the user, and then proceed to the next step; if no, this process ends; Step A4: Detect whether the user performs a specified operation on the correct code or pseudo code information. If yes, extract the saved correct code or pseudo code information, push and display it to the user, and then proceed to the next step; if no, this process ends; Step A5: Detect whether the user performs a specified operation on the knowledge point information. If yes, extract the saved knowledge point information, push and display it to the user, and this process ends; if no, this process ends.

4. The method according to claim 3, characterized in that Step A4 sets a timer, and when the timer reaches a certain time, the correct code or pseudo code information is pushed to the user.

5. The method according to claim 1, characterized in that Step 1 includes: Step 11: Obtain a number of homework data from various programming languages ​​and programming courses from colleges and universities. The homework data includes the description of the topic, submission status, the combination of correct code and incorrect code actually submitted by users for this topic, and each group of test input and output use cases corresponding to the topic. The data is grouped and cleaned according to the programming language to remove interference or contaminated data, and then randomly screened to form a test data set for the programming code; Step 12: Select multiple large models and construct multiple prompt word templates, select multiple test sample data from the test data set, and then construct corresponding prompt words based on different prompt word templates based on the error code and target function description in each test sample data, and then input the prompt words into different large models to obtain their corresponding correction codes. Finally, compare the correction codes obtained based on different prompt word templates and large models with the target function code of the test sample data to select the corresponding large model and prompt word template. In step 12, the correction codes obtained based on different prompt word templates and the large model are compared with the target function code, which further includes: Step 121, compare the correction code with the target function code, determine whether the correction code implements the same function as the target function code, and check whether the correctness of the correction code meets the coding standard; Step 122: Send the correction code and the target function code to the compiler for compilation and execution respectively, and check whether the execution results are consistent.

6. A large model-based auxiliary programming teaching system, characterized in that: Included are: A pre-testing device, used to construct a test data set of programming codes, and use the test data set to select a first large model, a second large model and construct all prompt word templates; The first information device is used to collect the code error correction problem and the error code input by the user, and then generate the prompt words of the intelligent question review and the prompt words of the correct code or pseudo code respectively based on the selected prompt word template, and then input the prompt words of the intelligent question review into the first large model to obtain the corresponding intelligent question review information, and at the same time input the prompt words of the correct code or pseudo code into the second large model to obtain the corresponding correct code or pseudo code information, and save the intelligent question review and the correct code or pseudo code information output by the first and second large models; The second information device is used to generate prompt words for detailed guidance based on the selected prompt word template, and then input the prompt words for detailed guidance into the first large model to obtain corresponding detailed guidance information, save the detailed guidance information, and then notify the third information device; The third information device is used to generate a key prompt word based on the selected prompt word template and the detailed guidance information output by the second information device, and then input the key prompt word into the first large model to obtain corresponding key prompt information, save the key prompt information, and then notify the fourth information device; The fourth information device is used to generate a prompt word for a knowledge point based on the selected prompt word template, and then input the prompt word for the knowledge point into the first large model to obtain corresponding knowledge point information, and save the knowledge point information; The information push device is used to push and display intelligent question review, key points, detailed guidance, correct code or pseudocode, and knowledge point information to the user in sequence according to the user's cognitive logic.

7. The system according to claim 6, characterized in that The prompt word templates include: prompt word templates for intelligent question review, prompt word templates for correct code or pseudo code, prompt word templates for detailed guidance, prompt word templates for key points, and prompt word templates for knowledge points, so that: The first information device generates prompt words for intelligent question review and prompt words for correct code or pseudo code based on the prompt word template for intelligent question review and the prompt word template for correct code or pseudo code respectively, The second information device constructs a prompt word for detailed guidance based on the prompt word template of detailed guidance from the code correction question and the error code, correct code or pseudo code information input by the user. The third information device generates a prompt word for key points based on the prompt word template of the key points, by constructing the code correction question and error code, correct code or pseudo code information, and detailed guidance information input by the user. The fourth information device constructs a prompt word for the knowledge point based on the prompt word template of the knowledge point, using the code correction question and the error code, correct code or pseudocode information input by the user.

8. The system according to claim 6, characterized in that The information push device pushes and displays information to the user in the following order: a. Intelligent question review -> b. Key points -> c. Detailed guidance -> d. Correct code or pseudo code -> e. Knowledge points, The information push device further includes: The intelligent question review push unit is used to extract the saved intelligent question review information, push and display it to the user, and then notify the key point push unit; The key point push unit is used to detect whether the user performs a specified operation on the key point information. If yes, the saved key point information is extracted, pushed and displayed to the user, and then the detailed guidance push unit is notified; A detailed guidance push unit, used to detect whether the user performs a specified operation on the detailed guidance information, and if so, extract the saved detailed guidance information, push and display it to the user, and then notify the correct code or pseudo code push unit; The correct code or pseudo code push unit is used to detect whether the user performs a specified operation on the correct code or pseudo code information. If yes, the saved correct code or pseudo code information is extracted, pushed and displayed to the user, and then the knowledge point push unit is notified; The knowledge point push unit is used to detect whether the user performs a specified operation on the knowledge point information. If so, the saved knowledge point information is extracted and pushed and displayed to the user.

9. The system according to claim 8, characterized in that The correct code or pseudo code push unit sets a timer, and pushes the correct code or pseudo code information to the user when the timer reaches a certain time.

10. The system according to claim 6, characterized in that The pre-test device includes: The test data set unit obtains several homework data from various programming languages ​​and programming courses from colleges and universities. The homework data includes the description of the topic, submission status, the combination of correct code and incorrect code actually submitted by users for this topic, and each group of test input and output use cases corresponding to the topic. The data is grouped and cleaned according to the programming language to remove interference or contaminated data, and then randomly screened to form a test data set for programming codes. The model and prompt word selection unit selects multiple large models and constructs multiple prompt word templates, selects multiple test sample data from the test data set, and then generates corresponding prompt words based on different prompt word templates for the error code and target function description in each test sample data, and then inputs the prompt words into different large models to obtain the corresponding correction codes, and finally compares the correction codes obtained based on different prompt word templates and large models with the target function code of the test sample data to select the corresponding large model and prompt word template. Wherein, the model and prompt word selection unit further includes: A code evaluation component compares the obtained correction code with the target function code to determine whether the correction code implements the same function as the target function code, and checks whether the correctness of the correction code complies with the coding standard; The code running component sends the obtained correction code and target function code to the compiler for compilation and running respectively, and checks whether the running results are consistent.

11. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the large model-based auxiliary programming teaching method described in any one of claims 1 to 5 are implemented.

12. A computer-readable storage medium, characterized in that: It stores computer executable instructions, which, when executed by a processor, implement the steps of the large model-based auxiliary programming teaching method described in any one of claims 1 to 5.

Citation Information

Cited By

  • Programming learning diagnosis method and system based on double-engine verification

    CN121478247A

  • Dynamic knowledge graph driven personalized learning path generation method and system

    CN121480660A

  • Multi-agent collaborative education decision-making system and method

    CN121481806A