Cross-domain data aggregation method and system based on federated learning and block chain
The large-scale model-driven visualization teaching system solves the problem of understanding professional terminology in computer algorithm teaching, provides personalized learning paths, and improves the user's learning experience and teaching effectiveness.
Patent Information
- Application Number
- CN202511677515.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-10
AI Technical Summary
Existing computer algorithm teaching suffers from problems such as barriers to understanding professional terminology, rigid interaction mechanisms, inefficient feature extraction, and a lack of personalized teaching. These issues make it difficult for users to understand the core logic of algorithms, result in inflexible learning paths, and lack of targeted teaching content.
The system employs a computer algorithm visualization teaching generation system based on a large model. It constructs an easy-to-understand feature set through a preprocessing module, provides a graphical classification map through an interactive module, conducts dynamic question and answering through a question-and-answer module, generates personalized learning content through a teaching content generation module, and generates learning suggestions by calling the large model through an extension module.
It enables dynamic adjustment of teaching content based on user feedback, improving user comprehension and the relevance of learning paths, and enhancing the practicality and interactivity of learning.
Smart Images

Figure CN121504381A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of artificial intelligence driven education technology, and specifically relates to a computer algorithm visualization teaching generation system based on a large model. BACKGROUND
[0002] In the existing field of computer algorithm teaching, the traditional teaching method has the following significant defects: Professional term cognitive barrier: a large number of professional terms such as "partition operation" and "benchmark element selection" are used in algorithm description, making it difficult for zero foundation users to understand the core logic of the algorithm. For example, the professional description of the quicksort algorithm contains terms such as "recursive division" and "benchmark element selection", which have a significant gap with the user's understanding of "divide and conquer" and "average complexity".
[0003] Interaction mechanism is rigid: the existing teaching system mainly uses static text or fixed flowchart display, and lacks an interactive mechanism that dynamically adjusts according to the user's cognitive level. For example, the algorithm classification atlas is in the form of a linear list, which cannot realize hierarchical dynamic jumping from "sorting algorithm" to "quicksort".
[0004] Feature extraction is inefficient: the traditional manual screening algorithm feature extraction method has the problems of low feature overlap and fine classification. For example, the traditional method may extract two low-correlation features "recursive step" and "optimal substructure" at the same time, resulting in the need for multiple rounds of questioning to effectively narrow down the learning range.
[0005] Lack of personalized teaching: there is no dynamic teaching path generation mechanism based on user real-time feedback. For example, when the user expresses that they do not understand the "recursion" concept, the system cannot automatically avoid the recursive algorithm path and instead recommend an iterative implementation scheme.
[0006] Based on the above defects, the present application proposes a computer algorithm visualization teaching generation system based on a large model. SUMMARY
[0007] In order to overcome the shortcomings and deficiencies of the prior art, the first object of the present application is to provide a computer algorithm visualization teaching generation system based on a large model; the second object of the present application is to provide a computer algorithm visualization teaching generation method based on a large model.
[0008] The first object of the present application adopts the following technical solution: The computer algorithm visualization teaching generation system based on a large model comprises a preprocessing module, an interaction module, a question and answer module, a teaching content generation module, and an extension module. The preprocessing module is used to construct the mapping relationship between the categories, core concepts, and features corresponding to various algorithms. It aggregates algorithm categories into a set called "Category" and extracts user-understandable features into a set called "Feature". It generates a set of candidate feature pairs called "Candidate Feature" through the Cartesian product of "Category" and "Feature". It then selects easily understandable feature sets called "Algorithm Feature" based on the semantic association rules of the algorithm domain knowledge graph. Finally, it labels the easily understandable features with difficulty levels and constructs the easily understandable feature weight vectors corresponding to each algorithm through word segmentation, similarity calculation, and weight allocation. Interactive module: Used to display an algorithm classification map that combines graphical and hierarchical representations, allowing users to select algorithm categories and check preset programming basic tags to narrow down the learning scope; Question answering module: Based on the algorithm category and programming basic tags selected by the user, it obtains the user's cognitive information through k rounds of dynamic question answering. In each round, it selects the feature with the largest information entropy gain ratio from the easy-to-understand features that have never been asked before and initiates a question, and the question matches the preset answer options. The teaching content generation module is used to calculate the similarity between the easy-to-understand feature weight vectors of each algorithm and the target easy-to-understand feature weight vectors to determine recommended learning content; it generates a suitability assessment based on the algorithm's basic level, the degree of consistency between question and answer descriptions, and the semantic relevance of unasked features, and performs operations such as direct display, display after difficulty adjustment, or recommendation of prior knowledge learning; it provides feedback on algorithm matching results, core concepts, neutral processing instructions for unasked features, and related learning resources before and after the display. The extended module is used to convert user historical question and answer data, algorithm classification graph selection records, programming basic tags, algorithm matching results, and unasked feature information into natural language description text containing ambiguity and credibility information. It calls the large model interface with preset configuration instructions to obtain learning suggestions and displays them through interactive visualization. The preset configuration instructions include configuration instructions for generating balance suggestions based on neutral state analysis of unasked features.
[0009] Preferably, the semantic association rules of the preprocessing module include the domain adaptability of categories and features and the necessity of teaching scenarios; preferably, the construction process of the easy-to-understand feature weight vector is as follows: the algorithm is input into the algorithm teaching feature library to obtain descriptive statements, after lexicalization, the cosine similarity between each lexical and the easy-to-understand features is calculated, features with similarity exceeding the preset threshold are selected and weights are assigned, and the weights satisfy the normalization constraint.
[0010] Preferably, the algorithm classification map in the interactive module solves the problem of beginners' difficulty in understanding algorithm classification through a graphical and intuitive form; the programming basic tags selected by the user are used to assist in the probability calculation in the subsequent question and answer module, and together with the selection of algorithm categories, they achieve a double narrowing of the learning scope.
[0011] Preferably, the question-answering module stops k rounds of question-answering when "the proportion of answered features covering the key features of the algorithm is greater than or equal to the preset key feature coverage threshold" or "the change in confidence of recommendations over multiple consecutive rounds is less than the preset confidence change threshold". The information entropy gain ratio calculation for each round of questioning combines the user's answered results, the semantic association matrix between features, and the high-weight feature list of candidate algorithms to ensure that the questions have both discriminative power and key information coverage.
[0012] Preferably, the similarity calculation of the teaching content generation module adopts the cosine similarity algorithm; when the fitness evaluation value does not reach the preset threshold, the user is prompted to choose between "adjusting the difficulty" or "supplementing unasked features"; the relevant learning resources provided after display include recommended learning paths, practice questions and explanations of algorithm application scenarios.
[0013] Preferably, the natural language description text of the extension module explicitly marks the neutral processing logic of unasked features; preferably, in the preset configuration instructions of the large model, the balanced suggestion combines the domain relevance strength of user programming base tags and unasked features.
[0014] The second objective of this invention is achieved through the following technical solution: A method for generating computer algorithm visualization teaching based on large models is used to implement a computer algorithm visualization teaching generation system based on large models. The method includes the following steps: Step 1, Data Collection: Collect computer algorithm teaching materials, algorithm domain knowledge, and user behavior data; preferably, the algorithm teaching materials are screened for quality assessment to construct an algorithm database; preferably, the algorithm domain knowledge includes a domain knowledge graph containing association strength labels, semantic association matrices between features, and corresponding difficulty coefficients; preferably, the user behavior data is used to construct a question-and-answer behavior database containing user programming basic labels, question features, user answers, and algorithm category fields. Step 2, Data Preprocessing: With a fixed set of Category and Feature, CandidateFeature is generated through Cartesian product and Algorithm Feature is obtained by filtering based on semantic association rules; Algorithm Decomposition is used to convert the algorithm into a weighted combination of easily understandable features. Preferably, Algorithm Decomposition includes retrieval of description statements, lexicalization, similarity calculation and weight allocation, and finally constructs the easily understandable feature weight vector of each algorithm. Step 3: Matching Degree Calculation: User feedback is obtained through m rounds of dynamic question answering. User answers are extended into Answer vectors according to the rule of neutral default value + related feature correction. Cosine similarity is used to calculate the matching degree between the Answer vector and the weight vector of each algorithm. The teaching content with the highest matching degree is selected as the initial recommendation, and the recommendation confidence is calculated. Step 4: Dynamic Generation of Learning Path: Based on the improved C4.5 algorithm, a question decision tree is generated. The feature-response probability is calculated in stages. The feature of each round of questioning is selected by the information entropy gain ratio until the recommendation confidence reaches the preset threshold, and the final recommended visual teaching content is determined.
[0015] Preferably, in step one, the algorithm teaching materials are sourced from computer textbooks and educational channels, and the collected content includes the specific steps of the algorithm, implementation code, and analysis of time and space complexity.
[0016] Preferably, in step four, the feature-response probability is calculated in two stages: The cold start phase adopts a weighted calculation method based on feature difficulty coefficient, basic programming labels, and category-feature association strength; The historical data stage is based on historical frequency statistics and Bayesian update correction. The update formula includes the number of historical samples, the current user understanding ratio, and a preset smoothing coefficient. Preferably, the improved C4.5 algorithm adds a key feature priority constraint: when the unasked feature belongs to the high-weight features of the candidate algorithm with a preset algorithm ratio, its information entropy gain ratio is multiplied by a preset coefficient.
[0017] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: 1. This invention combines a k-round dynamic question-and-answer mechanism with an improved C4.5 algorithm. The system can dynamically adjust the questioning strategy and calculate the recommendation confidence based on real-time user feedback and basic programming tags. This ensures that the appropriate visual teaching content is accurately located with the fewest rounds, thus optimizing the personalized learning path from static recommendation to dynamic adaptation.
[0018] 2. This invention generates candidate feature pairs by taking the Cartesian product of the Category set and the Feature set, and then uses semantic association rules from the knowledge graph of the algorithm domain to filter effective pairs, forming an easily understandable feature set, Algorithm Feature. Furthermore, through lexicalization, cosine similarity calculation, and weight allocation, easily understandable feature weight vectors for each algorithm are constructed, achieving semantic conversion and weight quantification from technical terms to user-understandable features, thereby improving the comprehensibility of teaching content.
[0019] 3. This invention converts user historical question-and-answer data, algorithm classification graph selection records, and basic programming tags into natural language text containing ambiguity and credibility information. It then calls a pre-configured large model interface to generate learning suggestions, which are displayed through interactive visualization. This upgrades decision support from one-way teaching to two-way intelligent interaction, enhancing the relevance and practicality of learning. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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.
[0021] Figure 1 The block diagram of the computer algorithm visualization teaching generation system based on a large model according to the present invention is shown; Figure 2 The flowchart of the computer algorithm visualization teaching generation method based on a large model according to the present invention is shown; Figure 3 A flowchart illustrating the dynamic generation of the learning path according to the present invention is shown. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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 are within the scope of protection of the present invention.
[0023] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more exemplary embodiments. Numerous specific details are provided in the following description to give a full understanding of exemplary embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, steps, etc., can be employed. In other instances, well-known structures, methods, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0024] Example 1: See Figure 1 As shown, this embodiment provides a computer algorithm visualization teaching generation system based on a large model. The system includes: The preprocessing module constructs a mapping relationship between the categories, core concepts, and features corresponding to various algorithms, aggregating all algorithm categories into a set called "Category," and extracting user-understandable features from these features into a set called "Feature." When constructing the easily understandable feature set "Algorithm Feature," it first generates a set of candidate feature pairs ("Candidate Feature") through the Cartesian product of "Category" and "Feature," then filters out meaningless pairings based on semantic association rules from the algorithm domain knowledge graph, ultimately obtaining the "Algorithm Feature." The semantic association rules include the domain adaptability of the category and feature (e.g., "search path" only adapts to the "search algorithm" category) and the necessity for the teaching scenario (e.g., "divide and conquer" and "sorting algorithm" have a strong teaching association). Simultaneously, it labels easily understandable features with "difficulty level tags" (e.g., "beginner," "basic," and "advanced," determined based on the algorithm teaching syllabus and domain expert annotations; for example, "number of comparisons" is labeled as beginner level, and "recursive implementation" as basic level). Each algorithm is input into the algorithm teaching feature library to obtain descriptive statements related to the algorithm, and lexical processing is performed on these descriptive statements, calculating the relationship between each lexical and the "Algorithm." The similarity of each easily understandable feature in the Feature is calculated, and the weight of each easily understandable feature is determined based on the similarity. Finally, the easily understandable feature weight vector corresponding to each algorithm is constructed.
[0025] Interactive Module: Displays an algorithm classification map, allowing users to select the corresponding algorithm category based on their learning needs. The displayed algorithm classification map uses a combination of graphical and hierarchical presentation. Given the varying levels of cognitive ability among users at different learning stages, and the different difficulties they may encounter in understanding technical terminology, operating the interactive interface, and selecting learning content, the graphical and intuitive format guides users in selecting learning content, addressing the difficulty beginners face in understanding algorithm classifications. When selecting an algorithm category of interest, users can simultaneously check their own programming foundation tags (such as "Zero," "Beginner," and "Advanced"). These tags are used to assist in subsequent probability calculations. By selecting categories and foundational tags, users can precisely narrow down their learning scope.
[0026] The question-and-answer module, based on the user-selected algorithm category and programming foundation tags, requests confirmation information from the user regarding easily understandable features related to the algorithm category, in order to construct a target easily understandable feature weight vector. Specifically, during the j-th round of questioning, this module selects the easily understandable feature with the highest information entropy gain ratio from the unquestioned easily understandable features related to the algorithm category and initiates a question to the user. Furthermore, considering the differences in learning backgrounds and knowledge reserves among different users, this module obtains the user's cognitive information through k rounds of question-and-answer (where k is a dynamically determined round based on the question-and-answer process; the determination of k must consider both the "number of unquestioned features" and the "current recommendation confidence" to avoid insufficient information due to too many unquestioned features). Each question in the question-and-answer module uses the expression "Do you understand this feature attribute?" and matches three options: "understand", "do not understand", and "partially understand". This further refines the positioning of suitable visual teaching content within the algorithm range narrowed down by the algorithm classification graph selection.
[0027] The teaching content generation module calculates the similarity between the easily understandable feature weight vectors of each algorithm and the target easily understandable feature weight vector, and identifies the visualized teaching content of the algorithm to which the easily understandable feature weight vector with the highest similarity to the target easily understandable feature weight vector belongs as recommended learning content. This teaching content generation module serves as a vehicle for auxiliary learning and content display. Based on the possible learning scope determined through algorithm classification graph selection, the question-and-answer module, and user basic tags, it comprehensively considers the algorithm's basic level, its consistency with the description determined by the question-and-answer module, and the "semantic relevance of unasked features" (such as the domain relevance strength between unasked features and answered features) to select the optimally matched teaching content. Since the accuracy of the teaching content matching has been evaluated, this module... The module is also configured to generate a suitability assessment by combining the learning difficulty of the algorithm, and based on the results of the suitability assessment, perform operations such as direct display, display after difficulty adjustment, or recommend relevant prior knowledge learning; before displaying the learning content, the module is configured to provide the user with feedback on the algorithm matching results executed by the system, the core concepts of the algorithm, the teaching content information to be displayed, and "handling instructions for unasked features" (informing the user that unasked features are temporarily treated as neutral), and if the suitability assessment value does not reach a preset threshold, it will ask the user whether to adjust the difficulty or "supplement the unasked features"; after displaying the learning content, the module is configured to provide the user with relevant learning resources, recommended learning paths, and practice questions to achieve a complete intelligent teaching service.
[0028] Extended Module: This module calls the large model interface to provide personalized learning suggestions (auxiliary function). Specifically, it converts the user's historical question-and-answer data, selection records of algorithm classification graphs, user's basic programming tags, algorithm matching results executed by the system, and "list of unasked features and semantic association information" into natural language description text. This natural language description text is used to characterize the user's learning state, covering both the ambiguity information in the user's answering process and the credibility information of the system's judgment, as well as clearly marking the neutral processing logic of unasked features. By calling the large model's API interface, the natural language description text is input into the large model, which is pre-configured (pre-assigning instructions to provide algorithm learning suggestions, including the requirement to "provide balanced suggestions based on the neutral state of unasked features and user's basic tags"), to obtain learning suggestions generated by the large model. These suggestions are then presented to the user through interactive visualization, providing additional learning resources and allowing the user to understand the relevant application scenarios of the algorithm in advance, thus improving the targeting of learning.
[0029] The following describes the algorithm flow used in the system provided by this invention: See Figure 2 As shown, the specific process is as follows: Step 1: Data Collection.
[0030] This step involves collecting computer algorithm teaching materials, algorithm domain knowledge, and user behavior data to serve as the foundational data support for the algorithm visualization teaching generation system. It specifically includes three parts: Algorithm teaching material collection: Using the latest computer textbooks as the main data source, a large amount of algorithm teaching materials were collected, including the specific steps of the algorithms, related implementation code, time complexity and space complexity analysis, etc. The teaching materials came from multiple channels. To ensure the quality and accuracy of the data, the data was evaluated and screened. A large number of common algorithms were selected, and the corresponding categories, core concepts and feature information of the algorithms were organized to build an algorithm database for subsequent processing. Knowledge Acquisition in the Algorithm Domain: Collect knowledge graphs in the algorithm domain, which include semantic association strength labels for categories and features (such as "strong association", "weak association" and "no association"), "semantic association matrix between features" (used to characterize the domain relevance of different easily understandable features, such as the association strength between "recursive implementation" and "divide and conquer"), and "difficulty level labels for easily understandable features" (labeled by domain experts in conjunction with the teaching syllabus, divided into beginner, basic and advanced levels, with corresponding difficulty coefficients of 0.3, 0.6 and 0.9 respectively). User Q&A behavior data collection: Obtain historical user Q&A data to build a user Q&A behavior database. Data fields include "user programming basics tag", "question feature f", "user answer q" and "algorithm category", which are used to train the probability prediction model and initialize probability parameters. The above three types of data serve as the basis for subsequent feature pair screening, non-question feature processing and P(q|j,f) calculation. P(q|j,f) represents the probability that the user answers q when asking question feature f in the j-th round (q∈{0,0.5,1}, 0=do not understand, 0.5=partially understand, 1=understand).
[0031] Step 2: Data preprocessing.
[0032] To apply algorithm-related information to the logic of generating teaching content, it is necessary to convert highly technical algorithmic terminology into user-understandable, perceptible, and easily judged expressions. This step addresses the challenge of large datasets that are difficult to process manually by applying rule-based natural language processing technology with a database. Users learning algorithms may or may not have programming experience; the algorithmic features that most users can understand include: (1) Visible class characteristics: code structure, flowchart, execution steps, etc.; (2) Conceptual characteristics: time complexity, space complexity, applicable scenarios, etc.; (3) Application characteristics: real-world cases, problem solving, extensions and variations, etc. (4) Difficulty level characteristics: beginner, basic, intermediate, advanced, etc.
[0033] In this step, two specific sets are fixed: Category = {several common algorithm categories}, and Feature = {several specific features that are easy for users to identify}. In this step, an effective pairing of "category + specific feature" is defined as an easily understandable feature, and its construction process includes: Generate candidate set: Generate Candidate Feature = Category × Feature by Cartesian product of Category and Feature; the set of Cartesian product of Category and Feature is all possible pairings of "Category + Feature".
[0034] Semantic filtering: Based on the association rules in the knowledge graph of the algorithm domain, meaningless pairings are eliminated; specifically, if the association strength between the labeled category c and feature f in the knowledge graph is "no association", or the semantic similarity between the two (calculated by the pre-trained language model) is lower than the preset threshold, then the (c,f) pairing is eliminated from the Candidate Feature. Forming a feature set: The selected candidate feature pairs constitute an Algorithm Feature, and each easily understandable feature is associated with a "list of semantic associations between features" (based on the semantic association matrix between features in the knowledge graph) and a "difficulty level label and difficulty coefficient" (based on the annotation in the knowledge graph, such as f = (sorting algorithm, recursive implementation) associated with the difficulty level "basic level" and the difficulty coefficient 0.6).
[0035] For example, suppose Category = {sorting algorithm, search algorithm}, and Feature = {number of comparisons, search path, recursive implementation}: In the knowledge graph, "sorting algorithm" and "number of comparisons" are strongly related and at an introductory level of difficulty; "sorting algorithm" and "recursive implementation" are moderately related and at a basic level of difficulty; "search algorithm" and "search path" are strongly related and at an introductory level of difficulty. The semantic similarity between "sorting algorithm" and "search path", and between "search algorithm" and "number of comparisons" is all below the threshold; Therefore, Algorithm Feature = {(sorting algorithm, number of comparisons), (sorting algorithm, recursive implementation), (search algorithm, search path)}, and each is associated with its corresponding difficulty coefficient and associated feature list (e.g., the associated feature of (sorting algorithm, recursive implementation) is (sorting algorithm, number of comparisons), with an association strength of 0.7).
[0036] Based on the data collected above, each algorithm term can be decomposed into its easily understandable features, and this relationship can be regarded as a mapping; where F is a subset of Algorithm Features, representing the set of easily understandable features that the algorithm can be decomposed into, and ω is a function of F→[0,1], satisfying ω(f) is used to reflect the relative importance of feature f among all easily understandable features exhibited by the algorithm; for example, let algorithm a = quicksort, feature f1 = (sorting algorithm, divide and conquer) (difficulty coefficient 0.6), f2 = (sorting algorithm, recursive implementation) (difficulty coefficient 0.6), f3 = (sorting algorithm, average complexity O(nlogn)) (difficulty coefficient 0.9), based on teaching experience and algorithm characteristics, the following mapping relationship can be obtained: Decomposition: a → ({f1, f2, f3}, [f1 → 0.3, f2 → 0.2, f3 → 0.5]); This mapping relationship indicates that the algorithm "Quick Sort" exhibits three easily understandable features: "divide and conquer," "recursive implementation," and "average complexity O(nlogn)," with complexity being the primary feature. To support the calculation of the above mapping relationship, an additional corpus database, corpusDatabase, needs to be constructed. This corpus database stores tuples (algorithm name, sentence describing the specific performance of the algorithm's features). Relevant information is obtained from mainstream computer education websites, and pre-trained programming-related word vector libraries are downloaded. It is assumed that for each string str, its word vector representation Word2Vec(str) can be obtained at an acceptable cost. The algorithm Decomposition receives the corpus database corpusDatabase and the specific algorithm a, and finally outputs the mapping relationship Decomposition: a→({f1,f2,f3},[f1→0.3,f2→0.2,f3→0.5]). This algorithm relies on a predefined constant—the similarity threshold similarity Critical Value, i.e., the screening threshold (preset constant) for feature and word similarity, to perform semantic overlap judgment. Understandably, while the collected data is professional and comprehensive, it is not easy for the program to process, for reasons including: For a specific algorithm (such as "quicksort"), the "feature attributes" in its corresponding table entry may be descriptions such as "partitioning operation, pivot element selection, recursive partitioning". Such descriptions are suitable for professionals, but not for beginners to learn on their own. The feature overlap between different algorithms is low; among the main features selected for each algorithm, in most cases many features of one algorithm do not appear in the features of other algorithms, indicating that the classification is too fine.
[0037] Therefore, it is necessary to ensure a high degree of feature overlap between different algorithms in order to effectively narrow down the scope through fewer rounds of questioning. Based on this, easily understandable features are selected. These features are both easy to understand in name and can cover as many algorithms as possible with as few as possible. Clearly, an algorithm should be associated with several different easily understandable features, and an algorithm often more significantly exhibits certain features while less significantly exhibiting others. Therefore, a weighted combination is used to represent an algorithm. The core of data preprocessing lies in constructing a "transformer" to perform the above transformation. This transformer is implemented through the Decomposition algorithm, which utilizes a pre-collected algorithm teaching feature library to complete the transformation. Its operation process is as follows: (1) Receive the name of the algorithm to be converted, a, as input; (2) Retrieve all descriptive statements related to a in the algorithm teaching feature library and aggregate the descriptive statements into text paragraphs; (3) The text paragraph is decomposed into multiple lexical units using lexicalization technology; (4) Examine each word unit one by one, analyze the correlation between the word unit and each easily understandable feature, and assign reward points to easily understandable features with high correlation.
[0038] Let tokens represent the set of tokens obtained after lexicalization of the description text of algorithm a; for each easily understandable feature f, calculate its similarity reward score with all tokens: ; Where cos(u,v) is the cosine similarity calculation; Word vector representation of a string.
[0039] Based on a preset similarity threshold (similarity critical value), easily understandable features with reward scores greater than the threshold are selected and formed into a set. For each feature, its weight is calculated to ensure that the easily understandable feature weight vector of algorithm a is obtained.
[0040] After examining all lexical units, each easily understandable feature receives a corresponding reward score. Based on a preset threshold, easily understandable features with reward scores greater than the threshold are selected and identified as features related to the algorithm. Furthermore, the weight of each easily understandable feature is determined based on the relative magnitude of the reward scores, and the easily understandable feature weight vector of the algorithm is labeled with a "feature association list" and "difficulty level label and coefficient" for subsequent calculation of P(q|j,f).
[0041] Step 3: Matching degree calculation.
[0042] Through m rounds of question-and-answer sessions (where m is dynamically determined based on the question-and-answer situation, specifically: when "the proportion of key algorithm features covered by the answered features is ≥ a preset threshold (e.g., 70%)" or "the change in recommendation confidence after two consecutive rounds of question-and-answer sessions is < 5%), the question-and-answer session stops, and user feedback is obtained. Each question is expressed as "Do you understand the feature attribute f?", and is matched with three options: "Understand", "Don't understand", and "Partially understand". The next section will explain how to select the feature attribute f for each question. Assuming that the user's answer has been obtained, it is represented as the mapping PartialAnswer:={f1→a1,f2→a2,...,fm→am}, where f1,...,fm are the feature attributes of the questions from the 1st to the mth rounds, aj is the answer of the jth round, and the three options "Understand", "Don't understand", and "Partially understand" correspond to the values 1, 0, and 0.5 respectively, and the user has checked the programming basics tag B (B∈{zero, beginner, advanced}). The mapping PartialAnswer is extended to Algorithm. When a Feature obtains a mapped Answer, the processing logic of "neutral default value + related feature correction" is adopted. The specific rules are as follows: If the easily understandable feature fj has been asked: based on the user's answer "understand", "partially understand", and "do not understand", the j-th component of the vector is assigned 1, 0.5, and 0 respectively; if the easily understandable feature fj has not been asked: first, a neutral default value α is assigned (α∈[0.4,0.6], the default value is 0.5, representing that the user's understanding status has not yet been obtained); then, based on the "semantic association matrix between features" in the knowledge graph, the related features of fj that have been asked (i∈[1,m]) are searched. If the answer value of fi is ai, then the component values of fj are corrected to: ,in, To make the domain association strength between features fj and fi easier to understand ( Furthermore, the corrected value must be constrained to the range [0,1] (e.g., if the corrected value is <0, take 0; if it is >1, take 1); for example, fj = (sorting algorithm, recursive implementation) has not been asked, but its associated feature fi = (sorting algorithm, number of comparisons) has been asked and the answer is ai = 1 (understanding), indicating the strength of the association. Then the component value of fj is corrected to 0.5 + (1 - 0.5) × 0.7 = 0.85; the algorithm vectorization receives the algorithm database algorithmDatabase, the corpus database corpusDatabase and the specific algorithm i constructed above, and finally outputs the mapping of Algorithm Feature → [0,1]; assuming that the user's answer has generated the final mapping Answer, for each possible algorithm i, the matching degree is defined. The visual teaching content corresponding to the algorithm with the highest matching degree is the learning content initially recommended by the system, and the recommendation confidence is calculated (confidence = highest matching degree / second highest matching degree; if there is only one candidate algorithm, the confidence is 1). It can be understood that all algorithms have been represented as weighted combinations of easily understandable features. Subsequent tasks include: Intelligent questioning: Asking users if they understand a certain easily understood feature; Accurate Judgment: Based on the answer results and the correction values of the unasked features, the most suitable visual teaching content is determined.
[0043] In the actual operation of the algorithm, the two tasks of intelligent questioning and accurate judgment need to be executed simultaneously.
[0044] For ease of explanation, we first assume a "random" questioning method, where each time a user is randomly selected from the unasked, easily understood features, and asked whether they understand that feature. After several rounds of responses, we obtain the user's understanding profile of each feature. The goal of matching degree calculation is to calculate the suitability of each algorithm's teaching content for the user based on the answers and the correction values of the unasked features. This process is implemented through the Vectorization algorithm, whose core idea is to use cosine similarity to evaluate the matching degree. An algorithm a can be represented as a combination of a series of weighted, easily understood features (f1, ..., fn, ω1, ..., ωn) (where n is the total number of features in the Algorithm Feature), where the weights of easily understood features not decomposed into Algorithm a are set to 0. The n-dimensional vector Answer formed by the user's answer extension is compared with the n-dimensional weight vector Vectorization(a) of Algorithm a to calculate the cosine similarity, which is the suitability of Algorithm a for the user. Therefore, the algorithm flow is as follows: (1) Receive the questions raised, the user's answers, the user's basic programming tags, and the feature association information in the knowledge graph as input; (2) Following the rule of “neutral default value + related feature correction”, the user’s answer is constructed into an n-dimensional vector Answer; (3) Calculate the cosine similarity between Answer and the vector Vectorization(i) corresponding to each algorithm one by one to obtain Matching(i); (4) For teaching content belonging to the same category of algorithm, multiply their similarity by the "category matching coefficient" and sum them up to get the score of the teaching content of that category. The category matching coefficient is the coefficient for adjusting the category priority in the matching degree calculation. If the category is the category selected by the user through the interaction module, the coefficient is 1.2; otherwise, it is 1.0.
[0045] (5) Select the teaching content with the highest score as the recommended content and calculate the recommendation confidence level.
[0046] Step 4: Dynamically generate the learning path.
[0047] See Figure 3 As shown, step four is as follows: Determine suitable visual teaching content; obtain the question-and-answer logic (i.e., question decision tree) generation algorithm for the answers, which is essentially an improved version of the C4.5 algorithm. The core optimization point is to clarify the calculation method of P(q|j,f) (the probability of the user answering q when the question feature f is asked in the j-th round), which is processed in two stages: "cold start stage" and "historical data stage", as follows: The computational logic of S41 and P(q|j,f).
[0048] S411. Cold Start Phase (User Q&A behavior database data volume < preset threshold, such as 1000 entries): At this time, there is insufficient historical data to support statistics. P(q|j,f) is initialized based on "domain knowledge + user basic tags + feature difficulty", with the following formula: ; Where q∈{0,0.5,1} (corresponding to “do not understand”, “partially understand” and “understand” respectively); w1, w2, w3 are weight coefficients, satisfying w1+w2+w3=1, with default values of w1=0.4, w2=0.3, w3=0.3 (which can be fine-tuned with a small amount of pilot data); Based on the probability of the difficulty coefficient of feature f, where the difficulty coefficient of f is d (d∈[0,1]), then (The higher the difficulty, the higher the probability of "not understanding"). (The lower the difficulty, the higher the probability of "understanding"). (A fixed small value is used to prioritize distinguishing between "understanding" and "not understanding" during the cold start phase); for example, if f = (sorting algorithm, recursive implementation) and the difficulty coefficient d = 0.6, then... , , ; Based on the probability of the user's basic programming label B, if B = zero basic programming knowledge, then , , If B = beginner level, then , , If B = advanced class, then , , ; Based on the probability of the association strength between category c and feature f, if the association strength is "strong association", then , , If it is a "middle relation", then , , If it is a "weak association", then , , ; S412, Historical Data Stage (User Q&A Behavior Database Data Volume ≥ Preset Threshold): At this stage, P(q|j,f) is updated and optimized based on historical statistical data and Bayesian methods. The steps are as follows: Historical frequency statistics: From the user question-and-answer behavior database, samples with "category c", "programming basics tag B", and "question feature f" are selected. The frequency count(q) of each answer q is counted. Then the initial probability is... ; Bayesian update: P0(q|j,f) is adjusted by incorporating the current user's already answered features' tendency (denoted as T, where T is the proportion of "understanding" in the current user's already answered features, i.e., the ratio of the number of times they understood to the total number of answers). The formula is: Where N is the number of samples in the historical data period (N≥100); k is the smoothing coefficient (default k=20, to avoid the current user's tendency to have too much influence); for example, if the historical statistics P0(q=1|j,f)=0.4, the current user T=0.7 (70% of the answered features are "understanding"), N=200, k=20, then P(q=1|j,f)=(0.4×200+0.7×20) / (200+20)=(80+14) / 220≈0.427.
[0049] S42, Improve the decision-making process of the C4.5 algorithm.
[0050] Let PartialAnswerj be the user's answer after the j-th (j≥0) round of question answering, and Answerj be its extended version according to the rule of "neutral default value + correlation feature correction"; the Answerj induces the probability distribution mapping (after normalization) pj:Algorithm→[0,1] of the user after the j-th round of question answering suitable for learning each algorithm. ;k represents all candidate algorithms, indicating the probability that the user is suitable for learning algorithm i after the j-th round), this mapping is a normalization function, based on which the information entropy Entropy(pj) can be calculated:; fixed Given q∈{0,0.5,1}, define Answerj(f,q) as: assigning values to f according to the answer q, and then extending it to Algorithm through the "association feature correction" rule. The mapping of features similarly induces a normalization function p'f,q:Algorithm→[0,1]; under the condition of selecting the question feature attribute f and the user's answer q, the conditional entropy Entropy(pj|(f,q))∶=Entropy(p'f,q), and the expected conditional entropy is: ExpectedEntropy(j,f)=∑q∈{0,0.5,1}P(q|j,f)・Entropy(pj|(f,q)), where P(q|j,f) is calculated according to the logic of the "cold start phase" or "historical data phase" in Section 4.1 above; the expected conditional entropy can be understood as the amount of information expected to be obtained after selecting the question feature attribute f; the information gain is defined as: InformationGain(j,f)=Entropy(pj)-ExpectedEntropy(j,f). To correct the bias of feature selection, split information is introduced to measure the uniformity of feature value distribution, and its calculation formula is: Wherein, when P(q|j,f)=0, this term is defined as 0 (to avoid the logarithm being meaningless). The split information reflects the distribution complexity of all possible responses to feature f. The closer the value is to log(3) (because q has 3 possible values), the more uniform the distribution of feature values. Based on this, the evaluation formula for the information entropy gain ratio EntropyGainRatio is: When SplitInformation(j,f) = 0 (i.e., all possible response probabilities of feature f are concentrated in a single value), we define EntropyGainRatio(j,f) = 0 (at this time, the feature has no discriminative value).
[0051] The improved C4.5 algorithm used in this invention follows the same approach as the C4.5 algorithm. After the j-th round of question answering, it greedily selects the feature attribute with the largest EntropyGainRatio(j,・) value from the unselected feature attributes to ask a question. Furthermore, during feature selection, an additional "key feature priority" constraint is added: if an unselected feature f belongs to a "high-weight feature" (weight > 0.3) of more than 80% of the current candidate algorithms, then its EntropyGainRatio(j,f) is multiplied by a coefficient of 1.3 (prioritizing its selection). Asking for key features); it is understandable that the purpose of this step is to make the questions discriminative and cover key information; for example, if the user (B = beginner) has indicated that they understand "number of comparisons" (f1, difficulty coefficient 0.3, correlation strength with "recursive implementation" f2 0.7), then when calculating P(q|j,f2), if in the historical data stage, P0(q=1|j,f2) = 0.4 for f2, and the current user T = 0.8 (80% of the answered features are "understanding"), then P(q=1|j,f2) = (0.4×N+0.8×k) / ( If the information entropy gain ratio of N+k is the largest, then ask f2 first to verify the user's understanding of the core features of the sorting algorithm, rather than asking secondary features with low relevance; the questioning needs to be based on previous questions, user answers, user basic tags and feature association information, so the construction process of the decision tree is actually the following questioning, analysis and re-questioning process: (1) Determine the current data stage (cold start / historical data), and calculate P(q|j,f) of the unquestioned features according to the corresponding logic; (2) Based on P(q|j,f), the user's answers, features (2) Calculate the EntropyGainRatio(j,f) of the unasked features and sort them; (3) Select the feature with the largest EntropyGainRatio(j,f) to ask a question, record the user's answer, and store the question and answer data (B,f,q,c) in the user question and answer behavior database for subsequent updates of P(q|j,f); (4) Recalculate the recommendation confidence. If the confidence does not reach the stopping threshold (e.g., 0.85), return to step (1); otherwise, stop the question and answer process. Similar to the C4.5 algorithm, the improved C4.5 algorithm used in this invention also performs greedy selection through information gain ratio. However, the C4.5 algorithm is deterministic reasoning, while the improved C4.5 algorithm of this invention is "probabilistic reasoning + association correction + phased probability calculation". The object of its entropy calculation is the probability distribution after association correction. This improvement not only solves the problems of undefined P(q|j,f) and cold start dilemma (through domain knowledge initialization and historical data update), but also avoids erroneous preferences for sparse features and calculation bias in high confidence states. At the same time, it solves the problem of loss of feature information without questions, thereby improving the accuracy of recommendation and the practicality of the system.
[0052] The beneficial effects of this embodiment are as follows: This system accurately matches the user's cognitive level through dynamic question answering and feature weight analysis, achieving adaptive recommendation of algorithm teaching content. Graphical interaction lowers the barrier to understanding, and the large model generates personalized suggestions, effectively improving learning efficiency and satisfaction, and solving the problem of beginners' difficulty in understanding algorithm classification.
[0053] All formulas in this invention are dimensionless and calculated numerically. The preset parameters in the formulas can be set by those skilled in the art according to the actual situation.
[0054] The weighting coefficients of this invention are used to measure the degree of influence of different factors or variables on a certain outcome or decision. The weighting coefficient is defined as the numerical value assigned to each factor when comparing and evaluating multiple factors, reflecting their importance or priority. These weighting coefficients can be determined according to specific circumstances and needs, and are usually jointly formulated and confirmed by professionals or relevant stakeholders. By reasonably setting the weighting coefficients, programs or systems can be helped to make decisions or predictions more accurately.
[0055] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
[0056] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to specific implementations. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A computer algorithm visualization teaching generation system based on a large model, characterized in that, include: The preprocessing module constructs the mapping relationship between the categories, core concepts, and features of various algorithms, aggregates algorithm categories into a set called "Category," and extracts user-understandable features into a set called "Feature." It generates a set of candidate feature pairs ("Candidate Feature") through the Cartesian product of the "Category" and "Feature" sets, and obtains an easily understandable feature set ("Algorithm Feature") based on the semantic association rules of the algorithm domain knowledge graph. It then labels the easily understandable features with difficulty levels and constructs the easily understandable feature weight vectors for each algorithm through lexicalization, similarity calculation, and weight allocation. Interactive module: Allows users to select algorithm categories and check preset programming basics tags; Question answering module: Based on the algorithm category and programming basic tags selected by the user, it obtains the user's cognitive information through k rounds of dynamic question answering. In each round, it selects the feature with the largest information entropy gain ratio from the easy-to-understand features that have never been asked before and initiates a question, and the question matches the preset answer options. The teaching content generation module calculates the similarity between the easily understandable feature weight vectors of each algorithm and the target easily understandable feature weight vectors to determine recommended learning content; it generates a fitness assessment and performs the operation; and it displays feedback before and after the algorithm matching results, core concepts, explanations of neutral processing of unasked features, and related learning resources. Extended Module: Converts user learning status profile data into natural language descriptive text containing ambiguity and credibility information, calls the large model interface with preset configuration instructions to obtain learning suggestions, and displays them through interactive visualization. The preset configuration instructions include configuration instructions for generating balanced suggestions based on neutral state analysis of unasked features.
2. The computer algorithm visualization teaching generation system based on a large model as described in claim 1, characterized in that, The semantic association rules of the preprocessing module include the domain adaptability of categories and features and the necessity of teaching scenarios; the construction process of the easy-to-understand feature weight vector is as follows: the algorithm is input into the algorithm teaching feature library to obtain descriptive sentences, after lexicalization, the cosine similarity between each lexical and the easy-to-understand features is calculated, features with similarity exceeding the preset threshold are selected and weights are assigned, and the weights satisfy the normalization constraint.
3. The computer algorithm visualization teaching generation system based on a large model as described in claim 1, characterized in that, The algorithm classification map in the interactive module solves the problem of beginners' difficulty in understanding algorithm classification through a graphical and intuitive form; the programming basic tags selected by the user are used to assist in the probability calculation in the subsequent question and answer module, and together with the algorithm category selection, they achieve a double narrowing of the learning scope.
4. The computer algorithm visualization teaching generation system based on a large model as described in claim 1, characterized in that, The question-answering module stops k rounds of question-answering when "the proportion of answered features covering the key features of the algorithm is greater than or equal to the preset key feature coverage threshold" or "the change in confidence of recommendations over multiple consecutive rounds is less than the preset confidence change threshold". The information entropy gain ratio calculation for each round of questioning combines the user's answered results, the semantic association matrix between features, and the high-weight feature list of candidate algorithms to ensure that the question has both discriminative power and key information coverage.
5. The computer algorithm visualization teaching generation system based on a large model as described in claim 1, characterized in that, The similarity calculation of the teaching content generation module adopts the cosine similarity algorithm; when the suitability assessment value does not reach the preset threshold, the user is prompted to either "adjust the difficulty" or "supplement the unasked features"; the relevant learning resources provided after display include recommended learning paths, practice questions, and explanations of algorithm application scenarios; the execution operations include direct display, display after difficulty adjustment, or recommended prior knowledge learning; the suitability assessment is generated based on the algorithm's basic level, the degree of consistency between question and answer descriptions, and the semantic relevance of unasked features.
6. The computer algorithm visualization teaching generation system based on a large model as described in claim 1, characterized in that, The extended module's natural language description text explicitly marks the neutral processing logic for unasked features; the preset configuration instructions of the large model suggest balancing the domain association strength between user programming basic tags and unasked features; the user learning status profile data includes user historical question and answer data, algorithm classification graph selection records, programming basic tags, algorithm matching results, and unasked feature information.
7. A method for generating computer algorithm visualization teaching based on a large model, used to implement the computer algorithm visualization teaching generation system based on a large model as described in claim 1, characterized in that, The method includes the following steps: Step 1, Data Collection: Collect computer algorithm teaching materials, algorithm domain knowledge, and user behavior data; the algorithm teaching materials are screened for quality assessment to build an algorithm database; the algorithm domain knowledge includes a domain knowledge graph containing association strength labels, semantic association matrices between features, and corresponding difficulty coefficients; the user behavior data is used to build a question-and-answer behavior database containing user programming basic labels, question features, user answers, and algorithm category fields. Step 2, Data Preprocessing: With a fixed set of Category and Feature, CandidateFeature is generated through Cartesian product and easily understandable feature set Algorithm Feature is obtained by filtering based on semantic association rules; the algorithm Decomposition is used to transform the algorithm into a weighted combination of easily understandable features. The algorithm Decomposition includes retrieving description statements, lexicalization, similarity calculation and weight allocation, and finally constructs the easily understandable feature weight vector of each algorithm. Step 3: Matching Degree Calculation: User feedback is obtained through m rounds of dynamic question answering. User answers are extended into Answer vectors according to the rule of neutral default value + related feature correction. Cosine similarity is used to calculate the matching degree between the Answer vector and the weight vector of each algorithm. The teaching content with the highest matching degree is selected as the initial recommendation, and the recommendation confidence is calculated. Step 4: Dynamic Generation of Learning Path: Based on the improved C4.5 algorithm, a question decision tree is generated. The feature-response probability is calculated in stages. The feature of each round of questioning is selected by the information entropy gain ratio until the recommendation confidence reaches the preset threshold, and the final recommended visual teaching content is determined.
8. The computer algorithm visualization teaching generation method based on a large model as described in claim 7, characterized in that, In step one, the algorithm teaching materials are sourced from computer textbooks and educational channels, and the collected content includes the specific steps of the algorithm, implementation code, and analysis of time and space complexity.
9. The computer algorithm visualization teaching generation method based on a large model as described in claim 7, characterized in that, In step four, the feature-response probability is calculated in two stages: The cold start phase adopts a weighted calculation method based on feature difficulty coefficient, basic programming labels, and category-feature association strength; The historical data stage is based on historical frequency statistics and Bayesian update correction. The update formula includes the number of historical samples, the current user understanding ratio, and a preset smoothing coefficient. The improved C4.5 algorithm adds a key feature priority constraint: when the unasked feature belongs to the high-weight features of the candidate algorithm with a preset algorithm ratio, its information entropy gain ratio is multiplied by a preset coefficient.