Node control method, device and electronic device for visual knowledge graph
Through dynamic programming strategy, the center node is set as the ring center in the knowledge graph, and the child nodes and leaf nodes are set in sequence according to the ring and connected through curves, which solves the problem of random and indistinguishable nodes in the knowledge graph, and realizes the node's existence The order and density are properly presented, which is convenient for learning and sorting.
Patent Information
- Application Number
- CN202410313569.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2023-12-21
- Filing Date
- 2024-03-19
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-03-19
AI Technical Summary
In the knowledge graph, especially in the case of huge scale, the presentation method of nodes is relatively arbitrary, making it difficult to distinguish and recognize nodes of different levels. In the case of huge number of nodes, the content of the knowledge graph is difficult to be presented in an orderly manner.
Using a dynamic programming strategy, set the center node as the center of the ring. The child nodes and leaf nodes are set in sequence from the inside out according to the ring and are connected through curves. Each child node and the corresponding multiple leaf nodes are connected by curves. Dynamically adjust the distribution and placeholding of nodes to achieve proper and orderly presentation.
Through dynamic planning strategies, each node is presented in an orderly and dense manner along the ring perimeter, which is convenient for students to sort out and learn knowledge points. Especially when the number of nodes is huge, it is easy to distinguish between nodes of different levels. identify.
Smart Images

Figure CN118133944B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computers and the Internet, and in particular to a node control method, device and electronic device for a visual knowledge graph. Background Art
[0002] With the rapid development of artificial intelligence, and supported by technologies such as big data, the Internet of Things, and natural language processing, knowledge graphs have played an important role in promoting various social industries such as security, finance, education, transportation, science and technology, and medical care. They are also often used as one of the core supporting technologies in the fields of intelligent question answering and recommendation systems. Therefore, it is of great practical significance to carry out research on knowledge graph-related technologies. With the rapid expansion of data and information, knowledge graph technology faces many problems in knowledge acquisition, representation, fusion, and application. Especially for large-scale knowledge graphs, the presentation of each node in the knowledge graph is often relatively random. Especially in situations where the number of nodes is huge, nodes of different levels are prone to interfere with each other and are difficult to distinguish and identify. Summary of the invention
[0003] The purpose of this application is to provide a node control method, device and electronic device for a visual knowledge graph.
[0004] An embodiment of the present application provides a node control method for a visualized knowledge graph, comprising: setting a central node as the center of a ring, and setting child nodes and leaf nodes in sequence from the inside to the outside of the ring; wherein the central node is set as a knowledge unit, the child nodes are set as attributes of the knowledge unit, and the leaf nodes are set as knowledge points; the knowledge unit includes multiple attributes, and the attributes of the knowledge unit include multiple knowledge points; each child node and the corresponding multiple leaf nodes are connected by a curve; and through a dynamic programming strategy, the child nodes and leaf nodes are controlled to be set in sequence along the circumference of the ring.
[0005] Furthermore, the ring includes a first arc and a second arc arranged sequentially from the inside to the outside; wherein the child nodes are arranged to be spaced apart in sequence along the circumference of the first arc, and the leaf nodes are arranged to be spaced apart in sequence along the circumference of the second arc.
[0006] Furthermore, the dynamic programming strategy is used to control the sub-nodes and leaf nodes to be arranged in sequence along the circumference of the ring, including: determining the total number of knowledge point slots on the second arc according to the arc length of the second arc, a preset text height and line spacing; wherein each knowledge point slot corresponds to the display of a single line of text; partitioning the ring to obtain multiple sub-areas, and determining the first knowledge point slot allocation in each sub-area; performing optimization calculations based on the current number of knowledge points and the total number of knowledge points corresponding to each sub-node to determine the second knowledge point slot allocation corresponding to each sub-node; wherein, if the second knowledge point slot allocation corresponding to multiple sub-nodes in the current sub-area is greater than the first knowledge point slot allocation in each sub-area, some knowledge points are displayed across sub-areas.
[0007] Furthermore, the method of controlling the sub-nodes and leaf nodes to be arranged in sequence along the circumference of the ring through a dynamic programming strategy also includes: setting the spacing between adjacent leaf nodes with the same attribute to be smaller than the spacing between adjacent leaf nodes with different attributes.
[0008] Furthermore, the dynamic programming strategy is used to control the sub-nodes and leaf nodes to be arranged in sequence along the circumference of the ring, and also includes: if the number of knowledge points corresponding to the current sub-node is greater than the second knowledge point slot allocation, some knowledge points are folded in the default display state; in the interactive process, the folded knowledge points are displayed in the knowledge point slots corresponding to the adjacent sub-nodes on both sides of the current sub-region, and the range is gradually expanded to display them in sequence; when the folded knowledge points cannot be fully displayed in the current sub-region, they are displayed across sub-regions; wherein, a curve is drawn from the current sub-node and extended to another adjacent sub-region, and the end of the curve then diverges to draw multiple curves connected to the knowledge point slots on the second arc to display each knowledge point.
[0009] Furthermore, the dynamic programming strategy is used to control the child nodes and leaf nodes to be arranged in sequence along the circumference of the ring, and also includes: if the number of words in the current knowledge point is greater than the display word count threshold of the single-line text corresponding to the knowledge point slot, part of the text of the current knowledge point is folded and displayed; or, the text of the current knowledge point is displayed in a broken line.
[0010] Furthermore, the dynamic programming strategy is used to control the sub-nodes and leaf nodes to be arranged in sequence along the circumference of the ring, and also includes: sorting the knowledge points with the same attributes in sequence according to the set order, and marking the corresponding serial numbers in front of the knowledge points; wherein the set order includes the chronological order of each knowledge point or the importance of each knowledge point; or, sorting the knowledge points with the same attributes in sequence according to the number of words in the knowledge point text.
[0011] Furthermore, the node control method of the visual knowledge graph also includes: after clicking the current knowledge point, triggering and generating a new visual knowledge graph; wherein the current knowledge point is set as a new central node, the attributes of the current knowledge point are set as new child nodes, and the child knowledge points of the current knowledge point are set as new leaf nodes.
[0012] Furthermore, the dynamic programming strategy is used to control the sub-nodes and leaf nodes to be arranged in sequence along the circumference of the ring, and also includes: dividing the second arc into multiple sub-areas, and determining the knowledge point slots on the second arc in the sub-areas according to the arc length of the second arc and a preset text line spacing; dynamically allocating the knowledge point slots on the second arc to obtain the number of allocated knowledge point slots under each attribute; and dynamically determining the starting position and ending position of the knowledge point slots under each attribute on the second arc according to the number of allocated knowledge point slots under each attribute.
[0013] Further, the second arc is divided into multiple sub-areas, and the knowledge point slots on the second arc in the sub-areas are determined according to the arc length of the second arc and the preset text line spacing, including: establishing coordinates with the center of the second arc as the center point, and dividing the second arc into 4 sub-areas using horizontal and vertical coordinates; determining the available vertical coordinate range in the sub-area according to the radius of the second arc; determining the number of available rows in the sub-area according to the available vertical coordinate range in the sub-area and the preset text line spacing; determining the number of available nodes in the sub-area according to the number of available rows in the sub-area; determining the coordinates of the available nodes in the sub-area according to the number of available nodes in the sub-area, the radius of the second arc and the preset text line spacing; wherein the available nodes are set to be distributed in sequence along the vertical coordinate according to the preset text line spacing; moving the available nodes in the sub-area laterally along the x-axis to form new points on the second arc, and determining the new points as knowledge point slots.
[0014] Furthermore, the knowledge point slots on the second arc are dynamically allocated to obtain the number of knowledge point slots allocated under each attribute, including: reserving the number of gaps between each group of leaf nodes under two adjacent attributes; calculating the number of knowledge points under each attribute in the sub-area; calculating the average allocated number of knowledge point slots under each attribute according to the number of attributes in the sub-area, and calculating the number of knowledge point slots remaining in the initial state; comparing the number of knowledge points and the number of gaps under each attribute in the sub-area with the average allocated number of knowledge point slots under each attribute, recycling the excess knowledge point slots under the target attribute, and summing them with the remaining number of knowledge point slots in the initial state to obtain the remaining number of allocable knowledge point slots; taking attributes as units, allocating the remaining number of allocable knowledge point slots to attributes with insufficient knowledge point slots in round-robin manner until the remaining number of allocable knowledge point slots is zero, to obtain the number of knowledge point slots allocated under each attribute.
[0015] Furthermore, the starting and ending positions of the knowledge point slots under each attribute on the second arc are dynamically determined based on the number of knowledge point slots allocated under each attribute, including: screening out target knowledge point slots based on the center point coordinates of each attribute in the sub-area and the center point coordinates of all knowledge point slots in the sub-area; wherein the target knowledge point slot is the knowledge point slot closest to the center point of the attribute; and determining the starting and ending positions of the knowledge point slots based on the center position of the target knowledge point slot and the number of allocated knowledge point slots.
[0016] Furthermore, the method of connecting each child node and the corresponding multiple leaf nodes with a curve includes: setting the graph of the attribute to be composed of a first center point and a first circle, and setting the graph of the knowledge point slot to be composed of a second center point and a second circle; connecting the center of the second arc with the first center point to obtain a first line segment, and extending the first line segment to intersect with the first circle to obtain a first intersection; connecting the center of the second arc with the second center point to obtain a second line segment, and intersecting the second line segment with the second circle to obtain a second intersection; drawing the first intersection and the second intersection with a cubic Bezier curve, and controlling the shape and curvature of the cubic Bezier curve with a first control point and a second control point; wherein the horizontal coordinate of the first control point is the same as the horizontal coordinate of the first intersection, and the vertical coordinate of the first control point is the same as the vertical coordinate of the second intersection; the horizontal coordinate of the second control point is the same as the horizontal coordinate of the second intersection, and the vertical coordinate of the second control point is the same as the vertical coordinate of the first intersection.
[0017] An embodiment of the present application provides a node control device for a visualized knowledge graph, including: a setting module, which is used to set the central node as the center of a ring, and set the child nodes and leaf nodes in sequence from the inside to the outside of the ring; wherein the central node is set as a knowledge unit, the child nodes are set as attributes of the knowledge unit, and the leaf nodes are set as knowledge points; the knowledge unit includes multiple attributes, and the attributes of the knowledge unit include multiple knowledge points; a connection module, which is used to connect each child node and the corresponding multiple leaf nodes with a curve; a control module, which is used to control the child nodes and leaf nodes to be set in sequence along the circumference of the ring through a dynamic programming strategy.
[0018] An embodiment of the present application provides an electronic device, which includes a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the steps of the method described above are implemented.
[0019] An embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the steps of the method described above are implemented.
[0020] An embodiment of the present application provides a computer program product, wherein the computer program product includes computer program instructions, and when the computer program instructions are executed by a processor, the steps of the method described above are implemented.
[0021] The above technical solution of the present application has the following beneficial technical effects:
[0022] In the embodiment of the present application, through the dynamic programming strategy, the position and distribution of each child node on the inner ring and the position and distribution of each leaf node on the outer ring can be adaptively adjusted, so that each node can be properly dense and orderly presented along the circumference of the ring. The knowledge unit is set at the center of the ring, the attribute of the knowledge unit is set in the inner ring, and multiple knowledge points are set in the outermost ring, and each child node and the corresponding multiple leaf nodes are connected by curves, so that the content contained in the visual knowledge graph provided by the embodiment of the present application and the relationship between each node can be clearly seen; even in the case of a huge number of nodes, nodes of different levels are easily distinguished and identified, and nodes of the same level are distributed along the circumference of the same ring, which can achieve proper density and orderly presentation, and facilitate students to sort out and learn knowledge points. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following briefly introduces the drawings in the embodiments of the present application.
[0024] Figure 1 It is a schematic diagram of the system architecture of an embodiment of the present application.
[0025] Figure 2 It is a flowchart of a node control method of a visual knowledge graph in an embodiment of the present application.
[0026] Figure 3 It is a structural diagram of a visual knowledge graph according to an embodiment of the present application.
[0027] Figure 4 This is a schematic diagram of the processing process of a node control method of a visual knowledge graph in an embodiment of the present application. Figure 1 .
[0028] Figure 5 This is a schematic diagram of the processing process of a node control method of a visual knowledge graph in an embodiment of the present application. Figure 2 .
[0029] Figure 6 This is a schematic diagram of the processing process of a node control method of a visual knowledge graph in an embodiment of the present application. Figure 3 .
[0030] Figure 7This is a schematic diagram of the processing process of a node control method of a visual knowledge graph in an embodiment of the present application. Figure 4 .
[0031] Figure 8 This is a schematic diagram of the processing process of a node control method of a visual knowledge graph in an embodiment of the present application. Figure 5 .
[0032] Fig. 9 It is a structural block diagram of a node control device for a visual knowledge graph according to an embodiment of the present application.
[0033] Fig.10 It is a schematic diagram of an electronic device used to implement a node control method of a visual knowledge graph in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that the purpose of providing these embodiments is to make the principles and spirit of the present application clearer and more thorough, so that those skilled in the art can better understand and implement the principles and spirit of the present application. The exemplary embodiments provided herein are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments herein, all other embodiments obtained by ordinary technicians of the art without creative work are within the scope of protection of this application.
[0035] Embodiments of the present application relate to terminal devices and / or servers. Those skilled in the art will appreciate that the embodiments of the present application may be implemented as a system, apparatus, device, method, computer-readable storage medium, or computer program product. Therefore, the present disclosure may be specifically implemented in at least one of the following forms: complete hardware, complete software, or a combination of hardware and software. According to the embodiments of the present application, the present application claims protection for a node control method, apparatus, electronic device, computer-readable storage medium, and computer program product for a visual knowledge graph. Figure 1 A schematic diagram of a system architecture of an embodiment of the present application is shown. Figure 1As shown, the system includes a terminal device 102 and a server 104. Among them, the terminal device 102 may include at least one of the following: a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart TV, various wearable devices, an augmented reality AR device, a virtual reality VR device, etc. A client can be installed on the terminal device 102. For example, the client can be a client that specifically performs a specific function (such as an application app), or a client with multiple application applets (different functions) embedded in it, or a client logged in through a browser. The user can operate on the terminal device 102. For example, the user can open the client installed on the terminal device 102 and input instructions through the client operation, or the user can open the browser installed on the terminal device 102 and input instructions through the browser operation. After the terminal device 102 receives the instruction input by the user, the request information containing the instruction is sent to the server 104. After receiving the request information, the server 104 performs corresponding processing and then returns the processing result information to the terminal device 102. The user instruction is completed through a series of data processing and information interaction.
[0036] In this document, terms such as first, second, third, etc. are only used to distinguish one entity (or operation) from another entity (or operation), but not to require or imply any order or relationship between these entities (or operations).
[0037] Figure 2 A schematic flow chart of a node control method of a visual knowledge graph according to an embodiment of the present application is shown. The method may include the following specific steps:
[0038] Step S110: Set the central node as the center of the ring, and set the child nodes and leaf nodes in sequence from the inside to the outside of the ring; wherein the central node is set as a knowledge unit, the child nodes are set as attributes of the knowledge unit, and the leaf nodes are set as knowledge points; the knowledge unit includes multiple attributes, and the attributes of the knowledge unit include multiple knowledge points.
[0039] In the embodiment of the present application, the ring can be set as a small rectangle nested in a large rectangle, a small square nested in a large square, or a small circle nested in a large circle; or the ring can also be set as a non-closed loop figure, for example, a small arc nested in a large arc; Figure 3As shown, a knowledge unit can be, for example, a chapter of a textbook, and the attributes of a knowledge unit establish the connection between the knowledge unit and each knowledge point, such as an association and inclusion relationship, and therefore can also be defined as the relationship / attribute of a knowledge unit. The relationship / attribute of a knowledge unit can specifically include definitions of terms, basic principles, core concepts, major significance, key learning points, teaching objectives or key difficulties, etc. In this way, according to the relationship / attribute of the knowledge unit, it is possible to classify the various knowledge points contained in the knowledge unit, for example, it can be classified into content logic, teaching content and extended content, etc., to facilitate students to sort out and learn the knowledge points.
[0040] Step S120: Connect each child node and the corresponding leaf nodes using curves.
[0041] In an embodiment of the present application, when the number of leaf nodes set in the outermost ring is large, by reasonably controlling the curvature of the curve, the connection curves between each child node and the corresponding multiple leaf nodes can avoid overlapping and crossing, and the connection relationship between each child node and the corresponding multiple leaf nodes can be clearly presented.
[0042] Step S130: through a dynamic programming strategy, control the child nodes and leaf nodes to be arranged in sequence along the circumference of the ring.
[0043] In the embodiment of the present application, through the dynamic programming strategy, the position and distribution of each child node on the inner ring and the position and distribution of each leaf node on the outer ring can be adaptively adjusted, so that each node can be properly distributed and orderly presented along the circumference of the ring. The knowledge unit is set at the center of the ring, the attribute of the knowledge unit is set in the inner ring, and multiple knowledge points are set in the outermost ring, and each child node and the corresponding multiple leaf nodes are connected by curves, so that the content contained in the visual knowledge graph provided by the embodiment of the present application and the relationship between each node can be clearly seen; even in the case of a huge number of nodes, nodes of different levels are easily distinguished and identified, and nodes of the same level are distributed along the circumference of the same ring, which can achieve proper density and orderly presentation, and facilitate students to sort out and learn knowledge points.
[0044] In some embodiments, the ring includes a first arc and a second arc arranged sequentially from the inside to the outside; wherein the child nodes are arranged to be spaced apart in sequence along the circumference of the first arc, and the leaf nodes are arranged to be spaced apart in sequence along the circumference of the second arc.
[0045] Specifically, when there are a large number of knowledge points, the diameter of the second arc can be increased to extend the circumference of the second arc, so that the distribution of leaf nodes can be properly dense and orderly presented; when the number of knowledge points is small, the diameter of the second arc can be appropriately reduced to shorten the circumference of the second arc. Therefore, the ring setting has strong scalability and a wide range of applications.
[0046] In some embodiments, step S130, controlling the sub-nodes and the leaf nodes to be arranged sequentially along the perimeter of the ring by a dynamic programming strategy, may specifically include the following steps:
[0047] Step S131: determining the total number of knowledge point slots on the second arc according to the arc length of the second arc, the preset text height and the line spacing; wherein each knowledge point slot corresponds to the display of a single line of text;
[0048] Step S132: partitioning the ring to obtain a plurality of sub-areas, and determining the allocation quota of the first knowledge point slot in each sub-area;
[0049] Step S133: Optimize the calculations based on the current number of knowledge points and the total number of knowledge points corresponding to each sub-node to determine the second knowledge point slot allocation corresponding to each sub-node; if the second knowledge point slot allocation corresponding to multiple sub-nodes in the current sub-region is greater than the first knowledge point slot allocation in each sub-region, some knowledge points are displayed across sub-regions.
[0050] Specifically, each knowledge point is presented in generalized text, and the text of each knowledge point can be set outside the second arc and presented horizontally, and the total number of knowledge point slots can be calculated based on the arc length, text height and line spacing of the second arc; when the ring is partitioned, for example, the ring can be divided into four sub-areas according to the settings of the horizontal axis and the vertical axis, and the second arc can be set intermittently between adjacent sub-areas to avoid numerous knowledge points being continuously distributed along the arc and causing visual fatigue and difficulty in recognition; according to the current number of knowledge points and the total number of knowledge points corresponding to each sub-node, and the placeholder of each sub-node can be reasonably allocated according to the attributes of the knowledge points, several rounds of optimization calculations can be performed to determine the allocation of the second knowledge point slots corresponding to each sub-node, and distribute them evenly, so as to display as many knowledge points as possible, so as to achieve the beauty of the presented visual effect and achieve a reasonable density of the knowledge points.
[0051] In some embodiments, in step S130, the dynamic programming strategy is used to control the sub-nodes and leaf nodes to be arranged in sequence along the perimeter of the ring, and further includes: setting the spacing between adjacent leaf nodes of the same attribute to be smaller than the spacing between adjacent leaf nodes of different attributes. In this way, leaf nodes of the same attribute can be close to each other, while leaf nodes of different attributes can be far away from each other, which is conducive to students' distinction and recognition during the learning process.
[0052] In some embodiments, step S130, the dynamic programming strategy is used to control the child nodes and leaf nodes to be arranged in sequence along the circumference of the ring, and also includes: if the number of knowledge points corresponding to the current child node is greater than the second knowledge point slot allocation, some knowledge points are folded in the default display state; in the process of interaction, the folded knowledge points are displayed in the knowledge point slots corresponding to the adjacent child nodes on both sides of the current sub-region, and the range is gradually expanded to display them in sequence; when the folded knowledge points cannot be fully displayed in the current sub-region, they are displayed across sub-regions; wherein, a curve is drawn from the current child node and extended to another adjacent sub-region, and the end of the curve then diverges to draw multiple curves connected to the knowledge point slots on the second arc to display each knowledge point.
[0053] Specifically, when there are a large number of knowledge points, even after several rounds of optimization calculations, when the number of knowledge points corresponding to the current sub-node is greater than the allocated quota of the second knowledge point slot, some knowledge points will be folded in the default display state; during the interaction, the folded knowledge points can be displayed to fully display all the knowledge points corresponding to the sub-node; for the folded knowledge points directly connected by the curve, they can be displayed in this area by borrowing, first borrowing from the knowledge point slots corresponding to the adjacent sub-nodes on both sides, and when they are not enough, the range will continue to be gradually expanded to both sides to display in sequence, and cross-sub-area borrowing can also be performed. At this time, a curve is drawn from the current sub-node to extend to another adjacent sub-area, and the end of the curve diverges to draw multiple curves connected to the second arc to display each knowledge point.
[0054] In some embodiments, step S130, the sub-nodes and leaf nodes are controlled to be arranged in sequence along the circumference of the ring through a dynamic programming strategy, and also includes: if the number of words in the current knowledge point is greater than the display word count threshold of the single-line text corresponding to the knowledge point slot, part of the text of the current knowledge point is folded and displayed; or, the text of the current knowledge point is displayed in a broken line.
[0055] Specifically, the principle of optimizing the calculation and determining the knowledge point slot allocation is to display as many knowledge points as possible in the visual knowledge graph, and to fully display the text content when there are free knowledge point slots. For example, each line of text can accommodate 40 words, and the text of the current knowledge point is 50 words, and the extra text behind can be folded; if there are remaining knowledge point slots in the sub-area, the text of the current knowledge point can be displayed in two lines.
[0056] In some embodiments, step S130, the dynamic programming strategy is used to control the child nodes and leaf nodes to be arranged in sequence along the circumference of the ring, and also includes: sorting the knowledge points with the same attributes in sequence according to the set order, and marking the corresponding serial numbers in front of the knowledge points; wherein the set order includes the time sequence of each knowledge point or the importance of each knowledge point; or, sorting the knowledge points with the same attribute in sequence according to the number of words in the knowledge point text.
[0057] Specifically, when knowledge points with the same attributes have a clear set order, the set order can be, for example, the chronological order of each knowledge point or the degree of importance of each knowledge point. The knowledge points are ranked according to the set order and the corresponding serial numbers are marked in front of the knowledge points. When knowledge points with the same attributes do not have a clear order, they can be ranked according to the visual effect, or according to the number of words in each line of text, that is, each line of text can be from short to long or from long to short, and the knowledge points are sorted from top to bottom. This can make the overall visual effect of the visualized knowledge graph beautiful and achieve a reasonable ranking density of the knowledge points.
[0058] In some embodiments, step S130, controlling the sub-nodes and the leaf nodes to be arranged sequentially along the circumference of the ring by a dynamic programming strategy, further includes the following specific steps:
[0059] Step S134: dividing the second arc into a plurality of sub-areas, and determining the knowledge point slots on the second arc in the sub-areas according to the arc length of the second arc and a preset text line spacing;
[0060] Step S135: dynamically allocating the knowledge point slots on the second arc to obtain the number of knowledge point slots allocated under each attribute;
[0061] Step S136: According to the number of knowledge point slots allocated under each attribute, dynamically determine the starting position and the ending position of the knowledge point slot under each attribute on the second arc.
[0062] Specifically, all knowledge points and attributes under the current knowledge unit can be obtained to obtain the number of attributes and the total number of knowledge points. For example, the radii of the first arc and the second arc can be reasonably determined according to the preset text height and line spacing, so as to obtain the knowledge point slots on the second arc in the sub-area. In order to obtain the best presentation, the knowledge point slots on the second arc are reasonably and dynamically allocated according to the actual number of knowledge points under each attribute to obtain the number of allocated knowledge point slots under each attribute (that is, the second knowledge point slot allocation amount corresponding to each sub-node); in order to avoid overlapping and crossing the connection curve between each attribute and the knowledge point slot, and to display it beautifully, the starting position and ending position of the knowledge point slot under each attribute on the second arc are reasonably and dynamically determined.
[0063] In some embodiments, step S134, dividing the second arc into a plurality of sub-areas, and determining the knowledge point slots on the second arc in the sub-areas according to the arc length of the second arc and a preset text line spacing, comprises the following specific steps:
[0064] Step S1341: establishing coordinates with the center of the second arc as the center point, and dividing the second arc into four sub-areas using the horizontal coordinate and the vertical coordinate;
[0065] Step S1342: determining the available vertical coordinate range in the sub-area according to the radius of the second arc;
[0066] Step S1343: determining the number of available lines in the sub-area according to the available vertical coordinate range in the sub-area and the preset text line spacing;
[0067] Step S1344: Determine the number of available nodes in the sub-region according to the number of available rows in the sub-region;
[0068] Step S1345: determining the coordinates of the available nodes in the sub-region according to the number of available nodes in the sub-region, the radius of the second arc and the preset text line spacing; wherein the available nodes are arranged to be distributed in sequence along the vertical coordinate according to the preset text line spacing;
[0069] Step S1346: Move the available nodes in the sub-area laterally along the x-axis to form a new point on the second arc, and determine the new point as a knowledge point slot.
[0070] In some embodiments, step S135, dynamically allocating the knowledge point slots on the second arc to obtain the number of knowledge point slots allocated under each attribute, includes the following specific steps:
[0071] Step S1351: reserve the number of spaces between each group of leaf nodes under two adjacent attributes; calculate the number of knowledge points under each attribute in the sub-region;
[0072] Step S1352: Calculate the average number of knowledge point slots allocated under each attribute according to the number of attributes in the sub-region, and calculate the number of knowledge point slots remaining in the initial state;
[0073] Step S1353: comparing the number of knowledge points and the number of gaps under each attribute in the sub-region with the average number of knowledge point slots allocated under each attribute, reclaiming the redundant knowledge point slots under the target attribute, and summing them up with the number of knowledge point slots remaining in the initial state to obtain the remaining number of allocable knowledge point slots;
[0074] Step S1354: Allocate the remaining number of allocatable knowledge point slots to the attributes with insufficient knowledge point slots in round-robin fashion, taking attributes as units, until the remaining number of allocatable knowledge point slots is zero, so as to obtain the number of allocated knowledge point slots for each attribute.
[0075] In some embodiments, step S136, dynamically determining the starting position and the ending position of the knowledge point slot under each attribute on the second arc according to the number of knowledge point slots allocated under each attribute, includes the following specific steps:
[0076] Step S1361: Filter out a target knowledge point slot according to the center point coordinates of each attribute in the sub-region and the center point coordinates of all knowledge point slots in the sub-region; wherein the target knowledge point slot is the knowledge point slot closest to the center point of the attribute;
[0077] Step S1362: Determine the starting position and the ending position of the knowledge point slot according to the center position of the target knowledge point slot and the number of allocated knowledge point slots.
[0078] In some embodiments, step S120, connecting each child node and the corresponding plurality of leaf nodes with a curve, comprises the following specific steps:
[0079] Step S121: setting the graph of the attribute to be composed of a first center point and a first circle, and setting the graph of the knowledge point slot to be composed of a second center point and a second circle;
[0080] Step S122: Connect the center of the second arc and the first center point to obtain a first line segment, and extend the first line segment to intersect with the first circle to obtain a first intersection point;
[0081] Step S123: connecting the center of the second arc and the second center point to obtain a second line segment, and the second line segment intersects the second circle to obtain a second intersection point;
[0082] Step S124: Draw a cubic Bezier curve between the first intersection and the second intersection, and use the first control point and the second control point to control the shape and curvature of the cubic Bezier curve; wherein the horizontal coordinate of the first control point is the same as the horizontal coordinate of the first intersection, and the vertical coordinate of the first control point is the same as the vertical coordinate of the second intersection; the horizontal coordinate of the second control point is the same as the horizontal coordinate of the second intersection, and the vertical coordinate of the second control point is the same as the vertical coordinate of the first intersection.
[0083] In some embodiments, the node control method of the visual knowledge graph further includes:
[0084] After clicking the current knowledge point, a new visual knowledge graph is triggered and generated; in which the current knowledge point is set as a new central node, the attributes of the current knowledge point are set as new child nodes, and the child knowledge points of the current knowledge point are set as new leaf nodes.
[0085] Specifically, after the user clicks on the current knowledge point on the browsing interface of the terminal device 102, a request message for generating a new visual knowledge graph is triggered and sent to the server 104. After receiving the request message, the server 104 performs corresponding processing and then returns the processing result information to the terminal device 102. At this time, a new visual knowledge graph can be displayed on the browsing interface of the terminal device 102; that is, a ring with a new central node as the center is presented, and each new child node and the corresponding multiple new leaf nodes are connected by curves. The new child nodes and the new leaf nodes are arranged in sequence along the circumference of the first arc and the second arc respectively. The control method of each node can adopt the above-mentioned steps S110-S130, thereby clearly presenting the hierarchical relationship between the nodes, and enabling the students to understand at a glance the content contained in the visual knowledge graph provided in the embodiment of the present application and the relationship between the nodes; nodes of different levels are easily distinguished and identified, and nodes of the same level are distributed along the circumference of their respective arcs, which can achieve proper density and orderly presentation.
[0086] The above describes the implementation methods and advantages of the embodiments of the present application through multiple embodiments. Figure 4-Figure 8 In combination with specific examples, a specific processing process of an embodiment of the present application is described in detail.
[0087] Entity node (Node): An entity node is a knowledge point that can be represented by text. If the text is long, it needs to be displayed in multiple lines.
[0088] Knowledge point slot (Slot): used to display entity nodes. Each knowledge point slot only displays one line of text. When there are more than one line of entity nodes, multiple knowledge point slots are required to display them.
[0089] Attribute (A): An attribute can include one or more entity nodes.
[0090] 1. Determine the knowledge point slots on the second arc (i.e. the outermost circle)
[0091] 1) Take the center O of the second arc as the center point, set the coordinates to (0, 0), the horizontal and vertical coordinates to x and y respectively, and the radius of the second arc to r;
[0092] 2) Divide the second arc into multiple sub-areas, generally divided into 4 sub-areas by the horizontal and vertical coordinates;
[0093] 3) Determine the available vertical coordinate range (y coordinate range [y1, y2]) of each sub-region;
[0094] 4) Determine the line spacing H according to the display font size, text height and preset line spacing;
[0095] 5) Divide the data into equal parts according to a fixed row spacing or a minimum row spacing requirement, and calculate the number of rows L available for each sub-region, where each row corresponds to a knowledge point slot;
[0096]
[0097] The number of available nodes in each sub-area is S=L;
[0098] 6) Determine the value of the horizontal coordinate x of the available node p (take the second arc radius r), and determine all available nodes p∈P according to the number of rows L and row spacing H calculated in the previous step, and set the coordinates of p to (x, y);
[0099] 7) For each available node p∈P, determine its y value of the ordinate, move it horizontally along the x-axis to the second arc, and determine it as a new point p'∈P'. The new point is the knowledge point slot; the coordinates of the knowledge point slot (new point p') are (x', y), where x' can be calculated by the following formula:
[0100]
[0101] Here, the ± sign of x' remains the same as that of x.
[0102] The steps for determining the knowledge point slot on the second arc are illustrated as follows (wherein each parameter can be set with reference to the coordinate value, and is not measured in a specific length unit, considering that the size of the set text is related to the display pixel and resolution):
[0103] 1) Set the horizontal coordinate range to [-1.5, 1.5], the vertical coordinate range to [-1, 1], the center coordinate to (0, 0), and the radius of the second arc to r = 0.9;
[0104] 2) Divide into four areas according to the coordinate quadrant, counting counterclockwise as the first, second, third and fourth quadrants;
[0105] 3) Taking the first quadrant as an example: the available vertical coordinate range y∈[0.07,0.9];
[0106] 4) The line spacing of the text is: H = 0.04;
[0107] 5) Calculate the number of available rows: According to formula 1,
[0108]
[0109] S = L = 21;
[0110] 6) There are 21 points p∈P in the first quadrant, calculated with H=0.04, namely: p1(0.9,0.07), p2(0.9,0.11), p3(0.9,0.15)…p21(0.9,0.87);
[0111] 7) Calculate according to formula 2: The positions of the knowledge point slots p'∈P' are p1'(0.897,0.07), p2'(0.893,0.11), p3'(0.887,0.15)...p21'(0.230,0.87).
[0112] 2. Dynamic allocation of knowledge point slots
[0113] Principle: Display the content of entity nodes as much as possible while paying attention to clear visual presentation.
[0114] 1) Determine the number of reserved spaces SEP between each attribute (i.e., between each group of leaf nodes under two adjacent attributes). SEP can be set to 1 or 0. Considering the visual presentation effect, the default value is 1 (i.e., one knowledge point slot is separated), i.e., SEP=1;
[0115] 2) Calculate the number of entity nodes under each attribute by quadrant;
[0116] 3) In the initial state, according to the number of attributes R, the average distribution number A of knowledge point slots is calculated, and the remaining number of knowledge point slots Rem0 is calculated;
[0117]
[0118] Rem0 = S – A*R;
[0119] 4) According to the number of nodes and the number of empty spaces actually required by the attribute, the redundant knowledge point slots are recovered and summed up with the remaining number of knowledge point slots Rem0 to obtain the remaining number of allocable knowledge point slots Rem1, waiting for re-allocation;
[0120] 5) Remaining knowledge point slot allocation scheme 1, taking attributes as units, allocating the remaining allocable knowledge point slots Rem1 to the attributes with insufficient knowledge point slots in round-robin, and obtaining the remaining knowledge point slots Rem2 after allocation;
[0121] 6) Remaining knowledge point slot allocation scheme 2, allocates the remaining allocatable knowledge point slots in round-robin mode, taking attributes as units, until Rem2 is 0.
[0122] The dynamic allocation process of knowledge point slots is illustrated as follows:
[0123] Assumption: The number of available knowledge point slots in the first quadrant is S=21, and the number of attributes R is 5.
[0124] 1) Let SEP = 1;
[0125] 2) First quadrant: Assume that the number of entity nodes under the five attributes is [5 10 3 1 1] respectively;
[0126] 3)
[0127] Rem0=SA*R=21-4*5=1
[0128] In the initial state:
[0129] Number of entity nodes: [5 10 3 1 1];
[0130] Allocated quantity: [4 4 4 4 4];
[0131] Number of free spaces: [-1 -6 1 3 3];
[0132] 4) Reclaim the redundant knowledge point slots. At this time, the number of remaining allocatable knowledge point slots Rem1 = 5.
[0133] Number of entity nodes: [5 10 3 1 1];
[0134] Assign quantity: [4 4 4 2 2];
[0135] Number of free spaces: [-1 -6 1 1 1];
[0136] 5) Remaining knowledge point slot allocation scheme 1, after allocation, Rem2 = 0, then
[0137] Number of entity nodes: [5 10 3 1 1];
[0138] Allocation quantity: [6 7 4 2 2];
[0139] Free quantity: [1 -3 1 1 1];
[0140] Among them, the free quantity of each attribute can be set to 1 first, that is, SEP=1 is satisfied;
[0141] 6) Remaining knowledge point slot allocation plan 2, Rem2=0, because there are no remaining knowledge point slots after allocation, and no further allocation is required.
[0142] 3. Dynamically determine the optimal knowledge point slots and number of entity nodes to display based on the number of allocated knowledge point slots
[0143] 3.1 Calculate the center position of the optimal knowledge point slot. Among all knowledge point slots, calculate and filter out the optimal knowledge point slot that matches a certain attribute (i.e., child node) to balance the node display effect; Algorithm 1: Find the nearest knowledge point slot, use a certain attribute center point P A The coordinates of the knowledge point slot center point [P S1 ,P S2 ,P S3 …] and take the knowledge point slot with the largest cosine similarity (i.e., the smallest angle θ).
[0144] (1) The formula for calculating the cosine value between the center position of an attribute and the center position of a knowledge point slot is as follows:
[0145]
[0146] Where (x1, y1) is the attribute center point P A The horizontal and vertical coordinates of the knowledge point slot; (x2, y2) is the center point of the knowledge point slot [P S1 ,P S2 ,P S3 …];
[0147] (2) According to the above formula, calculate P A With all knowledge point slot center points [P S1 ,P S2 ,P S3 …], that is, [cosθ1, cosθ2, cosθ3…];
[0148] (3) Take the knowledge point slot with the largest cos value as the optimal knowledge point slot S O ;
[0149] Idx max =ArgMax[cosθ1, cosθ2, cosθ3...];
[0150] Where, Idx max is the corresponding index number of the optimal knowledge point slot, specifically 1, 2, 3, etc. (for example, the one with the largest cosθ2 value is selected, and the corresponding index number Idx of the optimal knowledge point slot is returned) max is 2);
[0151] 3.2 Determine the distribution of the best knowledge point slots. For example, among the number of available knowledge point slots S in the first quadrant, the best knowledge point slot S O As the center, dynamically distribute the number of knowledge point slots N allocated under a certain attribute, determine the adopted knowledge point slot; calculate and determine the starting position Idx of the entity node in the knowledge point slotstart and end position Idx end ; The calculation process is as follows:
[0152] Idx start '=Idx max -N / 2
[0153] Rem'=S–N-Idx start '
[0154]
[0155]
[0156] Idx end =Idx start +N
[0157] In the formula, S is the number of available knowledge point slots in the sub-region (i.e., the number of available nodes in the sub-region); N is the number of allocated knowledge point slots under a certain attribute.
[0158] 4. Calculate the connection position and angle of the optimal connection line between the attribute and the knowledge point slot
[0159] (1) Let the coordinates of the center point of attribute A be A(x1,y1) and its radius be R A ; The center coordinates of knowledge point slot S are S(x2,y2), and its radius is R S ;
[0160] (2) Extend the line connecting the center point O(0,0) and A(x1,y1), and the intersection with the attribute edge is A'(x1',y1'); extend the center point O(0,0) and S(x2,y2) and the intersection with the knowledge point slot edge is S'(x2',y2');
[0161] The calculation formula for the coordinates of point A' (x1', y1') is as follows:
[0162]
[0163]
[0164] The calculation formula of the S' point coordinates (x2', y2') is as follows:
[0165]
[0166]
[0167] (3) The two intersection points A' and S' are the connection positions of the two ends of the connecting line;
[0168] (4) The connecting line adopts a third-order Bézier curve from the starting point A' to the end point S'. The shape and curvature of the curve are controlled by control points P1 and P2, and a cubic Bézier curve is drawn;
[0169] The coordinate calculation formulas of P1 and P2 are as follows:
[0170] P1(x1',y2')
[0171] P2(x2',y1')
[0172] Among them, x1', x2', y2', y1' are the coordinate values of points A'(x1', y1') and S'(x2', y2') respectively.
[0173] 5. Dynamic programming of all nodes under a single attribute / relationship
[0174] (1) All entity nodes under a single attribute / relationship can be regarded as a group to calculate the number of knowledge point slots required for all entity nodes under the single attribute / relationship;
[0175] (2) By default, all knowledge point slots in the area where this attribute is located are used. If the number of slots in this area is insufficient, all remaining allocatable knowledge point slots in the two quadrants on the same side can be used, or all remaining allocatable knowledge point slots in the adjacent area can be used or borrowed until all remaining allocatable knowledge point slots are allocated;
[0176] (3) In the adjacent area, dynamically determine the optimal knowledge point slots and quantity of the display entity nodes according to the number of allocated knowledge point slots; the implementation process of this step can refer to the specific steps 3.1 and 3.2 of item 3 above.
[0177] It should be noted that the above specific processing process is a preferred implementation mode proposed in this application, which can better adjust and display the distribution of each node to achieve proper density and orderly presentation.
[0178] In addition, those skilled in the art may also adopt other methods to calculate and obtain the distribution of each node. For example, knowledge point slots are set on the second arc according to the fixed line spacing of the text, knowledge point slots are evenly distributed for each attribute, and redundant knowledge points under each attribute are folded and displayed, which can be specifically represented by ellipsis (……).
[0179] Corresponding to the method embodiment of the present application, the embodiment of the present application also provides a node control device for a visual knowledge graph, such as Fig. 9 As shown, including:
[0180] A setting module 510 is used to set the central node as the center of the ring, and to set the child nodes and leaf nodes in order from the inside to the outside of the ring; wherein the central node is set as a knowledge unit, the child nodes are set as attributes of the knowledge unit, and the leaf nodes are set as knowledge points; the knowledge unit includes multiple attributes, and the attributes of the knowledge unit include multiple knowledge points;
[0181] A connection module 520, which is used to connect each child node and the corresponding plurality of leaf nodes using a curve;
[0182] The control module 530 is used to control the sub-nodes and leaf nodes to be arranged in sequence along the circumference of the ring through a dynamic programming strategy.
[0183] The electronic device in the embodiment of the present application may be a user terminal device, a server, other computing devices, or a cloud server. Fig.10 A schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application is shown. The electronic device may include a processor 601 and a memory 602 storing computer program instructions. When the processor 601 executes the computer program instructions, the process or function of any of the above-mentioned embodiments of the method is implemented.
[0184] Specifically, the processor 601 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application. The memory 602 may include a large-capacity memory for data or instructions. For example, the memory 602 may be at least one of the following: a hard disk drive (HDD), a read-only memory (ROM), a random access memory (RAM), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, a universal serial bus (USB) drive or other physical / tangible memory storage device. For another example, the memory 602 may include a removable or non-removable (or fixed) medium. For another example, the memory 602 may be inside or outside the integrated gateway disaster recovery device. The memory 602 may be a non-volatile solid-state memory. In other words, the memory 602 usually includes a tangible (non-transitory) computer-readable storage medium (such as a memory device) encoded with computer-executable instructions, and when the software is executed (such as executed by one or more processors), the operation described in the method of the embodiment of the present application can be performed. The processor 601 implements the process or function of any method in the above embodiments by reading and executing the computer program instructions stored in the memory 602.
[0185] In one example, Fig.10The electronic device shown may also include a communication interface 603 and a bus 610. Among them, the processor 601, the memory 602, and the communication interface 603 are connected through the bus 610 and complete the communication between each other. The communication interface 603 is mainly used to realize the communication between each module, device, unit and / or device in the embodiment of the present application. The bus 610 includes hardware, software or both, and can couple the components of the online data traffic billing device to each other. For example, the bus may include at least one of the following: an accelerated graphics port (AGP) or other graphics bus, an enhanced industrial standard architecture (EISA) bus, a front-end bus (FSB), a hypertransport (HT) interconnect, an industrial standard architecture (ISA) bus, an infinite bandwidth interconnect, a low pin count (LPC) bus, a memory bus, a micro channel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus or other suitable buses. The bus 610 may include one or more buses. Although the embodiments of the present application describe or illustrate a specific bus, the embodiments of the present application may consider any suitable bus or interconnection method.
[0186] In combination with the method in the above embodiments, an embodiment of the present application also provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the process or function of any method in the above embodiments is implemented.
[0187] In addition, an embodiment of the present application further provides a computer program product, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the process or function of any one of the methods in the above embodiments is implemented.
[0188] The above exemplarily describes the flowcharts and / or block diagrams of the methods, devices, systems and computer program products of the embodiments of the present application, and describes the relevant various aspects. It should be understood that each box or combination thereof in the flowchart and / or block diagram can be implemented by computer program instructions, or by dedicated hardware that performs a specified function or action, or by a combination of dedicated hardware and computer instructions. For example, these computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to form a machine that enables these instructions executed by such a processor to enable the implementation of the functions / actions specified in each box or combination thereof in the flowchart and / or block diagram. Such a processor can be a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.
[0189] The functional blocks shown in the structured block diagram of the embodiment of the present application can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc.; when implemented in software, it is a program or code segment used to perform the required task. The program or code segment can be stored in a memory, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0190] It should be noted that the present application is not limited to the specific configurations and processes described above or shown in the figures. The above is only a specific implementation mode of the present application. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the described system, device, module or unit can refer to the corresponding process in the method embodiment without further description. It should be understood that the scope of protection of the present application is not limited to this. Any technician familiar with the technical field can think of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and these modifications or substitutions should be included in the scope of protection of the present application.
Claims
1. A node control method for a visual knowledge graph, characterized in that: include: The central node is set as the center of the ring, and the child nodes and leaf nodes are set in sequence from the inside to the outside according to the ring; wherein the central node is set as a knowledge unit, the child nodes are set as attributes of the knowledge unit, and the leaf nodes are set as knowledge points; the knowledge unit includes multiple attributes, and the attributes of the knowledge unit include multiple knowledge points; Connect each child node and the corresponding leaf nodes with a curve; Through the dynamic programming strategy, the control sub-nodes and leaf nodes are arranged in sequence along the circumference of the ring; wherein, The ring includes a first arc and a second arc arranged sequentially from the inside to the outside; wherein the child nodes are arranged sequentially at intervals along the circumference of the first arc, and the leaf nodes are arranged sequentially at intervals along the circumference of the second arc; The total number of knowledge point slots on the second arc is determined according to the arc length of the second arc, the preset text height and the line spacing; wherein each knowledge point slot corresponds to the display of a single line of text; the ring is partitioned to obtain multiple sub-areas, and the first knowledge point slot allocation in each sub-area is determined; based on the current number of knowledge points and the total number of knowledge points corresponding to each sub-node, an optimization calculation is performed to determine the second knowledge point slot allocation corresponding to each sub-node; wherein, if the second knowledge point slot allocation corresponding to multiple sub-nodes in the current sub-area is greater than the first knowledge point slot allocation in each sub-area, some knowledge points are displayed across sub-areas.
2. The method according to claim 1, characterized in that The dynamic programming strategy is used to control the sub-nodes and leaf nodes to be arranged in sequence along the perimeter of the ring, including: The spacing between adjacent leaf nodes with the same attribute is set to be smaller than the spacing between adjacent leaf nodes with different attributes.
3. The method according to claim 1, characterized in that The method controls the sub-nodes and the leaf nodes to be arranged in sequence along the perimeter of the ring through a dynamic programming strategy, and further includes: If the number of knowledge points corresponding to the current sub-node is greater than the second knowledge point slot allocation, some knowledge points are folded in the default display state; During the interaction, the knowledge points that are folded are displayed in the knowledge point slots corresponding to the adjacent sub-nodes on both sides of the current sub-region, and the range is gradually expanded to display them in turn; When the folded knowledge point cannot be fully displayed in the current sub-region, it is displayed across sub-regions; a curve is drawn from the current sub-node and extended to another adjacent sub-region, and the end of the curve then diverges to draw multiple curves connected to the knowledge point slots on the second arc to display each knowledge point.
4. The method according to claim 1, characterized in that The method controls the sub-nodes and the leaf nodes to be arranged in sequence along the perimeter of the ring through a dynamic programming strategy, and further includes: If the number of words in the current knowledge point is greater than the display word count threshold of the single-line text corresponding to the knowledge point slot, part of the text of the current knowledge point will be folded and displayed; or, Wrap the text of the current knowledge point and display it in lines.
5. The method according to claim 1, characterized in that The method controls the sub-nodes and the leaf nodes to be arranged in sequence along the perimeter of the ring through a dynamic programming strategy, and further includes: The knowledge points with the same attributes are sorted in a set order and corresponding serial numbers are marked before the knowledge points; wherein the set order includes the time sequence of each knowledge point or the importance of each knowledge point; or, According to the number of words in the knowledge point text, the knowledge points with the same attributes are sorted in order.
6. The method according to any one of claims 1 to 5, characterized in that: Also includes: After clicking the current knowledge point, a new visual knowledge graph is triggered and generated; in which the current knowledge point is set as a new central node, the attributes of the current knowledge point are set as new child nodes, and the child knowledge points of the current knowledge point are set as new leaf nodes.
7. The method according to claim 1, characterized in that The method controls the sub-nodes and the leaf nodes to be arranged in sequence along the perimeter of the ring through a dynamic programming strategy, and further includes: Divide the second arc into a plurality of sub-areas, and determine the knowledge point slots on the second arc in the sub-areas according to the arc length of the second arc and a preset text line spacing; The knowledge point slots on the second arc are dynamically allocated to obtain the number of knowledge point slots allocated under each attribute; According to the number of knowledge point slots allocated under each attribute, the starting position and the ending position of the knowledge point slot under each attribute on the second arc are dynamically determined.
8. The method according to claim 7, characterized in that The step of dividing the second arc into a plurality of sub-areas and determining the knowledge point slots on the second arc in the sub-areas according to the arc length of the second arc and a preset text line spacing includes: Establish coordinates with the center of the second arc as the center point, and divide the second arc into 4 sub-areas using the horizontal coordinate and the vertical coordinate; Determine the available vertical coordinate range in the sub-area according to the radius of the second arc; Determine the number of available lines in the sub-area according to the available vertical coordinate range in the sub-area and the preset text line spacing; Determine the number of available nodes in the sub-region based on the number of available rows in the sub-region; Determine the coordinates of the available nodes in the sub-region according to the number of available nodes in the sub-region, the radius of the second arc and the preset text line spacing; wherein the available nodes are arranged to be distributed in sequence along the vertical coordinate according to the preset text line spacing; The available nodes in the sub-area are moved laterally along the x-axis to form new points on the second arc, and the new points are determined as knowledge point slots.
9. The method according to claim 8, characterized in that The step of dynamically allocating the knowledge point slots on the second arc to obtain the number of allocated knowledge point slots under each attribute includes: The number of spaces reserved between each group of leaf nodes under two adjacent attributes; Calculate the number of knowledge points under each attribute in the sub-region; According to the number of attributes in the sub-region, calculate the average number of knowledge point slots allocated under each attribute, and calculate the number of knowledge point slots remaining in the initial state; According to the number of knowledge points and the number of gaps under each attribute in the sub-region, the average number of knowledge point slots under each attribute is compared, and the redundant knowledge point slots under the target attribute are recovered. The remaining number of allocable knowledge point slots is obtained by summing up with the number of knowledge point slots remaining in the initial state; Taking attributes as units, the remaining allocatable knowledge point slots are allocated to the attributes with insufficient knowledge point slots in round-robin fashion until the remaining allocatable knowledge point slots are zero, so as to obtain the allocated number of knowledge point slots under each attribute.
10. The method according to claim 7, characterized in that The step of dynamically determining the starting position and the ending position of the knowledge point slot under each attribute on the second arc according to the number of knowledge point slots allocated under each attribute includes: According to the center point coordinates of each attribute in the sub-region and the center point coordinates of all knowledge point slots in the sub-region, the target knowledge point slot is screened out; wherein the target knowledge point slot is the knowledge point slot closest to the center point of the attribute; according to the center position of the target knowledge point slot and the number of allocated knowledge point slots, the starting position and the ending position of the knowledge point slot are determined.
11. The method according to claim 7, characterized in that The method of connecting each child node and the corresponding plurality of leaf nodes with a curve includes: The graph of the attribute is set to be composed of the first center point and the first circle, and the graph of the knowledge point slot is set to be composed of the second center point and the second circle; Connect the center of the second arc and the first center point to obtain a first line segment, and extend the first line segment to intersect with the first circle to obtain a first intersection point; Connect the center of the second arc and the second center point to obtain a second line segment, and intersect the second line segment with the second circle to obtain a second intersection point; A cubic Bezier curve is drawn between the first intersection and the second intersection, and the shape and curvature of the cubic Bezier curve are controlled by the first control point and the second control point; wherein the abscissa of the first control point is the same as the abscissa of the first intersection, and the ordinate of the first control point is the same as the ordinate of the second intersection; the abscissa of the second control point is the same as the abscissa of the second intersection, and the ordinate of the second control point is the same as the ordinate of the first intersection.
12. A node control device for a visual knowledge graph, characterized in that: include: A setting module, which is used to set the central node as the center of the ring, and the child nodes and leaf nodes are sequentially set from the inside to the outside according to the ring; wherein the central node is set as a knowledge unit, the child nodes are set as attributes of the knowledge unit, and the leaf nodes are set as knowledge points; the knowledge unit includes multiple attributes, and the attributes of the knowledge unit include multiple knowledge points; A connection module, which is used to connect each child node and the corresponding multiple leaf nodes using curves; A control module, which is used to control the sub-nodes and leaf nodes to be arranged in sequence along the circumference of the ring through a dynamic programming strategy; wherein, The ring includes a first arc and a second arc arranged sequentially from the inside to the outside; wherein the child nodes are arranged sequentially at intervals along the circumference of the first arc, and the leaf nodes are arranged sequentially at intervals along the circumference of the second arc; The total number of knowledge point slots on the second arc is determined according to the arc length of the second arc, the preset text height and the line spacing; wherein each knowledge point slot corresponds to the display of a single line of text; the ring is partitioned to obtain multiple sub-areas, and the first knowledge point slot allocation in each sub-area is determined; based on the current number of knowledge points and the total number of knowledge points corresponding to each sub-node, an optimization calculation is performed to determine the second knowledge point slot allocation corresponding to each sub-node; wherein, if the second knowledge point slot allocation corresponding to multiple sub-nodes in the current sub-area is greater than the first knowledge point slot allocation in each sub-area, some knowledge points are displayed across sub-areas.
13. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; when the electronic device executes the computer program instructions, the method according to any one of claims 1 to 11 is implemented.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 11 is implemented.
