CN112035667B - Knowledge graph display method and device and terminal equipment - Google Patents

Knowledge graph display method and device and terminal equipment Download PDF

Info

Publication number
CN112035667B
CN112035667B CN202010907318.3A CN202010907318A CN112035667B CN 112035667 B CN112035667 B CN 112035667B CN 202010907318 A CN202010907318 A CN 202010907318A CN 112035667 B CN112035667 B CN 112035667B
Authority
CN
China
Prior art keywords
node
layer
data
relation
icon
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010907318.3A
Other languages
Chinese (zh)
Other versions
CN112035667A (en
Inventor
李彦龙
吕晓东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Henan Zhongyuan Consumption Finance Co ltd
Original Assignee
Henan Zhongyuan Consumption Finance Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Henan Zhongyuan Consumption Finance Co ltd filed Critical Henan Zhongyuan Consumption Finance Co ltd
Priority to CN202010907318.3A priority Critical patent/CN112035667B/en
Publication of CN112035667A publication Critical patent/CN112035667A/en
Application granted granted Critical
Publication of CN112035667B publication Critical patent/CN112035667B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • G06F16/358Browsing; Visualisation therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Computational Linguistics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention relates to a knowledge graph display method, a knowledge graph display device and terminal equipment, which are used for acquiring graph data, wherein the graph data comprises node data and relation data, creating an empty connection relation layer and a node layer, placing the relation data into the connection relation layer, placing the node data into the node layer, traversing all relation data, drawing a connection pattern and an arrow pattern for each relation data, adding display characters, traversing all the node data, drawing a node icon, selecting a corresponding icon code for each node, rendering, displaying the node data on the node layer, and displaying the relation data on the connection relation layer. The knowledge graph display method provided by the invention is not limited to the types of graph data, and can realize graph display without changing the execution process of the method steps by only modifying the relevant content in the method steps when changing or adding different types of graph data, so that the flexibility and the usability are higher, a large amount of development time is saved, and the refined analysis can be provided.

Description

Knowledge graph display method and device and terminal equipment
Technical Field
The invention relates to a knowledge graph display method, a knowledge graph display device and terminal equipment.
Background
In the process of using the knowledge graph, visual interface display is often needed, after the knowledge graph is built, business personnel want to quickly find the corresponding graph and check the topological relation, and can make some fine analysis, so that the visual display method of the knowledge graph is needed for quick display of the knowledge graph and provision of a fine analysis tool. Most of the existing knowledge graph display methods are field knowledge graph display methods, the customization degree is high, and the flexibility and usability are poor; only style can be displayed, and no fine analysis can be provided; when the knowledge graph data source is changed, the knowledge graph data source needs to be redeveloped.
Disclosure of Invention
The invention aims to provide a knowledge graph display method, a knowledge graph display device and terminal equipment, which are used for solving the problem of poor flexibility of the existing knowledge graph display method.
In order to solve the problems, the invention adopts the following technical scheme:
a knowledge graph display method, comprising:
acquiring map data, wherein the map data comprises node data and relationship data;
creating an empty connection relation layer and a node layer according to the map data;
the relation data are put into the connection relation layer, and the node data are put into the node layer;
traversing all the relation data in the connection relation layer, drawing a connecting line style and an arrow style for each relation data, and adding display characters;
traversing all the node data in the node layer, and drawing a node icon;
selecting a corresponding icon code for each node according to the node data, and then rendering each node;
and displaying all the drawn node data on the node layer, and displaying all the drawn relationship data on the connection relationship layer.
Preferably, before the acquiring the map data, the knowledge map display method further includes:
acquiring a query template of a knowledge graph, wherein the query template can search corresponding graph data;
setting a matching rule, wherein the matching rule is used for marking nodes or relations conforming to a first preset rule when the knowledge graph is displayed;
generating corresponding options according to a second preset rule, displaying the set rule options, and providing a clicking function;
setting the node icons according to preset node icon configuration rules.
Preferably, the setting the node icon according to the preset node icon configuration rule includes:
when the node icons are set according to a preset node icon configuration rule, analyzing SVG icon codes according to the selected SVG icons, and extracting path codes for drawing the SVG icons.
Preferably, the creating an empty connection relation layer and a node layer according to the map data includes:
and creating canvas according to the map data, generating a force guide layout by using a force guide function of d3, and creating the connection relation layer and the node layer.
Preferably, after the relationship data is placed in the connection relationship layer and the node data is placed in the node layer, the knowledge graph display method further includes:
the relationship data is sorted using the links () function of d3, and the node data is sorted using the nodes () function of d 3.
Preferably, the displaying all the drawn node data on the node layer and displaying all the drawn relationship data on the connection relationship layer includes:
and displaying all the drawn node data on the node layer, displaying all the drawn relationship data on the connection relationship layer, adding iteration of the force layout, and obtaining position coordinates of the force layout by each node after multiple iterations, wherein the knowledge graph has the display effect of the force layout.
Preferably, the knowledge graph display method further includes:
and binding the click event corresponding to the node layer and the connection relation layer, and binding the corresponding drag event to the node layer.
Preferably, in the node layer, all the node data are traversed, and node icons are drawn, wherein the node icons are divided into a community color circle layer, a node background circle layer, an icon layer, a node text layer, a drawing pin layer, an identification layer and a number checking layer.
A knowledge graph display apparatus, comprising:
the map data acquisition module is used for acquiring map data, wherein the map data comprises node data and relationship data;
the empty layer creating module is used for creating an empty connection relation layer and a node layer according to the map data;
the data embedding module is used for embedding the relation data into the connection relation layer and embedding the node data into the node layer;
the first traversing module is used for traversing all the relation data in the connection relation layer, drawing a connecting line style and an arrow style for each relation data, and adding display characters;
the second traversing module is used for traversing all the node data in the node layer and drawing node icons;
the rendering module is used for selecting a corresponding icon code for each node according to the node data, and then rendering each node;
and the display module is used for displaying all the drawn node data on the node layer and displaying all the drawn relationship data on the connection relationship layer.
A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the knowledge graph presentation method as described above when the computer program is executed.
The beneficial effects of the invention are as follows: according to the knowledge graph display method, firstly, an empty connection relation layer and a node layer are created according to node data and relation data in graph data, then all the relation data and all the node data are traversed through correspondingly combining the node data and the relation data and the connection relation layer and the node layer, a connection line style and an arrow style are drawn for each relation data, display characters are added, a node icon is drawn, corresponding icon codes are selected for the nodes according to the node data, rendering is conducted, finally all the drawn node data are displayed on the node layer, and all the drawn relation data are displayed on the connection relation layer. Therefore, the knowledge graph display method provided by the invention is not limited to the types of graph data, and if the graph data of different types are replaced or added, the graph display can be realized by only modifying the relevant content in the method steps and not changing the execution process of the method steps, compared with custom development, the flexibility and the usability are higher, a large amount of development time is saved, and even if the knowledge graph data source is changed, the new development is not needed, and in addition, the refined analysis can be provided.
Drawings
In order to more clearly illustrate the technical solution of the embodiments of the present invention, the following briefly describes the drawings that are required to be used in the embodiments:
fig. 1 is an overall flow diagram of a knowledge graph display method according to an embodiment of the present disclosure;
fig. 2 is a schematic overall structure of a knowledge graph display apparatus according to a second embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a terminal device according to a third embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
In addition, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The knowledge graph display method provided by the embodiment of the application can be applied to terminal equipment such as mobile phones, tablet computers, wearable equipment, vehicle-mounted equipment, augmented reality (augmented reality, AR)/Virtual Reality (VR) equipment, notebook computers, ultra-mobile personal computer (UMPC), netbooks, personal digital assistants (personal digital assistant, PDA) and the like, and the specific types of the terminal equipment are not limited. That is, the carrier of the client corresponding to the knowledge graph display method provided in the embodiment of the present application may be any one of the above-mentioned terminal devices.
In order to explain the technical solutions described in the present application, the following description will be given by way of specific embodiments.
Referring to fig. 1, which is a flowchart of an implementation procedure of the knowledge-graph display method according to the first embodiment of the present application, for convenience of explanation, only a portion related to the embodiment of the present application is shown.
The knowledge graph display method comprises the following steps:
step S101: acquiring map data, wherein the map data comprises node data and relation data:
in this embodiment, the carrier of the client corresponding to the knowledge graph display method provided in the embodiment of the present application is illustrated by taking a terminal device as an example, and the terminal device is in communication connection with a server, and the graph data is stored in the server, that is, the data of the prepared knowledge graph is stored in a database in the server in advance, specifically in the Neo4j graph database. It should be understood that the terminal device may also be disconnected from the server in which case the profile data is stored in the terminal device without being retrieved from the server.
Further, before acquiring the profile data, the terminal device needs to do some preparation work, that is, before acquiring the profile data, the knowledge profile display method further includes:
preparing a query template of the knowledge graph, namely acquiring the query template of the knowledge graph, wherein the query template can be newly added at any time, and the query name, the query sentence, the query type and the description information can be filled in when the query template is newly added. Various query sentences such as one degree, two degrees and the like can be written by taking the unique primary key as a retrieval condition. The query template can be used for searching corresponding map data, namely, the map data required by the specification.
And setting a matching rule, wherein the matching rule can be modified at any time. The fields of rule name, rule classification, rule type, tag name, attribute name, match type, match content, etc. are specified. The matching rule is used for marking out nodes or relations conforming to a first preset rule when the knowledge graph is displayed. It should be understood that the first preset rule is set according to the actual situation.
And generating corresponding options according to the second preset rules, displaying the rule options set by the user, and providing a clicking function. It should be understood that the second preset rule is set according to the actual situation.
Setting the node icons according to preset node icon configuration rules. The icon can be set at any time, and the icon name, the icon identification, the icon code, the label name, the attribute name, the matching type, the matching content and the sequence value are specified. And when the node icons are set according to the preset node icon configuration rules, analyzing SVG icon codes according to SVG icons selected by a user, and extracting path codes for drawing the SVG icons.
The user inputs a specific query main key through the terminal equipment, initiates a query request of a query template, is connected to the server through network communication, and the server sorts the map data into node data and relation data and returns the node data and the relation data to the terminal equipment.
Step S102: creating an empty connection relation layer and a node layer according to the map data:
in this embodiment, after the terminal device receives the map data, a canvas is created, and a force guiding layout is generated using the force guiding function of d3, so as to create an empty connection relation layer and an empty node layer.
Step S103: the relation data are put into the connection relation layer, and the node data are put into the node layer:
after the terminal equipment creates the empty connection relation layer and the node layer, the relation data are put into the connection relation layer, and the node data are put into the node layer. Further, the terminal device puts the relation data into the connection relation layer, after the node data is put into the node layer, the relation data is sorted by using the links () function of d3, and the node data is sorted by using the nodes () function of d 3.
Step S104: in the connection relation layer, traversing all the relation data, drawing a connection line style and an arrow style for each relation data, and adding display characters:
and traversing all the relation data in the connection relation layer by the terminal equipment, drawing a connection line style and an arrow style for each relation data, and adding display characters. In this embodiment, the connection lines and the connection line characters are drawn according to the sorted connection relationship data, and the marker-end matching arrow is used.
Step S105: traversing all the node data in the node layer, and drawing node icons:
and the terminal equipment traverses all the node data in the node layer and draws the node icons. In the embodiment, all node data are traversed in a node layer, and node icons are drawn and divided into a community color circle layer, a node background circle layer, an icon layer, a node character layer, a drawing pin layer, an identification layer and a number checking layer. Then, the node icon is divided into 8 layers, and the sequence is respectively a community color circle layer, a node background circle layer, an icon layer, a node character layer at the bottom, a drawing pin layer, an identification layer and a number checking layer at the top. And setting the transparency of each layer to be 0, and displaying when waiting for rendering without displaying.
Step S106: selecting a corresponding icon code for each node according to the node data, and then rendering each node:
and the terminal equipment selects a corresponding icon code for each node as an icon layer according to the icon configuration and in combination with the node data, and then renders each node to render a node background circle layer, an icon background circle layer and an icon layer.
Step S107: displaying all the drawn node data on the node layer, and displaying all the drawn relationship data on the connection relationship layer:
the terminal equipment displays all the drawn node data on the node layer, displays all the drawn relationship data on the connection relationship layer, adds iteration of the force layout, and after multiple iterations, the knowledge graph has the display effect of the force layout, namely the graph generates the display effect of the force layout, and each node obtains the position coordinate of the force layout.
In this embodiment, the knowledge graph display method further includes:
the corresponding click event is bound to the node layer and the connection relation layer, and the corresponding drag event is bound to the node layer, specifically as follows:
adding a binding event, binding a selected function by a left click node, binding the selected function by a left click relation, binding a default template query by a left click double click node, adding a menu by a right click node, such as node expansion, hiding the node, hiding the selected node, highlighting a one-layer association, highlighting a two-layer association, canceling the selected node, dragging the left click of the node, and dragging the left click of the canvas.
Clicking the node by a left key, acquiring data of clicking the node, displaying node information in a text box, exchanging colors of an icon background circle layer and an icon layer of the node, filling the colors in the background layer, achieving the effect of highlighting the node, and reminding a user.
And clicking the relationship by a left key, acquiring data of the clicking relationship, thickening relationship lines and arrows, and displaying relationship information in a text box.
And (3) double-clicking the node by the left key, expanding the node associated with the node by using a default expansion template, and adding the current map.
And (5) right-click menu and node expansion, and adding the expanded data into the current map according to the selected template.
Hiding the node, hiding the node icon clicked by the current right button, hiding the associated relation, deleting the data from the map display, and updating the map display effect. Hiding the selected node, hiding all the currently selected nodes by clicking, deleting the data from the map display, and updating the map display effect, wherein the effect is the same as that of hiding the node.
Highlighting one-layer association, acquiring one-layer association node of the node selected by the right key, and reducing opacity of icons and relations of all other nodes so as to highlight the node of the one-layer association of the node. Highlighting the two-layer association, consistent with highlighting the one-layer association, acquiring the node of the two-layer association of the right click node, and reducing the opacity of all other nodes and icons.
And (3) selecting the nodes in a deselection mode, acquiring all the nodes clicked by the left key, exchanging the colors of the icon background circle layer and the icon layer, and canceling the filling color of the background layer.
The left key of the node is dragged, the node is clicked to drag simultaneously, the canvas coordinates of the node are changed, the effect of changing the position is achieved, meanwhile, the node does not provide the force layout effect any more, and the node coordinates are fixed.
The left key of the canvas is dragged, the blank is dragged, the coordinates of all nodes are changed, the center point of the canvas is changed, and the effect of changing the map position is achieved.
By adding a mouse roller event and sliding the roller, the canvas can be enlarged and reduced, and the coordinates of the nodes are changed, so that the map can be enlarged and reduced.
Clicking a rule option list generated by the terminal equipment, checking one item, traversing all data, comparing whether each node accords with the rule condition, and filling the node icon layer which accords with the rule with other colors for distinguishing.
It should be understood that the foregoing is only a few specific embodiments of the click event and the drag event, and other settings of the click event and the drag event may be performed according to actual needs besides the foregoing embodiments.
Repeating the steps, and selecting different templates to achieve the purpose of analysis. Matching rules and node icons are added, and various click events are added, so that quick help is provided for accurate analysis of users.
Corresponding to the knowledge graph display method described in the knowledge graph display method embodiment above, fig. 2 shows a block diagram of the knowledge graph display apparatus provided in the second embodiment of the present application, and for convenience of explanation, only the portion relevant to the embodiment of the present application is shown.
Referring to fig. 2, the knowledge-graph display apparatus 200 includes:
a map data acquisition module 201, configured to acquire map data, where the map data includes node data and relationship data;
an empty layer creation module 202, configured to create an empty connection relationship layer and a node layer according to the map data;
a data placement module 203, configured to place the relationship data into the connection relationship layer, and place the node data into the node layer;
a first traversing module 204, configured to traverse all the relationship data in the connection relationship layer, draw a line style and an arrow style for each relationship data, and add a display text;
a second traversing module 205, configured to traverse all the node data in the node layer and draw a node icon;
the rendering module 206 is configured to select a corresponding icon code for each node according to the node data, and then render each node;
and the display module 207 is configured to display all the drawn node data on the node layer, and display all the drawn relationship data on the connection relationship layer.
Further, the knowledge-graph display apparatus 200 further includes:
acquiring a query template of a knowledge graph, wherein the query template can search corresponding graph data;
setting a matching rule, wherein the matching rule is used for marking nodes or relations conforming to a first preset rule when the knowledge graph is displayed;
generating corresponding options according to a second preset rule, displaying the set rule options, and providing a clicking function;
setting the node icons according to preset node icon configuration rules.
Further, the knowledge-graph display apparatus 200 further includes:
when the node icons are set according to a preset node icon configuration rule, analyzing SVG icon codes according to the selected SVG icons, and extracting path codes for drawing the SVG icons.
Further, the empty layer creation module 202 is specifically configured to:
and creating canvas according to the map data, generating a force guide layout by using a force guide function of d3, and creating the connection relation layer and the node layer.
Further, the knowledge-graph display apparatus 200 further includes:
and the data sorting module is used for sorting the relation data by using the links () function of d3 and sorting the node data by using the nodes () function of d 3.
Further, the display module 207 is specifically configured to:
and displaying all the drawn node data on the node layer, displaying all the drawn relationship data on the connection relationship layer, adding iteration of the force layout, and obtaining position coordinates of the force layout by each node after multiple iterations, wherein the knowledge graph has the display effect of the force layout.
Further, the knowledge-graph display apparatus 200 further includes:
and the event binding module is used for binding the corresponding click events to the node layer and the connection relation layer and binding the corresponding drag events to the node layer.
Further, the second traversal module 205 is specifically configured to: and traversing all the node data in the node layer, and drawing node icons, wherein the node icons are divided into a community color circle layer, a node background circle layer, an icon layer, a node text layer, a drawing pin layer, an identification layer and a number checking layer.
It should be noted that, because the content of information interaction and execution process between the above devices/modules is based on the same concept as the embodiment of the knowledge graph display method in the present application, specific functions and technical effects thereof may be found in the embodiment of the knowledge graph display method, and will not be described herein.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional modules is illustrated, and in practical application, the above-mentioned functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the knowledge-graph display apparatus 200 is divided into different functional modules, so as to perform all or part of the above-mentioned functions. The functional modules in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional modules are only for distinguishing from each other, and are not used for limiting the protection scope of the application. The specific working process of each functional module may refer to the corresponding process in the embodiment of the knowledge graph display method, and will not be described herein.
Fig. 3 is a schematic structural diagram of a terminal device according to a third embodiment of the present application. As shown in fig. 3, the terminal device 300 includes: a processor 302, a memory 301 and a computer program 303 stored in the memory 301 and executable on the processor 302. The number of processors 302 is at least one, one for example in fig. 3. The processor 302 implements the steps of the knowledge graph display method described above, that is, the steps shown in fig. 1, when executing the computer program 303.
The specific implementation process of the terminal device 300 may refer to the above embodiment of the knowledge graph display method.
By way of example, the computer program 303 may be partitioned into one or more modules/units that are stored in the memory 301 and executed by the processor 302 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments are used for describing the execution of the computer program 303 in the terminal device 300.
The terminal device 300 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a master control, or a mobile terminal such as a mobile phone. Terminal device 300 may include, but is not limited to, a processor and memory. It will be appreciated by those skilled in the art that fig. 3 is merely an example of a terminal device 300 and is not limiting of the terminal device 300, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the terminal device 300 may also include input and output devices, network access devices, buses, etc.
The processor 302 may be a CPU (Central Processing Unit ), but may also be other general purpose processors, DSPs (Digital Signal Processor, digital signal processors), ASICs (Application Specific Integrated Circuit, application specific integrated circuits), FPGAs (Field-Programmable Gate Array, off-the-shelf programmable gate arrays) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 301 may be an internal storage unit of the terminal device 300, such as a hard disk or a memory. The memory 301 may also be an external storage device of the terminal device 300, such as a plug-in hard disk, SMC (Smart Media Card), SD Card (Secure Digital Card), flash Card (Flash memory Card), or the like, provided on the terminal device 300. Further, the memory 301 may also include both an internal storage unit and an external storage device of the terminal device 300. The memory 301 is used to store an operating system, application programs, boot loader programs, data, and other programs, etc., such as program code of the computer program 303. The memory 301 may also be used to temporarily store data that has been output or is to be output.
The present application also provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the knowledge graph display method embodiment described above.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the implementation of all or part of the flow of the above embodiment of the method for displaying a knowledge graph may be accomplished by a computer program to instruct related hardware, where the computer program 303 may be stored in a computer readable storage medium, and the computer program 303 may implement the steps of the embodiment of the method for displaying a knowledge graph when executed by the processor 302. Wherein the computer program 303 comprises computer program code, the computer program 303 code may be in the form of source code, object code, executable files or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal equipment, a recording medium, a computer Memory, a ROM (Read-Only Memory), a RAM (Random Access Memory ), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other manners. For example, the apparatus/terminal device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (7)

1. The knowledge graph display method is characterized by comprising the following steps of:
acquiring map data, wherein the map data comprises node data and relationship data;
creating an empty connection relation layer and a node layer according to the map data;
the relation data are put into the connection relation layer, and the node data are put into the node layer;
traversing all the relation data in the connection relation layer, drawing a connecting line style and an arrow style for each relation data, and adding display characters;
traversing all the node data in the node layer, and drawing a node icon;
selecting a corresponding icon code for each node according to the node data, and then rendering each node;
displaying all the drawn node data on the node layer, and displaying all the drawn relationship data on the connection relationship layer;
before the acquiring the map data, the knowledge map display method further includes:
acquiring a query template of a knowledge graph, wherein the query template can search corresponding graph data;
setting a matching rule, wherein the matching rule is used for marking nodes or relations conforming to a first preset rule when the knowledge graph is displayed;
generating corresponding options according to a second preset rule, displaying the set rule options, and providing a clicking function;
setting node icons according to preset node icon configuration rules;
the setting the node icon according to the preset node icon configuration rule includes:
when the node icons are set according to a preset node icon configuration rule, analyzing SVG icon codes according to the selected SVG icons, and extracting path codes for drawing the SVG icons;
creating an empty connection relation layer and a node layer according to the map data, wherein the method comprises the following steps:
and creating canvas according to the map data, generating a force guide layout by using a force guide function of d3, and creating the connection relation layer and the node layer.
2. The knowledge-graph display method according to claim 1, wherein after the relationship data is placed in the connection relationship layer and the node data is placed in the node layer, the knowledge-graph display method further comprises:
the relationship data is sorted using the links () function of d3, and the node data is sorted using the nodes () function of d 3.
3. The knowledge-graph display method according to claim 1, wherein displaying all the drawn node data on the node layer and displaying all the drawn relationship data on the connection relationship layer comprises:
and displaying all the drawn node data on the node layer, displaying all the drawn relationship data on the connection relationship layer, adding iteration of the force layout, and obtaining position coordinates of the force layout by each node after multiple iterations, wherein the knowledge graph has the display effect of the force layout.
4. The knowledge-graph display method according to claim 1, further comprising:
and binding the click event corresponding to the node layer and the connection relation layer, and binding the corresponding drag event to the node layer.
5. The knowledge graph display method according to claim 1, wherein in the node layer, all the node data are traversed, and node icons are drawn, wherein the node icons are divided into a community color circle layer, a node background circle layer, an icon layer, a node text layer, a drawing pin layer, an identification layer and a number checking layer.
6. A knowledge graph display device, characterized by comprising:
the map data acquisition module is used for acquiring map data, wherein the map data comprises node data and relationship data;
the empty layer creating module is used for creating an empty connection relation layer and a node layer according to the map data;
the data embedding module is used for embedding the relation data into the connection relation layer and embedding the node data into the node layer;
the first traversing module is used for traversing all the relation data in the connection relation layer, drawing a connecting line style and an arrow style for each relation data, and adding display characters;
the second traversing module is used for traversing all the node data in the node layer and drawing node icons;
the rendering module is used for selecting a corresponding icon code for each node according to the node data, and then rendering each node;
the display module is used for displaying all the drawn node data on the node layer and displaying all the drawn relationship data on the connection relationship layer;
before the map data are acquired, the knowledge map display device further comprises a module for realizing the following processes:
acquiring a query template of a knowledge graph, wherein the query template can search corresponding graph data;
setting a matching rule, wherein the matching rule is used for marking nodes or relations conforming to a first preset rule when the knowledge graph is displayed;
generating corresponding options according to a second preset rule, displaying the set rule options, and providing a clicking function;
setting node icons according to preset node icon configuration rules;
the setting the node icon according to the preset node icon configuration rule includes:
when the node icons are set according to a preset node icon configuration rule, analyzing SVG icon codes according to the selected SVG icons, and extracting path codes for drawing the SVG icons;
creating an empty connection relation layer and a node layer according to the map data, wherein the method comprises the following steps:
and creating canvas according to the map data, generating a force guide layout by using a force guide function of d3, and creating the connection relation layer and the node layer.
7. Terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the knowledge-graph presentation method according to any of claims 1-5 when the computer program is executed by the processor.
CN202010907318.3A 2020-09-02 2020-09-02 Knowledge graph display method and device and terminal equipment Active CN112035667B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010907318.3A CN112035667B (en) 2020-09-02 2020-09-02 Knowledge graph display method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010907318.3A CN112035667B (en) 2020-09-02 2020-09-02 Knowledge graph display method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN112035667A CN112035667A (en) 2020-12-04
CN112035667B true CN112035667B (en) 2023-07-21

Family

ID=73591045

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010907318.3A Active CN112035667B (en) 2020-09-02 2020-09-02 Knowledge graph display method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN112035667B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114792087A (en) * 2021-01-26 2022-07-26 北京资采信息技术有限公司 Jsmind-based analysis and display method
CN112800242B (en) * 2021-01-28 2023-07-28 平安科技(深圳)有限公司 Pedigree mining method, pedigree mining device, electronic equipment and computer-readable storage medium
CN113010686A (en) * 2021-03-04 2021-06-22 北京顶象技术有限公司 Knowledge graph display method
CN112988950B (en) * 2021-03-12 2023-10-13 成都数联铭品科技有限公司 Front-end rendering method and system of knowledge graph, electronic equipment and storage medium
CN113064971A (en) * 2021-04-12 2021-07-02 苏州城方信息技术有限公司 Interactive graph structure-based policy text relation mining and expressing method
CN113342992B (en) * 2021-06-16 2022-11-08 中国科学院空天信息创新研究院 Knowledge map association graph layout method based on pruning technology and automatic graph expansion
CN113326090A (en) * 2021-06-18 2021-08-31 麦克方程(北京)科技有限责任公司 Visual configuration method and device, electronic equipment and storage medium
CN113407735B (en) * 2021-07-19 2023-07-18 北京优锘科技有限公司 Method, device, equipment and medium for generating architecture map based on JSON data
CN113704492B (en) * 2021-08-26 2024-02-27 山东大学 Construction method and system of elderly care data knowledge graph
CN113721894A (en) * 2021-09-14 2021-11-30 福韵数据服务有限公司 Incidence relation graph drawing method based on force guidance algorithm model
CN114020852A (en) * 2021-09-29 2022-02-08 苏州臻璇数据信息技术有限公司 Knowledge graph display method and device
CN114299718B (en) * 2021-12-28 2023-02-10 广州小鹏汽车科技有限公司 Interaction method, server and storage medium
CN114827139A (en) * 2022-03-31 2022-07-29 奥特酷智能科技(南京)有限公司 Data flow diagram applied to vehicle-mounted system
CN114780083B (en) 2022-06-17 2022-10-18 之江实验室 Visual construction method and device of knowledge map system
CN115495518B (en) * 2022-09-22 2023-10-24 奇点浩翰数据技术(北京)有限公司 Method and device for generating chart
CN117076682A (en) * 2023-07-24 2023-11-17 企查查科技股份有限公司 Knowledge graph generation method and generation equipment
CN116934556B (en) * 2023-09-08 2023-12-26 四川三思德科技有限公司 Target personnel accurate control method based on big data fusion

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918475A (en) * 2019-01-24 2019-06-21 西安交通大学 A kind of Visual Inquiry method and inquiry system based on medical knowledge map
CN111309897A (en) * 2020-02-27 2020-06-19 中诚信征信有限公司 Big data knowledge graph visualization method and device
CN111598988A (en) * 2020-05-19 2020-08-28 北京海致星图科技有限公司 D3-based method and system for rendering knowledge graph data nodes

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9953081B2 (en) * 2015-02-26 2018-04-24 Accenture Global Services Limited System for linking diverse data systems
CN109804364A (en) * 2016-10-18 2019-05-24 浙江核新同花顺网络信息股份有限公司 Knowledge mapping constructs system and method
CN109815327B (en) * 2018-12-07 2023-08-15 南京中新赛克科技有限责任公司 SVG-based big data knowledge graph visualization solution
CN111259297A (en) * 2020-01-14 2020-06-09 清华大学 Interaction visualization method, platform and system for knowledge graph

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918475A (en) * 2019-01-24 2019-06-21 西安交通大学 A kind of Visual Inquiry method and inquiry system based on medical knowledge map
CN111309897A (en) * 2020-02-27 2020-06-19 中诚信征信有限公司 Big data knowledge graph visualization method and device
CN111598988A (en) * 2020-05-19 2020-08-28 北京海致星图科技有限公司 D3-based method and system for rendering knowledge graph data nodes

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A Classification Canvas for the analysis of biomedical data;A.B. Demko等;《Canadian Conference on Electrical and Computer Engineering 2001. Conference Proceedings (Cat. No.01TH8555)》;第1-2页 *
情报产品可视化展示模式和方法研究;张迪 等;《情报理论与实践》;第43卷(第2期);第66-71页 *

Also Published As

Publication number Publication date
CN112035667A (en) 2020-12-04

Similar Documents

Publication Publication Date Title
CN112035667B (en) Knowledge graph display method and device and terminal equipment
CN109614424B (en) Page layout generation method, device, computing equipment and medium
CN109408764B (en) Page area dividing method, device, computing equipment and medium
US11307908B2 (en) Format-specific data object passing between applications
CN110738037B (en) Method, apparatus, device and storage medium for automatically generating electronic form
US8584044B2 (en) Localized thumbnail preview of related content during spatial browsing
CN107301179A (en) The method and apparatus of data base read-write separation
US11256383B2 (en) Graphically representing content relationships on a surface of graphical object
CN113535165A (en) Interface generation method and device, electronic equipment and computer readable storage medium
US20180285965A1 (en) Multi-dimensional font space mapping and presentation
JP2007265031A (en) Dictionary content processor, content display system and content display method
KR20150034106A (en) Comparison and merging of ic design data
US9304981B1 (en) System and method for providing an inter-application overlay to communicate information between users and tools in the EDA design flow
CN111782758A (en) Drawing review result viewing method based on CAD and related device
CN108133048A (en) file ordering method, device and mobile terminal
US20110099183A1 (en) Search-based filtering for property grids
CN111222166A (en) Method and device for sharing and managing design material in multi-user online collaboration
CN115357587A (en) Business form generation method and system, electronic equipment and readable storage medium
EP3164783B1 (en) Graphical user interface for non-hierarchical file system
CN101833411B (en) For the method and apparatus of person's handwriting input
CN113157964A (en) Method and device for searching data set through voice and electronic equipment
Milovanovic et al. Python Data Visualization Cookbook
CN113656486B (en) Method, device, terminal equipment and storage medium for generating visualized object
US20060095469A1 (en) System and method for facilitating peer review of a deliverable
US20230086037A1 (en) Graphical diagram comparison

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant