A program code processing method, apparatus, device, medium, and product

By combining a code content verification model with a multi-verification model, the problem of low efficiency and unreliable results in identifying error locations in target code text during coding education for teenagers is solved, achieving efficient and accurate error feedback.

CN122220197APending Publication Date: 2026-06-16BEIJING SIMING QICHUANG TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING SIMING QICHUANG TECH CO LTD
Filing Date
2026-03-10
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

In teaching coding to teenagers, existing models struggle to efficiently and accurately identify error locations in target code text, and the feedback results are unreliable and incomplete.

Method used

By constructing a code content verification model, the target code text is compared with the standard code text, and a code content feedback text is generated. The feedback text is determined within a preset time to improve recognition efficiency and accuracy. Multiple verification models are used to complement each other to ensure the reliability and comprehensiveness of the feedback.

🎯Benefits of technology

This improved the model's efficiency and accuracy in identifying error locations in target code text, ensured the reliability and comprehensiveness of feedback results, and reduced resource consumption and processing delays.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122220197A_ABST
    Figure CN122220197A_ABST
Patent Text Reader

Abstract

A program code processing method, device, equipment, medium and product are disclosed. The method comprises: determining target code text of target program code and its corresponding standard code text according to a processing request for the target program code; obtaining code content feedback text of the target code text of the code content checking model according to the standard code text and the target code text, based on a code content checking model; if it is determined that the generation time of the code content feedback text meets the preset text feedback time condition of the content feedback text, the code content feedback text is determined as the target content feedback text of the target code text of the code content checking model; and generating a processing result of the target program code according to the target content feedback text. The embodiment improves the efficiency and accuracy of the model in identifying the error position in the target code text, and improves the reliability and comprehensiveness of the model in providing error feedback for the target program code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a program code processing method, apparatus, device, medium, and product. Background Technology

[0002] With the rapid development of computing technology, all industries are gradually realizing digital transformation, making coding for teenagers an indispensable part of children's education. Comparing the target code text (student's answer text) with the standard code text (standard answer text) to identify errors in the target code and corresponding modification suggestions is an essential step in teaching coding to teenagers.

[0003] Currently, in the process of teaching coding to teenagers, most of the time teachers manually review the target code. However, this method is not only labor-intensive and inefficient, but also requires constant teacher involvement, making it impossible to provide timely guidance on problems. While using large models, such as abstract syntax trees, to compare target code text with standard code text can provide a more professional and academic description of the target code text, it is not suitable for teaching coding to teenagers. This is because the teaching of coding to teenagers does not require learning information such as code structure and complexity, and the syntax tree only performs in-depth analysis of code structure without focusing on the specific error locations in the target code text. This makes the model's output highly unpredictable, thus failing to provide significant assistance to teaching coding to teenagers.

[0004] Therefore, in the process of teaching coding to teenagers, how to improve the efficiency and accuracy of the model in identifying error locations in the target code text, and ensure the reliability and comprehensiveness of the model's feedback results, has become an urgent problem to be solved by those skilled in the art. Summary of the Invention

[0005] This invention provides a program code processing method, apparatus, device, medium, and product to improve the efficiency and accuracy of the model in identifying error locations in target code text, and to enhance the reliability and comprehensiveness of the model in providing error feedback to the target program code.

[0006] According to one aspect of the present invention, a program code processing method is provided, comprising: Based on the processing request for the target program code, determine the target program code text and its corresponding standard code text; Based on the standard code text and the target code text, and using the code content verification model, the code content feedback text of the code content verification model to the target code text is obtained; If it is determined that the generation time of the code content feedback text meets the preset text feedback time condition of the content feedback text, then the code content feedback text is determined as the target content feedback text of the code content verification model for the target code text; Based on the target content feedback text, the processing result of the target program code is generated.

[0007] According to another aspect of the present invention, a program code processing apparatus is provided, comprising: The code text acquisition module is used to determine the target code text of the target program code and its corresponding standard code text based on the processing request for the target program code; The feedback text generation module is used to obtain the code content feedback text of the code content verification model for the target code text based on the standard code text and the target code text and the code content verification model. The target feedback text determination module is used to determine the code content feedback text as the target content feedback text of the code content verification model for the target code text if the generation time of the code content feedback text meets the preset text feedback time condition of the content feedback text. The processing result generation module is used to generate the processing result of the target program code based on the target content feedback text.

[0008] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: at least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the program code processing method according to any embodiment of the present invention.

[0009] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the program code processing method described in any embodiment of the present invention.

[0010] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the program code processing method described in any embodiment of the present invention.

[0011] The technical solution of this embodiment of the invention determines the target code text and its corresponding standard code text of the target program code based on the processing request for the target program code; based on the standard code text and the target code text, and using a code content verification model, obtains the code content feedback text of the code content verification model for the target code text; if the generation time of the code content feedback text meets the preset text feedback time condition, then the code content feedback text is determined as the target content feedback text of the code content verification model for the target code text; and based on the target content feedback text, the processing result of the target program code is generated. This embodiment of the technical solution can obtain the code content feedback text of the target code text based on the obtained target code text and standard code text of the target program code, and determine the target content feedback text based on the generation time of the code content feedback text, thereby generating the processing result of the target program code. This improves the efficiency and accuracy of the model in identifying error locations in the target code text, and enhances the reliability and comprehensiveness of the model's error feedback for the target program code.

[0012] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 This is a flowchart of a program code processing method provided in Embodiment 1 of the present invention; Figure 2 This is a flowchart of a program code processing method provided in Embodiment 2 of the present invention; Figure 3 This is a schematic diagram of the structure of a program code processing device according to Embodiment 3 of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device that implements the program code processing method of the present invention. Detailed Implementation

[0015] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0016] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0017] Example 1 Figure 1 This invention provides a flowchart of a program code processing method according to Embodiment 1. This embodiment is applicable to situations where the efficiency of identifying error locations in code text is low and the output quality is poor during code programming teaching. This method can be executed by a program code processing device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes: S110. Based on the processing request for the target program code, determine the target code text of the target program code and its corresponding standard code text.

[0018] The target code text can be program code written according to a specified programming task during the coding instruction process; specifically, it can be program code written by learners according to a specified programming task. The standard code text can be program code provided to implement a specified programming task; specifically, it can be task answer code written by instructors according to a specified programming task, or program code obtained from teaching materials for that programming task. The specified programming task could be, for example, using a loop to traverse an array and calculate its sum, or using a loop to access array elements and find the maximum value in the array, etc.

[0019] Specifically, based on the processing request for the target program code, i.e., identifying the error locations in the code text corresponding to the target program code, the specified programming task corresponding to the target program code can be determined. Based on the specified programming task, the target code text written by the learner according to the specified programming task, as well as the task answer code text written by the instructor or the corresponding program code text provided in the teaching materials, i.e., the standard code text, can be obtained.

[0020] S120. Based on the standard code text and the target code text, and using the code content verification model, obtain the code content feedback text of the code content verification model on the target code text.

[0021] Specifically, the code content verification model can be used to input standard code text and target code text into a code content verification model. The model compares the code content of the target and standard code texts to obtain a comparison result. Based on this result, it identifies the differences between the target and standard code texts. Then, based on these differences, it generates feedback text for the target code text. The code content verification model can act as a tutor in the coding learning process for teenagers, pointing out errors in their coding assignments and providing solutions rather than simply providing the correct answers.

[0022] The code content feedback text can be feedback text generated based on the target code text and the standard code text. Specifically, it can also be feedback text that completes text content quality verification and includes the text content quality results. This can include the code error type, error location, and code modification suggestions in the target code text, as well as the verification results for the text content quality. For example, the code content feedback text could be: "The code error starts on line 6; Code error type description: Logical error: The code lacks a statement to read variables from the input device, causing the program to be unable to correctly obtain the input value and perform the judgment. Code modification suggestions: First, it is recommended to read the user input value before conditional judgment to ensure that subsequent judgment logic can be based on correct data; Second, it is recommended to clarify the range of input data and processing flow when writing conditional judgment statements, and then gradually write the corresponding judgment branches; The text content quality verification result can be that the text content is reasonable, and this embodiment does not impose specific limitations on this.

[0023] Specifically, the target code text and standard code text can be input into the code content verification model, and the code content verification model can obtain code content feedback text for the target code text based on the comparison results between the target code text and the standard code text. Specifically, the code content feedback text can be output as a separate text, or it can be output as a comment on the target code text.

[0024] Optionally, the code content verification model includes a first code content verification model, which in turn includes a first code verification model and a first content verification model. Based on the standard code text and the target code text, and using the code content verification model, the code content verification model provides feedback text on the target code text. This includes: generating a first code content verification result for the target code text based on the standard code text and the target code text, and using the first code verification model; generating a first reference code content feedback text for the target code text based on the first code content verification result; obtaining a first text content evaluation result for the first reference code content feedback text based on the first content verification model, and adjusting the text content of the first reference code content feedback text based on the first text content evaluation result to obtain the code content feedback text for the target code text from the first code content verification model.

[0025] The code content verification model can be constructed based on both a code verification model and a content verification model. The code verification model identifies differences in code content between the target code text and the standard code text, identifies errors in the target code text, and generates feedback text based on these errors. The content verification model verifies the feedback text generated by the code verification model to determine its reasonableness and accuracy. Specifically, it involves repeatedly analyzing the text content of both the target and standard code texts to obtain the analysis results for the target code text. Based on these results, the quality of the feedback text generated by the code verification model is assessed, and its reasonableness and accuracy are assessed.

[0026] The first reference code content verification result can be obtained by comparing the target code text and the standard code text to obtain the difference text content, which can specifically include the code error location and code error type.

[0027] The first reference code content feedback text can be a generated feedback text used to record the difference in text content. Specifically, it can be a feedback text of the difference in text content obtained by comparing the target code text and the standard code text, which has not yet undergone quality verification. The first text content evaluation result can be the result of quality verification of the difference in text content, which can specifically include whether the text content is reasonable or unreasonable.

[0028] Specifically, after inputting the target code text and standard code text into the first code verification model, the first code verification model compares the differences between the target code text and the standard code text to obtain the difference comparison results. Based on the difference comparison results, the text content differences between the target code text and the standard code text are determined. Then, the difference text content, along with the target code text and the standard code text, are input into the first content verification model, and the text content of the target code text and the standard code text is analyzed again to obtain the text content analysis results. Based on the text content analysis results, the text content quality of the difference text content is judged to obtain the text content quality judgment results. Further, based on the quality judgment results and the difference text content, the first content verification model generates code text content feedback for the target code text.

[0029] Optionally, based on the first reference code content feedback text and the first content verification model, a first text content evaluation result of the first content verification model on the first reference code content feedback text is obtained, including: generating a first reference code content feedback text on the target code text based on the standard code text and the target code text and the first content verification model; performing a consistency comparison between the first reference code content feedback text and the first reference code content feedback text to obtain a first text content comparison result; and generating a first text content evaluation result on the first reference code content feedback text based on the first text content comparison result.

[0030] The first reference code content feedback text can be a reference content text used to verify the text content quality of differing text content. Specifically, it can be input into the first content verification model along with the standard code text and the target code text to obtain the reference content text output by the first content verification model. Further, it can be compared with the reference content text output by the first code verification model to obtain a consistency comparison result. Based on the consistency comparison result, a text content evaluation result for the first reference code content feedback text is generated.

[0031] Optionally, based on the comparison result of the first text content, a first text content evaluation result for the feedback text of the first reference code content is generated, including: if the comparison result of the first text content is the same, then a first text content evaluation result with reasonable text content is generated for the feedback text of the first reference code content; or, if the comparison result of the first text content is different, then a first text content evaluation result with unreasonable text content is generated for the feedback text of the first reference code content.

[0032] For example, if target code text A and its corresponding standard code text B are obtained, they can be input into a pre-built code content verification model to obtain target content feedback text for the target program code. The code content verification model can be composed of a code verification model and a content verification model. Specifically, the code verification model within the code content verification model can obtain the code content verification result between target code text A and standard code text B. Based on this result, a reference code content feedback text a1 for target code text A is generated. This reference feedback text can contain the number of misaligned lines, error information, and error correction suggestions for the target code text. In other words, the input to the code verification model is the target code text and the standard code text, and the output is the code error information and error correction suggestions for the target code. Furthermore, a secondary code content verification can be performed on target code text A and standard code text B using the content verification model within the code content verification model, generating a comparison code content feedback text a2 for target code text A. Then, a consistency comparison is performed between the feedback text a2 of the target code and the feedback text a1 of the reference code. Based on the consistency comparison result, the text content evaluation result of the content validation model on the feedback text of the reference code is obtained. It should be noted that the text content evaluation result output by the content validation model can be a judgment on whether the code content validation result output by the code validation model is reasonable. That is, the input of the content validation model is the target code text, the standard code text, and the feedback text of the reference code; the model output is whether the reviewer agrees or disagrees with the code error information and error modification suggestions given in the feedback text of the reference code, and can be structured data.

[0033] It should also be noted that feedback text a2 and feedback text a1 can be the same or different. If feedback text a2 and feedback text a1 are the same, the text content evaluation result output by the content verification model is considered reasonable as a code content verification result, and feedback text a1 can be identified as the target content feedback text. If feedback text a2 and feedback text a1 are different, the text content evaluation result output by the content verification model is considered unreasonable as a code content verification result. In this case, feedback text a1 can be adjusted based on the text content evaluation result, and the adjusted feedback text a1 can be identified as the target content feedback text. This embodiment does not impose specific restrictions on this.

[0034] Optionally, the code content verification model includes a second code content verification model. Based on the standard code text and the target code text, and using the code content verification model, a code content feedback text is obtained for the target code text. This includes: generating a second code content verification result for the target code text based on the standard code text and the target code text, and using the second code verification model; generating a second reference code content feedback text for the target code text based on the second code content verification result; obtaining a second text content evaluation result for the second reference code content feedback text based on the second content verification model; and adjusting the text content of the second reference code content feedback text based on the second text content evaluation result to obtain the code content feedback text for the target code text from the second code content verification model.

[0035] Specifically, based on the above embodiments, the code content verification model also includes a second code content verification model, wherein the first code content verification model and the second code content verification model can simultaneously perform code content verification operations on the target code text.

[0036] Specifically, the process involves simultaneously inputting the target code text and the standard code text into a first code content verification model and a second code content verification model. The first and second models then perform a difference comparison to obtain the comparison results. Based on these results, the textual differences between the target code text and the standard code text are identified. Next, these differing textual contents, along with the target and standard code texts, are input into the first and second content verification models again for further text content analysis. Based on these analysis results, the differing textual contents are assessed for quality, yielding a quality assessment result. Finally, based on the quality assessment result and the differing textual contents, feedback from the first and second code content verification models on the target code text's content is generated.

[0037] Optionally, the code content verification model includes a third code content verification model, which comprises a third code verification model and a third content verification model. Based on the standard code text and the target code text, and using the code content verification model, the code content verification model provides feedback text on the target code text. This includes: generating a third code content verification result for the target code text based on the standard code text and the target code text, and using the third code verification model; generating a third reference code content feedback text for the target code text based on the third code content verification result; obtaining a third text content evaluation result for the third reference code content feedback text based on the third content verification model; and adjusting the text content of the third reference code content feedback text based on the third text content evaluation result to obtain the code content feedback text for the target code text from the third code content verification model.

[0038] Specifically, based on the above embodiments, the code content verification model also includes a third code content verification model, wherein the first code content verification model, the second code content verification model and the third code content verification model can simultaneously perform code content verification operations on the target code text.

[0039] Specifically, the process involves simultaneously inputting the target code text and standard code text into a first code content verification model, a second code content verification model, and a third code content verification model. The target code text and standard code text are then compared using each of these three models to obtain comparison results. Based on these results, the textual differences between the target code text and the standard code text are identified. Next, these differing textual contents, along with the target and standard code texts, are input into the first, second, and third code content verification models again to perform text content analysis, yielding analysis results. Based on these analysis results, the differing textual contents are assessed for quality, resulting in a quality assessment result. Finally, based on the quality assessment result and the differing textual contents, feedback from the first, second, and third code content verification models regarding the target code text's content is generated.

[0040] It should be noted that the code verification model and content verification model included in the code content verification model can be the same digital network model or different digital network models. Specifically, if the first code verification model in the first code content verification model can be the first network model, then the first content verification model can be the second network model; if the second code verification model in the second code content verification model can be the second network model, then the second content verification model can be the first network model; if the third code verification model in the third code content verification model can be the first network model, then the third content verification model can be the third network model. This embodiment does not impose specific limitations on the comparison.

[0041] S130. If it is determined that the generation time of the code content feedback text meets the pre-set text feedback time condition of the content feedback text, then the code content feedback text is determined as the target content feedback text of the code content verification model for the target code text.

[0042] Specifically, the text feedback time condition can be used to determine the text generation time of the fastest generated code content feedback text. Specifically, the target code text and standard code text can be simultaneously input into a first code content verification model, a second code content verification model, and a third code content verification model. The model output results of each code content verification model are continuously monitored. If code content feedback text for the target code text generated by any code content verification model is obtained, the model output operation of the other code content verification models is terminated, and the obtained code content feedback text is determined as the target content feedback text of the code content verification model for the target code text. That is, based on the text feedback time condition, the code content feedback text of the code content verification model for the target code text can be obtained in the shortest possible time. Even if any code content verification model malfunctions or has poor analysis quality, as long as the code content feedback text generated by the code content verification model is obtained, that code content feedback text can be determined as the final output, greatly enhancing the robustness of the model.

[0043] Optionally, before obtaining the code content feedback text of the code content verification model for the target code text based on the standard code text and the target code text, the method further includes: processing the code content of the target code text and the standard code text to obtain the target execution text corresponding to the target code text and the standard execution text corresponding to the standard code text; performing a consistency comparison between the target execution text and the standard execution text to obtain the consistency comparison result of the execution text; if the consistency comparison result shows that the target execution text and the standard execution text are the same, then generating and feeding back a prompt message indicating that the code of the target code text is correct.

[0044] Specifically, code content processing of the target code text and standard code text can involve code cleaning and standardization. This involves removing markers in the target code text and standard code text that are not logically related to the target program code. These markers can be teaching aids or code comments, ensuring that the target code text and standard code text contain executable code logic. Furthermore, line numbers can be dynamically added to each line in the target code text and standard code text. This allows the code content verification model to clearly identify the location of code errors during text content analysis of the target code text, improving the verifiability and accuracy of the code content feedback text and solving the problem of unclear code location in traditional large-scale models.

[0045] Specifically, upon obtaining the target execution text of the target code text and the standard execution text of the standard code text, a consistency comparison can be performed between the target execution text and the standard execution text. This can be achieved by hashing the target execution text and standard execution text, and then comparing the hash results; or by performing a text consistency comparison. Further, if the consistency comparison result shows that the target execution text and the standard execution text are the same, the code in the target code text can be directly determined to be correct, and a message indicating that the code in the target code text is correct can be generated and fed back. If the consistency comparison result shows that the target execution text and the standard execution text are different, a code error can be determined in the target code text, and the target code text and the standard code text can be input into a pre-built code content verification model. The model outputs a target content feedback text for the target code text, which is then used to generate the processing result for the target program code. In other words, a hash comparison or text comparison can be performed on the target code text before submitting it to the code content verification model. If the comparison result shows that the target code text and the standard code text are consistent, the code in the target code text can be directly determined to be correct and returned, thus bypassing the subsequent call process to the code content verification model. It greatly reduces resource consumption and processing latency when identifying error locations in target code text, and improves the efficiency and accuracy of identifying error locations in target code text.

[0046] S140. Based on the target content feedback text, generate the target program code as a processing result.

[0047] Specifically, processing operations on the target program code text can be generated based on the code content verification results recorded in the target content feedback text. If the code content verification result in the target content feedback text indicates that the text content is reasonable, then annotations or comments are made in the target program code based on the code error locations, error types, and code modification suggestions included in the target content feedback. This generates code feedback text for the target program code and sends it to the user. If the code content verification result in the target content feedback text indicates that the text content is unreasonable, no annotations or comments are made in the target program code. Instead, based on the standard code text, the code error locations and their corresponding error types in the target code text are determined. These errors could include inconsistencies in programming languages, complete deviations from standard code in core functionality, garbled text, or malicious code fragments. This also generates code feedback text for the target program code and sends it to the user.

[0048] The technical solution of this embodiment of the invention determines the target code text and its corresponding standard code text of the target program code based on the processing request for the target program code; based on the standard code text and the target code text, and using a code content verification model, obtains the code content feedback text of the code content verification model for the target code text; if the generation time of the code content feedback text meets the preset text feedback time condition, then the code content feedback text is determined as the target content feedback text of the code content verification model for the target code text; and based on the target content feedback text, the processing result of the target program code is generated. This embodiment of the technical solution can obtain the code content feedback text of the target code text based on the obtained target code text and standard code text of the target program code, and determine the target content feedback text based on the generation time of the code content feedback text, greatly improving the model's efficiency in identifying error locations in the target code text. Furthermore, generating the processing result of the target program code based on the target content feedback text improves the accuracy of the model in identifying error locations in the target code text and ensures the reliability and comprehensiveness of the model's feedback results.

[0049] Example 2 Figure 2 This is a flowchart of a program code processing method provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment provides a preferred example. For example... Figure 2 As shown, the method includes the following specific steps: S210. Based on the processing request for the target program code, determine the target code text of the target program code and its corresponding standard code text.

[0050] S220A. Based on the standard code text and the target code text, and using the first code content verification model, obtain the code content feedback text of the first code content verification model for the target code text.

[0051] S220B. Based on the standard code text and the target code text, and using the second code content verification model, obtain the code content feedback text of the second code content verification model for the target code text.

[0052] S220C: Based on the standard code text and the target code text, and using the third code content verification model, obtain the code content feedback text of the third code content verification model for the target code text.

[0053] S230. If it is determined that the generation time of the code content feedback text meets the pre-set text feedback time condition of the content feedback text, then the code content feedback text is determined as the target content feedback text of the code content verification model for the target code text.

[0054] S240. Based on the target content feedback text, generate the target program code as a processing result.

[0055] This embodiment's technical solution allows the target code text and standard code text of the acquired target program code to be input into a first code content verification model, a second code content verification model, and a third code content verification model. Each model generates a code content feedback text for the target code text, and the target content feedback text is determined based on the generation time of this feedback text. This significantly improves the efficiency of identifying error locations in the target code text. Furthermore, by utilizing the logical reasoning and code understanding capabilities of different models, complementary capabilities are formed, avoiding the judgment errors of a single model. This improves the accuracy of the model in identifying error locations in the target code text and ensures the reliability and comprehensiveness of the model's feedback results.

[0056] Example 3 Figure 3 This is a schematic diagram of a program code processing device provided in Embodiment 3 of the present invention. The program code processing device provided in this embodiment of the present invention is applicable to situations where the efficiency of identifying error locations in code text is low and the output quality is poor during code programming teaching. This program code processing device can be implemented in hardware and / or software, such as... Figure 3 As shown, it specifically includes: a code text acquisition module 310, a feedback text generation module 320, a target feedback text determination module 330, and a processing result generation module 340. Among them, The code text acquisition module 310 is used to determine the target code text of the target program code and its corresponding standard code text based on the processing request for the target program code.

[0057] The feedback text generation module 320 is used to obtain the code content feedback text of the code content verification model for the target code text based on the standard code text and the target code text and the code content verification model.

[0058] The target feedback text determination module 330 is used to determine the code content feedback text as the target content feedback text of the code content verification model for the target code text if the generation time of the code content feedback text meets the preset text feedback time condition of the content feedback text.

[0059] The processing result generation module 340 is used to generate the processing result of the target program code based on the target content feedback text.

[0060] This solution can obtain code content feedback text for the target code text based on the target code text and standard code text obtained from the target program code, using a code content verification model. Based on the generation time of the code content feedback text, the target content feedback text is determined, and the processing result for the target program code is generated accordingly. This improves the efficiency and accuracy of the model in identifying error locations in the target code text, and ensures the reliability and comprehensiveness of the model's feedback results.

[0061] Optionally, the code content verification model includes a first code content verification model, which includes a first code verification model and a first content verification model; the feedback text generation module 320 includes: The first code verification unit is used to generate a first code content verification result for the target code text based on the first code verification model, according to the standard code text and the target code text. The first text generation unit is used to generate a first reference code content feedback text for the target code file based on the first code content verification result. The first text verification unit is used to obtain the first text content evaluation result of the first content verification model on the first text content feedback text based on the first reference code content feedback text and the first content verification model. The first feedback text generation unit is used to adjust the text content of the first reference code content feedback text according to the first text content evaluation result, so as to obtain the code content feedback text of the first code content verification model for the target code text.

[0062] Optionally, the first text verification unit is specifically used to generate a first comparison code content feedback text for the target code text based on the first content verification model, according to the standard code text and the target code text; The first text content feedback text of the first comparison code is compared with the first text content feedback text of the first reference code to obtain the first text content comparison result; Based on the first text content comparison result, a first text content evaluation result is generated for the feedback text of the first reference code content.

[0063] Optionally, the code content verification model includes a second code content verification model, which in turn includes a second code verification model and a second content verification model; the feedback text generation module 320 includes: The second code verification unit is used to generate a second code content verification result for the target code text based on the second code verification model, according to the standard code text and the target code text. The second text generation unit is used to generate a second reference code content feedback text for the target code file based on the second code content verification result; The second text verification unit is used to obtain the second text content evaluation result of the second content verification model on the second text content feedback text based on the second reference code content feedback text and the second content verification model. The second feedback text generation unit is used to adjust the text content of the second reference code content feedback text according to the second text content evaluation result, so as to obtain the code content feedback text of the second code content verification model for the target code text.

[0064] Optionally, the code content verification model includes a third code content verification model, which includes a third code verification model and a third content verification model; the feedback text generation module 320 includes: The third code verification unit is used to generate a third code content verification result for the target code text based on the standard code text and the target code text, and on the basis of the third code verification model. The third text generation unit is used to generate a third reference code content feedback text for the target code file based on the third code content verification result. The third text verification unit is used to obtain the third text content evaluation result of the third content verification model on the third reference code content feedback text based on the third content verification model. The third feedback text generation unit is used to adjust the text content of the third reference code content feedback text according to the third text content evaluation result, so as to obtain the code content feedback text of the third code content verification model for the target code text.

[0065] Optionally, the device may also include: The code text verification module is used to process the code content of the target code text and the standard code text before obtaining the code content feedback text of the code content verification model for the target code text based on the standard code text and the target code text, thereby obtaining the target execution text corresponding to the target code text and the standard execution text corresponding to the standard code text. The target execution text and the standard execution text are compared for consistency to obtain the consistency comparison result of the execution text; If the consistency comparison result shows that the target execution text and the standard execution text are the same, then a prompt message indicating that the target code text is correct is generated and fed back.

[0066] The program code processing apparatus provided in the embodiments of the present invention can execute the program code processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0067] Example 4 Figure 4 A schematic diagram of an electronic device 40 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0068] like Figure 4 As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42 or a random access memory (RAM) 43, communicatively connected to the at least one processor 41. The memory stores computer programs executable by the at least one processor. The processor 41 can perform various appropriate actions and processes based on the computer program stored in the ROM 42 or loaded from storage unit 48 into the RAM 43. The RAM 43 may also store various programs and data required for the operation of the electronic device 40. The processor 41, ROM 42, and RAM 43 are interconnected via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0069] Multiple components in electronic device 40 are connected to I / O interface 45, including: input unit 46, such as keyboard, mouse, etc.; output unit 47, such as various types of monitors, speakers, etc.; storage unit 48, such as disk, optical disk, etc.; and communication unit 49, such as network card, modem, wireless transceiver, etc. Communication unit 49 allows electronic device 40 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0070] Processor 41 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 41 performs the various methods and processes described above, such as program code processing methods.

[0071] In some embodiments, the program code processing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the program code processing method described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to execute the program code processing method by any other suitable means (e.g., by means of firmware).

[0072] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0073] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0074] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0075] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0076] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0077] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability.

[0078] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0079] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for processing program code, characterized in that, include: Based on the processing request for the target program code, determine the target program code text and its corresponding standard code text; Based on the standard code text and the target code text, and using the code content verification model, the code content feedback text of the code content verification model to the target code text is obtained; If it is determined that the generation time of the code content feedback text meets the preset text feedback time condition of the content feedback text, then the code content feedback text is determined as the target content feedback text of the code content verification model for the target code text; Based on the target content feedback text, the processing result of the target program code is generated.

2. The method according to claim 1, characterized in that, The code content verification model includes a first code content verification model, which in turn includes a first code verification model and a first content verification model. The step of obtaining the code content feedback text of the code content verification model for the target code text based on the standard code text and the target code text includes: Based on the standard code text and the target code text, and using the first code verification model, a first code content verification result is generated for the target code text. Based on the first code content verification result, generate a first reference code content feedback text for the target code file; Based on the feedback text of the first reference code content, and based on the first content verification model, the first text content evaluation result of the first content verification model on the feedback text of the first reference code content is obtained; Based on the evaluation result of the first text content, the text content of the first reference code content feedback text is adjusted to obtain the code content feedback text of the first code content verification model for the target code text.

3. The method according to claim 2, characterized in that, The step of obtaining the first text content evaluation result of the first content verification model on the first reference code content feedback text based on the first content verification model includes: Based on the standard code text and the target code text, and using the first content verification model, a first reference code content feedback text for the target code text is generated; The first text content feedback text of the first comparison code is compared with the first text content feedback text of the first reference code to obtain the first text content comparison result; Based on the first text content comparison result, a first text content evaluation result is generated for the feedback text of the first reference code content.

4. The method according to claim 1, characterized in that, The code content verification model includes a second code content verification model, which in turn includes a second code verification model and a second content verification model. The step of obtaining the code content feedback text of the code content verification model for the target code text based on the standard code text and the target code text includes: Based on the standard code text and the target code text, and using the second code verification model, a second code content verification result for the target code text is generated; Based on the second code content verification result, generate a second reference code content feedback text for the target code file; Based on the feedback text of the second reference code content, and based on the second content verification model, the second text content evaluation result of the second content verification model on the feedback text of the second reference code content is obtained; Based on the evaluation result of the second text content, the text content of the second reference code content feedback text is adjusted to obtain the code content feedback text of the second code content verification model for the target code text.

5. The method according to claim 1, characterized in that, The code content verification model includes a third code content verification model, which in turn includes a third code verification model and a third content verification model. The step of obtaining the code content feedback text of the code content verification model for the target code text based on the standard code text and the target code text includes: Based on the standard code text and the target code text, and using the third code verification model, a third code content verification result for the target code text is generated; Based on the third code content verification result, a third reference code content feedback text for the target code file is generated; Based on the feedback text of the third reference code content, and based on the third content verification model, the third text content evaluation result of the third content verification model on the feedback text of the third reference code content is obtained; Based on the evaluation result of the third text content, the text content of the third reference code content feedback text is adjusted to obtain the code content feedback text of the third code content verification model for the target code text.

6. The method according to claim 1, characterized in that, Before obtaining the code content feedback text of the code content verification model for the target code text based on the standard code text and the target code text, the method further includes: The target code text and the standard code text are processed to obtain the target executable text corresponding to the target code text and the standard executable text corresponding to the standard code text; The target execution text and the standard execution text are compared for consistency to obtain the consistency comparison result of the execution text; If the consistency comparison result shows that the target execution text and the standard execution text are the same, then a message indicating that the target code text is correct is generated and returned.

7. A program code processing device, characterized in that, include: The code text acquisition module is used to determine the target code text of the target program code and its corresponding standard code text based on the processing request for the target program code; The feedback text generation module is used to obtain the code content feedback text of the code content verification model for the target code text based on the standard code text and the target code text and the code content verification model. The target feedback text determination module is used to determine the code content feedback text as the target content feedback text of the code content verification model for the target code text if the generation time of the code content feedback text meets the preset text feedback time condition of the content feedback text. The processing result generation module is used to generate the processing result of the target program code based on the target content feedback text.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that is executed by the at least one processor, such that the at least one processor is able to perform the program code processing method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the program code processing method according to any one of claims 1-6.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the program code processing method according to any one of claims 1-6.