Knowledge graph rendering method and device under large-scale data, equipment and product
By dividing data into blocks according to the ontology structure and determining rendering priorities, the problems of slow rendering speed and page crashes in large-scale knowledge graphs are solved, achieving efficient rendering and querying, and improving user experience and knowledge retrieval efficiency.
Patent Information
- Application Number
- CN202510663558.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-21
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-05-21
AI Technical Summary
When processing knowledge graphs with large-scale data, rendering speed is slow, page loading is sluggish, and it may even cause page crashes. Existing technologies are difficult to render and query large-scale knowledge graphs efficiently.
By dividing the knowledge graph into data blocks according to the ontology structure, determining the layout information and rendering priority of node data, querying and rendering node data on demand, and adopting the methods of block storage and layered rendering, the client memory pressure is reduced and the query speed and rendering efficiency are improved.
It improves the rendering speed and page loading speed of knowledge graphs, avoids page crashes, enhances user experience and knowledge retrieval efficiency, simplifies rendering complexity, and reduces computational overhead.
Smart Images

Figure CN120216606B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of knowledge graph, big data processing and artificial intelligence, in particular, to a knowledge graph rendering method and device under large-scale data, equipment and products. BACKGROUND
[0002] Knowledge graph is a commonly used technical means in the field of knowledge governance. Due to its structured data form, knowledge can be composed into a knowledge graph of any network shape with points (entities) and edges (relationships), which can clearly represent the complex relationships between knowledge and support semantic search and knowledge reasoning, with strong knowledge integration and association capabilities, as well as scalability.
[0003] However, when processing knowledge graph under large-scale data, a lot of time is spent on querying all node data of the knowledge graph under large-scale data and performing graph rendering, which is slow in rendering speed, causes page loading to be lagging and blank, and even may cause page crash. SUMMARY
[0004] This summary is provided to introduce a selection of concepts, which are further described below in the detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
[0005] In a first aspect, the present disclosure provides a knowledge graph rendering method under large-scale data, the knowledge graph rendering method comprising:
[0006] In response to a knowledge graph display operation on the client, performing data query in a data block corresponding to a target knowledge graph to obtain node data for rendering, wherein the data block is obtained by dividing the target knowledge graph according to an ontology structure of the target knowledge graph, and each node data in the data block corresponds to a same entity type in the ontology structure;
[0007] Determining layout information of the node data, wherein the layout information at least represents a position of a node corresponding to the node data in a display interface of the client;
[0008] Determining an entity type of a data block to which the node data belongs as an entity type of the node data, and determining a rendering priority of the node data according to the entity type of the node data, a connection relationship between entity types in the ontology structure, and a preset rendering priority, wherein the preset rendering priority is used to represent a rendering priority of a first specific entity type and a second specific entity type having a specific connection relationship;
[0009] According to the layout information, the entity type, and the rendering priority of the node data, the node data is rendered to obtain the target knowledge graph.
[0010] In a second aspect, the present disclosure provides a knowledge graph rendering device under large-scale data, which comprises:
[0011] The query module is configured to, in response to a knowledge graph display operation on the client, perform data query in a data block corresponding to the target knowledge graph to obtain node data for rendering, wherein the data block is obtained by dividing the target knowledge graph according to an ontology structure of the target knowledge graph, and each node data in the data block corresponds to a same entity type in the ontology structure.
[0012] The first determination module is configured to determine layout information of the node data, wherein the layout information at least represents a position of a node corresponding to the node data in a display interface of the client.
[0013] The second determination module is configured to determine an entity type of a data block to which the node data belongs as the entity type of the node data, and determine a rendering priority of the node data according to the entity type of the node data, a connection relationship between entity types in the ontology structure, and a preset rendering priority, wherein the preset rendering priority is used to represent a rendering priority of a first specific entity type and a second specific entity type having a specific connection relationship.
[0014] The rendering module is configured to render the node data according to at least the layout information, the entity type, and the rendering priority of the node data to obtain the target knowledge graph.
[0015] In a third aspect, the present disclosure provides a computer readable medium having a computer program stored thereon, wherein the program is executed by a processing device to implement the steps of the method in the first aspect.
[0016] In a fourth aspect, the present disclosure provides an electronic device, which comprises:
[0017] A storage device having a computer program stored thereon;
[0018] A processing device configured to execute the computer program in the storage device to implement the steps of the method in the first aspect.
[0019] In a fifth aspect, the present disclosure provides a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the steps of the method in the first aspect.
[0020] By the technical solution, the target knowledge graph can be divided into different data blocks according to the ontology structure of the target knowledge graph, so that the node data required for rendering the target knowledge graph can be queried according to the data blocks, and then the layout information of the node data is determined, and the rendering priority of the node data is determined according to the entity type of the node data, the connection relationship between the entity types in the ontology structure and the preset rendering priority, and finally the node data is rendered according to at least the layout information, the entity type and the rendering priority of the node data, and the target knowledge graph is obtained. By using the method, it is not necessary to query all node data of the knowledge graph under large-scale data and perform graph rendering at one time, but the node data is queried and the graph is rendered on demand in the data block corresponding to the target knowledge graph, which not only can reduce the memory pressure of the client, but also can improve the query speed of the node data and the rendering speed of the knowledge graph under large-scale data, and then the page loading speed is improved, and the page crash is avoided. In addition, the node data can be rendered step by step according to the rendering priority, the page response speed is improved, the page blank is avoided, the user experience is improved, and then when the knowledge graph after rendering is used for knowledge retrieval, the knowledge retrieval efficiency can be improved.
[0021] Other features and advantages of the present disclosure will be described in detail in the following detailed description section. BRIEF DESCRIPTION OF DRAWINGS
[0022] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent by describing in detail the embodiments thereof with reference to the attached drawings in which:
[0023] Figure 1 is a schematic flow chart of a knowledge graph rendering method under large-scale data according to an exemplary embodiment of the present disclosure;
[0024] Figure 2 is a process schematic diagram of a knowledge graph rendering method under large-scale data according to an exemplary embodiment of the present disclosure;
[0025] Figure 3 is a display schematic diagram of a configuration page according to an exemplary embodiment of the present disclosure;
[0026] Figure 4 is a process schematic diagram of a graph rendering according to an exemplary embodiment of the present disclosure;
[0027] Figure 5 is a schematic diagram of setting a knowledge graph display according to an exemplary embodiment of the present disclosure;
[0028] Figure 6 is a display diagram of knowledge graph re-rendering according to an exemplary embodiment of the present disclosure;
[0029] Figure 7 is a display diagram of knowledge graph list display according to an exemplary embodiment of the present disclosure;
[0030] Figure 8 is a structural diagram of a knowledge graph rendering device under large-scale data according to an exemplary embodiment of the present disclosure;
[0031] Figure 9 is a structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0032] Embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be interpreted as being limited to the embodiments set forth herein, but rather, these embodiments are provided so that the present disclosure can be more thoroughly and completely understood. It should be understood that the drawings of the present disclosure are for illustrative purposes only and are not intended to limit the scope of the present disclosure.
[0033] It should be understood that each step recited in the method embodiments of the present disclosure can be executed in different order and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the execution of the steps shown. The scope of the present disclosure is not limited in this respect.
[0034] The term "comprising" and variations thereof as used herein are open-ended, that is, "comprising but not limited to." The term "based on" is "based, at least in part, on." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments." Related terms are defined in the following description.
[0035] It should be noted that the concepts of "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0036] It should be noted that the modification of "one", "multiple" mentioned in the present disclosure is illustrative and not limiting, and those skilled in the art should understand that, unless otherwise explicitly indicated in the context, it should be understood as "one or more".
[0037] The names of the messages or information exchanged between the plurality of devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0038] It can be understood that, before using the technical solutions disclosed in the embodiments of the present disclosure, the type, use range, use scenario, etc. of the personal information involved in the present disclosure should be informed to the user and the authorization of the user should be obtained in a proper manner according to relevant laws and regulations.
[0039] For example, in response to receiving an active request of a user, a prompt information is sent to the user to explicitly prompt the user that the operation requested to be performed will require obtaining and using personal information of the user. Thus, the user can voluntarily choose whether to provide personal information to the software or hardware such as an electronic device, an application program, a server or a storage medium, etc. performing the operation of the technical solutions of the present disclosure according to the prompt information.
[0040] As an optional but non-limiting implementation manner, in response to receiving an active request of a user, the manner of sending a prompt information to the user may, for example, be a pop-up window manner, and the prompt information may be presented in the form of text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0041] It can be understood that the above notification and obtaining of user authorization process is only illustrative, and does not limit the implementation manners of the present disclosure, and other manners meeting relevant laws and regulations can also be applied to the implementation manners of the present disclosure.
[0042] At the same time, it can be understood that the data (including but not limited to the data itself, the acquisition or use of the data) involved in the present technical solutions should comply with the requirements of relevant laws and regulations and relevant provisions.
[0043] When processing a knowledge graph under large-scale data, performance bottlenecks may be encountered, mainly manifested in:
[0044] 1. Poor performance of graph data query and reasoning under large-scale data:
[0045] Firstly, the knowledge graph under large-scale data contains a large amount of entity and relationship data, and a large amount of memory and disk space is needed to store and process these data. When querying, it takes a lot of time to locate and read data from such a large amount of data. In addition, the data in the knowledge graph is from a wide range of sources and has various formats, including structured, semi-structured and unstructured data. Integrating and processing these different types of data requires additional overhead, increasing the complexity of query and reasoning.
[0046] Secondly, in the graph structure of the knowledge graph, there are complex multi-hop relationships between entities. When querying and reasoning, a large number of nodes and edges may need to be traversed to find paths or relationships that meet the conditions, resulting in exponential growth of the search space and thus reducing performance. In addition, the structure of the knowledge graph is often irregular, with large differences in node degree and connection density in different areas, making rule-based or statistical query and reasoning algorithms inefficient in processing, prone to data skew and other problems, and affecting overall performance.
[0047] Thirdly, the reasoning task of the knowledge graph usually requires the use of complex logical rules and algorithms, such as description logic-based reasoning and rule-based reasoning. These algorithms require a large number of logical judgments and deductions when processing large-scale data, resulting in low reasoning speed.
[0048] Fourthly, in order to handle large-scale data knowledge graphs, distributed storage and computing architectures are usually required. However, data communication and coordination in distributed systems can incur additional overhead, affecting query and reasoning performance. Data transmission, task scheduling, and synchronization between different nodes can all cause increased latency.
[0049] 2. Graph data cannot be queried hierarchically:
[0050] Knowledge graphs are complex network structures, with entities connected by multiple types of relationships, and there is no strict hierarchical relationship. An entity can be associated with multiple different types of entities, making it difficult to determine a clear hierarchical order for hierarchical rendering. And knowledge graphs are usually dynamic, with new entities and relationships being added to the graph. New information may change the relationships between existing entities or introduce entirely new relationship paths, making it difficult to determine a stable hierarchical structure in advance. In addition, the relationships in the knowledge graph have rich semantic information, with different relationship types representing different semantic meanings. These semantic information is crucial for understanding and processing the knowledge graph, but also increases the complexity of rendering.
[0051] 3. Large-scale data knowledge graph rendering is slow and even causes page crashes:
[0052] Firstly, large-scale data knowledge graphs contain a large amount of node data and edge data, which requires a lot of time to transfer data from the server to the client during network transmission. If the network condition is not good, the transmission time will be further prolonged, causing the page to be in a loading state for a long time.
[0053] Secondly, the download of the knowledge graph data under large-scale data is limited when the network bandwidth is low. For example, during the download process, there may be data interruption or extremely slow download speed, which not only prolongs the loading time, but also may cause incomplete data, thereby affecting the rendering of the graph.
[0054] Thirdly, the knowledge graph is usually displayed in a graphical manner, which requires complex layout calculation to determine the position of each node and edge on the page. For the knowledge graph under large-scale data, the complexity of layout calculation increases exponentially, consuming a large amount of processor time, thereby affecting the efficiency of responding to user operations. In addition, rendering the knowledge graph requires drawing a large number of nodes and edges, which will occupy a large amount of browser memory. When the number of graphical elements is too large, the rendering performance of the browser will be severely affected, resulting in lag or even crash. In addition, the drawing process also needs to handle the style, color, interactive effect, etc. of the graph, further increasing the complexity and time consumption of rendering.
[0055] Fourthly, due to the limitation of the performance of the client computer, the rendering calculation of the knowledge graph under large-scale data is huge, which may cause the processor to reach the saturation state, resulting in slow response of the browser, or even no response. In addition, the available memory of the client is limited, and various objects, textures, etc. generated during the rendering process of the knowledge graph data under large-scale data need to occupy memory. When the memory occupation exceeds the memory limit, memory overflow occurs, causing the page to crash.
[0056] In the related art, the knowledge graph data is compressed on the server side, and then decompressed on the client side, which can speed up the network transmission, but requires a lot of time to wait for the transmission and decompression of the data compression package, and the user experience is poor. Or distribute the knowledge graph data to the content distribution network, get the data from the node closest to the user and send it to the client of the user, which highly depends on the related services of the content distribution network and requires high basic equipment, which cannot be widely applied. Or use the acceleration function of the browser to improve the rendering capability, but this method requires high hardware equipment or software of the client, which also cannot be widely applied.
[0057] Therefore, the present disclosure provides a knowledge graph rendering method, device, equipment and product under large-scale data to solve the above technical problems.
[0058] The embodiments of the present disclosure are further explained and described below with reference to the accompanying drawings.
[0059] Figure 1 is a flowchart of a knowledge graph rendering method under large-scale data according to an exemplary embodiment of the present disclosure, referring to Figure 1 The knowledge graph rendering method can include the following steps:
[0060] S101: In response to the knowledge graph display operation at the client, data is queried in the data block corresponding to the target knowledge graph, and node data for rendering is obtained.
[0061] The data block is obtained by dividing the target knowledge graph according to an ontology structure of the target knowledge graph, and each node data in the data block corresponds to a same entity type in the ontology structure.
[0062] It should be noted that the large-scale data refers to data with a data amount greater than a preset data amount threshold, for example, a data amount of millions, a data amount of tens of millions, a data amount of hundreds of millions, or a data amount of trillions, and the present disclosure does not limit this.
[0063] In a possible manner, the data block is obtained by the following manner: determining the ontology structure of the target knowledge graph and the entity types included in the ontology structure, and taking the entity type with the largest range in the ontology structure as an initial target entity type, and performing the following process: dividing every third number of data belonging to the target entity type in the target knowledge graph into a data block according to data creation time, until the data belonging to the target entity type is completely divided into data blocks, taking the next entity type connected to the target entity type in the ontology structure as a new target entity type, and until the data in the target knowledge graph is completely divided into data blocks.
[0064] In this embodiment, the ontology structure of the knowledge graph is used to define the framework structure of the knowledge graph. Taking a professional course knowledge graph as an example, the ontology structure can include a professional entity type, the professional entity type includes a professional direction entity type, the professional direction entity type includes a course entity type, and the course entity type includes a knowledge point entity type. The actual business scenario can be defined according to actual business scenarios, and the present disclosure does not limit this.
[0065] Of course, the knowledge graph can be the above-mentioned professional course knowledge graph, and can also be a knowledge graph of other business scenarios, and the present disclosure does not limit this.
[0066] For example, taking the above-mentioned professional course knowledge graph as an example, first, the data of the professional entity type is sorted according to data creation time, and the first number of professional entity type data is divided into a first data block, and the remaining professional entity type data is further divided into a second data block, and so on, until the data of the professional entity type is completely divided into data blocks, and the subsequent professional direction entity type is further divided into data blocks, and the present disclosure does not limit this.
[0067] As Figure 2As shown, the data of the knowledge graph under large-scale data can be stored in blocks in advance according to certain rules, so that when the target knowledge graph is rendered subsequently, the corresponding node data can be obtained from the corresponding data block as needed, avoiding loading all node data of the knowledge graph under large-scale data at one time, improving the query efficiency of node data and the data transmission efficiency from the server to the client, and ensuring the integrity of the node data required for rendering the target knowledge graph even in the case of low network bandwidth. The blocking rule can be blocking according to different functional modules and different entity types of business, which can be set according to requirements, and the present disclosure does not limit this.
[0068] S102: Determine the layout information of the node data.
[0069] The layout information at least represents the position of the node corresponding to the node data in the client display interface.
[0070] For example, as shown, after obtaining the node data as needed, the node data can be summarized and the layout information of the node data can be calculated, such as determining the coordinates of the display position of the node in the client display interface, and the association clustering statistics between different node data corresponding nodes, etc. The specific setting can be according to requirements, and the present disclosure does not limit this. Figure 2
[0071] S103: Determine the entity type of the data block to which the node data belongs as the entity type of the node data, and determine the rendering priority of the node data according to the entity type of the node data, the connection relationship between the entity types in the ontology structure, and the preset rendering priority.
[0072] The preset rendering priority is used to represent the rendering priority of the first specific entity type and the second specific entity type with a specific connection relationship.
[0073] In a possible manner, the preset rendering priority is obtained by configuring the following way: in the client display configuration page, the ontology structure of the target knowledge graph and the preset configuration item are displayed in the configuration page, the preset configuration item includes a first configuration item for configuring the first specific entity type, a second configuration item for configuring the second specific entity type, a third configuration item for configuring the specific connection relationship between the first specific entity type and the second specific entity type, and a fourth configuration item for configuring the rendering priority; in response to the configuration operation of the preset configuration item in the configuration page, the preset rendering priority is obtained.
[0074] In this embodiment, as shown, the rendering priority of the node data is determined according to the entity type of the data block to which the node data belongs, the connection relationship between the entity types in the ontology structure, and the preset rendering priority. Figure 3 As shown, a client displays a configuration page, on which an ontology structure of a knowledge graph can be created, and a connection relationship between different entity types can be created, and a rendering priority of different entity types can be configured, and the like, and the present disclosure does not limit this.
[0075] For example, the connection relationship and the rendering priority between any two entity types can be configured. For example, a first specific entity type can be selected by a drop-down menu in a first configuration item, a second specific entity type can be selected by a drop-down menu in a second configuration item, and a connection relationship between the two can be set in a third configuration item, and then a corresponding rendering priority can be set in a fourth configuration item. As shown by a solid line x1 in FIG. 8, the corresponding configuration between the selected entity type nodes can be displayed, and then as shown by a solid line x2 in FIG. 8, specific information of the connection relationship between the two can be displayed, including a relationship name and a relationship priority, wherein the relationship priority is the rendering priority, which can be set according to requirements, and the present disclosure does not limit this. Figure 3 Figure 3
[0076] For example, the entity type corresponding to node data A is the professional direction entity type in FIG. 8, and the entity type corresponding to node data B is the course entity type in FIG. 8. For example, the relationship priority between the professional direction entity type and the major entity type is set to be higher than the relationship priority between the professional direction entity type and the course entity type, and then the rendering priority of node data A is higher than the rendering priority of node data B. Thus, when rendering the knowledge graph, the node data can be gradually rendered according to the rendering priority of the node data. Figure 3 Figure 3 For example, the rendering priority of an entity type with high importance can be set to a high priority, and the rendering priority of an entity type with low importance can be set to a low priority. In this way, the node data with high importance can be rendered first, which facilitates the user to be first shown the node data with high importance, and subsequently the node data with low importance is gradually rendered. This not only improves the page response speed and avoids page blanking, but also helps the user to quickly obtain important knowledge and improves the user experience.
[0077] In addition, the node data with the same priority can be rendered in batches according to a certain number, which can be set according to requirements, and the present disclosure does not limit this.
[0078] By grading and block storage of the knowledge graph data under large-scale data, the data nodes of the knowledge graph under large-scale data can be subsequently queried and rendered in layers, which simplifies the rendering complexity and improves the rendering efficiency of the knowledge graph under large-scale data.
[0079]
[0080] S104: render the node data according to at least the layout information, the entity type, and the rendering priority of the node data, to obtain a target knowledge graph.
[0081] By using the method, without querying all node data of the knowledge graph under large-scale data and rendering the graph at one time, but querying the node data on demand in the data block corresponding to the target knowledge graph and rendering the graph, the memory pressure of the client can be reduced, the query speed of the node data and the rendering speed of the knowledge graph under large-scale data can be improved, the page loading speed is improved, and page crashes are avoided. In addition, the node data can be rendered step by step according to the rendering priority, the page response speed is improved, page blanking is avoided, the user experience is improved, and the knowledge retrieval efficiency is improved when the knowledge graph after rendering is used for knowledge retrieval.
[0082] In this embodiment, since part of the knowledge graph in the knowledge graph under large-scale data is queried and rendered on demand, the amount of data is greatly reduced, and even if different types of node data are integrated and processed, the required computing overhead is small, and the complexity of subsequent data query and reasoning is reduced. In the process of query and reasoning, a large number of nodes do not need to be traversed, the rule-based or statistical query and reasoning algorithm can be efficiently run, the amount of calculation is reduced, and the query and reasoning speed is improved. In addition, the distributed system storage and computing architecture is not needed, the performance of query and reasoning is further improved, and the algorithm does not depend on additional hardware or software optimization, which is convenient for popularization and application.
[0083] In a possible manner, rendering the node data according to at least the layout information, the entity type, and the rendering priority of the node data, to obtain a target knowledge graph, includes: according to the layout information and the rendering priority corresponding to the node data, the node data is drawn as a canvas element to obtain a knowledge graph node corresponding to the node data; in response to completion of the node data drawing, according to the entity type and the rendering priority of the node data, edges between the knowledge graph nodes are rendered, and according to the interactive event associated with the node data, scalable vector elements and / or hypertext markup language elements are added to the knowledge graph nodes to obtain the target knowledge graph.
[0084] In this embodiment, the knowledge graph can be divided into different layers, such as a background layer, a node layer, an edge layer, etc., and the layers are rendered respectively, so that the graph layout of the knowledge graph can be rendered layer by layer, the page drawing efficiency is improved, the page response speed is improved, page blanking is avoided, and the user experience is improved.
[0085] For example, as shown in FIG. 6, the knowledge graph is divided into a background layer, a node layer, and an edge layer, and the layers are rendered respectively. Figure 4As shown, the node data can be rendered according to the position coordinates of the node data in the page in order from high to low according to the rendering priority, to obtain the corresponding knowledge graph node. Then, the edges between the knowledge graph nodes are rendered in order from high to low according to the rendering priority, and the rendering can also be performed according to the entity type, for example, the node style and edge style of different entity types are different, which can be set according to requirements, and the present disclosure does not limit this. By rendering the graph layout of the knowledge graph in layers, the page drawing efficiency can be improved, and then the page loading efficiency is improved, avoiding page lag or crash. In addition, when the rendered knowledge graph is used for knowledge retrieval, the knowledge retrieval efficiency can be improved.
[0086] For example, for a page element that needs to be interacted, for example, a knowledge graph node corresponding to node data associated with an interaction event, a scalable vector element and / or a hypertext markup language element can be added to the knowledge graph node to realize the node interaction function, thereby obtaining a target knowledge graph with an interaction event.
[0087] Since the user usually browses the knowledge graph first and then interacts with the page, by rendering the nodes and edges of the knowledge graph first and then rendering the interaction events of the nodes, the user can quickly obtain the graph content of the knowledge graph, and the user can interact with the knowledge graph conveniently.
[0088] In a possible manner, the node data is multiple, and the node data is rendered according to at least the layout information, the entity type and the rendering priority of the node data to obtain a target knowledge graph, including: storing the multiple node data in a processing queue according to the reading order of the multiple node data; reading a first number of node data from the processing queue according to the storage order of the multiple node data, and rendering and processing the first number of node data by a first number of working processes respectively, wherein the rendering and processing is used to render and process the node data according to at least the layout information, the entity type and the rendering priority of the node data; in response to a target working process in the first number of working processes completing the rendering and processing of a node data, a new node data is read from the processing queue again, and the new node data is rendered and processed by the target working process until all the node data in the processing queue is rendered and processed to obtain the target knowledge graph.
[0089] For example, the node data is multiple, especially when rendering and processing the knowledge graph under large-scale data, a large amount of rendering time is required, therefore, as shown, the multiple node data can be rendered and processed in parallel by multiple working processes. Figure 2 The first number can be set according to requirements, and the present disclosure does not limit this.
[0090] Assuming that the number of work processes is N, N is a positive integer, a plurality of node data can be stored in a processing queue according to the reading order, and then N node data are read from the processing queue according to the storage order of the node data, so that the N node data are rendered by N work processes in parallel. Further, if a work process completes the rendering of a node data, a new node data is read from the processing queue for rendering until all node data in the processing queue are rendered to obtain the target knowledge graph. By performing parallel rendering of the graph through multiple processes, the rendering efficiency of the graph can be improved, thereby improving the page loading speed and avoiding page crashes, and when knowledge retrieval is performed on the rendered knowledge graph, the knowledge retrieval efficiency can be improved.
[0091] In a possible manner, in response to a knowledge graph display operation at the client, data is queried in the data block corresponding to the target knowledge graph to obtain node data for rendering, including: in response to a display operation of at least one node in the target knowledge graph at the client, determining a node data identifier corresponding to the at least one node, and sending the node data identifier to the server, wherein the server stores the data block corresponding to the target knowledge graph, the server is configured to query data in the data block corresponding to the target knowledge graph according to the node data identifier to obtain node data for rendering, and determine layout information of the node data, and send the node data and the layout information to the client; receiving the node data for rendering sent by the server. Determining the layout information of the node data includes: receiving the layout information of the node data sent by the server.
[0092] In this embodiment, one or more nodes to be displayed can be determined, for example, one or more nodes in an existing knowledge graph can be triggered as nodes to be displayed, or the nodes to be displayed can be determined through a search operation or a configuration operation, etc., and the present disclosure does not limit this.
[0093] For example, as shown in Figure 5 , the target knowledge graph to be displayed can be determined by configuring configuration items such as display range, query condition, filtering condition, etc., so as to determine the graph nodes to be queried, and the configuration page can be displayed by responding to a trigger operation of a query control of a knowledge graph display page, such as the control 61 in Figure 6 . The specific display range, query condition and filtering condition can be set according to requirements, for example, the display range is a certain entity type, the query condition is a certain entity attribute, and the filtering condition is to filter individual nodes, etc., and the present disclosure does not limit this. Thus, the corresponding knowledge graph can be displayed according to the user's requirements, and the user experience is improved.
[0094] For example, the node data corresponding to the node to be displayed is identified and sent to the server, the server queries the corresponding node data from the corresponding data block based on the node data identifier, and returns the node data to the client. Compared with the method of transmitting all the node data of the complete knowledge graph to the client and then querying the node data of the node to be displayed by the client, the network transmission pressure between the server and the client can be reduced, and the data query and data processing pressure of the client can be reduced.
[0095] Furthermore, the server can also perform layout calculation of the node data, such as display position of the node on the client page, aggregated statistics of node relationship, etc., and return the layout information of the node data to the client, so that the client can directly perform rendering according to the layout information, thereby further reducing the calculation pressure of the client.
[0096] It should be understood that the processing capability and available memory of the processor of the client are limited, while the rendering calculation amount of the knowledge graph under large-scale data is huge and requires a large amount of memory. By performing the query of the node data and the calculation of the layout information of the server, the data processing pressure and memory pressure of the client can be reduced, thereby improving the page rendering speed, further improving the page response speed, and avoiding the situation of no response such as blank page. In addition, it can also prevent memory overflow and avoid the situation of page crash.
[0097] In the embodiment, when querying the node data, the server can query the node data corresponding to the node data identifier, and can also continue to query the node data associated with the node data corresponding to the node data identifier and return it to the client according to the requirements, such as the node data of the next hop or the node data of the next two hops of the node data corresponding to the node data identifier, etc. The specific setting can be made according to the requirements, and the present disclosure does not limit it. The node data corresponding to the node data identifier and other node data associated therewith can be displayed to the user, and the data integrity for subsequent data query and reasoning is also ensured.
[0098] In a possible manner, in response to a knowledge graph display operation on the client, data is queried in a data block corresponding to a target knowledge graph to obtain node data for rendering, including: displaying the target knowledge graph and a filtering input box on the client, wherein the filtering input box is used to filter nodes in the target knowledge graph for display; in response to an input operation in the filtering input box, determining a filtering keyword corresponding to the input operation; querying first node data of which the node name includes the filtering keyword and second node data having a second number of hop connection relationships with the first node data in the data block corresponding to the target knowledge graph to obtain node data for rendering.
[0099] For example, as Figure 6As shown, the target knowledge graph and a filtering input box can be displayed on the client, and the nodes in the target knowledge graph are displayed according to the layout information, for example, the clustering effects between different nodes are different, so as to intuitively reflect the closeness of the association relationship between the nodes. In addition, Figure 6 Q1 and Q2 in the formula represent the number of nodes currently displayed, which is a positive integer.
[0100] For example, in response to an input operation in the filtering input box, a corresponding filtering keyword is determined, for example Figure 6 "P" in the formula, so that the first node data whose node name includes "P" and the second node data having a second number of hop connection relationships can be queried from the data block corresponding to the target knowledge graph, where the second number can be set according to requirements, and the present disclosure does not limit this. The process can be performed by the server, and the present disclosure does not limit this.
[0101] In the present embodiment, Figure 6 The number of nodes displayed in the target knowledge graph shown is limited, for example, only a certain node and the next hop node of the certain node can be displayed. When a user queries a certain node, the user can continue to drill down to display other nodes associated with the certain node, so as to facilitate the user to obtain node information of other nodes related to the certain node, and also facilitate data query and reasoning in combination with the certain node and the associated nodes of the certain node.
[0102] For example, the nodes corresponding to the first node data and the second node data can not exist in the original knowledge graph, or the association relationship between the nodes corresponding to the first node data and the second node data or the clustering effect of the page is different from that of the original knowledge graph. Therefore, it is necessary to recalculate the layout information of the first node data and the second node data, and to re-render the graph according to the first node data and the second node data and the corresponding layout information, to obtain a new knowledge graph as shown in Figure 6 so as to intuitively show the node information of the newly acquired nodes and the associated nodes of the nodes to the user, and the association relationship between the nodes.
[0103] It should be understood that, in addition to the search operation requiring reacquisition of node data and layout calculation, for example, when the mouse is dragged to zoom in or out of the knowledge graph to display a new knowledge graph, the node data can also be reacquired and layout calculation can also be performed, for example, the user zooms in on the node P shown in Figure 6 then the node data associated with the node P is gradually acquired and layout calculation is performed again, and then the node data related to the node P is re-rendered. Since all the node data of the knowledge graph is not acquired, it is equivalent to zooming in or out of the subgraph, so the amount of data to be processed is greatly reduced, which can ensure that the page does not freeze during operation, and in the process of zooming in or out of the knowledge graph, the default scaling ratio of the graph can be adapted, so that the global graph is clear and visible.
[0104] In a possible manner, the knowledge graph rendering method under large-scale data further includes: in response to a detail viewing operation on the target knowledge graph, displaying a data list corresponding to the target knowledge graph, wherein the client displays a fourth number of rows of data in the data list, and the fourth number of rows of data is rendered and displayed by a fifth number of document object model elements; in response to a sliding operation on the data list, determining, according to a sliding distance and a sliding direction corresponding to the sliding operation, first data to be displayed in the data list and second data that is not slid away in the fourth number of rows of data; and rendering the first data and the second data based on the fifth number of document object model elements, to display new fourth number of rows of data on the display screen of the client.
[0105] As shown in Figure 7 , the list display of the knowledge graph can be implemented based on the document object model elements, for example, the detail information of the target knowledge graph can be displayed in the form of a list. It should be understood that, due to the performance limitation of the client, the more the document object model elements for page rendering, the slower the rendering speed. A fixed number of document object model elements can be set to implement graph rendering according to user demand and performance limitation, so as to avoid too many document object model elements for rendering, and thus improve the page rendering speed. The fifth number can be set according to demand, and the present disclosure does not limit this.
[0106] For example, as shown in Figure 7 , assuming that the data list includes Y rows of data, and the number of document object model elements can render X rows of data, wherein Y is greater than X, and X and Y are positive integers, X rows of data can be fixedly rendered in the page, in response to a sliding operation on the data list, first data to be displayed and second data that is not slid away in the originally displayed X rows of data are determined, and then the first data and the second data are rendered based on the fifth number of document object model elements, that is, the page is re-rendered, so that new X rows of data are displayed on the display screen of the client. Thus, the display of large-scale data in a limited number of document object model elements is realized, and the performance limitation of the client is avoided, and the page rendering performance is improved.
[0107] In other possible implementations, the network requests sent by the client to the server can be optimized, for example, a reasonable request number limit can be set according to the performance of the client and the network performance, and the network requests for requesting a small number of node data are combined, so as to reduce the request times and reduce the additional overhead of each request.
[0108] In other possible implementations, a data caching strategy can also be set, for example, requested node data is cached at the client, and a certain caching time is set. If the node data is not updated after the expiration, the node data is processed with a delay, for example, the data validity period of the node data is increased. In this way, when the user requests the node data again, the node data can be obtained locally, avoiding repeated requests to the server, reducing the number of requests, and improving the query efficiency of the node data and the rendering efficiency of the graph, thereby improving the performance of data query and reasoning.
[0109] In addition, when rendering a knowledge graph under large-scale data, some unnecessary node information and interaction capabilities can be omitted to further improve the graph rendering efficiency and avoid page blanking or crashes. For example, based on historical interaction information, node information and interaction capabilities that are not frequently used can be optimized. The specific setting is not limited by the present disclosure.
[0110] Based on the same concept, the present disclosure also provides a knowledge graph rendering device under large-scale data, as shown in Figure 8 The knowledge graph rendering device 800 can include:
[0111] The query module 801 is configured to perform data query in a data block corresponding to a target knowledge graph in response to a knowledge graph display operation on a client, to obtain node data for rendering. The data block is obtained by dividing the target knowledge graph according to an ontology structure of the target knowledge graph, and each node data in the data block corresponds to a same entity type in the ontology structure.
[0112] The first determination module 802 is configured to determine layout information of the node data, wherein the layout information at least represents a position of a node corresponding to the node data in a display interface of the client.
[0113] The second determination module 803 is configured to determine an entity type of a data block to which the node data belongs as an entity type of the node data, and determine a rendering priority of the node data according to the entity type of the node data, a connection relationship between entity types in the ontology structure, and a preset rendering priority. The preset rendering priority is used to represent a rendering priority of a first specific entity type and a second specific entity type with a specific connection relationship.
[0114] The rendering module 804 is configured to render the node data according to at least the layout information, the entity type, and the rendering priority of the node data, to obtain the target knowledge graph.
[0115] Optionally, the rendering module 804 is configured to:
[0116] According to the layout information corresponding to the node data and the rendering priority, the node data is drawn as a canvas element to obtain a knowledge graph node corresponding to the node data.
[0117] In response to completion of drawing of the node data, edges between the knowledge graph nodes are rendered according to the entity type of the node data and the rendering priority, and scalable vector elements and / or hypertext markup language elements are added to the knowledge graph nodes according to the interactive event associated with the node data, to obtain the target knowledge graph.
[0118] Optionally, the node data is multiple, and the rendering module 804 is configured to:
[0119] According to the reading order of the multiple node data, the multiple node data is stored in a processing queue;
[0120] According to the storage order of the multiple node data, a first number of node data is read from the processing queue, and the first number of node data is rendered by the first number of working processes respectively, wherein the rendering processing is used to render the node data according to at least the layout information, the entity type and the rendering priority of the node data;
[0121] In response to completion of rendering processing of a node data by a target working process in the first number of working processes, a new node data is read from the processing queue again, and the new node data is rendered by the target working process until all node data in the processing queue is rendered to obtain the target knowledge graph.
[0122] Optionally, the query module 801 is configured to:
[0123] In response to a display operation of at least one node in the target knowledge graph on the client side, a node data identifier corresponding to the at least one node is determined, and the node data identifier is sent to the server, wherein the server stores a data block corresponding to the target knowledge graph, the server is configured to perform data query in the data block corresponding to the target knowledge graph according to the node data identifier to obtain node data for rendering, and determine layout information of the node data, and send the node data and the layout information to the client;
[0124] The node data for rendering sent by the server is received.
[0125] The first determination module 802 is configured to:
[0126] The layout information of the node data sent by the server is received.
[0127] Optionally, the query module 801 is configured to:
[0128] display the target knowledge graph and a filtering input box on the client, wherein the filtering input box is configured to filter nodes in the target knowledge graph for display;
[0129] in response to an input operation in the filtering input box, determine a filtering keyword corresponding to the input operation;
[0130] query, in the data block corresponding to the target knowledge graph, first node data including a node name including the filtering keyword and second node data having a second number of hop connection relationships with the first node data, to obtain node data for rendering.
[0131] Optionally, the data block is obtained by the following method:
[0132] determine an ontology structure of the target knowledge graph and entity types included in the ontology structure, and take an entity type with the largest range in the ontology structure as an initial target entity type, and perform the following process:
[0133] divide every third number of data belonging to the target entity type in the target knowledge graph into a data block according to data creation time, until the data belonging to the target entity type is completely divided into data blocks, take a next entity type connected to the target entity type in the ontology structure as a new target entity type, until the data in the target knowledge graph is completely divided into data blocks.
[0134] Optionally, the knowledge graph rendering apparatus 800 further includes a viewing module, and the viewing module is configured to:
[0135] in response to a detail viewing operation on the target knowledge graph, display a data list corresponding to the target knowledge graph, wherein the client displays a fourth number of rows of data in the data list, and the fourth number of rows of data are rendered and displayed by a fifth number of document object model elements;
[0136] in response to a sliding operation on the data list, determine, according to a sliding distance and a sliding direction corresponding to the sliding operation, first data to be displayed in the data list and second data in the fourth number of rows of data that is not slid away;
[0137] render the first data and the second data based on the fifth number of document object model elements, to display new fourth number of rows of data on the display screen of the client.
[0138] Optionally, the preset rendering priority is configured by the following way.
[0139] displaying a configuration page in the client, wherein the configuration page displays an ontology structure of the target knowledge graph and preset configuration items, the preset configuration items including a first configuration item for configuring a first specific entity type, a second configuration item for configuring a second specific entity type, a third configuration item for configuring a specific connection relationship between the first specific entity type and the second specific entity type, and a fourth configuration item for configuring a rendering priority;
[0140] obtaining the preset rendering priority in response to configuration operations on the preset configuration items in the configuration page respectively.
[0141] Based on the same idea, the embodiments of the present disclosure further provide a computer readable medium having a computer program stored thereon, which is executed by a processing device to implement the steps of any of the above knowledge graph rendering methods under large-scale data.
[0142] Based on the same idea, the embodiments of the present disclosure further provide an electronic device, which can include:
[0143] a storage device having a computer program stored thereon;
[0144] a processing device configured to execute the computer program in the storage device to implement the steps of any of the above knowledge graph rendering methods under large-scale data.
[0145] Based on the same idea, the embodiments of the present disclosure further provide a computer program product including a computer program, which is executed by a processor to implement the steps of any of the above knowledge graph rendering methods under large-scale data.
[0146] Reference will now be made to the following description Figure 9 , which shows a structural schematic diagram of an electronic device 900 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Personal Computers), PMPs (Portable Multimedia Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, as well as fixed terminals such as digital TVs, desktop computers, and the like. Figure 9 The electronic device shown is only an example and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.
[0147] As Figure 9As shown, the electronic device 900 can include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901 that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 902 or loaded into a random access memory (RAM) 903 from a storage device 908. Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0148] Generally, the following devices can be connected to the I / O interface 905: input devices 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 908 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 909. The communication devices 909 can allow the electronic device 900 to communicate wirelessly or wired with other devices to exchange data. Although Figure 9 The electronic device 900 is shown with various devices, but it should be understood that not all of the shown devices are required to be implemented or present. More or fewer devices can alternatively be implemented or present.
[0149] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication devices 909, or installed from the storage devices 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above-described functions defined in the methods of embodiments of the present disclosure are performed.
[0150] It is noted that the aforementioned computer-readable medium of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium can be, for example and without limitation, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a computer-readable program code transmitted by a computer-readable storage medium or carried by a carrier wave in a baseband or as part of a carrier wave. Such a propagated computer-readable signal medium can take various forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium that can be used to carry or store a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to wire, cable, RF (radio frequency), or the like, or any suitable combination of the foregoing.
[0151] In some embodiments, communication can be conducted using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
[0152] The aforementioned computer-readable medium can be included in the aforementioned electronic device; or can exist separately from the electronic device without being incorporated into the electronic device.
[0153] The computer readable medium described above carries one or more programs, when the one or more programs are executed by the electronic device, cause the electronic device to: in response to a knowledge graph display operation of a client, perform data query in a data block corresponding to a target knowledge graph, to obtain node data for rendering, wherein the data block is obtained by dividing the target knowledge graph according to an ontology structure of the target knowledge graph, and each node data in a data block corresponds to a same entity type in the ontology structure; determine layout information of the node data, wherein the layout information at least represents a position of a node corresponding to the node data in a display interface of the client; determine an entity type of a data block to which the node data belongs as an entity type of the node data, and determine a rendering priority of the node data according to the entity type of the node data, a connection relationship between entity types in the ontology structure, and a preset rendering priority, wherein the preset rendering priority is used to represent a rendering priority of a first specific entity type and a second specific entity type having a specific connection relationship; and render the node data according to at least the layout information, the entity type, and the rendering priority of the node data, to obtain the target knowledge graph.
[0154] Computer program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0155] The computer program product of the first aspect can include one or more non-transitory computer-readable media storing instructions that, when executed, cause one or more processors to perform the operations of the method of the first aspect. The computer program product of the first aspect can include a computer-readable medium storing instructions that, when executed, cause one or more processors to perform the operations of the method of the first aspect.
[0156] The modules involved in the embodiments of the present disclosure can be implemented in the form of software or in the form of hardware. In some cases, the name of the module does not constitute a limitation on the module itself.
[0157] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, non-limiting, exemplary types of hardware logic components that can be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system on a chip (SOCs), complex programmable logic devices (CPLDs), etc.
[0158] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable storage media can include, without limitation, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media can include one or more lines of electrical wire, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0159] The above description merely illustrates the preferred embodiment of the disclosure and a principle of applied technologies. It should be understood by those skilled in the art that the disclosed range of the disclosure is not limited to the technical solutions formed by the specific combinations of the technical features described above, and should also cover other technical solutions formed by the combinations of the technical features described above or their equivalent features without departing from the disclosed concept. For example, the technical solutions formed by the mutual replacement of the above-described features and the technical features with similar functions disclosed in the disclosure (but not limited to) can be formed.
[0160] Furthermore, although operations are depicted in a particular, sequential order, this should not be understood as requiring or implying that the operations are performed in the order illustrated or sequentially. In certain circumstances, multitasking and parallel processing can be advantageous. Likewise, although specific implementation details are contained in the above discussion, these should not be construed as limiting the scope of the disclosure. Certain features described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable sub-combination.
[0161] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely illustrative of the example forms of implementing the claims. As to the means for performing the operations of the apparatus in the above-described embodiments, the specific manner in which the various modules perform the operations has been described in detail in the embodiments related to the method, and will not be described here in detail.
Claims
1. A method for rendering a knowledge graph under large-scale data, characterized in that, The knowledge graph rendering method comprises: In response to a knowledge graph display operation on the client, data is queried in a data block corresponding to a target knowledge graph to obtain node data for rendering, wherein the data block is obtained by dividing the target knowledge graph according to an ontology structure of the target knowledge graph, and each node data in the data block corresponds to a same entity type in the ontology structure; Layout information of the node data is determined, wherein the layout information at least represents a position of a node corresponding to the node data in a display interface of the client; An entity type of a data block to which the node data belongs is determined as an entity type of the node data, and a rendering priority of the node data is determined according to the entity type of the node data, a connection relationship between entity types in the ontology structure, and a preset rendering priority, wherein the preset rendering priority is used to represent a rendering priority of a first specific entity type and a second specific entity type having a specific connection relationship; The node data is rendered according to at least the layout information, the entity type, and the rendering priority of the node data to obtain the target knowledge graph; The data block is obtained by the following method: An ontology structure of the target knowledge graph and entity types included in the ontology structure are determined, and a largest-range entity type in the ontology structure is taken as an initial target entity type, and the following process is performed: Every third number of data belonging to the target entity type in the target knowledge graph is divided into a data block according to data creation time until the data belonging to the target entity type is completely divided into data blocks, a next entity type connected with the target entity type in the ontology structure is taken as a new target entity type until the data in the target knowledge graph is completely divided into data blocks; The data block corresponding to the target knowledge graph is stored in a server, and the method further comprises: The node data is cached in the client, and a data validity period corresponding to the node data is set, and the node data cached in the client is used to obtain the node data from the client for graph rendering when the node data is requested next time; In response to reaching the data validity period corresponding to the node data, the data validity period of the node data is increased in the case that the node data is not updated. 2.The method of claim 1, wherein, The rendering of the node data according to at least the layout information, the entity type, and the rendering priority of the node data to obtain the target knowledge graph comprises: According to the layout information and the rendering priority of the node data, the node data is drawn as a canvas element to obtain a knowledge graph node corresponding to the node data; In response to the node data being drawn, edges between the knowledge graph nodes are rendered according to the entity type and the rendering priority of the node data, and scalable vector elements and / or hypertext markup language elements are added to the knowledge graph nodes according to an interactive event associated with the node data to obtain the target knowledge graph. 3.The method of claim 1, wherein, The node data is multiple, and the node data is rendered according to at least the layout information, the entity type and the rendering priority of the node data, to obtain the target knowledge graph, comprising: According to the reading order of the plurality of node data, the plurality of node data is stored in the processing queue; According to the storage order of the plurality of node data, the first number of node data is read from the processing queue, and the first number of node data is rendered by the first number of working processes, respectively, wherein the rendering processing is used for rendering the node data according to at least the layout information, the entity type and the rendering priority of the node data; In response to the rendering processing of the target working process in the first number of working processes completing a node data, a new node data is read from the processing queue again, and the new node data is rendered by the target working process until the node data in the processing queue is rendered completely, and the target knowledge graph is obtained. 4.The method of claim 1, wherein, In response to the knowledge graph display operation on the client, data query is performed in the data block corresponding to the target knowledge graph to obtain node data for rendering, comprising: In response to the display operation of at least one node in the target knowledge graph on the client, the node data identifier corresponding to the at least one node is determined, and the node data identifier is sent to the server, wherein the server is used for querying data in the data block corresponding to the target knowledge graph according to the node data identifier to obtain node data for rendering, and determining the layout information of the node data, and sending the node data and the layout information to the client; Receiving the node data for rendering sent by the server; The determination of the layout information of the node data comprises: Receiving the layout information of the node data sent by the server. 5.The method of claim 1, wherein, In response to the knowledge graph display operation on the client, data query is performed in the data block corresponding to the target knowledge graph to obtain node data for rendering, comprising: Displaying the target knowledge graph and the filtering input box on the client, wherein the filtering input box is used for filtering the nodes in the target knowledge graph for display; In response to the input operation in the filtering input box, the filtering keyword corresponding to the input operation is determined; Querying the first node data whose node name includes the filtering keyword and the second node data having a second number of jump connection relationships with the first node data in the data block corresponding to the target knowledge graph to obtain node data for rendering.
6. The method of claim 1-5, wherein, The knowledge graph rendering method further comprises: In response to the detail viewing operation on the target knowledge graph, the data list corresponding to the target knowledge graph is displayed, wherein the fourth number of rows of data in the data list are displayed on the client, and the fourth number of rows of data are rendered and displayed by the fifth number of document object model elements; In response to the sliding operation on the data list, according to a sliding distance and a sliding direction corresponding to the sliding operation, first data to be displayed in the data list and second data not slid away in the fourth number of rows of data are determined; Based on the fifth number of document object model elements, the first data and the second data are rendered to display new fourth number of rows of data on a display screen of the client.
7. The method of claim 1-5, wherein, The preset rendering priority is configured in the following manner: A configuration page is displayed on the client, wherein the configuration page displays an ontology structure of the target knowledge graph and preset configuration items, the preset configuration items include a first configuration item for configuring a first specific entity type, a second configuration item for configuring a second specific entity type, a third configuration item for configuring a specific connection relationship between the first specific entity type and the second specific entity type, and a fourth configuration item for configuring a rendering priority; In response to a configuration operation on the preset configuration items in the configuration page, the preset rendering priority is obtained.
8. A knowledge graph rendering apparatus under large-scale data, characterized in that, The knowledge graph rendering apparatus includes: A query module configured to perform data query in a data block corresponding to a target knowledge graph in response to a knowledge graph display operation on a client, to obtain node data for rendering, wherein the data block is obtained by dividing the target knowledge graph according to an ontology structure of the target knowledge graph, and each node data in a data block corresponds to a same entity type in the ontology structure; A first determination module configured to determine layout information of the node data, wherein the layout information at least represents a position of a node corresponding to the node data in a display interface of the client; A second determination module configured to determine an entity type of a data block to which the node data belongs as an entity type of the node data, and determine a rendering priority of the node data according to the entity type of the node data, a connection relationship between entity types in the ontology structure, and a preset rendering priority, wherein the preset rendering priority represents a rendering priority of a first specific entity type and a second specific entity type having a specific connection relationship; A rendering module configured to render the node data according to at least the layout information, the entity type, and the rendering priority of the node data, to obtain the target knowledge graph; The data block is divided in the following manner: An ontology structure of the target knowledge graph and entity types included in the ontology structure are determined, and a largest-range entity type in the ontology structure is taken as an initial target entity type, and the following process is performed: According to data creation time, every third number of data belonging to the target entity type in the target knowledge graph is divided into a data block until data belonging to the target entity type is completely divided into data blocks, a next entity type connected to the target entity type in the ontology structure is taken as a new target entity type until data in the target knowledge graph is completely divided into data blocks; The data block corresponding to the target knowledge graph is stored in a server, and the device is further configured to: cache the node data in the client and set a data validity period corresponding to the node data, the node data cached in the client being used to obtain the node data from the client for graph rendering when the node data is requested next time; in response to the data validity period corresponding to the node data being reached, increase the data validity period of the node data in the case where the node data is not updated.
9. A computer readable medium having stored thereon a computer program, characterized in that, The computer program is executed by a processing device to implement the steps of the method of any one of claims 1-7.
10. An electronic device, comprising: comprising: a storage device having a computer program stored thereon; a processing device configured to execute the computer program in the storage device to implement the steps of the method of any one of claims 1-7.
11. A computer program product comprising a computer program, characterized in that, The computer program is executed by a processor to implement the steps of the method of any one of claims 1-7.
Citation Information
Patent Citations
Knowledge graph display method and device, computer device and readable storage medium
CN112035708A
Front-end rendering method and system of knowledge graph, electronic equipment and storage medium
CN112988950A