Method, device and storage medium for visualizing a knowledge graph
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA CONSTRUCTION BANK
- Filing Date
- 2023-01-06
- Publication Date
- 2026-08-07
AI Technical Summary
[0003]本申请提供一种可视化知识图谱的配置方法、装置、设备及存储介质,用以解决现有技术中一经渲染图谱的样式就单一固定无法修改的问题
[0019] The configuration method, apparatus, device, and storage medium for the visualized knowledge graph provided in this application have the following beneficial effects: Based on the user-defined graph visualization parameters, this application can realize the customization of nodes, edges, and text without manually modifying the code, thereby increasing the style of the visualized knowledge graph and improving the visualization effect of the knowledge graph.
Smart Images

Figure CN116415000B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of knowledge graph technology, and in particular to a method, apparatus, device and storage medium for configuring a visual knowledge graph. Background Technology
[0002] A knowledge graph (KG) is a visualization technique that visually represents knowledge and the relationships between it. Entities act as nodes in the graph, and the semantic relationships between entities are represented as edges. Knowledge graphs break down data silos, facilitating machine learning and knowledge reasoning to discover deep knowledge and relationships, thus supporting intelligent search, intelligent question answering, recommendation, and intelligent decision-making. In related technologies, knowledge graph visualization methods typically utilize middleware such as ECharts and D3. However, once rendered, the graph's style is fixed and cannot be modified. Even changing node colors requires manual code modification by the developer, which is user-unfriendly. Summary of the Invention
[0003] This application provides a method, apparatus, device, and storage medium for configuring a visualized knowledge graph, in order to solve the problem in the prior art that the style of the graph is singular, fixed, and cannot be modified once it is rendered.
[0004] Firstly, this application provides a method for configuring a visualized knowledge graph, comprising: obtaining user-defined graph visualization parameters, graph data to be visualized, and a target graph layout, wherein the graph visualization parameters include node parameters, edge parameters, and text parameters; generating multiple nodes and multiple edges based on the node information and relationship information between nodes contained in the graph data, wherein each node and each edge has unique identification information; arranging the multiple nodes and multiple edges according to the target graph layout to obtain an initial visualized knowledge graph; and rendering the multiple nodes, multiple edges, and text in the initial visualized knowledge graph according to the graph visualization parameters to generate the visualized knowledge graph.
[0005] In some embodiments, after generating the visualized knowledge graph, the method further includes: displaying the visualized knowledge graph on a target page; obtaining the display status of the visualized knowledge graph on the target page; and adjusting the visualized knowledge graph according to the display status.
[0006] In some embodiments, obtaining the display status of the visualized knowledge graph on the target page and adjusting the visualized knowledge graph according to the display status includes: obtaining the node density of the visualized knowledge graph on the target page as a first node density; in response to the first node density being greater than a preset density threshold, determining at least one target node in the visualized knowledge graph; merging all descendant nodes belonging to the target node into the target node to generate a virtual node.
[0007] In some embodiments, the method for configuring a visualized knowledge graph further includes: in response to detecting a click operation on any virtual node, expanding multiple descendant nodes corresponding to the virtual node to display them on the target page.
[0008] In some embodiments, determining at least one target node in a visualized knowledge graph includes: displaying the visualized knowledge graph on a target page according to a preset second node density; obtaining all nodes displayed on the target page as candidate nodes; obtaining all nodes beyond the target page as overflow nodes; and selecting candidate nodes that share an edge with any overflow node as target nodes.
[0009] In some embodiments, the method for obtaining the target map layout includes: unifying the format of the map data to generate target map data; obtaining the basic attributes of the target map data; and determining the target map layout from multiple candidate map layouts based on the basic attributes.
[0010] Secondly, this application provides a configuration device for a visualized knowledge graph, comprising: an acquisition module for acquiring user-defined graph visualization parameters, graph data to be visualized, and a target graph layout, wherein the graph visualization parameters include node parameters, edge parameters, and text parameters; a generation module for generating multiple nodes and multiple edges based on the node information and relationship information between nodes contained in the graph data, wherein each node and each edge has unique identification information; a layout module for arranging the multiple nodes and multiple edges according to the target graph layout to obtain an initial visualized knowledge graph; and a rendering module for rendering the multiple nodes, multiple edges, and text in the initial visualized knowledge graph according to the graph visualization parameters to generate a visualized knowledge graph.
[0011] In some embodiments, the configuration device for the visualized knowledge graph further includes: a display module for displaying the visualized knowledge graph on a target page; and an adjustment module for obtaining the display status of the visualized knowledge graph on the target page and adjusting the visualized knowledge graph according to the display status.
[0012] In some embodiments, the adjustment module is further configured to: obtain the node density of the visualized knowledge graph on the target page as a first node density; in response to the first node density being greater than a preset density threshold, determine at least one target node in the visualized knowledge graph; and merge all descendant nodes belonging to the target node into the target node to generate a virtual node.
[0013] In some embodiments, the adjustment module is further configured to: in response to detecting a click operation on any virtual node, expand the multiple descendant nodes corresponding to the virtual node to display them on the target page.
[0014] In some embodiments, the adjustment module is further configured to: display the visualized knowledge graph on the target page according to a preset second node density; obtain all nodes displayed on the target page as candidate nodes; obtain all nodes beyond the target page as outgoing nodes; and select candidate nodes that share an edge with any outgoing node as target nodes.
[0015] In some embodiments, the acquisition module is further configured to: unify the format of the graph data to generate target graph data; acquire the basic attributes of the target graph data; and determine the target graph layout from multiple candidate graph layouts based on the basic attributes.
[0016] Thirdly, this application provides an electronic device, including: a processor and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the aforementioned configuration method for a visual knowledge graph.
[0017] Fourthly, a computer-readable storage medium is provided, wherein when computer-readable storage medium stores computer-executable instructions, the computer-executable instructions are executed by a processor for implementing the aforementioned configuration method of a visualized knowledge graph.
[0018] Fifthly, a computer program product is provided, including a computer program / instruction, characterized in that the computer program / instruction, when executed by a processor, implements the aforementioned configuration method for a visual knowledge graph.
[0019] The configuration method, apparatus, device, and storage medium for the visualized knowledge graph provided in this application have the following beneficial effects: Based on the user-defined graph visualization parameters, this application can realize the customization of nodes, edges, and text without manually modifying the code, thereby increasing the style of the visualized knowledge graph and improving the visualization effect of the knowledge graph. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0021] Figure 1 An exemplary implementation of a method for configuring a visual knowledge graph provided in this application;
[0022] Figure 2(a) is a schematic diagram of a balance diagram layout shown in this application;
[0023] Figure 2(b) is a schematic diagram of a structural layout shown in this application;
[0024] Figure 2(c) is a schematic diagram of a logic diagram layout shown in this application;
[0025] Figure 2(d) is a schematic diagram of a tree diagram layout shown in this application;
[0026] Figure 2(e) is a schematic diagram of a timeline layout shown in this application;
[0027] Figure 2(f) is a schematic diagram of a circular diagram layout shown in this application;
[0028] Figure 3 An exemplary implementation of a method for configuring a visual knowledge graph provided in this application;
[0029] Figure 4 This application provides an exemplary implementation of a method for configuring a visualized knowledge graph.
[0030] Figure 5 A schematic diagram of a configuration device for a visual knowledge graph provided in an embodiment of this application;
[0031] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0032] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0033] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0034] Terminology Explanation: A knowledge graph (KG) is a visual representation of knowledge and its relationships. Entities act as nodes in the graph, and the semantic relationships between entities are the edges. Essentially, a knowledge graph is a semantic network. Knowledge graphs break down data barriers, facilitating machine learning and knowledge reasoning to discover deep knowledge and relationships, thus supporting intelligent search, intelligent question answering, recommendation, and intelligent decision-making.
[0035] Figure 1 This application illustrates an exemplary implementation of a method for configuring a visualized knowledge graph, such as... Figure 1 As shown, the configuration method for this visualized knowledge graph includes the following steps:
[0036] S101, obtain the target user's custom graph visualization parameters, the graph data to be visualized, and the target graph layout. The graph visualization parameters include node parameters, edge parameters, and text parameters.
[0037] Obtain the target user's custom graph visualization parameters, which include node parameters, edge parameters, and text parameters.
[0038] For example, in this application, a color palette can be provided to allow users to customize the visualization parameters of the graph. Node parameters may include node color, node size, node transparency, etc.; edge parameters may include edge color, edge length, edge thickness, etc.; text parameters may include text color, text font, text size, etc. Optionally, colors can be stored in hexadecimal representation, and node radius, edge length, and thickness can be stored in pixels or centimeters.
[0039] Obtain the graph data to be visualized into a knowledge graph. For example, the graph data can be the structural data of a university, such as data from the academic affairs office and student union, or data about actors, directors, and theme songs of a TV series.
[0040] Obtain the target graph layout, wherein the target graph layout includes, but is not limited to, at least one of the following layouts: balanced graph, structure graph, tree graph, logic graph, time axis, and pie chart.
[0041] S102, Based on the node information and relationship information between nodes contained in the graph data, generate multiple nodes and multiple edges, where each node and each edge has unique identification information.
[0042] Based on the node information and relationship information between nodes contained in the graph data, multiple nodes and multiple edges are generated, where each node and each edge has unique identification information.
[0043] In this context, a node represents an entity, and an edge represents the relationship between two entities.
[0044] S103, Arrange multiple nodes and edges according to the target graph layout to obtain the generated initial visualized knowledge graph.
[0045] Based on the selected target graph layout, multiple nodes and edges are arranged to obtain the initial visualized knowledge graph.
[0046] S104: Render multiple nodes, edges, and text in the initial visualized knowledge graph according to the graph visualization parameters to generate a visualized knowledge graph.
[0047] The initial visualized knowledge graph obtained above is rendered by using the graph visualization parameters to generate a visualized knowledge graph.
[0048] This application proposes a configuration method for a visualized knowledge graph. It involves acquiring user-defined graph visualization parameters, graph data to be visualized, and a target graph layout. The graph visualization parameters include node parameters, edge parameters, and text parameters. Based on the node information and relationships between nodes in the graph data, multiple nodes and edges are generated, each with a unique identifier. These nodes and edges are then arranged according to the target graph layout to obtain an initial visualized knowledge graph. Finally, the initial visualized knowledge graph is rendered using the graph visualization parameters to generate the visualized knowledge graph. This application allows for customization of nodes, edges, and text based on user-defined graph visualization parameters without manual code modification, enhancing the style of the visualized knowledge graph and improving its visualization effect.
[0049] In some embodiments, the method for obtaining the target map layout includes: standardizing the format of the map data to generate target map data, obtaining the basic attributes of the target map data, and determining the target map layout from multiple candidate map layouts based on the basic attributes.
[0050] The candidate graph layouts can include balanced graphs, structured graphs, tree diagrams, logical graphs, timelines, pie charts, etc. For example, if the basic attributes of the target graph data indicate that a timeline exists in the target graph data, then a timeline layout can be selected as the target graph layout.
[0051] The following is a simplified illustration of the layout of some candidate maps:
[0052] Figure 2(a) is a schematic diagram of a balanced diagram layout shown in this application; Figure 2(b) is a schematic diagram of a structural diagram layout shown in this application; Figure 2(c) is a schematic diagram of a logic diagram layout shown in this application; Figure 2(d) is a schematic diagram of a tree diagram layout shown in this application; Figure 2(e) is a schematic diagram of a time axis layout shown in this application; and Figure 2(f) is a schematic diagram of a circular diagram layout shown in this application.
[0053] Furthermore, in this application, when encountering browser compatibility issues, incompatible properties or functions can be obtained, and browser compatibility issues can be resolved by using native JavaScript or different CSS properties to accommodate display differences across different browsers and improve the visualization effect of the knowledge graph.
[0054] Figure 3 This application illustrates an exemplary implementation of a method for configuring a visualized knowledge graph, such as... Figure 3 As shown, the configuration method for this visualized knowledge graph includes the following steps:
[0055] S301, obtain the target user's custom graph visualization parameters, the graph data to be visualized, and the target graph layout. The graph visualization parameters include node parameters, edge parameters, and text parameters.
[0056] S302, based on the node information and relationship information between nodes contained in the graph data, generate multiple nodes and multiple edges, where each node and each edge has unique identification information.
[0057] S303: Arrange multiple nodes and edges according to the target graph layout to obtain the generated initial visualized knowledge graph.
[0058] S304: Render multiple nodes, edges, and text in the initial visualized knowledge graph according to the graph visualization parameters to generate a visualized knowledge graph.
[0059] For details on the specific implementation of steps S301 to S304, please refer to the relevant parts of the above embodiments, which will not be repeated here.
[0060] S305 displays a visualized knowledge graph on the target page.
[0061] The obtained visualized knowledge graph is then displayed on the target page. The target page refers to the page used to display the visualized knowledge graph.
[0062] Optionally, the target page can be a mobile page, tablet page, computer page, etc.
[0063] S306, Obtain the display status of the visualized knowledge graph on the target page, and adjust the visualized knowledge graph according to the display status.
[0064] It's easy to understand that when too many nodes are displayed on the target page, the limited screen size results in a dense display of the overall visualized knowledge graph, leading to poor visualization. To avoid this, this application uses the node density of the visualized knowledge graph on the target page as the first node density. If the first node density is greater than a preset density threshold, at least one target node in the visualized knowledge graph is identified, and all descendant nodes belonging to the target node are merged into the target node to generate a virtual node. Optionally, the virtual node can be displayed as a dashed line, and the node or relationship name of the virtual node is displayed on it. Optionally, the node density can be the ratio of the total number of nodes to the total screen size.
[0065] Specifically, when determining at least one target node in the visualized knowledge graph, the visualized knowledge graph can be displayed on the target page according to a preset second node density. All nodes displayed on the target page are obtained as candidate nodes, all nodes beyond the target page are obtained as outgoing nodes, and candidate nodes that share an edge with any outgoing node are selected as target nodes.
[0066] Furthermore, if a click operation on any virtual node is detected, the multiple descendant nodes corresponding to the virtual node will be expanded and displayed on the target page.
[0067] This application allows for the customization of nodes, edges, and text based on user-defined graph visualization parameters without requiring manual code modification. It also enhances the style of the visualized knowledge graph and adjusts it according to the display status, making the visualized knowledge graph more suitable for the current viewport size and improving the visualization effect.
[0068] Figure 4 This application illustrates an exemplary implementation of a method for configuring a visualized knowledge graph, such as... Figure 4 As shown, the configuration method for this visualized knowledge graph includes the following steps:
[0069] The style unit provides a color palette to allow users to customize graph visualization parameters. Node parameters can include node color, size, and transparency; edge parameters can include edge color, length, and thickness; and text parameters can include text color, font, and size. Optionally, colors can be stored in hexadecimal representation, and node radius, edge length, and thickness can be stored in pixels or centimeters. Customized graph visualization parameters are stored as JSON objects in the cache unit.
[0070] The layout unit provides candidate graph layouts such as balanced graph layout, structure graph layout, tree graph layout, logic graph layout, timeline layout, and circular graph layout. It selects one layout from multiple candidate graph layouts as the target graph layout and stores the target graph layout in the cache unit.
[0071] The system uses a caching unit and a singly linked list to implement user-defined graph visualization parameters and graph data. The table header always stores the default configuration, and then the user-defined graph visualization parameters are cached sequentially to speed up graph visualization rendering.
[0072] The data processing unit unifies the graph data obtained from the graph database request, ensuring compatibility with the data format differences of different visualization middleware.
[0073] For example, the data processing module is mainly responsible for graph data processing. Taking a node type and edge type of 3 levels as an example, the graph data is in JSON format, with the specific format as follows:
[0074] Graph: {
[0075] ID:g1
[0076] Type:gt1,
[0077] Nodes: [{id:n1,name: node1, type1…},{id:n2,name: node2, type2…},{id:n3,name: node3, type3}]
[0078] Edges: [{id:e1,name:edge1,fn:n1,tn:n1,type1…},{id:e2,name:edge2,fn:n1,tn:n2,type2…},{id:e3,name:edge3,fn:n1,tn:n3,type3…}]
[0079] }
[0080] Graph is a JSON object representing the entire knowledge graph, Id is a unique identifier for the knowledge graph, and Type is the type of the knowledge graph, corresponding to one of the multiple candidate graph layouts. If it is "other", it indicates a layout graph provided by other components.
[0081] Nodes represents node data, and id is a unique identifier for each node, which cannot be duplicated.
[0082] Edges represent edge data, and id is a unique identifier for each edge, which cannot be repeated. type indicates the type of edge. For example, edge relationship types are divided into three categories, represented in the format "lg:mg:sg". lg is the major category, mg is the intermediate category, and sg is the minor category. For example: Campus Relationship: Alumni: University Alumni. Campus Relationship is the major category, Alumni Relationship is the intermediate category, and University Alumni is the minor category.
[0083] The display unit addresses the issues of poor visualization when the overall knowledge graph is densely displayed due to an excessive number of nodes, as well as browser compatibility problems. The display module is primarily responsible for visualizing the knowledge graph. It determines the optimal number and display method for the current target page based on the size of the target page, the style settings of nodes and edges in the user-configured graph visualization parameters, and the target graph layout. In this application, when browser compatibility issues arise, incompatible attributes or functions can be retrieved, and browser compatibility issues can be resolved using native JavaScript or different CSS properties to accommodate display differences across different browsers and improve the visualization effect of the knowledge graph.
[0084] The five units proposed in this application embodiment are integrated to construct a configurable knowledge graph visualization tool, enabling users to use it efficiently and quickly, as well as generate large screens quickly. This avoids the traditional cumbersome rendering methods, greatly shortens the project launch time, and reduces the workload of development.
[0085] This application proposes a configuration method for a visualized knowledge graph. It involves acquiring user-defined graph visualization parameters, graph data to be visualized, and a target graph layout. The graph visualization parameters include node parameters, edge parameters, and text parameters. Based on the node information and relationships between nodes in the graph data, multiple nodes and edges are generated, each with a unique identifier. These nodes and edges are then arranged according to the target graph layout to obtain an initial visualized knowledge graph. Finally, the initial visualized knowledge graph is rendered using the graph visualization parameters to generate the visualized knowledge graph. This application allows for customization of nodes, edges, and text based on user-defined graph visualization parameters without manual code modification, enhancing the style of the visualized knowledge graph and improving its visualization effect.
[0086] Figure 5 This is a schematic diagram of a configuration device for a visualized knowledge graph, as shown in this application. Figure 5 As shown, the configuration device 500 for the visualized knowledge graph includes an acquisition module 501, a generation module 502, a layout module 503, and a rendering module 504, wherein:
[0087] The acquisition module 501 is used to acquire the target user's custom graph visualization parameters, the graph data to be visualized, and the target graph layout. The graph visualization parameters include node parameters, edge parameters, and text parameters.
[0088] The generation module 502 is used to generate multiple nodes and multiple edges based on the node information and relationship information between nodes contained in the graph data, wherein each node and each edge has unique identification information;
[0089] The layout module 503 is used to arrange multiple nodes and multiple edges according to the target graph layout to obtain the generated initial visualized knowledge graph;
[0090] The rendering module 504 is used to render multiple nodes, multiple edges and text in the initial visualized knowledge graph according to the graph visualization parameters, and generate a visualized knowledge graph.
[0091] The configuration device for the visualized knowledge graph provided in this application allows for the customization of nodes, edges, and text based on user-defined graph visualization parameters without requiring manual code modification. This enhances the style of the visualized knowledge graph and improves its visualization effect.
[0092] In some embodiments, the configuration device 500 for the visualized knowledge graph further includes: a display module 505 for displaying the visualized knowledge graph on a target page; and an adjustment module 506 for obtaining the display status of the visualized knowledge graph on the target page and adjusting the visualized knowledge graph according to the display status.
[0093] In some embodiments, the adjustment module 506 is further configured to: obtain the node density of the visualized knowledge graph on the target page as a first node density; in response to the first node density being greater than a preset density threshold, determine at least one target node in the visualized knowledge graph; and merge all descendant nodes belonging to the target node into the target node to generate a virtual node.
[0094] In some embodiments, the adjustment module 506 is further configured to: in response to detecting a click operation on any virtual node, expand the multiple descendant nodes corresponding to the virtual node to display them on the target page.
[0095] In some embodiments, the adjustment module 506 is further configured to: display the visualized knowledge graph on the target page according to a preset second node density; obtain all nodes displayed on the target page as candidate nodes; obtain all nodes beyond the target page as outgoing nodes; and select candidate nodes that share an edge with any outgoing node as target nodes.
[0096] In some embodiments, the acquisition module 501 is further configured to: unify the format of the graph data to generate target graph data; acquire the basic attributes of the target graph data; and determine the target graph layout from multiple candidate graph layouts based on the basic attributes.
[0097] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device may include: a transceiver 61, a processor 62, and a memory 63.
[0098] Processor 62 executes computer execution instructions stored in memory, causing processor 62 to perform the scheme in the above embodiments. Processor 62 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0099] The memory 63 is connected to the processor 62 via the system bus and completes communication between them. The memory 63 is used to store computer program instructions.
[0100] Transceiver 61 can be used to acquire user-defined graph visualization parameters, graph data to be visualized, and target graph layout. The graph visualization parameters include node parameters, edge parameters, and text parameters. Based on the node information and relationships between nodes in the graph data, multiple nodes and edges are generated, each with a unique identifier. The multiple nodes and edges are arranged according to the target graph layout to obtain the initial visualized knowledge graph. The multiple nodes, edges, and text in the initial visualized knowledge graph are rendered according to the graph visualization parameters to generate the visualized knowledge graph.
[0101] The system bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.
[0102] The electronic device provided in this application embodiment can be the terminal device described in the above embodiments.
[0103] This application also provides a chip for executing instructions, which is used to execute the technical solution of the configuration method for the visualized knowledge graph in the above embodiments.
[0104] This application also provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the configuration method for the visualized knowledge graph described in the above embodiments.
[0105] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, it can implement the configuration method of the visualized knowledge graph in the above embodiments.
[0106] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0107] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for configuring a visual knowledge graph, characterized in that, include: The method involves obtaining user-defined graph visualization parameters, graph data to be visualized, and a target graph layout. The graph visualization parameters include node parameters, edge parameters, and text parameters. The method for obtaining the target graph layout includes: standardizing the format of the graph data to generate target graph data; obtaining the basic attributes of the target graph data; and determining the target graph layout from multiple candidate graph layouts based on the basic attributes. Based on the node information and relationship information between nodes contained in the graph data, multiple nodes and multiple edges are generated, wherein each node and each edge has unique identification information; The multiple nodes and multiple edges are arranged according to the target graph layout to obtain an initial visualized knowledge graph; wherein, the target graph layout includes at least one of a balanced graph, a structure graph, a tree graph, a logic graph, a timeline, and a pie chart; The multiple nodes, multiple edges, and text in the initial visualized knowledge graph are rendered according to the graph visualization parameters to generate a visualized knowledge graph; After generating the visualized knowledge graph, the process also includes: Display the visualized knowledge graph on the target page; The process of obtaining the display state of the visualized knowledge graph on the target page and adjusting the visualized knowledge graph according to the display state includes: obtaining the node density of the visualized knowledge graph on the target page as a first node density; in response to the first node density being greater than a preset density threshold, displaying the visualized knowledge graph on the target page according to a preset second node density; obtaining all nodes displayed on the target page as candidate nodes; obtaining all nodes beyond the target page as overflow nodes; selecting candidate nodes that share an edge with any of the overflow nodes as target nodes to determine at least one target node in the visualized knowledge graph; merging all descendant nodes belonging to the target node into the target node to generate a virtual node; wherein the node density is the ratio of the total number of nodes to the total screen size. The method further includes: In response to detecting a click operation on any of the virtual nodes, the plurality of descendant nodes corresponding to the virtual node are expanded and displayed on the target page.
2. A configuration device for a visual knowledge graph, characterized in that, include: The acquisition module is used to acquire user-defined graph visualization parameters, graph data to be visualized, and target graph layout. The graph visualization parameters include node parameters, edge parameters, and text parameters. The method for acquiring the target graph layout includes: standardizing the format of the graph data to generate target graph data; acquiring the basic attributes of the target graph data; and determining the target graph layout from multiple candidate graph layouts based on the basic attributes. The generation module is used to generate multiple nodes and multiple edges based on the node information and relationship information between nodes contained in the graph data, wherein each node and each edge has unique identification information; The layout module is used to arrange the multiple nodes and multiple edges according to the target graph layout to obtain the generated initial visualized knowledge graph; wherein, the target graph layout includes at least one of the following: balanced graph, structure graph, tree graph, logic graph, time axis, and pie chart; The rendering module is used to render the multiple nodes, multiple edges and text in the initial visualized knowledge graph according to the graph visualization parameters, and generate a visualized knowledge graph; The device further includes: The display module is used to display the visualized knowledge graph on the target page; An adjustment module is used to obtain the display status of the visualized knowledge graph on the target page and adjust the visualized knowledge graph according to the display status, including: obtaining the node density of the visualized knowledge graph on the target page as a first node density; in response to the first node density being greater than a preset density threshold, displaying the visualized knowledge graph on the target page according to a preset second node density; obtaining all nodes displayed on the target page as candidate nodes; obtaining all nodes beyond the target page as overflow nodes; selecting the candidate nodes that share an edge with any of the overflow nodes as target nodes to determine at least one target node in the visualized knowledge graph; merging all descendant nodes belonging to the target node into the target node to generate a virtual node; wherein the node density is the ratio of the total number of nodes to the total screen size; The adjustment module is also used for: In response to detecting a click operation on any of the virtual nodes, the plurality of descendant nodes corresponding to the virtual node are expanded and displayed on the target page.
3. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in claim 1.
4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in claim 1.
5. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of claim 1.
Citation Information
Patent Citations
Data visualization display method and system
CN110245180A
Visual display method of knowledge graph
CN115292403A