Knowledge graph generation method and device, electronic equipment and storage medium

By controlling the generation of knowledge graphs through template types, the problems of computational complexity and uncontrollable node positions in existing technologies are solved, resulting in better display effects and simpler node connections.

CN117236434BActive Publication Date: 2026-01-30NANJING BAIGEZHENGLIU NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310905919.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-21
Publication Date
2026-01-30
Estimated Expiration
2043-07-21

AI Technical Summary

Technical Problem

Existing knowledge graph generation methods are computationally complex and have uncontrollable node positions, resulting in chaotic node connections and poor display quality.

Method used

The knowledge graph generation is controlled by template type. The node hierarchy of the information to be displayed is divided according to the preset generation rules, the target template is determined, and the content to be displayed is input into the corresponding node position to generate the knowledge graph.

Benefits of technology

It improves the display effect of knowledge graphs and the controllability of node positions, simplifies the generation process, and makes node connection lines more concise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117236434B_ABST
    Figure CN117236434B_ABST
Patent Text Reader

Abstract

This disclosure relates to a method, apparatus, electronic device, and storage medium for generating a knowledge graph, belonging to the field of data processing technology. The method includes: first, acquiring information to be displayed, which represents the number and content of knowledge nodes to be displayed; then, dividing the information to be displayed into node levels based on preset generation rules, obtaining the number of nodes to be displayed at each node level and the content to be displayed for each node, with each node level corresponding to a target template; the preset generation rules include node level division rules and node input rules; further, determining the target template corresponding to each node level based on the number of nodes to be displayed; and finally, inputting the content to be displayed into the corresponding node position of the target template to generate the knowledge graph corresponding to the information to be displayed. By applying the technical solution of this disclosure, the controllability of the graph node positions can be improved, the complexity of node connection lines can be reduced, and thus the display effect of the knowledge graph can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, specifically to a method, apparatus, electronic device, and storage medium for generating a knowledge graph. Background Technology

[0002] With the development of educational informatization, knowledge graphs have received widespread attention and application. In the field of education, knowledge graphs graphically display textbook knowledge points on application software, making the relationships between knowledge points more intuitive. They are used to represent, organize, and reason about subject knowledge, providing rich subject knowledge bases for devices such as smart learning machines, and offering users personalized learning path planning and learning resource recommendations, facilitating user use and learning.

[0003] Currently, knowledge graphs are generally generated using tree structures. However, this method is computationally complex, and changes in the number of nodes can lead to variations in node positions, resulting in uncontrollable node locations, chaotic node connections, and ultimately, poor display quality. Summary of the Invention

[0004] In view of this, this disclosure provides a method, apparatus, electronic device, and storage medium for generating knowledge graphs. By controlling knowledge graph generation through template types, it effectively solves many problems such as the complexity of knowledge graph implementation and the uncontrollable position of graph nodes, while also improving the display effect of the knowledge graph. The technical solution of this disclosure is as follows:

[0005] According to a first aspect of the present disclosure, a method for generating a knowledge graph is provided, comprising:

[0006] Obtain the information to be displayed, which is used to characterize the number of knowledge nodes and the content of the nodes to be displayed;

[0007] The information to be displayed is divided into node levels based on preset generation rule information to obtain the number of nodes to be displayed in each node level and the content to be displayed in each node. Each node level corresponds to a target template. The preset generation rule information includes node level division rules and node input rules.

[0008] Based on the number of nodes to be displayed, determine the target template corresponding to each node level;

[0009] The content to be displayed is input into the corresponding node position of the target template to generate a knowledge graph corresponding to the information to be displayed.

[0010] According to this embodiment, based on the content to be displayed of the knowledge nodes, the preset template type corresponding to the knowledge graph and the target template node position corresponding to each knowledge node can be determined, and the content to be displayed of each knowledge node can be input into the corresponding template node position, thereby simplifying the generation of the knowledge graph and improving the display effect of the knowledge graph.

[0011] In some embodiments of this disclosure, determining the target template corresponding to each node level based on the number of nodes to be displayed includes:

[0012] Get the number of preset nodes corresponding to multiple preset templates;

[0013] The target template is determined by matching the number of nodes to be displayed with the preset number of nodes.

[0014] In some embodiments of this disclosure, determining the target template by matching the number of nodes to be displayed with the preset number of nodes includes:

[0015] By comparing the number of nodes to be displayed with the number of nodes in the first template, a first comparison result is obtained, wherein the first template is any one of the plurality of preset templates;

[0016] If the first comparison result indicates that the number of nodes to be displayed is greater than the number of nodes in the first template, then the number of nodes to be displayed is compared with the number of nodes in the second template to obtain a second comparison result. The second template is a preset template adjacent to the number of nodes in the first template, and the number of nodes in the second template is greater than the number of nodes in the first template; or...

[0017] If the first comparison result is that the number of nodes to be displayed is less than the number of nodes, then the number of nodes to be displayed is compared with the number of nodes corresponding to the third template to obtain a third comparison result. The third template is a preset template that is adjacent to the number of nodes corresponding to the first template, and the number of nodes is less than the number of nodes.

[0018] The target template is determined based on at least one of the first comparison result, the second comparison result, and the third comparison result.

[0019] In some embodiments of this disclosure, determining the target template based on at least one of the first comparison result, the second comparison result, and the third comparison result includes:

[0020] If the first comparison result indicates that the number of nodes to be displayed is equal to the number of nodes, then the first template is determined to be the target template.

[0021] If the second comparison result shows that the number of nodes to be displayed is greater than the number of the first nodes and less than the number of the second nodes, then the second template is determined to be the target template; or,

[0022] If the third comparison result is that the number of nodes to be displayed is less than the number of the first nodes but greater than the number of the third nodes, then the first template is determined to be the target template.

[0023] In some embodiments of this disclosure, the step of inputting the content to be displayed into the corresponding node position of the target template to generate a knowledge graph corresponding to the information to be displayed includes:

[0024] Determine the association information between different content to be displayed and the corresponding node positions, wherein the association information includes the input order and connection relationship between the different content to be displayed;

[0025] The content to be displayed is input into the corresponding node position according to the associated information;

[0026] Based on the aforementioned association information, the corresponding node positions are connected using node connection lines to generate the knowledge graph.

[0027] In some embodiments of this disclosure, inputting the content to be displayed to the corresponding node position according to the association information includes:

[0028] Obtain the node sequence number identifier of the target template;

[0029] Based on the association information and the node sequence number, the content to be displayed is input to the corresponding node position.

[0030] In some embodiments of this disclosure, inputting the content to be displayed to the corresponding node position based on the association information and the node sequence number includes:

[0031] A first quantity is determined based on the associated information, where the first quantity is the number of adjacent content to be displayed.

[0032] Compare the first number with the second number of adjacent nodes in the target template;

[0033] If the first quantity is greater than the second quantity, the content to be displayed is processed so that the first quantity is less than or equal to the second quantity, and the processed content to be displayed is input to the corresponding node position; or,

[0034] If the first quantity is less than or equal to the second quantity, then the content to be displayed is input to the corresponding node position.

[0035] In some embodiments of this disclosure, if the first quantity is greater than the second quantity, the content to be displayed is processed so that the first quantity is less than or equal to the second quantity, and the processed content to be displayed is input to the corresponding node position, including:

[0036] The content to be displayed is arranged according to the preset generation rule information, and the content to be displayed that is input first is determined based on the second quantity;

[0037] Input the content to be displayed, which is to be prioritized, into the corresponding node position.

[0038] In some embodiments of this disclosure, the step of connecting the corresponding node positions using node connectors based on the association information to generate the knowledge graph includes:

[0039] Based on the node sequence number identifier, determine the first node position and the second node position corresponding to the first sequence number and the second sequence number, respectively, wherein the first sequence number is an adjacent sequence number that is less than the second sequence number;

[0040] The first node position is determined as the starting direction of the node connection line, and the second node position is determined as the ending direction of the node connection line, wherein the ending direction is indicated by an arrow.

[0041] Secondly, this disclosure provides a knowledge graph generation apparatus, comprising:

[0042] The acquisition module is configured to acquire information to be displayed, which is used to characterize the number of knowledge nodes and the content of the nodes to be displayed;

[0043] The partitioning module is configured to partition the information to be displayed into node levels based on preset generation rule information, thereby obtaining the number of nodes to be displayed in each node level and the content to be displayed in each node. Each node level corresponds to a target template. The preset generation rule information includes node level partitioning rules and node input rules.

[0044] The determination module is configured to determine the target template corresponding to each node level based on the number of nodes to be displayed;

[0045] The generation module is configured to input the content to be displayed into the corresponding node position of the target template to generate a knowledge graph corresponding to the information to be displayed.

[0046] Thirdly, this disclosure provides an electronic device, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that the processor executes the computer program to implement the knowledge graph generation method described in the first aspect.

[0047] Fourthly, this disclosure provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the knowledge graph generation method described in the first aspect.

[0048] By employing the above technical solutions, this disclosure provides a knowledge graph generation method, apparatus, electronic device, and storage medium. Compared with existing technologies, this disclosure can determine the preset template type corresponding to the knowledge graph and the target template node position corresponding to each knowledge node based on the content to be displayed of the knowledge nodes. The content to be displayed for each knowledge node is then input into the corresponding template node position, thereby simplifying the knowledge graph generation process. Specifically, firstly, the information to be displayed is obtained, which represents the number and content of the knowledge nodes to be displayed. Then, based on preset generation rule information, the information to be displayed is hierarchically divided into nodes, obtaining the number of nodes to be displayed at each node level and the content to be displayed for each node. Each node level corresponds to a target template. The preset generation rule information includes node level division rules and node input rules. Next, based on the number of nodes to be displayed, the target template corresponding to each node level is determined. Finally, the content to be displayed is input into the corresponding node position of the target template to generate the knowledge graph corresponding to the information to be displayed. This improves the controllability of the graph node positions, simplifies node connections, and thus enhances the display effect of the knowledge graph.

[0049] The above description is merely an overview of the technical solution disclosed herein. In order to better understand the technical means of this disclosure and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this disclosure more apparent and understandable, specific embodiments of this disclosure are described below. Attached Figure Description

[0050] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0051] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 A flowchart illustrating a knowledge graph generation method provided in an embodiment of this disclosure is shown.

[0053] Figure 2 A flowchart illustrating another knowledge graph generation method provided in this disclosure embodiment is shown.

[0054] Figure 3 A schematic diagram illustrating an application scenario provided by an embodiment of this disclosure is shown;

[0055] Figure 4 This illustration shows an example diagram of a preset template type provided in an embodiment of the present disclosure;

[0056] Figure 5 This illustration shows an example diagram of another preset template type provided in this disclosure embodiment;

[0057] Figure 6 A schematic diagram illustrating an example provided by an embodiment of this disclosure is shown;

[0058] Figure 7 A schematic diagram of the structure of a knowledge graph generation apparatus provided in an embodiment of this disclosure is shown. Detailed Implementation

[0059] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0060] To improve upon current knowledge graph generation methods, which suffer from computational complexity, variable node numbers leading to changes in node positions, uncontrollable node locations, and chaotic node connections, resulting in poor knowledge graph display, this embodiment provides a knowledge graph generation method. Figure 1 As shown, the method includes:

[0061] Step 101: Obtain the information to be displayed.

[0062] The information to be displayed is used to represent the number of knowledge nodes and their content.

[0063] For example, the information to be displayed may include 8 nodes, with the content of each node being A (first node), B (second node), C (third node), D (fourth node), E (fifth node), F (sixth node), G (seventh node), and H (eighth node). The number of content nodes is the same as the number of nodes. Each node can be a summary based on the current learning situation of student XS01. Among them, node content A, B, and C can be important knowledge points that student XS01 has not mastered in textbook S-01, node content D, E, and F can be important knowledge points that student XS01 has mastered in textbook S-01, and node content G and H can be important knowledge points that student XS01 will learn in textbook S-01.

[0064] In this embodiment of the disclosure, when acquiring information to be displayed, the method may include: acquiring it through a wired data transmission device or a wireless data transmission device, and this embodiment does not limit this.

[0065] Step 102: Based on the preset generation rule information, divide the information to be displayed into node levels to obtain the number of nodes to be displayed in each node level and the content to be displayed in each node. Each node level corresponds to a target template.

[0066] The preset generation rule information includes node hierarchy division rules and node input rules.

[0067] In this embodiment of the disclosure, the preset generation rule information can be used for the hierarchical division of nodes and the input of the content to be displayed into the target template to generate a knowledge graph. This rule can be set according to the difficulty level of the knowledge nodes, and can be determined by the teaching and research teacher based on the difficulty level of the knowledge points. The node hierarchy can have an unlimited number of levels, and the number of nodes to be displayed in each level can be different or the same. Each node level has a target template corresponding to the number of nodes in that level. The target template can be one of several pre-defined template types, with each type corresponding to one template. The content to be displayed can be the text, symbols, images, etc., corresponding to each node obtained after dividing the information to be displayed according to the node hierarchy division rules.

[0068] In this embodiment of the disclosure, when the node hierarchy of the information to be displayed is divided based on the preset generation rule information to obtain the number of nodes to be displayed in each node hierarchy and the content to be displayed in each node, and each node hierarchy corresponds to a target template, the method of this embodiment may include: the node hierarchy is divided in advance by the teaching and research teacher based on years of teaching experience, and this embodiment does not limit this.

[0069] By applying the specific implementation method of this embodiment, layering can be performed when knowledge nodes are relatively complex or have different levels of difficulty, thereby improving the display effect of the knowledge graph.

[0070] Step 103: Determine the target template corresponding to each node level based on the number of nodes to be displayed.

[0071] For example, multiple template types can be pre-set, each template type can have a fixed number of nodes, and the number of nodes for each type of template is different. The number of nodes to be displayed is compared with the number of nodes for each template type, and the template with the same number of nodes as the number of nodes to be displayed is selected as the target template. There can be one or more target templates.

[0072] In this embodiment of the present disclosure, when determining the target template corresponding to each node level based on the number of nodes to be displayed, the method may include: the learning machine intelligent system comparing the number of nodes to be displayed with the number of nodes in the preset template type to determine the target template corresponding to each node level. This embodiment does not limit this.

[0073] By applying the specific implementation method of this embodiment, the target template corresponding to the content to be displayed can be determined, and then the display structure of the content to be displayed can be determined. Then, the target template can be used as the display structure to display the content to be displayed.

[0074] Step 104: Input the content to be displayed into the corresponding node position of the target template to generate the knowledge graph corresponding to the information to be displayed.

[0075] The corresponding node position can be one or more positions. The node position within each type of template is a fixed position. The knowledge graph can be a way to graphically display textbook knowledge points on application software, making it more intuitive to show the relationship between knowledge points and making it easier for users to use and learn.

[0076] Optionally, each piece of content to be displayed corresponds to a node position, and each node position also corresponds to a piece of content to be displayed. Inputting the content to be displayed into the corresponding node position allows the content to be input into the target template, generating a knowledge graph. If the number of node levels is N, then there are N target templates. The content to be displayed for each level is input into the target template for that level, and the node levels after inputting the content are combined to generate a knowledge graph.

[0077] By applying the specific implementation method of this embodiment, the content to be displayed can be input into the corresponding node position of the target template, thereby obtaining a knowledge graph with more stable nodes and better display effect.

[0078] This disclosure provides a method for generating a knowledge graph, employing a novel approach that controls the display of the knowledge graph through template types. This effectively addresses numerous issues such as the complexity of knowledge graph implementation and the uncontrollable display of graph nodes, thereby improving the display effect of the knowledge graph and enhancing student learning outcomes. Specifically, the method first acquires the information to be displayed; then, based on preset generation rules, it divides the information to be displayed into node levels, obtaining the number of nodes to be displayed at each node level and the content to be displayed for each node. Each node level corresponds to a target template; next, based on the number of nodes to be displayed, the target template corresponding to each node level is determined; finally, the content to be displayed is input into the corresponding node position of the target template, generating the knowledge graph corresponding to the information to be displayed. This improves the controllability of graph node positions, simplifies node connection lines, and thus enhances the display effect of the knowledge graph.

[0079] Furthermore, as a refinement and extension of the above embodiments, in order to fully illustrate the specific implementation process of the method in this embodiment, this embodiment provides the following: Figure 2 The specific method shown includes the following steps:

[0080] Step 201: Obtain the information to be displayed.

[0081] For the specific implementation process of the embodiments disclosed herein, please refer to the relevant description in step 101 of the embodiment, which will not be repeated here.

[0082] Step 202: Based on the preset generation rule information, divide the information to be displayed into node levels to obtain the number of nodes to be displayed in each node level and the content to be displayed in each node. Each node level corresponds to a target template.

[0083] The preset generation rule information includes node hierarchy division rules and node input rules.

[0084] For embodiments of this disclosure, refer to Figure 3 As shown, a knowledge graph can be layered according to the difficulty of knowledge nodes. The graph is divided into three layers, but it can also be divided into two, one, or more layers. Each layer uses a different template type depending on the number of nodes.

[0085] Optionally, the node hierarchy can be displayed horizontally or vertically after the knowledge graph is generated. For example, if the device displaying the knowledge graph is an e-learning machine with a display interface length of m and width of n, and the knowledge graph to be displayed has 3 levels, based on previous experiments, the minimum length and minimum width that can be clearly displayed for each level are a and b. If the knowledge graph has three levels, then the minimum length and minimum width that can be clearly displayed are 3a and 3b. Comparing 3a with m and 3b with n, if 3a is greater than m and 3b is less than n, then the node hierarchy of the knowledge graph will be displayed vertically after generation; if 3a is less than m and 3b is greater than n, then the node hierarchy of the knowledge graph will be displayed horizontally after generation.

[0086] By applying the specific implementation methods disclosed herein, not only can knowledge graphs be layered according to knowledge points, resulting in better display effects, but they can also be adjusted according to the screen parameters of the display device, thereby improving the convenience of the knowledge graph.

[0087] Step 203: Obtain the number of preset nodes corresponding to multiple preset templates.

[0088] In this embodiment of the disclosure, the number of preset templates can be a positive integer, and the specific number is not limited. Preset templates can be added according to the needs of knowledge nodes or display. The number of nodes in each preset template can be fixed.

[0089] In some examples, when obtaining the number of preset nodes corresponding to multiple preset templates, the method of this embodiment may include: marking each preset template in advance, the mark being the number of nodes corresponding to the preset template, and then storing it in a database, and then indexing according to the mark to obtain the number of preset nodes corresponding to multiple preset templates. This embodiment does not limit this.

[0090] For example, the current preset templates are template A, template B, template C, template D, template E, template F, and template G. Template A has 4 preset nodes, template B has 7, template C has 10, template D has 13, template E has 16, template F has 19, and template G has 22. Then, template A is labeled JDSL-A-4, template B is labeled JDSL-B-7, template C is labeled JDSL-C-10, template D is labeled JDSL-D-13, template E is labeled JDSL-E-16, template F is labeled JDSL-F-19, and template G is labeled JDSL-G-22, and these labels are stored in the database. Then, based on the labels in the database for templates A, B, C, D, E, F, and G, the number of preset nodes for each template is obtained.

[0091] By applying the specific implementation methods of the above embodiments, the number of preset nodes corresponding to each preset template can be obtained, and then the template required for knowledge graph generation can be obtained by utilizing the number of preset nodes corresponding to each preset template.

[0092] Step 204: Determine the target template by matching the number of nodes to be displayed with the preset number of nodes.

[0093] In this embodiment of the disclosure, the number of target templates can be determined according to the node level, with each node level corresponding to one target template, which is one or more of the preset templates.

[0094] Optionally, step 204 in the embodiment may specifically include: comparing the number of nodes to be displayed with the number of nodes in the first template to obtain a first comparison result, wherein the first template is any one of a plurality of preset templates; if the first comparison result is that the number of nodes to be displayed is greater than the number of nodes in the first template, then comparing the number of nodes to be displayed with the number of nodes in the second template to obtain a second comparison result, wherein the second template is a preset template adjacent to the number of nodes in the first template and the number of nodes in the second template is greater than the number of nodes in the first template; or, if the first comparison result is that the number of nodes to be displayed is less than the number of nodes in the first template, then comparing the number of nodes to be displayed with the number of nodes in the third template to obtain a third comparison result, wherein the third template is a preset template adjacent to the number of nodes in the first template and the number of nodes in the third template is less than the number of nodes in the first template; and determining a target template based on at least one of the first comparison result, the second comparison result, and the third comparison result.

[0095] Further optionally, determining the target template based on at least one of the first comparison result, the second comparison result, and the third comparison result may specifically include: if the first comparison result is that the number of nodes to be displayed is equal to the number of first nodes, then the first template is determined to be the target template; if the second comparison result is that the number of nodes to be displayed is greater than the number of first nodes and less than the number of second nodes, then the second template is determined to be the target template; or, if the third comparison result is that the number of nodes to be displayed is less than the number of first nodes and greater than the number of third nodes, then the first template is determined to be the target template.

[0096] For example, if the number of nodes to be displayed is Q, and the number of nodes in the first template MB-1 is W, comparing Q with W yields a first comparison result DB-one. If the first comparison result DB-one indicates that Q is greater than W, then comparing the number of nodes to be displayed, Q, with the number of nodes in the second template MB-2, R, yields a second comparison result DB-two. Here, the relationship between the second template MB-1 and the first template MB-1 is that the second template MB-2 is a preset template with an adjacent number of nodes to the first template MB-1, and R is greater than W. If the first comparison result DB-one indicates that Q is less than W, then comparing the number of nodes to be displayed, Q, with the number of nodes in the third template MB-3, T, yields a third comparison result DB-three. Here, the relationship between the third template MB-3 and the first template MB-1 is that the third template MB-3 is a preset template with an adjacent number of nodes to the first template MB-1, and T is less than W. Finally, the target template is determined based on the first comparison result DB-one, the second comparison result DB-two, and the third comparison result DB-three. If the first comparison result DB-one is Q equal to W, then the first template MB-1 is determined as the target template; if the second comparison result DB-two is Q greater than W and Q less than R, then the second template MB-2 is determined as the target template; if the third comparison result DB-three is Q less than W and Q greater than T, then the third template MB-3 is determined as the target template.

[0097] By applying the specific implementation methods of the above embodiments, a target template that is closest to the number of nodes to be displayed and meets the node input conditions can be determined. This avoids the problem of resource waste and space occupation caused by too many nodes in the target template, or the problem of the content to be displayed being unable to be input into the knowledge graph due to insufficient nodes in the target template, which in turn leads to the problem of missing content in the generated knowledge graph.

[0098] Step 205: Determine the association information and corresponding node positions between different contents to be displayed.

[0099] The associated information includes the input order and connection relationship between different content to be displayed.

[0100] In this embodiment of the disclosure, the input order can be the order in which different content to be displayed is input into the nodes of the target template, which can be determined by the teaching and research personnel based on teaching experience, logical relationships of knowledge points, gradual deepening of knowledge points, and the order of knowledge points; the connection relationship can be the connection relationship between adjacent knowledge points, which can be specifically represented as the connection relationship between different nodes of the template in the knowledge graph, and can be represented by connectors.

[0101] In some application scenarios, the input order can be determined based on the relationship between the knowledge nodes corresponding to different content to be displayed, and then the nodes in the template can be marked in sequence according to the input order, with one piece of content to be displayed corresponding to one node position.

[0102] For example, there are five pieces of information to be displayed, namely D1, D2, D3, D4, and D5. Based on the logical relationship of knowledge points, the input order of D1, D2, D3, D4, and D5 is determined to be D1, D4, D3, D2, and D5. If the nodes of the current target template are JD-1, JD-2, JD-3, JD-4, and JD-5, then the node position corresponding to D1 is JD-1; the node position corresponding to D4 is JD-2; the node position corresponding to D3 is JD-3; the node position corresponding to D2 is JD-4; and the node position corresponding to D5 is JD-5.

[0103] Through the specific implementation of the above embodiments, the node positions corresponding to the content to be displayed in the information to be displayed and the template can be obtained, and then the content to be displayed can be input into the nodes in the template, which can reduce the complexity of the knowledge graph generation process.

[0104] Step 206: Input the content to be displayed into the corresponding node position according to the associated information.

[0105] In this embodiment of the disclosure, each content to be displayed and its corresponding node position can be input according to the logical relationship of the knowledge nodes. For example, if the knowledge nodes are multiple knowledge nodes of the first semester of the fifth grade of primary school, and each knowledge node corresponds to a class period, then the content to be displayed of the first class period knowledge node is input into the first node position of the corresponding target template, the content to be displayed of the second class period knowledge node is input into the second node position of the corresponding target template, and so on.

[0106] Optionally, step 206 in the embodiment may specifically include: obtaining the node sequence number identifier of the target template; and inputting the content to be displayed into the corresponding node position according to the association information and the node sequence number identifier.

[0107] In some examples, certain template types can be referenced. Figure 4 and Figure 5 Each node in the template has its own designated slot, which can be identified by a number. Each slot has a fixed position, and the width of different templates is also fixed. In this way, the position of each node is fixed in the knowledge graph. During the node editing process, only the positions of adjacent nodes need to be modified, without affecting other nodes, making the adjustment of knowledge node positions very convenient.

[0108] Further optionally, inputting the content to be displayed to the corresponding node position based on the association information and node sequence number may specifically include: determining a first quantity based on the association information, the first quantity being the number of adjacent content to be displayed; comparing the first quantity with a second quantity of adjacent nodes in the target template; if the first quantity is greater than the second quantity, processing the content to be displayed so that the first quantity is less than or equal to the second quantity, and inputting the processed content to be displayed to the corresponding node position; or, if the first quantity is less than or equal to the second quantity, inputting the content to be displayed to the corresponding node position.

[0109] Specifically, if the first quantity is greater than the second quantity, the content to be displayed is processed so that the first quantity is less than or equal to the second quantity, and the processed content to be displayed is input to the corresponding node position. This may include: arranging the content to be displayed according to preset generation rule information, and determining the content to be displayed to be input first based on the second quantity; and inputting the content to be displayed to be input first to the corresponding node position.

[0110] For example, if the first content to be displayed in the input order is k1, and the corresponding node position of k1 in the target template is node p, then there are five adjacent content items to be displayed: k2, k3, k4, k5, and k6. However, there are three nodes adjacent to node p in the target template. Since the number of adjacent content items k2, k3, k4, k5, and k6 is greater than the number of adjacent nodes to node p in the target template, k2, k3, k4, k5, and k6 need to be processed. The processing is performed so that the number of content to be displayed adjacent to k1 is equal to the number of nodes adjacent to node p in the target template. After analyzing the input rules of k2, k3, k4, k5, and k6, the priority of k3, k4, and k6 is higher than that of k2 and k5. Therefore, k2 and k5 are temporarily not input. k3, k4, and k6 are input to the nodes adjacent to node p. Then, k1 is input to node p, and k3, k4, and k6 are input to the three nodes adjacent to node p respectively.

[0111] Through the specific implementation of the above embodiments, the content to be displayed can be input into the corresponding node positions according to the knowledge node order. At the same time, when the number of adjacent nodes cannot meet the input conditions of the content to be displayed corresponding to the adjacent knowledge nodes, the content to be displayed can be processed, thereby improving the node stability of the knowledge graph.

[0112] Step 207: Based on the association information, connect the corresponding node positions using node connection lines to generate a knowledge graph.

[0113] In this embodiment of the disclosure, node connection lines can be represented by connectors such as arrow connectors, straight connectors, and flow guides. The connection rules for node connection lines can be determined based on the node sequence identifiers and connection relationships of the target template. Nodes in the target template can be interconnected. When a node with a higher node sequence identifier is connected to a node with a lower node sequence identifier, the lower node serves as the starting point and ending point of the node connection line. For example, when a node with node sequence identifier 1 is connected to a node with node sequence identifier 2, an arrow connector is used as the node connection line. The arrow pointing towards node sequence identifier 2 serves as the ending point of the node connection line, while the arrow pointing in the opposite direction connects to node sequence identifier 1, serving as the starting point of the node connection line.

[0114] Optionally, step 207 in the embodiment may specifically include: determining the first node position and the second node position corresponding to the first number and the second number respectively according to the node sequence number identifier, wherein the first number is an adjacent number less than the second number; determining the first node position as the starting direction of the node connection line and the second node position as the ending direction of the node connection line, wherein the ending direction is indicated by the arrow pointing to the identifier.

[0115] For example, such as Figure 6 As shown, to further optimize the display of the knowledge graph, this embodiment has made significant optimizations to the connections between knowledge nodes. The direction of the node connection line is determined by the number of the slot. By applying the specific implementation method of this embodiment, the complexity of the connection lines can be reduced, avoiding the phenomenon of multiple intersecting and chaotic connection lines, increasing the aesthetics of the knowledge graph, and reducing the complexity of the connection lines.

[0116] This disclosure provides a method for generating a knowledge graph, employing a novel approach that controls the display of the knowledge graph through template types. This effectively addresses numerous issues such as the complexity of knowledge graph implementation and the uncontrollable display of graph nodes, thereby improving the display effect and enhancing student learning outcomes. Specifically, the method first acquires the information to be displayed; then, based on preset generation rules, it divides the information into node levels, obtaining the number of nodes to be displayed at each level and the content to be displayed for each node, with each node level corresponding to a target template; next, based on the number of nodes to be displayed, it determines the target template for each node level; finally, it inputs the content to be displayed into the corresponding node position of the target template, generating the knowledge graph corresponding to the information to be displayed. By applying the technical solution of this disclosure, node position control and node level classification can be effectively achieved, resulting in more stable knowledge graph nodes and better display effects. Moreover, this solution significantly reduces the complexity of the display implementation, making it particularly suitable for displaying knowledge graphs on various learning machines.

[0117] Furthermore, as Figure 1 and Figure 2 The specific implementation of the method shown in this embodiment provides a knowledge graph generation device, such as... Figure 7 As shown, the device includes: an acquisition module 31, a division module 32, a determination module 33, and a generation module 34.

[0118] The acquisition module 31 is configured to acquire information to be displayed, which is used to characterize the number of nodes and the content of the knowledge nodes to be displayed;

[0119] The partitioning module 32 is configured to partition the information to be displayed into node levels based on preset generation rule information, thereby obtaining the number of nodes to be displayed in each node level and the content to be displayed in each node. Each node level corresponds to a target template. The preset generation rule information includes node level partitioning rules and node input rules.

[0120] The determining module 33 is configured to determine the target template corresponding to each node level based on the number of nodes to be displayed;

[0121] The generation module 34 is configured to input the content to be displayed into the corresponding node position of the target template to generate a knowledge graph corresponding to the information to be displayed.

[0122] In a specific application scenario, module 33 is specifically configured to obtain the number of preset nodes corresponding to multiple preset templates; and to determine the target template by matching the number of nodes to be displayed with the number of preset nodes.

[0123] In a specific application scenario, the determining module 33 is further configured to compare the number of nodes to be displayed with the number of nodes in the first template to obtain a first comparison result, wherein the first template is any one of the plurality of preset templates; if the first comparison result indicates that the number of nodes to be displayed is greater than the number of nodes in the first template, then the number of nodes to be displayed is compared with the number of nodes in the second template to obtain a second comparison result, wherein the second template is a preset template adjacent to the number of nodes in the first template, and the number of nodes in the second template is greater than the number of nodes in the first template; or, if the first comparison result indicates that the number of nodes to be displayed is less than the number of nodes in the first template, then the number of nodes to be displayed is compared with the number of nodes in the third template to obtain a third comparison result, wherein the third template is a preset template adjacent to the number of nodes in the first template, and the number of nodes in the third template is less than the number of nodes in the first template; and the target template is determined based on at least one of the first comparison result, the second comparison result, and the third comparison result.

[0124] In a specific application scenario, the determining module 33 is further configured to: if the first comparison result is that the number of nodes to be displayed is equal to the number of the first nodes, determine the first template as the target template; if the second comparison result is that the number of nodes to be displayed is greater than the number of the first nodes and less than the number of the second nodes, determine the second template as the target template; or, if the third comparison result is that the number of nodes to be displayed is less than the number of the first nodes and greater than the number of the third nodes, determine the first template as the target template.

[0125] In a specific application scenario, the generation module 34 is specifically configured to determine the association information between different content to be displayed and the corresponding node positions. The association information includes the input order and connection relationship between the different content to be displayed. The content to be displayed is input to the corresponding node positions according to the association information. Based on the association information, the corresponding node positions are connected using node connection lines to generate the knowledge graph.

[0126] In a specific application scenario, the generation module 34 is further configured to obtain the node sequence number identifier of the target template; and input the content to be displayed to the corresponding node position according to the association information and the node sequence number identifier.

[0127] In a specific application scenario, the generation module 34 is further configured to determine a first quantity based on the association information, wherein the first quantity is the number of adjacent content to be displayed; compare the first quantity with a second quantity of adjacent nodes in the target template; if the first quantity is greater than the second quantity, process the content to be displayed so that the first quantity is less than or equal to the second quantity, and input the processed content to be displayed to the corresponding node position; or, if the first quantity is less than or equal to the second quantity, input the content to be displayed to the corresponding node position.

[0128] In a specific application scenario, the generation module 34 is further configured to arrange the content to be displayed according to the preset generation rule information, and determine the content to be displayed that is to be input first based on the second quantity; and input the content to be displayed that is to be input first to the corresponding node position.

[0129] In a specific application scenario, the generation module 34 is further configured to determine the first node position and the second node position corresponding to the first number and the second number respectively, based on the node sequence number identifier, wherein the first number is an adjacent number less than the second number; and to determine the first node position as the starting direction of the node connection line and the second node position as the ending direction of the node connection line, wherein the ending direction is an arrow pointing identifier.

[0130] It should be noted that other corresponding descriptions of the functional units involved in the knowledge graph display device provided in this embodiment can be found in [reference]. Figure 1 and Figure 2 The corresponding description in [the document] will not be repeated here.

[0131] Based on the above, Figure 1 and Figure 2 Accordingly, this embodiment also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. Figure 1 and Figure 2 The method shown.

[0132] Based on this understanding, the technical solution of this embodiment can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or portable hard drive), and includes several instructions to cause a computer device (such as a personal computer, server, or network device) to execute the methods of various implementation scenarios of this embodiment.

[0133] Based on the above, Figure 1 and Figure 2 The method shown, and as Figure 7 To achieve the above objectives, this disclosure also provides an electronic device, comprising a storage medium and a processor; the storage medium for storing a computer program; and the processor for executing the computer program to implement the above-described virtual device embodiments. Figure 1 and Figure 2 The method shown.

[0134] Optionally, the aforementioned physical devices may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Wi-Fi interfaces), etc.

[0135] Those skilled in the art will understand that the physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or combine certain components, or have different component arrangements.

[0136] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the aforementioned physical device, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to enable communication between the various components within the storage medium, as well as communication with other hardware and software in the information processing physical device.

[0137] Through the above description of the embodiments, those skilled in the art can clearly understand that this disclosure can be implemented using software plus necessary general-purpose hardware platforms, or it can be implemented through hardware. By applying the solution of this embodiment, this disclosure provides a method for generating a knowledge graph, adopting a new scheme of controlling the display of the knowledge graph through template types, effectively solving many problems such as the complexity of the knowledge graph implementation process and the uncontrollability of the graph node display, improving the display effect of the knowledge graph and improving the learning effect of students. Specifically, firstly, the information to be displayed is obtained; then, based on the preset generation rule information, the information to be displayed is divided into node levels, obtaining the number of nodes to be displayed at each node level and the content to be displayed at each node, with each node level corresponding to a target template; then, based on the number of nodes to be displayed, the target template corresponding to each node level is determined; then, the content to be displayed is input to the corresponding node position of the target template to generate the knowledge graph corresponding to the information to be displayed. By applying the technical solution of this disclosure, node position control and node level classification can be effectively realized, the knowledge graph nodes are more stable and the display effect is better; moreover, by adopting this solution, the implementation complexity of the display end can be greatly reduced, which is particularly suitable for the display of knowledge graphs for various learning machines. The knowledge graph implementation scheme for learning machines designed in this invention is applicable not only to the implementation of knowledge graphs in learning machines, pencil cases, and smart learning desks, but also to the implementation of similar graph-based schemes.

[0138] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the term "comprising" or any other variations thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0139] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for generating a knowledge graph, characterized in that, The method comprises: acquiring to-be-displayed information, the to-be-displayed information being used to represent a node quantity and node content of a to-be-displayed knowledge node, the node content including important knowledge points in a textbook that a student has not mastered, important knowledge points in the textbook that the student has mastered, and important knowledge points in the textbook that the student is about to learn; performing node level division on the to-be-displayed information based on preset generation rule information to obtain a to-be-displayed node quantity of each node level and to-be-displayed content of each node, each node level corresponding to a target template, the preset generation rule information including a node level division rule and a node input rule, the to-be-displayed content being text and pictures corresponding to each node obtained after the to-be-displayed information is divided according to the node level division rule; determining the target template corresponding to each node level according to the to-be-displayed node quantity; inputting the to-be-displayed content to corresponding node positions of the target template to generate a knowledge graph corresponding to the to-be-displayed information, including: determining association information between different to-be-displayed contents and the corresponding node positions, the association information including an input order and a connection relationship between the different to-be-displayed contents; inputting the to-be-displayed content to the corresponding node positions according to the association information; and connecting the corresponding node positions by using a node connection line based on the association information to generate the knowledge graph.

2. The method of claim 1, wherein, The determining of the target template corresponding to each node level according to the to-be-displayed node quantity comprises: acquiring preset node quantities corresponding to a plurality of preset templates; determining the target template by matching the to-be-displayed node quantity with the preset node quantities.

3. The method of claim 2, wherein, The determining of the target template by matching the to-be-displayed node quantity with the preset node quantities comprises: comparing the to-be-displayed node quantity with a first node quantity of a first template to obtain a first comparison result, the first template being any preset template in the plurality of preset templates; if the first comparison result is that the to-be-displayed node quantity is greater than the first node quantity, comparing the to-be-displayed node quantity with a second node quantity corresponding to a second template to obtain a second comparison result, the second template being a preset template adjacent to a node quantity corresponding to the first template, and the second node quantity being greater than the first node quantity; or if the first comparison result is that the to-be-displayed node quantity is less than the first node quantity, comparing the to-be-displayed node quantity with a third node quantity corresponding to a third template to obtain a third comparison result, the third template being a preset template adjacent to a node quantity corresponding to the first template, and the third node quantity being less than the first node quantity; determining the target template based on at least one of the first comparison result, the second comparison result, and the third comparison result.

4. The method of claim 3, wherein, The determining of the target template based on at least one of the first comparison result, the second comparison result, and the third comparison result comprises: If the first comparison result is that the number of the to-be-displayed nodes is equal to the first number of nodes, the first template is determined as the target template; If the second comparison result is that the number of the to-be-displayed nodes is greater than the first number of nodes and less than the second number of nodes, the second template is determined as the target template; or If the third comparison result is that the number of the to-be-displayed nodes is less than the first number of nodes and greater than the third number of nodes, the first template is determined as the target template.

5. The method of claim 1, wherein, The inputting the to-be-displayed content to the corresponding node position according to the association information comprises: obtaining a node sequence number identifier of the target template; inputting the to-be-displayed content to the corresponding node position according to the association information and the node sequence number identifier.

6. The method of claim 5, wherein, The inputting the to-be-displayed content to the corresponding node position according to the association information and the node sequence number identifier comprises: determining a first number according to the association information, the first number being a number of adjacent to-be-displayed contents; comparing the first number with a second number of adjacent nodes in the target template; if the first number is greater than the second number, processing the to-be-displayed content so that the first number is less than or equal to the second number, and inputting the processed to-be-displayed content to the corresponding node position; or if the first number is less than or equal to the second number, inputting the to-be-displayed content to the corresponding node position.

7. The method of claim 6, wherein, The inputting the to-be-displayed content to the corresponding node position according to the association information and the node sequence number identifier comprises: arranging the to-be-displayed content according to the preset generation rule information, and determining to-be-displayed content to be preferentially input based on the second number; inputting the to-be-displayed content to be preferentially input to the corresponding node position.

8. The method of claim 1, wherein, The connecting the corresponding node positions by using a node connection line based on the association information to generate the knowledge graph comprises: determining a first node position and a second node position corresponding to a first sequence number and a second sequence number respectively according to the node sequence number identifier, the first sequence number being an adjacent sequence number smaller than the second sequence number; determining the first node position as a starting direction of the node connection line and the second node position as a terminal direction of the node connection line, the terminal direction being an arrow pointing identifier.

9. A knowledge graph generation device, characterized in that, comprises: an obtaining module configured to obtain to-be-displayed information, the to-be-displayed information being used to represent a node number and node content of a to-be-displayed knowledge node, the node content including important knowledge points in a textbook that students have not mastered, important knowledge points in the textbook that students have mastered, and important knowledge points in the textbook that students are about to learn; The dividing module is configured to divide the to-be-displayed information based on preset generation rule information to obtain a to-be-displayed node quantity of each node level and to-be-displayed content of each node, and each node level corresponds to a target template, wherein the preset generation rule information includes a node level division rule and a node input rule, and the to-be-displayed content is text and pictures corresponding to each node obtained after the to-be-displayed information is divided according to the node level division rule; The determining module is configured to determine the target template corresponding to each node level according to the to-be-displayed node quantity. The generating module is configured to input the to-be-displayed content into corresponding node positions of the target template to generate a knowledge graph corresponding to the to-be-displayed information, including: determining association information between different to-be-displayed contents and the corresponding node positions, wherein the association information includes input orders and connection relationships between the different to-be-displayed contents; inputting the to-be-displayed content into the corresponding node positions according to the association information; and connecting the corresponding node positions by using a node connection line based on the association information to generate the knowledge graph.

10. An electronic device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, The processor executes the computer program to implement the knowledge graph generation method in any one of claims 1 to 8.

11. A computer readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the knowledge graph generation method in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Knowledge graph generation method and device, computer equipment and storage medium

    CN115048536A

  • Home knowledge graph construction method, equipment and medium

    CN115203424A