CN112035667A - 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
CN112035667A
CN112035667A CN202010907318.3A CN202010907318A CN112035667A CN 112035667 A CN112035667 A CN 112035667A CN 202010907318 A CN202010907318 A CN 202010907318A CN 112035667 A CN112035667 A CN 112035667A
Authority
CN
China
Prior art keywords
node
data
layer
relation
graph
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.)
Granted
Application number
CN202010907318.3A
Other languages
Chinese (zh)
Other versions
CN112035667B (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

Images

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, wherein graph data are obtained and comprise node data and relation data, an empty connection relation layer and a node layer are created, the relation data are arranged in the connection relation layer, the node data are arranged in the node layer, all the relation data are traversed, a connection line pattern and an arrow pattern are drawn for each relation data, display characters are added, all the node data are traversed, node icons are drawn, corresponding icon codes are selected for each node and are rendered, the node data are displayed on the node layer, and the relation data are displayed on the connection relation layer. The knowledge graph display method provided by the invention is not limited to the types of graph data, and if different types of graph data are replaced or added, the graph display can be realized only by modifying the related content in the method steps without changing the execution process of the method steps, 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 constructed, service personnel want to quickly find the corresponding graph and check the topological relation, and can perform some refined analysis, so that a visual display method of the knowledge graph is needed for the quick display of the knowledge graph and the provision of a refined analysis tool. Most of the existing knowledge graph display methods are domain knowledge graph display methods, the customization degree is high, and the flexibility and the usability are poor; only the pattern can be displayed, and refined analysis cannot be provided; when the knowledge-graph data source is changed, the knowledge-graph data source needs to be developed again.
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 that the existing knowledge graph display method is poor in flexibility.
In order to solve the problems, the invention adopts the following technical scheme:
a knowledge graph display method comprises the following steps:
acquiring map data, wherein the map data comprises node data and relation data;
creating an empty connection relation layer and a node layer according to the map data;
the relation data is placed into the connection relation layer, and the node data is placed 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 node icons;
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 relation data on the connection relation layer.
Preferably, before the obtaining of the atlas data, the knowledge-atlas displaying 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 out a node or a relation which accords with 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 click function;
and setting the node icons according to a preset node icon configuration rule.
Preferably, the setting of the node icon according to the preset node icon configuration rule includes:
and when the node icon is set according to the preset node icon configuration rule, resolving the SVG icon code according to the selected SVG icon, and extracting a path code for drawing the SVG icon.
Preferably, the creating an empty connection relation layer and a node layer according to the graph data includes:
and creating a canvas according to the graph data, generating a force guidance layout by using a force guidance 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 method for displaying a knowledge graph 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 all the drawn relationship data on the connection relationship layer includes:
displaying all drawn node data on the node layer, displaying all drawn relation data on the connection relation layer, adding iteration of force layout, and obtaining a force layout position coordinate by each node through multiple iterations.
Preferably, the knowledge-graph display method further comprises:
and binding corresponding click events to the node layer and the connection relation layer, and binding corresponding drag events 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 character layer, a drawing pin layer, an identification layer and a number matching layer.
A knowledge-graph display apparatus comprising:
the map data acquisition module is used for acquiring map data, and the map data comprises node data and relation 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 traversal module is used for traversing all the relation data in the connection relation layer, drawing a connection line style and an arrow style for each relation data, and adding display characters;
the second traversal 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 relation data on the connection relation 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 method of knowledge-graph presentation as described above when executing the computer program.
The invention has the beneficial effects that: according to the method for displaying the knowledge graph, an empty connection relation layer and an empty 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 correspondingly to the node data and the relation data and the connection relation layer and the node layer, a connection line pattern and an arrow pattern are drawn for each relation data, display characters and node icons are added, corresponding icon codes are selected for the nodes according to the node data and are rendered, 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 the graph data, if different types of graph data are replaced or added, the graph display can be realized only by modifying related contents in the method steps without changing the execution process of the method steps, compared with customized development, the method has higher flexibility and usability, saves a large amount of development time, does not need to be re-developed even if the knowledge graph data source is changed, can provide refined analysis, and has high drawing efficiency and supports the analysis and display of a large amount of data.
Drawings
In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings needed to be used in the embodiment will be briefly described as follows:
FIG. 1 is a schematic overall flow chart of a knowledge graph display method according to an embodiment of the present disclosure;
FIG. 2 is a schematic overall structure diagram of a knowledge-graph displaying apparatus provided in the second embodiment of the present application;
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 structures, 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 will 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 and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this 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 present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated 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 devices such as a mobile phone, a tablet personal computer, a wearable device, a vehicle-mounted device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA) and the like, and the embodiment of the application does not limit the specific type of the terminal device at all. 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 terminal devices.
In order to explain the technical means described in the present application, the following description will be given by way of specific embodiments.
Referring to fig. 1, it is a flowchart of an implementation process of a knowledge graph display method provided in an embodiment of the present application, and for convenience of description, only a part related to the embodiment of the present application is shown.
The knowledge graph display method comprises the following steps:
step S101: obtaining graph data, wherein the graph data comprises node data and relationship data:
in this embodiment, a carrier of a client corresponding to the method for displaying a knowledge graph provided by the embodiment of the present application is described by taking a terminal device as an example, and the terminal device is in communication connection with a server, and graph data is stored in the server, that is, data of a prepared knowledge graph is stored in a database in the server in advance, specifically, in a Neo4j graph database. It should be understood that the terminal device may also be communicatively unconnected to the server, in which case the profile data is stored in the terminal device and need not be retrieved from the server.
Further, before acquiring the atlas data, the terminal device needs to do some preparation work, that is, before acquiring the atlas data, the knowledge atlas display method further includes:
and preparing a knowledge graph query template, namely acquiring the knowledge graph query template, 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 are filled in the newly added query template. By using the unique main key as a retrieval condition, various query statements such as first-degree query statements, second-degree query statements and the like can be written. The corresponding profile data, i.e., the profile data specifying the requirements, can be searched using the query template.
And setting a matching rule, wherein the matching rule can be modified at any time. Specifying fields such as rule name, rule classification, rule type, tag name, attribute name, match type, match content, etc. The matching rule is used for marking out nodes or relations which accord with a first preset rule when the knowledge graph is displayed. It should be understood that the first preset rule is set according to actual conditions.
And generating corresponding options according to the second preset rule, displaying the rule options set by the user, and providing a click function. It should be understood that the second preset rule is set according to actual conditions.
And setting the node icons according to a preset node icon configuration rule. The icon can be set at any time, and the icon name, the icon identifier, the icon code, the tag name, the attribute name, the matching type, the matching content and the sequence value are designated. And when the node icon is set according to the preset node icon configuration rule, the SVG icon code is analyzed according to the SVG icon selected by the user, and the path code for drawing the SVG icon is extracted.
The user inputs a specific query main key through the terminal equipment, initiates a query request for querying the template, is connected to the server through network communication, and the server sorts the graph data into node data and relation data and returns the node data and the relation data to the terminal equipment.
Step S102: and 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, the canvas is created, the force guidance layout is generated using the force guidance function of d3, and an empty connection relation layer and an empty node layer are created.
Step S103: placing the relationship data into the connection relationship layer, placing the node data into the node layer:
after the terminal device creates an empty connection relation layer and a node layer, the relation data is placed in the connection relation layer, and the node data is placed in the node layer. Further, the terminal device puts the relationship data into the connection relationship layer, puts the node data into the node layer, and then sorts the relationship data using the links () function of d3, and sorts the node data using the nodes () function of d 3.
Step S104: in the connection relation layer, traversing all the relation data, drawing a connecting line style and an arrow style for each relation data, and adding display characters:
and traversing all the relation data by the terminal equipment in the connection relation layer, drawing a connecting 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 relation data, and a marker-end is used to match an arrow.
Step S105: in the node layer, traversing all the node data, and drawing a node icon:
and traversing all the node data and drawing node icons by the terminal equipment in the node layer. In this embodiment, in the node layer, all the node data is traversed, and in the node icon drawn, the node icon is 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 matching layer. Then, the node icons are divided into 8 layers, and the sequence is respectively that the community color circle layer, the node background circle layer, the icon layer, the node character layer are arranged at the bottom, the drawing pin layer, the identification layer and the number matching layer are arranged at the top. And setting the transparency of each layer to be 0, not displaying, and displaying when waiting for rendering.
Step S106: selecting a corresponding icon code for each node according to the node data, and then rendering each node:
the terminal equipment selects a corresponding icon code for each node as an icon layer according to icon configuration and by combining node data, then renders each node, and renders 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 relation data on the connection relation layer:
the terminal equipment displays all drawn node data on a node layer, displays all drawn relation data on a connection relation layer, adds iteration of force layout, and after multiple iterations, the knowledge graph has a force layout display effect, namely the graph generates a force layout display effect, and each node obtains a force layout position coordinate.
In this embodiment, the knowledge-graph display method further includes:
binding corresponding click events to the node layer and the connection relation layer, and binding corresponding drag events to the node layer, which is specifically as follows:
adding a binding event, clicking a node binding selection function by a left key, binding a selection function by a left key clicking relation, binding a default template query by double clicking the node by the left key, clicking a node adding menu by a right key, if node expansion is performed, hiding the node, hiding the selected node, highlighting one-layer association, highlighting two-layer association, canceling the selected node, dragging the left key of the node, and dragging the left key of a canvas.
And clicking a node by a left key, acquiring data of the clicked 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 background layer with colors, achieving the effect of highlighting the node, and reminding a user.
And clicking the relationship by the left key, acquiring data of the clicking relationship, simultaneously thickening a relationship line and an arrow, and simultaneously displaying relationship information in a text box.
And (4) 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 (4) right-clicking a menu, expanding nodes, and adding the expanded data into the current map according to the selected template.
Hiding the node, hiding the current right-click node icon, 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 clicked nodes, deleting the data from the map display with the same effect as the node hiding, and updating the map display effect.
And highlighting one layer of association, acquiring one layer of associated nodes of the nodes selected by the right key, and reducing the opacity of icons and relations of all other nodes so as to highlight the nodes of the one layer of association of the nodes. And (4) associating the two layers of highlights, wherein the two layers of highlighted associations are consistent with the one layer of highlighted associations, acquiring nodes associated with the two layers of right click nodes, and reducing the opaqueness of all other nodes and icons.
And canceling the selected node, acquiring all 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.
And dragging a left key of the node, clicking the node and dragging at the same time, changing the canvas coordinate of the node to achieve the effect of changing the position, and simultaneously, the node does not provide a force layout effect any more and the node coordinate is fixed.
The left key of the canvas is dragged, the blank is dragged, the coordinates of all the nodes are changed, the center point of the canvas is changed, and the effect of changing the position of the map is achieved.
And adding a mouse roller event, zooming the canvas by sliding the roller, changing the coordinates of the nodes, and realizing the zooming of the atlas.
And clicking a rule option list generated by the terminal equipment, checking one item, traversing all data, simultaneously comparing whether each node meets the condition of the rule, and filling other colors in the node icon layer meeting the condition for distinguishing.
It should be understood that the above only shows several specific embodiments of the click event and the drag event, and besides the above embodiments, the click event and the drag event may be set according to actual needs.
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 a user.
Fig. 2 shows a block diagram of a knowledge graph display apparatus provided in the second embodiment of the present application, which corresponds to the knowledge graph display method described in the previous embodiment of the knowledge graph display method.
Referring to fig. 2, the knowledge-graph displaying apparatus 200 includes:
the map data acquisition module 201 is configured to acquire map data, where the map data includes node data and relationship data;
an empty graph layer creating module 202, configured to create an empty connection relationship layer and a node layer according to the graph data;
a data embedding module 203, configured to embed the relationship data into the connection relationship layer, and embed the node data into the node layer;
a first traversal module 204, configured to traverse all the relationship data in the connection relationship layer, draw a connection line style and an arrow style for each relationship data, and add display text;
a second traversal module 205, configured to traverse all the node data in the node layer, and draw a node icon;
a rendering module 206, 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 displaying 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 out a node or a relation which accords with 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 click function;
and setting the node icons according to a preset node icon configuration rule.
Further, the knowledge-graph displaying apparatus 200 further includes:
and when the node icon is set according to the preset node icon configuration rule, resolving the SVG icon code according to the selected SVG icon, and extracting a path code for drawing the SVG icon.
Further, the empty graph layer creation module 202 is specifically configured to:
and creating a canvas according to the graph data, generating a force guidance layout by using a force guidance function of d3, and creating the connection relation layer and the node layer.
Further, the knowledge-graph displaying apparatus 200 further includes:
and the data sorting module is used for sorting the relational data by using a links () function of d3 and sorting the node data by using a nodes () function of d 3.
Further, the display module 207 is specifically configured to:
displaying all drawn node data on the node layer, displaying all drawn relation data on the connection relation layer, adding iteration of force layout, and obtaining a force layout position coordinate by each node through multiple iterations.
Further, the knowledge-graph displaying 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: in the node layer, traversing all the node data, 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 character layer, a drawing pin layer, an identification layer and a number matching layer.
It should be noted that, because the content of information interaction, execution process, and the like between the above-mentioned devices/modules is based on the same concept as that of the embodiment of the method for displaying a knowledge graph of the present application, specific functions and technical effects thereof may be referred to specifically in the section of the embodiment of the method for displaying a knowledge graph, and details thereof are not described here.
It will be clear to those skilled in the art that, for convenience and simplicity of description, the above division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the knowledge graph displaying apparatus 200 is divided into different functional modules to perform all or part of the above described functions. Each functional module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional modules are only used for distinguishing one functional module from another, and are not used for limiting the protection scope of the application. The specific working process of each functional module in the above description may refer to the corresponding process in the foregoing embodiment of the knowledge graph display method, and is not described herein again.
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 operable on the processor 302. The number of the processors 302 is at least one, and fig. 3 takes one as an example. The implementation steps of the above-described knowledge-graph presentation method, i.e. the steps shown in fig. 1, are implemented when the processor 302 executes 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.
Illustratively, 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 accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 303 in the terminal device 300.
The terminal device 300 may be a desktop computer, a notebook, a palm computer, a main control and other computing devices, or may be a mobile terminal such as a mobile phone. Terminal device 300 may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that fig. 3 is only an example of the terminal device 300 and does not constitute a limitation of the terminal device 300, and may include more or less components than those shown, or combine some of the components, or different components, for example, the terminal device 300 may further include input and output devices, network access devices, buses, etc.
The Processor 302 may be a CPU (Central Processing Unit), other general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 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 (Secure Digital Card), Flash Card, or the like provided on the terminal device 300. Further, the memory 301 may also include both an internal storage unit of the terminal device 300 and an external storage device. The memory 301 is used for storing an operating system, application programs, a boot loader, data, and other programs, such as program codes 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 further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps in the above embodiments of the knowledge graph displaying method may be implemented.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiments of the method for displaying a knowledge graph may be implemented by a computer program to instruct related hardware, the computer program 303 may be stored in a computer-readable storage medium, and the computer program 303 may implement the steps of the above-mentioned embodiments of the method for displaying a knowledge graph when being executed by the processor 302. Wherein the computer program 303 comprises computer program code, and the computer program 303 code may be in a source code form, an object code form, an executable file or some intermediate form, and the like. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, ROM (Read-Only Memory), RAM (Random Access Memory), electrical carrier wave signal, telecommunication signal, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
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 implementation. 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 ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed 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 can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A knowledge graph display method is characterized by comprising the following steps:
acquiring map data, wherein the map data comprises node data and relation data;
creating an empty connection relation layer and a node layer according to the map data;
the relation data is placed into the connection relation layer, and the node data is placed 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 node icons;
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 relation data on the connection relation layer.
2. The method of knowledge-graph display according to claim 1, wherein prior to obtaining graph data, the method further comprises:
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 out a node or a relation which accords with 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 click function;
and setting the node icons according to a preset node icon configuration rule.
3. The knowledge-graph displaying method according to claim 2, wherein the setting of the node icons according to the preset node icon configuration rule comprises:
and when the node icon is set according to the preset node icon configuration rule, resolving the SVG icon code according to the selected SVG icon, and extracting a path code for drawing the SVG icon.
4. The method of knowledge-graph display according to claim 1, wherein the creating of empty connection relation layers and node layers according to the graph data comprises:
and creating a canvas according to the graph data, generating a force guidance layout by using a force guidance function of d3, and creating the connection relation layer and the node layer.
5. The method of claim 4, wherein after placing the relationship data into the connection relationship layer and placing the node data into the node layer, the 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.
6. The method for displaying a knowledge-graph according to claim 1, wherein the displaying all the plotted node data on the node layer and all the plotted relationship data on the connection relationship layer comprises:
displaying all drawn node data on the node layer, displaying all drawn relation data on the connection relation layer, adding iteration of force layout, and obtaining a force layout position coordinate by each node through multiple iterations.
7. The knowledge-graph display method of claim 1, wherein the knowledge-graph display method further comprises:
and binding corresponding click events to the node layer and the connection relation layer, and binding corresponding drag events to the node layer.
8. The knowledge-graph displaying 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 matching layer.
9. A knowledge-graph displaying apparatus, comprising:
the map data acquisition module is used for acquiring map data, and the map data comprises node data and relation 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 traversal module is used for traversing all the relation data in the connection relation layer, drawing a connection line style and an arrow style for each relation data, and adding display characters;
the second traversal 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 relation data on the connection relation layer.
10. A 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 exposure method according to any one of claims 1-8 when executing the computer program.
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 true CN112035667A (en) 2020-12-04
CN112035667B 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)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800242A (en) * 2021-01-28 2021-05-14 平安科技(深圳)有限公司 Pedigree mining method and device, electronic equipment and computer-readable storage medium
CN112988950A (en) * 2021-03-12 2021-06-18 成都数联铭品科技有限公司 Front-end rendering method and system of knowledge graph, electronic device and storage medium
CN113010686A (en) * 2021-03-04 2021-06-22 北京顶象技术有限公司 Knowledge graph display method
CN113064971A (en) * 2021-04-12 2021-07-02 苏州城方信息技术有限公司 Interactive graph structure-based policy text relation mining and expressing method
CN113326090A (en) * 2021-06-18 2021-08-31 麦克方程(北京)科技有限责任公司 Visual configuration method and device, electronic equipment and storage medium
CN113342992A (en) * 2021-06-16 2021-09-03 中国科学院空天信息创新研究院 Knowledge map association graph layout method based on pruning technology and automatic graph expansion
CN113407735A (en) * 2021-07-19 2021-09-17 北京优锘科技有限公司 Method, device, equipment and storage medium for generating architecture map based on JSON data
CN113704492A (en) * 2021-08-26 2021-11-26 山东大学 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
CN114299718A (en) * 2021-12-28 2022-04-08 广州小鹏汽车科技有限公司 Interaction method, server and storage medium
CN114780083A (en) * 2022-06-17 2022-07-22 之江实验室 Visual construction method and device of knowledge map system
CN115495518A (en) * 2022-09-22 2022-12-20 奇点浩翰数据技术(北京)有限公司 Method and device for generating chart
CN116934556A (en) * 2023-09-08 2023-10-24 四川三思德科技有限公司 Target personnel accurate control method based on big data fusion
CN117076682A (en) * 2023-07-24 2023-11-17 企查查科技股份有限公司 Knowledge graph generation method and generation equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180232445A1 (en) * 2015-02-26 2018-08-16 Accenture Global Services Limited System for linking diverse data systems
CN109804364A (en) * 2016-10-18 2019-05-24 浙江核新同花顺网络信息股份有限公司 Knowledge mapping constructs system and method
CN109815327A (en) * 2018-12-07 2019-05-28 南京中新赛克科技有限责任公司 A kind of big data knowledge mapping visibility solution based on SVG
CN109918475A (en) * 2019-01-24 2019-06-21 西安交通大学 A kind of Visual Inquiry method and inquiry system based on medical knowledge map
CN111259297A (en) * 2020-01-14 2020-06-09 清华大学 Interaction visualization method, platform and system for knowledge graph
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

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180232445A1 (en) * 2015-02-26 2018-08-16 Accenture Global Services Limited System for linking diverse data systems
CN109804364A (en) * 2016-10-18 2019-05-24 浙江核新同花顺网络信息股份有限公司 Knowledge mapping constructs system and method
CN109815327A (en) * 2018-12-07 2019-05-28 南京中新赛克科技有限责任公司 A kind of big data knowledge mapping visibility solution based on SVG
CN109918475A (en) * 2019-01-24 2019-06-21 西安交通大学 A kind of Visual Inquiry method and inquiry system based on medical knowledge map
CN111259297A (en) * 2020-01-14 2020-06-09 清华大学 Interaction visualization method, platform and system for knowledge graph
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.B. DEMKO等: "A Classification Canvas for the analysis of biomedical data", 《CANADIAN CONFERENCE ON ELECTRICAL AND COMPUTER ENGINEERING 2001. CONFERENCE PROCEEDINGS (CAT. NO.01TH8555)》, pages 1 - 2 *
张迪 等: "情报产品可视化展示模式和方法研究", 《情报理论与实践》, vol. 43, no. 2, pages 66 - 71 *

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800242B (en) * 2021-01-28 2023-07-28 平安科技(深圳)有限公司 Pedigree mining method, pedigree mining device, electronic equipment and computer-readable storage medium
CN112800242A (en) * 2021-01-28 2021-05-14 平安科技(深圳)有限公司 Pedigree mining method and device, electronic equipment and computer-readable storage medium
CN113010686A (en) * 2021-03-04 2021-06-22 北京顶象技术有限公司 Knowledge graph display method
CN112988950A (en) * 2021-03-12 2021-06-18 成都数联铭品科技有限公司 Front-end rendering method and system of knowledge graph, electronic device and storage medium
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
CN113342992A (en) * 2021-06-16 2021-09-03 中国科学院空天信息创新研究院 Knowledge map association graph layout method based on pruning technology and automatic graph expansion
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
CN113407735A (en) * 2021-07-19 2021-09-17 北京优锘科技有限公司 Method, device, equipment and storage medium for generating architecture map based on JSON data
CN113704492A (en) * 2021-08-26 2021-11-26 山东大学 Construction method and system of elderly care data knowledge graph
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
CN114299718A (en) * 2021-12-28 2022-04-08 广州小鹏汽车科技有限公司 Interaction method, server and storage medium
US11907390B2 (en) 2022-06-17 2024-02-20 Zhejiang Lab Method and apparatus for visual construction of knowledge graph system
CN114780083A (en) * 2022-06-17 2022-07-22 之江实验室 Visual construction method and device of knowledge map system
CN115495518A (en) * 2022-09-22 2022-12-20 奇点浩翰数据技术(北京)有限公司 Method and device for generating chart
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
CN116934556A (en) * 2023-09-08 2023-10-24 四川三思德科技有限公司 Target personnel accurate control method based on big data fusion

Also Published As

Publication number Publication date
CN112035667B (en) 2023-07-21

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
CN109144997A (en) Data correlation method, device and storage medium
CN111427561A (en) Service code generation method and device, computer equipment and storage medium
CN107301179A (en) The method and apparatus of data base read-write separation
CN111078689B (en) Data processing method and system of discontinuous pre-ordering traversal tree algorithm
JP2007265031A (en) Dictionary content processor, content display system and content display method
KR20150034106A (en) Comparison and merging of ic design data
CN113535165A (en) Interface generation method and device, electronic equipment and computer readable storage medium
US9639587B2 (en) Social network analyzer
CN112560422A (en) Chart processing method, device, equipment and medium
CN113344514A (en) Item information display method and device, electronic equipment and readable medium
US9483852B2 (en) Method for displaying and manipulating genealogical data using a full family graph
CN110609927B (en) Visual family tree layout method, terminal device and storage medium
WO2021133581A1 (en) System and method for visualizing and navigating network data
CN111222166A (en) Method and device for sharing and managing design material in multi-user online collaboration
JP2018077762A (en) Screen recognition device, screen recognition method, and screen recognition program
CN110704481A (en) Method and device for displaying data
CN108255920A (en) Display methods, device, equipment and the storage medium of organization names retrieval type
JPWO2017043664A1 (en) Information management apparatus and file management method
CN113157964A (en) Method and device for searching data set through voice and electronic equipment
CN112328837A (en) Data display method, device, equipment and storage medium
CN112069236A (en) Associated file display method, device, equipment and storage medium
CN112612817A (en) Data processing method and device, terminal equipment and computer readable storage medium

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