Course ideological and political case automatic generation method and system based on knowledge graph

By using a knowledge graph-based approach, predefined relationship types and the construction of general and sub-knowledge graphs, curriculum-based ideological and political education cases are automatically generated, solving the problem of low efficiency in individual teacher writing and achieving efficient and professional case generation.

CN121745249APending Publication Date: 2026-03-27XINJIANG NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing cases of ideological and political education in courses mainly rely on individual teachers to collect, organize, and compile them, which is inefficient, makes it difficult to achieve systematization and large-scale implementation, and the quality of the cases is limited by the individual teachers' cognition and energy.

Method used

Using a knowledge graph-based approach, we automatically generate curriculum-based ideological and political education cases based on user needs by predefining relation types, constructing a general knowledge graph and sub-knowledge graphs, including predefining relation types, generating a general knowledge graph, constructing a sub-graph framework, obtaining case content requirements, and text processing.

Benefits of technology

This improved the efficiency and quality of generating ideological and political education cases in courses, ensuring that the generated cases met user needs and were professional.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121745249A_ABST
    Figure CN121745249A_ABST
Patent Text Reader

Abstract

According to the knowledge graph-based course ideological and political case automatic generation method and system provided by the invention, a relationship type is predefined, and a foundation is laid for graph construction and case generation; obtaining course ideological and political theories, subject theories and related instance data, and selecting matched relation types to construct a total knowledge graph to ensure the professionality and accuracy of the graph; the method comprises the following steps: determining case domain requirements, constructing a sub-graph framework based on the case domain requirements and a total knowledge graph, and selecting a matched relationship type for the sub-graph framework so as to construct a sub-knowledge graph and ensure domain and pertinence of graph contents; obtaining a case content demand of a user, and traversing in the total knowledge graph and the sub-knowledge graph to obtain a core path; the method comprises the steps of presetting a case template, configuring a content constraint rule for the case template, mapping entities and relationships on a core path into the case template based on the content constraint rule for text processing, obtaining course ideological and political cases, and improving the generation efficiency and quality of the cases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of curriculum-based ideological and political education case design technology, and in particular to a method and system for automatically generating curriculum-based ideological and political education cases based on knowledge graphs. Background Technology

[0003] The construction of ideological and political education in courses is not a one-time effort, but is closely related to the education system and corresponding course content, and evolves continuously with social development. Currently, cases of ideological and political education in courses mainly rely on individual teachers to collect, organize, and compile them, but this method is inefficient, difficult to systematize and scale up, and the quality of cases is limited by the individual teacher's cognition and energy.

[0004] Therefore, it is necessary to propose a method and system for automatically generating ideological and political education cases in courses based on knowledge graphs to solve the above problems. Summary of the Invention

[0005] Given that existing curriculum-based ideological and political education cases mainly rely on individual teachers for collection, organization, and writing, this method is inefficient, difficult to systematize and scale, and the quality of cases is limited by the individual teacher's knowledge and energy. One of the purposes of this application is to provide a knowledge graph-based method and system for automatically generating curriculum-based ideological and political education cases. This method combines user needs to generate a general knowledge graph and more detailed sub-knowledge graphs in the relevant fields. Based on user needs, it traverses the general knowledge graph and sub-knowledge graphs to automatically generate curriculum-based ideological and political education cases that meet the requirements, thereby improving the efficiency and quality of case generation.

[0006] To achieve the above objectives, this application adopts the following technical solution: The method for automatically generating curriculum-based ideological and political education cases based on knowledge graphs includes the following steps: Step S10: Predefine relation types; acquire curriculum ideological and political theory, discipline theory and related instance data; select matching relation types from the predefined relation types based on the curriculum ideological and political theory, discipline theory and related instance data to obtain the first candidate relation; construct the overall knowledge graph based on the first candidate relation. Step S20: Determine the case domain requirements; construct a sub-graph framework based on the case domain requirements and the overall knowledge graph; select a matching relation type for the sub-graph framework from predefined relation types to obtain a second candidate relation; construct a sub-knowledge graph based on the second candidate relation. Step S30: Obtain the user's case content requirements; based on the case content requirements, traverse the total knowledge graph and sub-knowledge graphs to obtain the core path; Step S40: Preset a case template, configure content constraint rules for the case template, and map the entities and relationships corresponding to the core path to the case template based on the content constraint rules; perform text processing on the entities and relationships in the case template to obtain curriculum ideological and political cases.

[0007] In one embodiment disclosed in this application, in step S10, a relation type is predefined; curriculum ideological and political theory, discipline theory, and related instance data are obtained; a matching relation type is selected from the predefined relation types based on the curriculum ideological and political theory, discipline theory, and related instance data to obtain a first candidate relation; and the construction of a total knowledge graph based on the first candidate relation includes: A relational framework is constructed, encompassing multiple relation types, including cognitive logic relations, value mapping relations, and teaching application relations. Historical case data is collected, and semantic analysis and entity relation extraction are performed on the historical case data to obtain various associations. Semantic relations, relational attributes, entity types, trigger words, domains, and value ranges are defined for each of these associations. The entity types include ideological and political elements, disciplinary concepts, and theoretical methods. The relational attributes include confidence, source, and strength. The domain and value range limit the entity types at the start and end points of the associations. Based on the semantic relations, relational attributes, and entity types of the associations, the various associations are categorized into the corresponding relation types within the relational framework, resulting in predefined relation types. Data on ideological and political education in courses, disciplinary theories, and related examples are collected. This data is preprocessed and transformed into structured data. Entity identification and relation extraction are performed on the structured data. Entities are classified according to their types. The entity types and relations in the structured data are matched with predefined relation types to obtain one or more first candidate relations. Semantic similarity is calculated for entities from different sources. Entities with semantic similarity greater than a set threshold are aligned and their relations are fused. The aligned and fused entities and relations are mapped to the same entity node and edge, respectively. The entity node and edge are stored in a graph database according to the first candidate relations to obtain the overall knowledge graph.

[0008] In one embodiment of this application, in step S20, the case domain requirements are determined, and a sub-graph framework is constructed based on the case domain requirements and the overall knowledge graph; a matching relation type is selected for the sub-graph framework from predefined relation types to obtain a second candidate relation; and the construction of the sub-knowledge graph based on the second candidate relation includes: The requirements of the case domains involved in the ideological and political education cases are determined. These requirements include target domain requirements, knowledge depth and breadth requirements, teaching scenario requirements, ideological and political focus requirements, and application scenario requirements. Entity nodes associated with the target domain requirements are selected from the overall knowledge graph through semantic similarity calculation. A graph centrality algorithm is used to identify core nodes with a central position within the target domain requirements from these associated entity nodes. Representative nodes are also identified from the associated entity nodes based on the teaching scenario requirements and application scenario requirements. Entity nodes and relationships associated with the core nodes and representative nodes are extracted from the overall knowledge graph. A sub-graph skeleton is constructed based on the core nodes, representative nodes, and their associated entity nodes and relationships. The entities corresponding to all entity nodes in the subgraph skeleton are classified according to their entity types. The classified entity types and relationships in the subgraph framework are matched with the predefined relationship types to obtain one or more second candidate relationships. External professional resources are acquired based on the knowledge depth and breadth requirements. Based on the external professional resources, the associated entities and relationships are expanded in multiple hops according to the second candidate relationships to obtain a primary subgraph. Based on the ideological and political focus requirements, a deep association is established between the primary subgraph and entity nodes in the total knowledge graph whose entity type is ideological and political elements to obtain a sub-knowledge graph. A bidirectional mapping relationship and an incremental synchronization mechanism are established between the sub-knowledge graph and the total knowledge graph.

[0009] In one embodiment disclosed in this application, in step S30, the user's case content requirements are obtained; based on the case content requirements, the core path is obtained by traversing the overall knowledge graph and sub-knowledge graphs, including: The user inputs a multidimensional query vector, which includes one or more of the following: target domain requirements, knowledge depth and breadth requirements, tutorial scenario requirements, ideological and political focus requirements, and application scenario requirements, and uses this as the user's case content requirements. The multidimensional query vector is subjected to semantic analysis and keyword extraction. The semantic analysis results and the extracted keywords are matched with predefined semantic relationships and trigger words of relationship types to obtain one or more retrieval relationship types. The extracted keywords are then matched with entities in the overall knowledge graph. A graph centrality algorithm is used to calculate the influence of the matched entity nodes. Entity nodes with influence values ​​higher than a preset threshold are selected as retrieval nodes. The matching degree between each sub-knowledge graph and the multidimensional query vector and retrieval nodes is calculated. Sub-knowledge graphs with matching degrees higher than a preset threshold are selected as sub-graphs to be retrieved. Starting from the retrieval node, the retrieval sub-graph is traversed based on the retrieval relationship type. Multiple paths formed by traversed entities and their connecting relationships are selected as multiple candidate paths. The multiple candidate paths are deduplicated. The performance of the deduplicated candidate paths is scored based on relationship attributes. The candidate paths with performance scores higher than a preset threshold are selected as core paths.

[0010] In one embodiment disclosed in this application, in step S40, a case template is preset, content constraint rules are configured for the case template, and entities and relationships corresponding to the core path are mapped to the case template based on the content constraint rules; text processing is performed on the entities and relationships within the case template to obtain curriculum-based ideological and political education cases, including: A pre-defined structured template containing multiple themes is used as a case template. Content constraint rules are configured for each theme of the case template. The content constraint rules include entity constraint rules and relation constraint rules. Entities and relations on the core path are classified according to entity type and semantic relationship. Based on the entity constraint rules and relation constraint rules, the classified entities and relations are mapped to the corresponding themes of the case template. After preprocessing, the entities and relationships within each topic are organized and sorted in a logical order to obtain structured information. The logical order includes chronological order, causal order, and deductive order. The general language model is adjusted for domain-specific application using the curriculum-based ideological and political education theory, discipline theory, and relevant example data to obtain a language adaptation model. The structured information is then converted into natural language text using the language adaptation model, and transition sentences are generated between adjacent topics in the case template to obtain curriculum-based ideological and political education cases.

[0011] The knowledge graph-based automatic generation system for ideological and political education case studies in courses includes the following modules: The relation type predefined module is used to predefine relation types; The overall knowledge graph generation module is used to acquire curriculum ideological and political theory, discipline theory and related instance data, select matching relation types from predefined relation types based on the curriculum ideological and political theory, discipline theory and related instance data to obtain the first candidate relation, and construct the overall knowledge graph based on the first candidate relation. The subgraph framework construction module is used to determine the case domain requirements and construct the subgraph framework based on the case domain requirements and the overall knowledge graph. The sub-knowledge graph generation module is used to select a matching relation type for the sub-graph framework from predefined relation types to obtain a second candidate relation, and to construct a sub-knowledge graph based on the second candidate relation. The requirement elicitation module is used to obtain users' case content requirements; The core path generation module is used to traverse the overall knowledge graph and sub-knowledge graphs based on the content requirements of the case to obtain the core path. The content filling module is used to preset case templates, configure content constraint rules for the case templates, and map the entities and relationships corresponding to the core path to the case templates based on the content constraint rules. The text processing module is used to process the entities and relationships within the case template to obtain curriculum-based ideological and political education cases.

[0012] In one embodiment disclosed in this application, the relation type predefinition module, used to predefine relation types, includes: A relational framework is constructed, encompassing multiple relation types, including cognitive logic relations, value mapping relations, and teaching application relations. Historical case data is collected, and semantic analysis and entity relation extraction are performed on the historical case data to obtain various associations. Semantic relations, relational attributes, entity types, trigger words, domains, and value ranges are defined for each of these associations. The entity types include ideological and political elements, disciplinary concepts, and theoretical methods. The relational attributes include confidence, source, and strength. The domain and value range limit the entity types at the start and end points of the associations. Based on the semantic relations, relational attributes, and entity types of the associations, the various associations are categorized into the corresponding relation types within the relational framework, resulting in predefined relation types. The overall knowledge graph generation module is used to acquire curriculum-based ideological and political education theory, disciplinary theory, and related instance data; select matching relation types from predefined relation types based on the curriculum-based ideological and political education theory, disciplinary theory, and related instance data to obtain a first candidate relation; and construct the overall knowledge graph based on the first candidate relation, including: Data on ideological and political education in courses, disciplinary theories, and related examples are collected. This data is preprocessed and transformed into structured data. Entity identification and relation extraction are performed on the structured data. Entities are classified according to their types. The entity types and relations in the structured data are matched with predefined relation types to obtain one or more first candidate relations. Semantic similarity is calculated for entities from different sources. Entities with semantic similarity greater than a set threshold are aligned and their relations are fused. The aligned and fused entities and relations are mapped to the same entity node and edge, respectively. The entity node and edge are stored in a graph database according to the first candidate relations to obtain the overall knowledge graph.

[0013] In one embodiment disclosed in this application, the sub-graph framework construction module is used to determine case domain requirements, and construct a sub-graph framework based on the case domain requirements and the overall knowledge graph, including: The requirements of the case domains involved in the ideological and political education cases are determined. These requirements include target domain requirements, knowledge depth and breadth requirements, teaching scenario requirements, ideological and political focus requirements, and application scenario requirements. Entity nodes associated with the target domain requirements are selected from the overall knowledge graph through semantic similarity calculation. A graph centrality algorithm is used to identify core nodes with a central position within the target domain requirements from these associated entity nodes. Representative nodes are also identified from the associated entity nodes based on the teaching scenario requirements and application scenario requirements. Entity nodes and relationships associated with the core nodes and representative nodes are extracted from the overall knowledge graph. A sub-graph skeleton is constructed based on the core nodes, representative nodes, and their associated entity nodes and relationships. The sub-knowledge graph generation module is used to select a matching relation type for the sub-graph framework from predefined relation types to obtain a second candidate relation, and to construct a sub-knowledge graph based on the second candidate relation, including: The entities corresponding to all entity nodes in the subgraph skeleton are classified according to their entity types. The classified entity types and relationships in the subgraph framework are matched with the predefined relationship types to obtain one or more second candidate relationships. External professional resources are acquired based on the knowledge depth and breadth requirements. Based on the external professional resources, the associated entities and relationships are expanded in multiple hops according to the second candidate relationships to obtain a primary subgraph. Based on the ideological and political focus requirements, a deep association is established between the primary subgraph and entity nodes in the total knowledge graph whose entity type is ideological and political elements to obtain a sub-knowledge graph. A bidirectional mapping relationship and an incremental synchronization mechanism are established between the sub-knowledge graph and the total knowledge graph.

[0014] In one embodiment disclosed in this application, the requirement acquisition module is used to acquire the user's case content requirements, including: The user inputs a multidimensional query vector, which includes one or more of the following: target domain requirements, knowledge depth and breadth requirements, tutorial scenario requirements, ideological and political focus requirements, and application scenario requirements, and uses this as the user's case content requirements. The core path generation module is used to traverse the overall knowledge graph and sub-knowledge graphs based on the case content requirements to obtain the core path, which includes: The multidimensional query vector is subjected to semantic analysis and keyword extraction. The semantic analysis results and the extracted keywords are matched with predefined semantic relationships and trigger words of relationship types to obtain one or more retrieval relationship types. The extracted keywords are then matched with entities in the overall knowledge graph. A graph centrality algorithm is used to calculate the influence of the matched entity nodes. Entity nodes with influence values ​​higher than a preset threshold are selected as retrieval nodes. The matching degree between each sub-knowledge graph and the multidimensional query vector and retrieval nodes is calculated. Sub-knowledge graphs with matching degrees higher than a preset threshold are selected as sub-graphs to be retrieved. Starting from the retrieval node, the retrieval sub-graph is traversed based on the retrieval relationship type. Multiple paths formed by traversed entities and their connecting relationships are selected as multiple candidate paths. The multiple candidate paths are deduplicated. The performance of the deduplicated candidate paths is scored based on relationship attributes. The candidate paths with performance scores higher than a preset threshold are selected as core paths.

[0015] In one embodiment disclosed in this application, the content filling module is used to preset a case template, configure content constraint rules for the case template, and map entities and relationships corresponding to the core path to the case template based on the content constraint rules, including: A pre-defined structured template containing multiple themes is used as a case template. Content constraint rules are configured for each theme of the case template. The content constraint rules include entity constraint rules and relation constraint rules. Entities and relations on the core path are classified according to entity type and semantic relationship. Based on the entity constraint rules and relation constraint rules, the classified entities and relations are mapped to the corresponding themes of the case template. The text processing module is used to process the entities and relationships within the case template to obtain curriculum-based ideological and political education cases, including: After preprocessing, the entities and relationships within each topic are organized and sorted in a logical order to obtain structured information. The logical order includes chronological order, causal order, and deductive order. The general language model is adjusted for domain-specific application using the curriculum-based ideological and political education theory, discipline theory, and relevant example data to obtain a language adaptation model. The structured information is then converted into natural language text using the language adaptation model, and transition sentences are generated between adjacent topics in the case template to obtain curriculum-based ideological and political education cases.

[0016] Compared with existing technologies, the beneficial effects of this invention are as follows: Predefining relation types lays a reasonable model foundation for subsequent graph construction and case generation; acquiring curriculum-based ideological and political education theory, disciplinary theory, and related example data, and selecting matching relation types from the predefined relation types based on these data to construct the overall knowledge graph, ensuring its professionalism and accuracy; determining case domain requirements, and constructing sub-graph frameworks based on these requirements and the overall knowledge graph; selecting matching relation types from the predefined relation types for the sub-graph frameworks to construct the sub-knowledge graph, ensuring the domain-specificity and relevance of the graph content; acquiring user case content requirements, and traversing the overall and sub-knowledge graphs based on these requirements to obtain targeted core paths that meet user needs; and pre-setting case templates, configuring content constraint rules for the templates, mapping entities and relationships corresponding to the core paths to the templates based on these rules, and performing text processing on the entities and relationships within the templates to obtain curriculum-based ideological and political education cases, thus improving the efficiency and quality of case generation. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating the knowledge graph-based method for automatically generating curriculum-based ideological and political education cases provided in this application; Figure 2 A schematic diagram of the framework of the knowledge graph-based automatic generation system for ideological and political education cases in courses provided in this application. Detailed Implementation

[0019] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of the invention. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.

[0020] The terms “comprising” and “having”, and any variations thereof, used in this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0022] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0023] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0024] Figure 1 This is a flowchart illustrating the knowledge graph-based method for automatically generating ideological and political education cases in courses, as provided in this application. The method includes the following steps: Step S10: Predefine relation types; acquire curriculum ideological and political theory, discipline theory and related instance data; select matching relation types from the predefined relation types based on the curriculum ideological and political theory, discipline theory and related instance data to obtain the first candidate relation; construct the overall knowledge graph based on the first candidate relation. Step S20: Determine the case domain requirements; based on the case domain requirements and the overall knowledge graph, construct a sub-graph framework; select a matching relation type from the predefined relation types for the sub-graph framework to obtain a second candidate relation; construct a sub-knowledge graph based on the second candidate relation. Step S30: Obtain the user's case content requirements; based on the case content requirements, traverse the overall knowledge graph and sub-knowledge graphs to obtain the core path; Step S40: Preset a case template, configure content constraint rules for the case template, and map the entities and relationships corresponding to the core path to the case template based on the content constraint rules; perform text processing on the entities and relationships in the case template to obtain curriculum ideological and political cases.

[0025] This knowledge graph-based method for automatically generating curriculum-based ideological and political education cases predefines relation types, laying a reasonable model foundation for subsequent graph construction and case generation. It acquires curriculum-based ideological and political education theories, disciplinary theories, and relevant example data. Based on these data, it selects matching relation types from the predefined relation types to construct the overall knowledge graph, ensuring its professionalism and accuracy. It then determines the case domain requirements and constructs a sub-graph framework based on these requirements and the overall knowledge graph. Matching relation types are selected from the predefined relation types for each sub-graph framework, ensuring the domain relevance and relevance of the graph content. Finally, it acquires the user's case content requirements and traverses the overall and sub-knowledge graphs to obtain targeted core paths that meet the user's needs. Furthermore, it pre-sets case templates, configures content constraint rules for these templates, maps entities and relationships on the core paths to the templates, and processes the entities and relationships within the templates to obtain curriculum-based ideological and political education cases, improving the efficiency and quality of case generation.

[0026] Preferably, in step S10, a relation type is predefined; curriculum-based ideological and political education theory, discipline theory, and related instance data are acquired; based on this curriculum-based ideological and political education theory, discipline theory, and related instance data, a matching relation type is selected from the predefined relation types to obtain a first candidate relation; and the overall knowledge graph is constructed based on this first candidate relation, including: A relational framework is constructed, encompassing multiple relation types, including cognitive logic relations, value mapping relations, and teaching application relations. Historical case data is collected, and semantic analysis and entity relation extraction are performed on this data to obtain various associations. Semantic relations, relational attributes, entity types, trigger words, domains, and value ranges are defined for each of these associations. Entity types include ideological and political elements, disciplinary concepts, and theoretical methods; relational attributes include confidence, source, and strength; and the domain and value range limit the entity types at the start and end points of the association. Based on the semantic relations, relational attributes, and entity types of these associations, they are categorized into the corresponding relation types within the relational framework, resulting in predefined relation types. Data on curriculum-based ideological and political education theories, disciplinary theories, and related examples are collected. This data is preprocessed and transformed into structured data. Entity identification and relation extraction are performed on this structured data. Entities are classified according to their type. The entity types and relations in the structured data are matched with predefined relation types to obtain one or more first-candidate relations. Semantic similarity is calculated for entities from different sources. Entities with semantic similarity greater than a set threshold are aligned and their relations are fused. The aligned and fused entities and relations are mapped to the same entity node and edge, respectively. These entity nodes and edges are stored in a graph database according to the first-candidate relations to obtain the overall knowledge graph.

[0027] In the above scheme, a relational framework is constructed using existing theories and domain knowledge. Historical case data is collected to populate the various relation types within the framework, ensuring a sufficiently comprehensive set of predefined relationships. This lays the foundation for subsequent graph construction and case generation. The relation types within the framework are categorized into cognitive logic relationships, value mapping relationships, and teaching application relationships, enabling efficient management of these relationships. Preprocessing of curriculum-based ideological and political education theories, disciplinary theories, and related example data includes, but is not limited to, data cleaning and terminology standardization. Transforming unstructured text into structured data refers to converting unstructured text into JSON or XML records with fixed fields. Semantic similarity calculations are performed on entities from different sources, including feature extraction and transformation into machine-processable vectors. Cosine similarity is then used to calculate the similarity between two vectors. The entity types and relationships in the structured data are matched with the entity types and semantic relationships in the predefined relation types to obtain first-candidate relationships. These first-candidate relationships constrain the generated knowledge graph, ensuring its professionalism and accuracy.

[0028] Preferably, in step S20, the case domain requirements are determined, and a sub-graph framework is constructed based on the case domain requirements and the overall knowledge graph; a matching relation type is selected for the sub-graph framework from predefined relation types to obtain a second candidate relation, and the sub-knowledge graph is constructed based on the second candidate relation, including: The requirements of the case domains involved in the ideological and political education cases are determined. These requirements include the target domain requirements, knowledge depth and breadth requirements, teaching scenario requirements, ideological and political focus requirements, and application scenario requirements. Through semantic similarity calculation, entity nodes related to the target domain requirements are selected from the overall knowledge graph. Then, through the graph centrality algorithm, the core node with a central position in the target domain requirements is identified from the related entity nodes. Based on the teaching scenario requirements and application scenario requirements, representative nodes are also identified from the related entity nodes. Entity nodes and relationships associated with the core node and representative node are extracted from the overall knowledge graph. Based on the core node, representative node, and their associated entity nodes and relationships, a sub-graph skeleton is constructed. The entities corresponding to all entity nodes in the subgraph skeleton are classified according to their entity types. The classified entity types and the relationships in the subgraph framework are matched with the predefined relationship types to obtain one or more second candidate relationships. Based on the knowledge depth and breadth requirements, external professional resources are acquired. Based on the external professional resources, the related entities and relationships are expanded in multiple hops according to the second candidate relationships to obtain a primary subgraph. Based on the ideological and political focus requirements, a deep association is established between the primary subgraph and the entity nodes in the total knowledge graph whose entity type is ideological and political elements to obtain a sub-knowledge graph. A bidirectional mapping relationship and incremental synchronization mechanism are established between the sub-knowledge graph and the total knowledge graph.

[0029] In the above steps, based on the analysis of existing cases, the needs of the case domains involved in the ideological and political education cases are determined. It should be noted that multiple different sub-knowledge graphs can be generated depending on the different needs of the target domain. After analyzing the needs of the target domain, they are transformed into a demand vector, and the entities in the total knowledge graph are transformed into entity vectors. The cosine similarity between the demand vector and each entity vector is calculated, and the entity nodes corresponding to the entity vectors with similarity higher than a preset threshold are taken as entity nodes associated with the needs of the target domain. The betweenness centrality algorithm is used to find core nodes from the associated entity nodes, that is, to select entity nodes with high influence. Similarly, semantic similarity calculation is used to find representative nodes from the associated entity nodes according to the needs of the tutorial scenario and the application scenario, that is, to select entity nodes that are iconic in specific tutorial scenarios and application scenarios. The sub-graph skeleton is constructed using the entity nodes with high influence and iconic status, as well as their associated entity nodes and relationships, to ensure the stability of the structure and the relevance of the content. The entities and relationships in the sub-knowledge graph skeleton are matched with predefined relationship types to ensure semantic consistency between the overall knowledge graph and the sub-knowledge graph. The scope of external professional resources acquired by the web crawler is constrained based on knowledge depth and breadth requirements, thereby limiting the number of hops in multi-hop expansion and preventing the graph from becoming too large. Based on the focus of ideological and political education, entity nodes of relevant ideological and political elements are selected from the overall knowledge graph. All non-ideological and political element entity nodes in the primary sub-graph are identified, and their semantic similarity with each relevant ideological and political element entity node is calculated. For each non-ideological and political element entity node, one or more associations with relevant ideological and political element entity nodes with similarity exceeding a preset threshold are established, achieving the organic integration of professional knowledge and ideological and political education elements, and ensuring the domain-specificity and relevance of the sub-knowledge graph.

[0030] In step S30, the user's case content requirements are obtained; based on these requirements, the entire knowledge graph and sub-knowledge graphs are traversed to obtain the core paths, including: The user inputs a multidimensional query vector, which includes one or more of the following: target domain requirements, knowledge depth and breadth requirements, tutorial scenario requirements, ideological and political focus requirements, and application scenario requirements, and uses this as the user's case content requirements. Semantic analysis and keyword extraction are performed on the multidimensional query vector. The semantic analysis results and the extracted keywords are matched with predefined semantic relationships and trigger words to obtain one or more retrieval relationship types. The extracted keywords are then matched with entities in the overall knowledge graph. A graph centrality algorithm is used to calculate the influence of the matched entity nodes. Entity nodes with influence values ​​higher than a preset threshold are selected as retrieval nodes. The matching degree between each sub-knowledge graph and the multidimensional query vector and retrieval nodes is calculated. Sub-knowledge graphs with matching degrees higher than a preset threshold are selected as sub-graphs to be retrieved. Starting from the retrieval node, the retrieval relationship type is used to traverse the sub-graph to be retrieved. Multiple paths formed by traversed entities and their connecting relationships are selected as candidate paths. These candidate paths are deduplicated, and their performance is scored based on relationship attributes. The candidate path with a performance score higher than a preset threshold is selected as the core path.

[0031] In the above technical solution, a multi-dimensional query vector is used as input. The retrieval relationship type is matched based on the multi-dimensional query vector to ensure the relevance, dynamism, and accuracy of the generated cases. Specifically, PageRank is used to calculate the influence of matched entity nodes in the overall knowledge graph, thereby extracting the most influential entity nodes and preventing the sub-knowledge graph from becoming too large. The matching degree between each sub-knowledge graph and the multi-dimensional query vector and retrieval node is calculated, including the number and weight of retrieval nodes in the sub-knowledge graph, and the number and weight of each entity node in the sub-knowledge graph matching the keywords extracted from the multi-dimensional query vector. These two factors are combined to obtain the matching degree score of the sub-knowledge graph. Performance scoring is performed on multiple candidate paths after deduplication based on relation attributes to ensure the reliability and stability of the obtained core path. It should be noted that there can be one or more core paths, and the corresponding generated curriculum-based ideological and political education cases can also be one or more, allowing users to choose from multiple cases.

[0032] Preferably, in step S40, a case template is preset, and content constraint rules are configured for the case template. Based on these content constraint rules, the entities and relationships corresponding to the core path are mapped to the case template. Text processing is performed on the entities and relationships within the case template to obtain curriculum-based ideological and political education cases, including: A pre-defined structured template containing multiple themes is used as a case template. Content constraint rules are configured for each theme of the case template. These content constraint rules include entity constraint rules and relation constraint rules. Entities and relations on the core path are classified according to their entity type and semantic relationship. Based on the entity constraint rules and relation constraint rules, the classified entities and relations are mapped to the corresponding themes of the case template. After preprocessing, the entities and relationships within each topic are organized and sorted in a logical order to obtain structured information. This logical order includes chronological order, causal order, and deductive order. The general language model is then adjusted for domain-specific application using the curriculum-based ideological and political education theory, disciplinary theory, and relevant example data to obtain a language adaptation model. This structured information is then transformed into natural language text using the language adaptation model, and transition sentences are generated between adjacent topics in the case template to obtain a curriculum-based ideological and political education case.

[0033] In the above technical solution, by pre-setting structured case templates, the generated curriculum-based ideological and political education cases are ensured to be complete and standardized. These multiple themes include, but are not limited to, case titles, teaching backgrounds, event / person descriptions, core knowledge points, mapped ideological and political points, and ideological insights. Entity constraint rules and relation constraint rules are configured for each theme of the case template, thereby restricting the types of entities and relationships that can be mapped to each theme and improving the accuracy of the content in the corresponding theme. Specifically, the domain-specific adjustments to the large language adaptation model include: constructing a domain training corpus based on curriculum-based ideological and political education theory, disciplinary theory, and relevant example data; cleaning and transforming the curriculum-based ideological and political education theory, disciplinary theory, and relevant example data into structured instruction-output pairs; extracting transition sentences and their corresponding contexts from historical case data; cleaning and transforming the transition sentences and their corresponding contexts into structured breakpoint-continuation pairs; inputting the domain training corpus into a general large oracle model for preliminary training; then inputting the instruction-output pairs into the pre-trained general large oracle model for supervised training to obtain a domain-specific large language model; and finally inputting the breakpoint-continuation pairs into the domain-specific large language model for supervised training to obtain a large language adaptation model. This ensures that the text processed by the large language adaptation model has sufficient professionalism and standardization.

[0034] Figure 2 A schematic diagram of the framework of the knowledge graph-based automatic generation system for ideological and political education cases in courses provided in this application. This knowledge graph-based automatic generation system for ideological and political education cases in courses includes the following modules: The relation type predefined module is used to predefine relation types; The overall knowledge graph generation module is used to acquire curriculum ideological and political theory, discipline theory and related instance data, select matching relation types from predefined relation types based on the curriculum ideological and political theory, discipline theory and related instance data to obtain the first candidate relation, and construct the overall knowledge graph based on the first candidate relation. The subgraph framework construction module is used to determine the case domain requirements and construct the subgraph framework based on the case domain requirements and the overall knowledge graph. The sub-knowledge graph generation module is used to select a matching relation type for the sub-graph framework from predefined relation types, obtain a second candidate relation, and construct the sub-knowledge graph based on the second candidate relation. The requirement elicitation module is used to obtain users' case content requirements; The core path generation module is used to traverse the overall knowledge graph and sub-knowledge graphs based on the content requirements of the case to obtain the core path. The content population module is used to preset case templates, configure content constraint rules for the case templates, and map the entities and relationships corresponding to the core path to the case templates based on the content constraint rules. The text processing module is used to process the entities and relationships within the case template to obtain a case study on ideological and political education.

[0035] This knowledge graph-based automatic generation system for ideological and political education cases in courses predefines relation types, laying a reasonable model foundation for subsequent graph construction and case generation. It acquires theoretical data on ideological and political education in courses, disciplinary theories, and relevant examples. Based on this data, it selects matching relation types from the predefined relation types to construct the overall knowledge graph, ensuring its professionalism and accuracy. It then determines the domain requirements for cases and constructs sub-graph frameworks based on these requirements and the overall knowledge graph. Matching relation types are selected from the predefined relation types for each sub-graph framework, ensuring the domain relevance and relevance of the graph content. Finally, it acquires the user's case content requirements and traverses the overall and sub-knowledge graphs to obtain targeted core paths that meet the user's needs. The system also pre-sets case templates, configures content constraint rules for these templates, maps entities and relationships on the core paths to the templates, and processes the entities and relationships within the templates to generate ideological and political education cases, improving the efficiency and quality of case generation.

[0036] Preferably, the relation type predefinition module, used to predefine relation types, includes: A relational framework is constructed, encompassing multiple relation types, including cognitive logic relations, value mapping relations, and teaching application relations. Historical case data is collected, and semantic analysis and entity relation extraction are performed on this data to obtain various associations. Semantic relations, relational attributes, entity types, trigger words, domains, and value ranges are defined for each of these associations. Entity types include ideological and political elements, disciplinary concepts, and theoretical methods; relational attributes include confidence, source, and strength; and the domain and value range limit the entity types at the start and end points of the association. Based on the semantic relations, relational attributes, and entity types of these associations, they are categorized into the corresponding relation types within the relational framework, resulting in predefined relation types. The overall knowledge graph generation module is used to acquire curriculum-based ideological and political education theory, disciplinary theory, and related example data. Based on this data, it selects matching relation types from predefined relation types to obtain first candidate relations. The overall knowledge graph is then constructed based on these first candidate relations, including: Data on curriculum-based ideological and political education theories, disciplinary theories, and related examples are collected. This data is preprocessed and transformed into structured data. Entity identification and relation extraction are performed on this structured data. Entities are classified according to their type. The entity types and relations in the structured data are matched with predefined relation types to obtain one or more first-candidate relations. Semantic similarity is calculated for entities from different sources. Entities with semantic similarity greater than a set threshold are aligned and their relations are fused. The aligned and fused entities and relations are mapped to the same entity node and edge, respectively. These entity nodes and edges are stored in a graph database according to the first-candidate relations to obtain the overall knowledge graph.

[0037] In the above scheme, a relational framework is constructed using existing theories and domain knowledge. Historical case data is collected to populate the various relation types within the framework, ensuring a sufficiently comprehensive set of predefined relationships. This lays the foundation for subsequent graph construction and case generation. The relation types within the framework are categorized into cognitive logic relationships, value mapping relationships, and teaching application relationships, enabling efficient management of these relationships. Preprocessing of curriculum-based ideological and political education theories, disciplinary theories, and related example data includes, but is not limited to, data cleaning and terminology standardization. Transforming unstructured text into structured data refers to converting unstructured text into JSON or XML records with fixed fields. Semantic similarity calculations are performed on entities from different sources, including feature extraction and transformation into machine-processable vectors. Cosine similarity is then used to calculate the similarity between two vectors. The entity types and relationships in the structured data are matched with the entity types and semantic relationships in the predefined relation types to obtain first-candidate relationships. These first-candidate relationships constrain the generated knowledge graph, ensuring its professionalism and accuracy.

[0038] Preferably, the sub-graph framework construction module is used to determine the case domain requirements, and based on the case domain requirements and the overall knowledge graph, constructs the sub-graph framework including: The requirements of the case domains involved in the ideological and political education cases are determined. These requirements include the target domain requirements, knowledge depth and breadth requirements, teaching scenario requirements, ideological and political focus requirements, and application scenario requirements. Through semantic similarity calculation, entity nodes related to the target domain requirements are selected from the overall knowledge graph. Then, through the graph centrality algorithm, the core node with a central position in the target domain requirements is identified from the related entity nodes. Based on the teaching scenario requirements and application scenario requirements, representative nodes are also identified from the related entity nodes. Entity nodes and relationships associated with the core node and representative node are extracted from the overall knowledge graph. Based on the core node, representative node, and their associated entity nodes and relationships, a sub-graph skeleton is constructed. This sub-knowledge graph generation module is used to select a matching relation type from predefined relation types for the sub-graph framework, obtain a second candidate relation, and construct the sub-knowledge graph based on the second candidate relation, including: The entities corresponding to all entity nodes in the subgraph skeleton are classified according to their entity types. The classified entity types and the relationships in the subgraph framework are matched with the predefined relationship types to obtain one or more second candidate relationships. Based on the knowledge depth and breadth requirements, external professional resources are acquired. Based on the external professional resources, the related entities and relationships are expanded in multiple hops according to the second candidate relationships to obtain a primary subgraph. Based on the ideological and political focus requirements, a deep association is established between the primary subgraph and the entity nodes in the total knowledge graph whose entity type is ideological and political elements to obtain a sub-knowledge graph. A bidirectional mapping relationship and incremental synchronization mechanism are established between the sub-knowledge graph and the total knowledge graph.

[0039] In the above steps, based on the analysis of existing cases, the needs of the case domains involved in the ideological and political education cases are determined. It should be noted that multiple different sub-knowledge graphs can be generated depending on the different needs of the target domain. After analyzing the needs of the target domain, they are transformed into a demand vector, and the entities in the total knowledge graph are transformed into entity vectors. The cosine similarity between the demand vector and each entity vector is calculated, and the entity nodes corresponding to the entity vectors with similarity higher than a preset threshold are taken as entity nodes associated with the needs of the target domain. The betweenness centrality algorithm is used to find core nodes from the associated entity nodes, that is, to select entity nodes with high influence. Similarly, semantic similarity calculation is used to find representative nodes from the associated entity nodes according to the needs of the tutorial scenario and the application scenario, that is, to select entity nodes that are iconic in specific tutorial scenarios and application scenarios. The sub-graph skeleton is constructed using the entity nodes with high influence and iconic status, as well as their associated entity nodes and relationships, to ensure the stability of the structure and the relevance of the content. The entities and relationships in the sub-knowledge graph skeleton are matched with predefined relationship types to ensure semantic consistency between the overall knowledge graph and the sub-knowledge graph. The scope of external professional resources acquired by the web crawler is constrained based on knowledge depth and breadth requirements, thereby limiting the number of hops in multi-hop expansion and preventing the graph from becoming too large. Based on the focus of ideological and political education, entity nodes of relevant ideological and political elements are selected from the overall knowledge graph. All non-ideological and political element entity nodes in the primary sub-graph are identified, and their semantic similarity with each relevant ideological and political element entity node is calculated. For each non-ideological and political element entity node, one or more associations with relevant ideological and political element entity nodes with similarity exceeding a preset threshold are established, achieving the organic integration of professional knowledge and ideological and political education elements, and ensuring the domain-specificity and relevance of the sub-knowledge graph.

[0040] Preferably, the requirement acquisition module is used to acquire the user's case content requirements, including: The user inputs a multidimensional query vector, which includes one or more of the following: target domain requirements, knowledge depth and breadth requirements, tutorial scenario requirements, ideological and political focus requirements, and application scenario requirements, and uses this as the user's case content requirements. The core path generation module is used to traverse the overall knowledge graph and sub-knowledge graphs based on the content requirements of this case, and obtain the core paths, including: Semantic analysis and keyword extraction are performed on the multidimensional query vector. The semantic analysis results and the extracted keywords are matched with predefined semantic relationships and trigger words to obtain one or more retrieval relationship types. The extracted keywords are then matched with entities in the overall knowledge graph. A graph centrality algorithm is used to calculate the influence of the matched entity nodes. Entity nodes with influence values ​​higher than a preset threshold are selected as retrieval nodes. The matching degree between each sub-knowledge graph and the multidimensional query vector and retrieval nodes is calculated. Sub-knowledge graphs with matching degrees higher than a preset threshold are selected as sub-graphs to be retrieved. Starting from the retrieval node, the retrieval relationship type is used to traverse the sub-graph to be retrieved. Multiple paths formed by traversed entities and their connecting relationships are selected as candidate paths. These candidate paths are deduplicated, and their performance is scored based on relationship attributes. The candidate path with a performance score higher than a preset threshold is selected as the core path.

[0041] In the above technical solution, a multi-dimensional query vector is used as input. The retrieval relationship type is matched based on the multi-dimensional query vector to ensure the relevance, dynamism, and accuracy of the generated cases. Specifically, PageRank is used to calculate the influence of matched entity nodes in the overall knowledge graph, thereby extracting the most influential entity nodes and preventing the sub-knowledge graph from becoming too large. The matching degree between each sub-knowledge graph and the multi-dimensional query vector and retrieval node is calculated, including the number and weight of retrieval nodes in the sub-knowledge graph, and the number and weight of each entity node in the sub-knowledge graph matching the keywords extracted from the multi-dimensional query vector. These two factors are combined to obtain the matching degree score of the sub-knowledge graph. Performance scoring is performed on multiple candidate paths after deduplication based on relation attributes to ensure the reliability and stability of the obtained core path. It should be noted that there can be one or more core paths, and the corresponding generated curriculum-based ideological and political education cases can also be one or more, allowing users to choose from multiple cases.

[0042] Preferably, the content filling module is used to preset a case template, configure content constraint rules for the case template, and map the entities and relationships corresponding to the core path to the case template based on the content constraint rules, including: A pre-defined structured template containing multiple themes is used as a case template. Content constraint rules are configured for each theme of the case template. These content constraint rules include entity constraint rules and relation constraint rules. Entities and relations on the core path are classified according to their entity type and semantic relationship. Based on the entity constraint rules and relation constraint rules, the classified entities and relations are mapped to the corresponding themes of the case template. This text processing module is used to process the entities and relationships within the case template, resulting in curriculum-based ideological and political education cases, including: After preprocessing, the entities and relationships within each topic are organized and sorted in a logical order to obtain structured information. This logical order includes chronological order, causal order, and deductive order. The general language model is then adjusted for domain-specific application using the curriculum-based ideological and political education theory, disciplinary theory, and relevant example data to obtain a language adaptation model. This structured information is then transformed into natural language text using the language adaptation model, and transition sentences are generated between adjacent topics in the case template to obtain a curriculum-based ideological and political education case.

[0043] In the above technical solution, by pre-setting structured case templates, the generated curriculum-based ideological and political education cases are ensured to be complete and standardized. These multiple themes include, but are not limited to, case titles, teaching backgrounds, event / person descriptions, core knowledge points, mapped ideological and political points, and ideological insights. Entity constraint rules and relation constraint rules are configured for each theme of the case template, thereby restricting the types of entities and relationships that can be mapped to each theme and improving the accuracy of the content in the corresponding theme. Specifically, the domain-specific adjustments to the large language adaptation model include: constructing a domain training corpus based on curriculum-based ideological and political education theory, disciplinary theory, and relevant example data; cleaning and transforming the curriculum-based ideological and political education theory, disciplinary theory, and relevant example data into structured instruction-output pairs; extracting transition sentences and their corresponding contexts from historical case data; cleaning and transforming the transition sentences and their corresponding contexts into structured breakpoint-continuation pairs; inputting the domain training corpus into a general large oracle model for preliminary training; then inputting the instruction-output pairs into the pre-trained general large oracle model for supervised training to obtain a domain-specific large language model; and finally inputting the breakpoint-continuation pairs into the domain-specific large language model for supervised training to obtain a large language adaptation model. This ensures that the text processed by the large language adaptation model has sufficient professionalism and standardization.

[0044] As can be seen from the above, this knowledge graph-based method for automatically generating curriculum-based ideological and political education cases, along with its predefined relationship types, lays a reasonable model foundation for subsequent graph construction and case generation. It acquires curriculum-based ideological and political education theories, disciplinary theories, and relevant example data. Based on these data, it selects matching relationship types from the predefined relationship types to construct the overall knowledge graph, ensuring its professionalism and accuracy. It determines the case domain requirements and constructs a sub-graph framework based on these requirements and the overall knowledge graph. It then selects matching relationship types from the predefined relationship types to construct the sub-knowledge graph, ensuring the domain relevance and relevance of the graph content. Finally, it acquires the user's case content requirements and traverses the overall and sub-knowledge graphs to obtain targeted core paths that meet the user's needs. Furthermore, it pre-sets case templates, configures content constraint rules for these templates, maps the entities and relationships corresponding to the core paths to the case templates based on these rules, and processes the entities and relationships within the case templates to obtain curriculum-based ideological and political education cases, thus improving the efficiency and quality of case generation.

[0045] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for automatically generating curriculum-based ideological and political education cases based on knowledge graphs, characterized in that: It includes the following steps: Step S10: Predefine relation types; acquire curriculum ideological and political theory, discipline theory and related instance data; select matching relation types from the predefined relation types based on the curriculum ideological and political theory, discipline theory and related instance data to obtain the first candidate relation; construct the overall knowledge graph based on the first candidate relation. Step S20: Determine the case domain requirements, and construct a sub-graph framework based on the case domain requirements and the overall knowledge graph; Select a matching relation type from the predefined relation types for the sub-graph framework to obtain a second candidate relation, and construct a sub-knowledge graph based on the second candidate relation; Step S30: Obtain the user's case content requirements; Based on the content requirements of the case, the core path is obtained by traversing the overall knowledge graph and sub-knowledge graphs. Step S40: Preset a case template, configure content constraint rules for the case template, and map the entities and relationships corresponding to the core path to the case template based on the content constraint rules; Text processing is performed on the entities and relationships within the case template to obtain curriculum-based ideological and political education cases.

2. The method for automatically generating curriculum-based ideological and political education cases based on knowledge graphs according to claim 1, characterized in that, In step S10, predefined relation types are defined; curriculum-based ideological and political education theory, disciplinary theory, and related instance data are acquired; based on the curriculum-based ideological and political education theory, disciplinary theory, and related instance data, a matching relation type is selected from the predefined relation types to obtain a first candidate relation; and the construction of the overall knowledge graph based on the first candidate relation includes: A relational framework is constructed, encompassing multiple relation types, including cognitive logic relations, value mapping relations, and teaching application relations. Historical case data is collected, and semantic analysis and entity relation extraction are performed on the historical case data to obtain various associations. Semantic relations, relational attributes, entity types, trigger words, domains, and value ranges are defined for each of these associations. The entity types include ideological and political elements, disciplinary concepts, and theoretical methods. The relational attributes include confidence, source, and strength. The domain and value range limit the entity types at the start and end points of the associations. Based on the semantic relations, relational attributes, and entity types of the associations, the various associations are categorized into the corresponding relation types within the relational framework, resulting in predefined relation types. Data on ideological and political education in courses, disciplinary theories, and related examples are collected. This data is preprocessed and transformed into structured data. Entity identification and relation extraction are performed on the structured data. Entities are classified according to their types. The entity types and relations in the structured data are matched with predefined relation types to obtain one or more first candidate relations. Semantic similarity is calculated for entities from different sources. Entities with semantic similarity greater than a set threshold are aligned and their relations are fused. The aligned and fused entities and relations are mapped to the same entity node and edge, respectively. The entity node and edge are stored in a graph database according to the first candidate relations to obtain the overall knowledge graph.

3. The method for automatically generating curriculum-based ideological and political education cases based on knowledge graphs according to claim 2, characterized in that, In step S20, the case domain requirements are determined, and a sub-graph framework is constructed based on the case domain requirements and the overall knowledge graph. Selecting a matching relation type from predefined relation types for the sub-graph framework to obtain a second candidate relation, and constructing a sub-knowledge graph based on the second candidate relation includes: The requirements of the case domains involved in the ideological and political education cases are determined. These requirements include target domain requirements, knowledge depth and breadth requirements, teaching scenario requirements, ideological and political focus requirements, and application scenario requirements. Entity nodes associated with the target domain requirements are selected from the overall knowledge graph through semantic similarity calculation. A graph centrality algorithm is used to identify core nodes with a central position within the target domain requirements from these associated entity nodes. Representative nodes are also identified from the associated entity nodes based on the teaching scenario requirements and application scenario requirements. Entity nodes and relationships associated with the core nodes and representative nodes are extracted from the overall knowledge graph. A sub-graph skeleton is constructed based on the core nodes, representative nodes, and their associated entity nodes and relationships. The entities corresponding to all entity nodes in the subgraph skeleton are classified according to their entity types. The classified entity types and relationships in the subgraph framework are matched with the predefined relationship types to obtain one or more second candidate relationships. External professional resources are acquired based on the knowledge depth and breadth requirements. Based on the external professional resources, the associated entities and relationships are expanded in multiple hops according to the second candidate relationships to obtain a primary subgraph. Based on the ideological and political focus requirements, a deep association is established between the primary subgraph and entity nodes in the total knowledge graph whose entity type is ideological and political elements to obtain a sub-knowledge graph. A bidirectional mapping relationship and an incremental synchronization mechanism are established between the sub-knowledge graph and the total knowledge graph.

4. The method for automatically generating curriculum-based ideological and political education cases based on knowledge graphs according to claim 3, characterized in that, In step S30, the user's case content requirements are obtained; Based on the content requirements of the aforementioned case, a traversal is performed on the overall knowledge graph and sub-knowledge graphs to obtain the core paths, including: The user inputs a multidimensional query vector, which includes one or more of the following: target domain requirements, knowledge depth and breadth requirements, tutorial scenario requirements, ideological and political focus requirements, and application scenario requirements, and uses this as the user's case content requirements. The multidimensional query vector is subjected to semantic analysis and keyword extraction. The semantic analysis results and the extracted keywords are matched with predefined semantic relationships and trigger words of relationship types to obtain one or more retrieval relationship types. The extracted keywords are then matched with entities in the overall knowledge graph. A graph centrality algorithm is used to calculate the influence of the matched entity nodes. Entity nodes with influence values ​​higher than a preset threshold are selected as retrieval nodes. The matching degree between each sub-knowledge graph and the multidimensional query vector and retrieval nodes is calculated. Sub-knowledge graphs with matching degrees higher than a preset threshold are selected as sub-graphs to be retrieved. Starting from the retrieval node, the retrieval sub-graph is traversed based on the retrieval relationship type. Multiple paths formed by traversed entities and their connecting relationships are selected as multiple candidate paths. The multiple candidate paths are deduplicated. The performance of the deduplicated candidate paths is scored based on relationship attributes. The candidate paths with performance scores higher than a preset threshold are selected as core paths.

5. The method for automatically generating curriculum-based ideological and political education cases based on knowledge graphs according to claim 2, characterized in that, In step S40, a case template is preset, content constraint rules are configured for the case template, and entities and relationships corresponding to the core path are mapped to the case template based on the content constraint rules. Text processing is performed on the entities and relationships within the aforementioned case template to obtain curriculum-based ideological and political education cases, including: A pre-set structured template containing multiple themes is provided as a case study template. Configure content constraint rules for each topic of the case template. The content constraint rules include entity constraint rules and relation constraint rules. Classify the entities and relations on the core path according to the entity type and semantic relationship. Based on the entity constraint rules and relation constraint rules, map the classified entities and relations to the corresponding topics of the case template. After preprocessing, the entities and relationships within each topic are organized and sorted in a logical order to obtain structured information. The logical order includes chronological order, causal order, and deductive order. The general language model is adjusted for domain-specific application using the curriculum-based ideological and political education theory, discipline theory, and relevant example data to obtain a language adaptation model. The structured information is then converted into natural language text using the language adaptation model, and transition sentences are generated between adjacent topics in the case template to obtain curriculum-based ideological and political education cases.

6. A knowledge graph-based automatic case generation system for ideological and political education in courses, characterized in that: It includes the following modules: The relation type predefined module is used to predefine relation types; The overall knowledge graph generation module is used to acquire curriculum ideological and political theory, discipline theory and related instance data, select matching relation types from predefined relation types based on the curriculum ideological and political theory, discipline theory and related instance data to obtain the first candidate relation, and construct the overall knowledge graph based on the first candidate relation. The subgraph framework construction module is used to determine the case domain requirements and construct the subgraph framework based on the case domain requirements and the overall knowledge graph. The sub-knowledge graph generation module is used to select a matching relation type for the sub-graph framework from predefined relation types to obtain a second candidate relation, and to construct a sub-knowledge graph based on the second candidate relation. The requirement elicitation module is used to obtain users' case content requirements; The core path generation module is used to traverse the overall knowledge graph and sub-knowledge graphs based on the content requirements of the case to obtain the core path. The content filling module is used to preset case templates, configure content constraint rules for the case templates, and map the entities and relationships corresponding to the core path to the case templates based on the content constraint rules. The text processing module is used to process the entities and relationships within the case template to obtain curriculum-based ideological and political education cases.

7. The knowledge graph-based automatic case generation system for ideological and political education in courses according to claim 6, characterized in that: The relation type predefinition module is used to predefine relation types, including: A relational framework is constructed, encompassing multiple relation types, including cognitive logic relations, value mapping relations, and teaching application relations. Historical case data is collected, and semantic analysis and entity relation extraction are performed on the historical case data to obtain various associations. Semantic relations, relational attributes, entity types, trigger words, domains, and value ranges are defined for each of these associations. The entity types include ideological and political elements, disciplinary concepts, and theoretical methods. The relational attributes include confidence, source, and strength. The domain and value range limit the entity types at the start and end points of the associations. Based on the semantic relations, relational attributes, and entity types of the associations, the various associations are categorized into the corresponding relation types within the relational framework, resulting in predefined relation types. The overall knowledge graph generation module is used to acquire curriculum-based ideological and political education theory, disciplinary theory, and related instance data; select matching relation types from predefined relation types based on the curriculum-based ideological and political education theory, disciplinary theory, and related instance data to obtain a first candidate relation; and construct the overall knowledge graph based on the first candidate relation, including: Data on ideological and political education in courses, disciplinary theories, and related examples are collected. This data is preprocessed and transformed into structured data. Entity identification and relation extraction are performed on the structured data. Entities are classified according to their types. The entity types and relations in the structured data are matched with predefined relation types to obtain one or more first candidate relations. Semantic similarity is calculated for entities from different sources. Entities with semantic similarity greater than a set threshold are aligned and their relations are fused. The aligned and fused entities and relations are mapped to the same entity node and edge, respectively. The entity node and edge are stored in a graph database according to the first candidate relations to obtain the overall knowledge graph.

8. The knowledge graph-based automatic case generation system for ideological and political education in courses according to claim 7, characterized in that: The sub-graph framework construction module is used to determine the case domain requirements, and based on the case domain requirements and the overall knowledge graph, constructs the sub-graph framework including: The requirements of the case domains involved in the ideological and political education cases are determined. These requirements include target domain requirements, knowledge depth and breadth requirements, teaching scenario requirements, ideological and political focus requirements, and application scenario requirements. Entity nodes associated with the target domain requirements are selected from the overall knowledge graph through semantic similarity calculation. A graph centrality algorithm is used to identify core nodes with a central position within the target domain requirements from these associated entity nodes. Representative nodes are also identified from the associated entity nodes based on the teaching scenario requirements and application scenario requirements. Entity nodes and relationships associated with the core nodes and representative nodes are extracted from the overall knowledge graph. A sub-graph skeleton is constructed based on the core nodes, representative nodes, and their associated entity nodes and relationships. The sub-knowledge graph generation module is used to select a matching relation type for the sub-graph framework from predefined relation types to obtain a second candidate relation, and to construct a sub-knowledge graph based on the second candidate relation, including: The entities corresponding to all entity nodes in the subgraph skeleton are classified according to their entity types. The classified entity types and relationships in the subgraph framework are matched with the predefined relationship types to obtain one or more second candidate relationships. External professional resources are acquired based on the knowledge depth and breadth requirements. Based on the external professional resources, the associated entities and relationships are expanded in multiple hops according to the second candidate relationships to obtain a primary subgraph. Based on the ideological and political focus requirements, a deep association is established between the primary subgraph and entity nodes in the total knowledge graph whose entity type is ideological and political elements to obtain a sub-knowledge graph. A bidirectional mapping relationship and an incremental synchronization mechanism are established between the sub-knowledge graph and the total knowledge graph.

9. The knowledge graph-based automatic case generation system for ideological and political education in courses according to claim 8, characterized in that: The requirement acquisition module is used to acquire users' case content requirements, including: The user inputs a multidimensional query vector, which includes one or more of the following: target domain requirements, knowledge depth and breadth requirements, tutorial scenario requirements, ideological and political focus requirements, and application scenario requirements, and uses this as the user's case content requirements. The core path generation module is used to traverse the overall knowledge graph and sub-knowledge graphs based on the case content requirements to obtain the core path, which includes: The multidimensional query vector is subjected to semantic analysis and keyword extraction. The semantic analysis results and the extracted keywords are matched with predefined semantic relationships and trigger words of relationship types to obtain one or more retrieval relationship types. The extracted keywords are then matched with entities in the overall knowledge graph. A graph centrality algorithm is used to calculate the influence of the matched entity nodes. Entity nodes with influence values ​​higher than a preset threshold are selected as retrieval nodes. The matching degree between each sub-knowledge graph and the multidimensional query vector and retrieval nodes is calculated. Sub-knowledge graphs with matching degrees higher than a preset threshold are selected as sub-graphs to be retrieved. Starting from the retrieval node, the retrieval sub-graph is traversed based on the retrieval relationship type. Multiple paths formed by traversed entities and their connecting relationships are selected as multiple candidate paths. The multiple candidate paths are deduplicated. The performance of the deduplicated candidate paths is scored based on relationship attributes. The candidate paths with performance scores higher than a preset threshold are selected as core paths.

10. The knowledge graph-based automatic generation system for ideological and political education cases in courses according to claim 7, characterized in that: The content filling module is used to preset a case template, configure content constraint rules for the case template, and map the entities and relationships corresponding to the core path to the case template based on the content constraint rules, including: A pre-defined structured template containing multiple themes is used as a case template. Content constraint rules are configured for each theme of the case template. The content constraint rules include entity constraint rules and relation constraint rules. Entities and relations on the core path are classified according to entity type and semantic relationship. Based on the entity constraint rules and relation constraint rules, the classified entities and relations are mapped to the corresponding themes of the case template. The text processing module is used to process the entities and relationships within the case template to obtain curriculum-based ideological and political education cases, including: After preprocessing, the entities and relationships within each topic are organized and sorted in a logical order to obtain structured information. The logical order includes chronological order, causal order, and deductive order. The general language model is adjusted for domain-specific application using the curriculum-based ideological and political education theory, discipline theory, and relevant example data to obtain a language adaptation model. The structured information is then converted into natural language text using the language adaptation model, and transition sentences are generated between adjacent topics in the case template to obtain curriculum-based ideological and political education cases.