Method and apparatus for constructing industrial knowledge graph, and computer device
By adopting hexagonal grid layout and optimizing node placement algorithms in the knowledge graph, the overlap problem caused by node and edge allocation is solved, and a clearer and more intuitive display effect is achieved, improving the user experience.
Patent Information
- Application Number
- PCT/CN2023/102458
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2025-01-02
AI Technical Summary
The prior art shows serious overlap and occlusion due to the allocation problems of nodes and edges when displaying knowledge graphs, which affects the user experience, especially in a two-dimensional rectangular coordinate system, which is difficult to maintain the balance of the logical and visual layers of nodes.
Using a hexagonal grid layout to display the knowledge graph, by placing nodes in the hexagonal grid layout and using straight lines or polylines to represent the connection relationship between nodes, ensuring that the position between nodes is reasonable and sparse to reserve enough space, and optimizing the placement of nodes through calculations Position to avoid uneven layout.
It effectively avoids overlap and occlusion of nodes, improves the display effect of the knowledge graph, makes the user experience clearer and more intuitive, and the connection relationship between nodes is clearer.
Smart Images

Figure CN2023102458_02012025_PF_FP_ABST
Abstract
Description
Method, device, and computer equipment for constructing industrial knowledge graph Technical Field
[0001] The present application relates to the field of knowledge graphs, and specifically, to a method, apparatus, computer equipment, and storage medium for constructing an industrial knowledge graph. Background Art
[0002] Knowledge graphs have recently been a topic of widespread discussion in academia and industry. They demonstrate tremendous potential in a variety of functional applications, as well as significant advantages in interpretability: when presenting a program, an organization, or a collection of related data, the graph structure composed of nodes and edges naturally conveys logic, earning it high recognition from clients worldwide.
[0003] Summary of the Invention
[0004] This summary is provided to introduce some selected concepts in a simplified form, which will be further described in the detailed description below. This summary is not intended to identify any key features or essential features of the claimed subject matter, nor is it intended to be used to help determine the scope of the claimed subject matter.
[0005] Based on this, the present application provides a method for constructing an industrial knowledge graph, including: determining a hexagonal grid layout of the industrial knowledge graph, wherein in the hexagonal grid layout, a non-edge grid is surrounded by six grids, and the edges of the six grids constitute a regular hexagon; placing multiple nodes in the industrial knowledge graph at the center of each of the multiple grids in the hexagonal grid layout; based on the connection relationship between the multiple nodes, using a straight line or a broken line to display the connection between the multiple nodes.
[0006] Based on the above method, a hexagonal grid layout can be used to assist in the display of the industrial knowledge graph. Through straight lines or broken lines, the content of the industrial knowledge graph can be presented in a complete and clear manner, greatly improving the user experience when browsing the knowledge graph.
[0007] Furthermore, multiple nodes in the industrial knowledge graph are placed at the center of each of the multiple grids in the hexagonal grid layout, including: placing a first node in the first grid among the multiple grids; placing a second node in the second grid among the multiple grids, wherein the second grid is adjacent to the first grid; and sparseizing the second grid in which the second node is placed.
[0008] Through the above method, nodes can be effectively placed in the hexagonal grid layout, making the positions between nodes more reasonable, and after sparseness, sufficient space is reserved for subsequent connections between nodes.
[0009] Furthermore, placing the second node in the second grid among the multiple grids includes: selecting unoccupied second grids one by one to place the second node; and selecting the second grid to place the second node based on regional optimal selection.
[0010] Through the above method, the nodes connected to the core node can be placed one by one and reasonably in appropriate positions around the core node, making the layout and visual experience more balanced.
[0011] Furthermore, selecting the unoccupied second grids one by one to place the second node includes: calculating the sum of the distances between the unoccupied second grids and all grids where nodes have been placed; and selecting the unoccupied second grid where the sum of the distances is the minimum to place the second node.
[0012] Through the above method, the nodes can be placed as compactly as possible around the core node, avoiding excessive space reservation and making the overall structure more compact.
[0013] Furthermore, the second grid is selected optimally according to the area to place the second node, including: calculating the weight of the second grid within a predetermined range; the weight includes the shortest total logical distance and the shortest total graphic distance; according to the weight, the unoccupied second grid is selected to place the second node.
[0014] This approach allows for local adjustments to node positions, allowing nodes to find more locations closer to core nodes. This also prevents multiple nodes from being placed in the same direction as a core node, leading to an unbalanced layout.
[0015] Furthermore, using a straight line or a broken line to display the connection between the multiple nodes includes: using a straight line or a broken line with the shortest total logical distance, the least repeated coverage and the least number of inflection points to display the connection between the multiple nodes.
[0016] Through the above method, the connection relationship between nodes can be made clearer and more intuitive, and overlap can be reduced.
[0017] In addition, the present application also provides a display device for an industrial knowledge graph, including: a layout determination module for determining the hexagonal grid layout of the industrial knowledge graph, wherein in the hexagonal grid layout, the non-edge grid is surrounded by six grids, and the edges of the six grids constitute a regular hexagon; a node placement module for placing multiple nodes in the industrial knowledge graph at the center of each of the multiple grids in the hexagonal grid layout; a connection module for displaying the connection between the multiple nodes using a straight line or a broken line based on the connection relationship between the multiple nodes.
[0018] The present application also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the above method when executing the computer program.
[0019] The present application also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the above method when executed by a processor.
[0020] The present application also provides a computer program product, which is tangibly stored on a computer-readable medium and includes computer-executable instructions. When the computer-executable instructions are executed, at least one processor is caused to perform the method described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Implementations of the present disclosure are illustrated by way of example and not limitation in the figures of the accompanying drawings in which like references indicate the same or similar parts.
[0022] FIG1 is a schematic diagram of the process of a method for constructing an industrial knowledge graph according to one embodiment of the present application.
[0023] FIG2 is a schematic diagram of a display device for an industrial knowledge graph according to an embodiment of the present application.
[0024] FIG3 is a schematic diagram of a computer device for displaying an industrial knowledge graph according to an embodiment of the present application.
[0025] FIG4 is a display effect diagram of an industrial knowledge graph according to one embodiment of the present application.
[0026] FIG5 is a display effect diagram of an industrial knowledge graph according to one embodiment of the present application.
[0027] FIG6 is a display effect diagram of an industrial knowledge graph according to one embodiment of the present application.
[0028] FIG7 is a display effect diagram of an industrial knowledge graph according to one embodiment of the present application.
[0029] The accompanying drawings are numerals as follows:
[0030] Steps S101-S103
[0031] 200: Installation
[0032] 201: Module
[0033] 202: Module
[0034] 203: Module
[0035] 204: Module
[0036] 205: Module
[0037] 206: Module
[0038] 207: Module
[0039] 208: Module
[0040] 300: Computer equipment
[0041] 302: Processor
[0042] 304: Memory DETAILED DESCRIPTION
[0043] In the following description, for the purpose of explanation, a large number of specific details are set forth. However, it is understood that the present invention can be implemented without these specific details. In other examples, well-known circuits, structures, and technologies are not shown in detail so as not to affect the understanding of the description.
[0044] References throughout this specification to "an implementation," "an implementation," "an exemplary implementation," "some implementations," "various implementations," etc., indicate that the implementations of the invention being described may include particular features, structures, or characteristics. However, it does not imply that every implementation must include those particular features, structures, or characteristics. Furthermore, some implementations may have some, all, or none of the features described for other implementations.
[0045] In the following description, the terms "coupled" and "connected" and their derivatives may be used. It should be understood that these terms are not intended as synonyms for each other. Rather, in certain implementations, "connected" is used to indicate that two or more components are in direct physical or electrical contact with each other, while "coupled" is used to indicate that two or more components cooperate or interact with each other, but they may or may not be in direct physical or electrical contact. Figure 1 is a flow chart of a method for generating a component according to one embodiment of the present application.
[0046] It should be understood that although the various steps in the flowchart of FIG1 are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in FIG1 may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0047] To visually display a knowledge graph on a panel, the key issue is how to properly distribute its core elements: nodes and edges. Typically, this panel is 2D and orthogonally coordinated, and the XY coordinate system is shared by both the distributional calculation and visual layers. This creates a serious node overlapping problem, as each node must occupy an area larger than its distribution coordinates, which may obscure or cover the coordinates assigned to other nodes.
[0048] However, a knowledge graph presentation mechanism based on a hexagonal grid layout can perfectly circumvent this problem. By using an additional logical layer of hexagonal coordinates, not only can the area occupied by the nodes in the original visual layer be strictly maintained, but additional visual possibilities can also be realized. Therefore, this hexagonal grid structure can be widely used in various scenarios, such as advertising flyers, video clips, and strategy games.
[0049] In the above situation, the node deployment of the knowledge graph should be completed using hexagonal coordinates on the logical layer. In order to solve this problem, we have proposed a new and complete mechanism accordingly. It first analyzes and divides all the nodes to be assigned into several batches, and then gradually distributes them to the hexagonal panel through certain settings. After determining the positions of all nodes, the modified pathfinding algorithm uses the connection relationship (or connection line) to implement it in the form of a straight line or an obtuse broken line. The above-mentioned method proposed is theoretically applicable to all kinds of knowledge graph data, but is more suitable for situations where the number of elements is limited, because the final visual results tend to be compact.
[0050] Based on this, this application provides a method for constructing an industrial knowledge graph, wherein:
[0051] S101, determining a hexagonal grid layout of an industrial knowledge graph, wherein in the hexagonal grid layout, a non-edge grid is surrounded by six grids, and the edges of the six grids form a regular hexagon.
[0052] The embodiments of the present disclosure assist in displaying the industrial knowledge graph through a hexagonal grid layout, wherein the hexagonal grid layout includes a plurality of grids of equal size. A hexagon is a shape with stable geometric characteristics. In a hexagonal grid layout, a plurality of grids of the same size are arranged seamlessly. Furthermore, the hexagonal grid layout of the industrial knowledge graph, wherein in the hexagonal grid layout, the non-edge grids are surrounded by six grids. For each grid at the non-edge in the hexagonal grid layout, each grid will be completely surrounded by the six surrounding grids. It should be understood that the boundary line in the hexagonal grid layout logically exists, but it can be presented or hidden visually. In some embodiments, the hexagonal grid layout can correspond to a hexagonal grid logical coordinate system. Optionally, each grid in the hexagonal grid layout can be a hexagon, and the hexagon formed by the centers of the six grids is an equilateral hexagon. Each grid has the same shape and size. Each grid in the hexagonal grid layout is a hexagon, and the central grid is surrounded by six adjacent grids to form a regular hexagon, and the nodes in the industrial knowledge graph are located at the center of one or more of these six grids.
[0053] In some embodiments, all cells have the same shape and size; non-edge cells are closely adjacent to the six surrounding cells, with little or no gaps between them; the centers of the six adjacent cells form a hexagon, which can be equilateral or unequal. The hexagonal lattice layout can theoretically be expanded if the above conditions are met. In some embodiments, the number of cells in the hexagonal lattice layout is more than twice the number of nodes.
[0054] S102: Place multiple nodes in the industrial knowledge graph at the center of each of the multiple grids in the hexagonal grid layout.
[0055] The hexagonal grid layout includes multiple grids of equal size, and each node is located in the central area of the grid. The nodes are connected by edges or connecting lines based on semantic relationships. In some embodiments, the geometric center of the node coincides with the geometric center of the grid, and the size of the node must be smaller than the size of the grid to ensure that there is no overlap between different nodes. According to the industrial knowledge graph of the embodiment of the present disclosure, the semantics represented by the node include but are not limited to: industrial organizations, facilities, production lines, equipment, components, position numbers, signals, products, personnel, projects, projects, tasks, events and other entities, as well as abstract descriptions (such as fault phenomena, fault causes, solutions, etc.) or professional terms (technology, algorithms, operating steps, etc.) that describe specific industrial phenomena. According to the embodiment of the present disclosure, each node is located inside a grid in the hexagonal grid layout. A node will not occupy multiple grids, nor can it be located in an area outside the hexagonal grid layout. Two nodes will not be logically placed in the same grid, thereby ensuring that the nodes do not visually overlap and are not blocked, thereby improving the user experience. In some embodiments, adjacent nodes may be located in adjacent (neighboring) grids or in non-adjacent (non-adjacent) grids.
[0056] S103: Based on the connection relationship between the multiple nodes, use a straight line or a broken line to display the connection between the multiple nodes.
[0057] Based on the semantic relationships between multiple nodes, the following straight lines or broken lines are used to display the connection relationships between multiple nodes. For example, based on the semantic relationship between the nodes, a straight line or broken line can be used to connect two nodes in the industrial knowledge graph. Because the embodiments of the present disclosure can use multiple lines to display connection relationships, and the lengths of the lines can vary and the connection methods can also vary, there may be situations where the lines intersect.
[0058] In the embodiments of the present application, a hexagonal grid layout is used to assist in the display of the industrial knowledge graph. Each node is displayed at the center of each grid, and multiple optional lines are used to display the edges between nodes. This presents the content of the industrial knowledge graph in a complete and clear manner, greatly improving the user experience when browsing the knowledge graph. The hexagonal grid layout can be used to standardize the distribution of nodes in a specific view to avoid suboptimal visual effects.
[0059] Furthermore, multiple nodes in the industrial knowledge graph are placed at the center of each of the multiple grids in the hexagonal grid layout, including: placing a first node in the first grid among the multiple grids; placing a second node in the second grid among the multiple grids, wherein the second grid is adjacent to the first grid; and thinning out the second grid where the second node is placed. This method can effectively place nodes in the hexagonal grid layout, making the positions between nodes more reasonable, and after thinning out, leaving sufficient space for subsequent connections between nodes.
[0060] Specifically, first, all nodes that need to be connected are set into a separate set, so that the nodes will be divided into different sets according to the connection situation. For example, the total number of nodes is 50, of which 40 nodes have a mutual connection relationship, or have an edge (edge), becoming the first set, and the other 10 nodes have a connection relationship, naturally becoming the second set. Any node in the first set has no connection relationship with any node in the second set. Then, according to the number of nodes in the set, the sets are arranged in descending order. As in the example above, the first set is arranged before the second set because the number of nodes in the first set is greater than the number of nodes in the second set. As mentioned above, in some embodiments, the number of grids is twice the number of nodes (components). The above implementation method uses algorithmic language to describe lines 1-3 of the code corresponding to Table 1.
[0061] Then, for each set (corresponding to line 4 in the following code), the first node is selected and placed in the first grid. In other words, the first node is placed in the first grid among the multiple grids. The remaining nodes in the set are then divided into batches based on the number of hops from the first node. The different batches are then sorted in ascending order based on the number of hops. In other words, batches with fewer hops are sorted before batches with more hops. In other words, the fewer the hops, the closer the node is to the first node. Use algorithmic language to describe lines 5-7 of the code in Table 1 below.
[0062] The first node selected may be referred to as a core node. The first node may be selected by various methods, such as manually formulated rules, automatic calculation, or manual designation, to suit different application scenarios. Specifically, for example:
[0063] (1) Hub node: The node with the largest number of connections to other nodes is selected as the first node;
[0064] (2) Root node: The node with the minimum average number of hops to all other nodes;
[0065] (3) Central node: the node with the least number of batches;
[0066] (4) Focus node: a node directly searched by the user or specified by other operations;
[0067] (5) Random node: any node selected randomly.
[0068] In some embodiments, after a core node is selected, it will be placed in the most central empty grid on the initial panel and will be directly locked.
[0069] Furthermore, a second node is placed in the second grid among the multiple grids. The second node is the node divided into batches according to the core node, and is placed around the first grid in the order of the batches. The placement of the second node in the second grid among the multiple grids specifically includes: selecting the unoccupied second grids one by one to place the second node; and optimally selecting the second grid according to the area and placing the second node. In this way, the nodes connected to the core node can be placed one by one and reasonably in appropriate positions around the core node, which is more balanced in layout and visual perception. Use language algorithm to describe lines 8-12 of the code in Table 1.
[0070] Table 1
[0071] The process of selecting unoccupied second grids one by one to place the second node may also be referred to as greedy node distribution. An embodiment of a specific placement method is as follows:
[0072] First, it is defined that for any node in each batch, they all have a corresponding previously placed (completed) node set. This previously placed (completed) node set is a non-empty set, because this non-empty set has the first node that has been placed previously as an element of this non-empty set. And the nodes in the previously placed node set (or simply the placed nodes) must be connected to any node in the set that has not been placed just now. It should be emphasized that, in some embodiments, after the second node is placed in the second grid, the second grid will not be locked, that is, according to the regional distribution optimization, you can also change or select another second grid to re-place the second node.
[0073] Then, for each batch divided by the number of hops, the nodes are sorted within the batch according to the number of their own connections. Then, for each node, the grid occupied by its associated and already placed node is used as the anchor, and the adjacent empty grids of the anchor grid are used as candidate grids. There may be multiple candidate grids. Then, for each candidate grid, the logical distance between the candidate grid and each anchor grid (the grid occupied by the already placed node) is calculated, and the logical distances are added to obtain the total logical distance of the candidate grid. The candidate grid with the shortest total logical distance is then used as the second grid, or a temporary second grid, to place the second node. If there are multiple candidate grids with the same and shortest total logical distances, one is selected as the second grid or a temporary second grid. Finally, the already placed node can be included in the set of already placed nodes, prepared as the relevant anchor for the next unplaced node. To summarize the above description, selecting unoccupied second grids one by one to place the second node includes: calculating the sum of the distances between the second grid and all grids containing already placed nodes; and selecting the second grid with the smallest sum of these distances to place the second node therein. This approach allows nodes to be placed as compactly as possible around the core node, avoiding excessive space reservation and achieving a more compact overall layout. The specific algorithm language is described below:
[0074] Table 2
[0075] Furthermore, based on the optimal area, a second grid is further selected and the second node is placed, including: first, for each of the above-mentioned second nodes that have been placed, a search range of available grids can be set, or a search set of available grids. Each grid within the search range, regardless of whether it is occupied, is weighted. The weight calculation mainly includes two methods: (a) logical distance and (b) graphical distance; then the grid with the best weight is selected as the new placement position of the second node, or the new second grid. This will produce three situations:
[0076] 1. If the new position is the original position or the original grid, the second node does not need to be moved.
[0077] 2. If the new position is an unoccupied grid, the second node moves to this grid or this position;
[0078] 3. The new position is a position or grid already occupied by another node, but the occupied node is also a node that needs to be adjusted and moved through regional optimization. It can be called the second swapped node. That is, the position of the second swapped node is not locked. Then the two nodes are swapped in position or grid. Then the new weight of the second swapped node in the swapped position and the old weight of the original position are calculated. If the new weight is not worse than the old weight, or the new weight is better than the old weight, the result of this swapping operation is permanently retained. On the contrary, if the new weight is worse than the old weight, or the new weight is not as good as the old weight, the swap is canceled, the two nodes return to their original positions, and the three cases mentioned above are used again to find a new position for the second node.
[0079] If the number of grids is not particularly large or if the hardware computing power is sufficiently strong, the search range in the regional optimization can be all grids. However, to control computing costs or for other purposes, it is recommended that the distance between the search range and the original position be less than or equal to a certain threshold, for example, less than 2. The search range can include the original position of the original second node, but excludes the second grids previously locked by regional optimization.
[0080] Furthermore, the calculation or formula of the weight can be flexibly defined. However, in some embodiments, the specific calculation criteria are as follows:
[0081] 1. The total logical distance is the shortest, where the total logical distance is the sum of the logical distances to all anchor grids;
[0082] 2. The total graphic distance is the shortest;
[0083] 3. The graphic distance to the center of the hexagonal grid layout (center of the panel) is the shortest.
[0084] For example, as shown in Figure 4, (a) represents the logical distance and (b) represents the graphical distance. In (a), the logical distance between node a and node c is 2, and the logical distance between node b and node c is also 2. In (b), the graphical distance between node a and node c is The graph distance between nodes b and c is 3·r, where r is the distance from the center of the hexagon to any endpoint of the hexagon.
[0085] Furthermore, after processing all unlocked second nodes, the resulting layout is compared with the initial layout. If no second nodes move during this round of processing, the regional optimization process is exited. Otherwise, if a second node moves during this round, the next round of regional optimization is continued or triggered. To prevent some second nodes from simply swapping positions without essentially optimizing their positions, a threshold is set. After a certain number of rounds reaches a certain threshold, an exit is triggered.
[0086] To summarize the above description, optimally selecting the second grid to place the second node based on the region includes: calculating the weight of the second grid within a predetermined range; the weight includes the shortest total logical distance and the shortest total graphic distance; and selecting the second grid based on the weight and placing the second node. In this way, the position of the node can be locally adjusted, allowing the node to find more locations closer to the core node to place the node. This also avoids placing multiple nodes in the same direction of the core node, resulting in an unbalanced layout.
[0087] Furthermore, the second grid where the second node is placed is thinned out to reserve enough space for subsequent connections between nodes after thinning out. Specifically, the method includes:
[0088] After the positions of all second nodes are locked, the distance between the second grids needs to be expanded. The expansion can be understood as an equal-proportional magnification, and the relative positions and composition shapes of the second grids have not changed. In some embodiments, the hexagonal grid layout after thinning should have the same hexagonal coordinate system as the hexagonal grid layout before thinning. In other words, the position coordinates of all placed nodes, as well as the panel boundaries, are multiplied by a scaling coefficient (scaling coefficient) of an integer type greater than 1. The thinning process is also to reserve enough blank space when connecting lines between nodes later, so as to ensure visual clarity and intuitiveness. The specific algorithm language description is as shown in row 14 of Table 1 above. For example, as shown in Figure 5, (a) represents the panel layout before thinning, and (b) represents the panel layout after thinning, where the thinning scaling coefficient is 2.
[0089] Furthermore, the connections between the multiple nodes are displayed using a straight line or broken line with the shortest total logical distance, the least overlap, and the fewest inflection points. This approach makes the connection relationship between nodes clearer and more intuitive, and reduces overlap. For example, as shown in Figure 6, (b) is relatively the best choice because (b) has fewer inflection points or bends than (a) and less overlap than (c).
[0090] In some embodiments, determining which grids an edge or line between a pair of nodes should pass through is a classic pathfinding problem. Many established algorithms can be applied, such as Dijkstra's algorithm or the A* algorithm, where the logical distance between hexagonal grids can be used as the cost in the calculation. In terms of the final output, namely the shortest path, there is no significant difference between these algorithms. In this proposal, the A* algorithm is recommended.
[0091] Specifically, the following factors can be considered in the connection selection scheme: 1. The shortest total logical distance, which is a prerequisite; 2. Fewer overlapping parts; 3. Fewer inflection points; 4. When all three conditions are met, select any one.
[0092] In some embodiments, the "least overlap possible" will change dynamically based on other connection relationships or connection conditions. Therefore, similar to the "regional optimal" approach mentioned above, multiple rounds of processes and comparison processes will be applied to select the optimal connection. For example, in the first round, a simple shortest path is selected or applied without other selection schemes or selection factors. Then the overall overlapping status is calculated, and an optimization round with a selection scheme is initialized (count the overall overlapping status and initialize an optimization round with selection scheme activated). If the path or connection does not change during this process, the entire selection process is exited. Otherwise, another round of optimization is triggered. In some embodiments, a maximum number of round thresholds is also set to terminate the path or connection selection process.
[0093] In some embodiments, the knowledge graph deployment mechanism of the present application can be divided into two main stages: 1) node distribution is deployed in batches on a blank hexagonal panel; 2) the implementation of edges is an obtuse broken line based on a modified pathfinding algorithm. In theory, the input knowledge graph can be any valid shape or amount of data, but in some embodiments, according to the characteristics of the present application, it is recommended to keep it at a limited size. For example, less than 100 nodes. The definition of nodes, or connected components and hops in graph theory can refer to the general public understanding. In some embodiments of the present application, the size and shape of the input knowledge graph, and the number of connected components should be small, and in most cases, the input knowledge graph should be a connected graph itself.
[0094] In some embodiments, the implementation of the connection relationship using obtuse broken lines includes: after confirming the position of the panel and all nodes, the next step is to realize the connection so that the display of the knowledge graph is completed. Assuming that only straight lines are used to represent the connection relationship, not only may some irregular angles of straight lines on the knowledge graph affect the visual experience, but the more important problem that cannot be ignored is that straight lines will produce confusing expressions under certain circumstances. For example, some straight lines may completely overlap with other straight lines visually, but if a broken line with an obtuse angle is used, this confusion can be completely avoided. As in some embodiments, using broken lines to represent can bypass the connection relationships represented by those straight lines, and because the panel has been sparsely spaced, there will always be empty grids reserved for the broken lines to bend. As shown in Figure 7, (a) shows the effect of using only straight lines for connection, and (b) shows the effect of using obtuse-angled lines to display the knowledge graph when appropriate.
[0095] However, there may be multiple shortest paths with exactly the same logical distance, but only one can be presented as a demonstration connection relationship. Therefore, this application adopts a further selection scheme. The selection scheme can be described by the following conditions (arranged in order): (1) the total logical distance is shortest (prerequisite); (2) fewer overlapping parts, as shown in Figure 6, (a) and (b) have no overlapping parts, and (c) has one; (3) fewer turning points, as shown in Figure 6, (a) has 4 turning points, and (b) and (c) each have only 2 turning points. If there are still multiple options available at this time, a path is randomly selected.
[0096] The node deployment method for the knowledge graph disclosed in this application is innovative and attractive, with the following specific features: (1) Graph algorithms are actually applied in the knowledge graph application. (2) Through the proposed deployment method, the nodes of the knowledge graph are rationally placed on the hexagonal panel, creating an overall clear and good knowledge display. (3) The method of this application is flexible for various visual designs, making it easy to switch styles to meet different customer needs.
[0097] The hexagonal grid structure used for knowledge graph display is an innovation of this application and is visually easy to identify. The method of this application can be detected mainly in two ways: (1) In terms of node distribution, the nodes are evenly distributed (most or almost all other knowledge graph presentation tools have uneven node distribution), and there is always an empty buffer grid between nodes. (2) Regarding the implementation of connection relationships, if the connection lines are straight lines or obtuse-angled broken lines (120° inflection points), the degree of intersection is highly standardized, like a subway map.
[0098] In some embodiments, the knowledge graph can also be displayed in 3D mode. In 3D mode, the nodes can be three-dimensional node models. The lines or edges connecting the nodes can be straight lines or broken lines, or arch lines. The arch lines can be curved lines, similar to the shape of an arch bridge, connecting two node models.
[0099] FIG2(a) provides a display device 200 for an industrial knowledge graph. The device 200 includes: a layout determination module 201 for determining a hexagonal grid layout of the industrial knowledge graph, wherein a non-edge grid is surrounded by six grids in the hexagonal grid layout, and the edges of the six grids form a regular hexagon; a node placement module 202 for placing multiple nodes in the industrial knowledge graph at the center of each of the grids in the hexagonal grid layout; and a relationship connection module 203 for displaying the connections between the multiple nodes using straight lines or broken lines based on the connection relationships between the multiple nodes.
[0100] Furthermore, as shown in Figure 2(b), the node placement module 202 also includes: a first grid selection module 204, used to place the first node in the first grid among the multiple grids; a second grid selection module 205, used to place the second node in the second grid among the multiple grids, wherein the second grid is adjacent to the first grid; and a second grid sparse module 206, used to sparse the second grid in which the second node has been placed.
[0101] Furthermore, as shown in FIG2(c), the second grid selection module 205 includes: a one-by-one selection module 207 for selecting unoccupied second grids one by one to place the second node; and an area selection module 208 for optimally selecting the second grid to place the second node according to the area.
[0102] Furthermore, the one-by-one selection module 207 is used to: calculate the sum of the distances between the second grid and all second grids where the second node is placed; select the second grid where the sum of the distances is the minimum, and place the second node therein.
[0103] Furthermore, the area selection module 208 is used to: calculate the weight of the second grid within a predetermined range; the weight includes the shortest total logical distance and the shortest total graphic distance; select the second grid according to the weight, and place the second node.
[0104] Furthermore, the relationship connection module 203 is configured to use a straight line or a broken line with the shortest total logical distance, the least repeated coverage, and the least number of inflection points to display the connection between the plurality of nodes.
[0105] It should be noted that the apparatus may include more or fewer modules to implement the described functionality. For example, at least one module in FIG. 2 may be further divided into a plurality of different submodules, each of which is configured to perform at least a portion of the operations described herein in conjunction with the corresponding module. Furthermore, in some examples, the apparatus 200 may further include additional modules for performing other operations already described in the specification. Furthermore, those skilled in the art will appreciate that the exemplary apparatus 200 may be implemented using software, hardware, firmware, or any combination thereof.
[0106] Figure 3 provides a computer device. According to one embodiment, the computer device 300 may include a processor 302, which executes a computer program stored in a memory 304. When the computer program is executed by the processor, the above method is implemented.
[0107] Those skilled in the art will understand that the structure shown in Figure 3 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0108] Those skilled in the art will appreciate that all or part of the processes in the methods for implementing the above-mentioned embodiments can be accomplished by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include processes for the implementation of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the various embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0109] The present application also provides a computer-readable storage medium having a computer program stored thereon, which implements the above steps when the computer program is executed by a processor.
[0110] The present application also provides a computer program product, which is tangibly stored on a computer-readable medium and includes computer-executable instructions. When the computer-executable instructions are executed, the computer-executable instructions cause at least one processor to perform the above method.
[0111] Furthermore, the computer program can be stored and run in the cloud to perform the method. Furthermore, the components of the program can be deployed on multiple devices and the cloud. For example, the corresponding steps can be deployed and run on a local or local computer, or run on different cloud devices, and transmit signals through a communication connection, or can also be deployed and run on a local or local computer. This application does not limit the manner or method, and the corresponding technology can be flexibly deployed to make full use of equipment and technologies such as the cloud, big data, and supercomputing capabilities to execute and complete the method.
[0112] Some implementations of the present disclosure may include articles of manufacture. Articles of manufacture may include storage media for storing logic. Examples of storage media may include one or more types of computer-readable storage media capable of storing electronic data, including volatile or non-volatile memory, removable or non-removable memory, erasable or non-erasable memory, writable or rewritable memory, and the like. Examples of logic may include various software units, such as software components, programs, applications, computer programs, application programs, system programs, machine programs, operating system software, middleware, firmware, software modules, routines, subroutines, functions, methods, processes, software interfaces, application program interfaces (APIs), instruction sets, computing codes, computer codes, code segments, computer code segments, words, values, symbols, or any combination thereof. In some implementations, for example, articles of manufacture may store executable computer program instructions that, when executed by a processor, cause the processor to perform the methods and / or operations described herein. Executable computer program instructions may include any suitable type of code, such as source code, compiled code, interpreted code, executable code, static code, dynamic code, and the like. Executable computer program instructions can be implemented according to a predefined computer language, method or syntax for commanding a computer to perform a specific function. The instructions can be implemented using any appropriate high-level, low-level, object-oriented, visual, compiled and / or interpreted programming language.
[0113] What has been described above includes examples of the disclosed architecture. It is, of course, not possible to describe every conceivable combination of components and / or methodologies, but those skilled in the art will appreciate that many other combinations and permutations are possible. Therefore, the novel architecture is intended to embrace all such alternatives, modifications, and variations that fall within the spirit and scope of the appended claims.
Claims
1. A method for constructing an industrial knowledge graph, comprising: Determine a hexagonal grid layout of the industrial knowledge graph, wherein in the hexagonal grid layout, a non-edge grid is surrounded by six grids, and the edges of the six grids form a regular hexagon; Placing a plurality of nodes in the industrial knowledge graph at the center of each of the plurality of grids in the hexagonal grid layout; Based on the connection relationship between the multiple nodes, the connection between the multiple nodes is displayed using a straight line or a broken line.
2. The method according to claim 1, wherein: A plurality of nodes in the industrial knowledge graph are respectively placed at the center of each of the plurality of grids in the hexagonal grid layout, including: placing a first node in a first grid among the plurality of grids; placing a second node in a second grid among the plurality of grids, wherein the second grid is adjacent to the first grid; The second grid in which the second node is placed is thinned.
3. The method according to claim 2, wherein: Placing a second node in a second grid among the plurality of grids comprises: Selecting unoccupied second grids one by one to place the second node; A second grid is selected based on the optimal area to place the second node.
4. The method according to claim 3, wherein: Selecting unoccupied second grids one by one to place the second node comprises: Calculate the sum of the distances between the unoccupied second grid and all grids where nodes have been placed; Select an unoccupied second grid where the sum of the distances is the smallest and place the second node.
5. The method according to claim 3, wherein: The second grid is selected according to the optimal area to place the second node, including: Calculate the weight of the second grid within the predetermined range, the weight including the shortest total logical distance and the shortest total graphic distance; According to the weight, an unoccupied second grid is selected and the second node is placed.
6. The method according to claim 3, wherein: Use straight lines or polylines to show the connections between the multiple nodes, including: The connection between the plurality of nodes is displayed using a straight line or a broken line with the shortest total logical distance, the least repeated covering and the least number of inflection points.
7. A display device (200) for an industrial knowledge graph, comprising: A layout determination module (201) is used to determine a hexagonal grid layout of the industrial knowledge graph, wherein in the hexagonal grid layout, a non-edge grid is surrounded by six grids, and the edges of the six grids form a regular hexagon; A node placement module (202) is used to place multiple nodes in the industrial knowledge graph at the center of each of the multiple grids in the hexagonal grid layout; The relationship connection module (203) is used to display the connection between the multiple nodes using a straight line or a broken line based on the connection relationship between the multiple nodes.
8. The device according to claim 7, wherein: The node placement module (202) further includes: A first grid selection module (204), configured to place a first node in a first grid among the plurality of grids; A second grid selection module (205), configured to place a second node in a second grid among the plurality of grids, wherein the second grid is adjacent to the first grid; The second grid sparse module (206) is used to sparse the second grid where the second node is placed.
9. The device according to claim 8, wherein: The second grid selection module (205) comprises: A one-by-one selection module (207), used for selecting unoccupied second grids one by one to place the second node; A region selection module (208) is used to optimally select the second grid to place the second node according to the region.
10. The device according to claim 9, wherein: The modules (207) are selected one by one, for including: Calculate the sum of the distances between the unoccupied second grid and all grids where nodes have been placed; Select an unoccupied second grid where the sum of the distances is the smallest and place the second node.
11. The device according to claim 9, wherein: The region selection module (208) is used to include: Calculate the weight of the second grid within the predetermined range; the weight includes the shortest total logical distance and the shortest total graphic distance; According to the weight, the unoccupied second grid is selected and the second node is placed.
12. The device according to claim 7, wherein: The relationship connection module (203) is used to: Use a straight line or a broken line with the shortest total logical distance, the least repeated coverage, and the least number of inflection points to display the multiple nodes The connection between.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
15. A computer program product tangibly stored on a computer readable medium and comprising computer executable instructions which, when executed, cause at least one processor to perform the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method, device, apparatus and computer readable storage medium for generating knowledge map
CN109271525A
Knowledge graph visualization method
CN116090555A
Semantic Network Establishing System and Establishing Method Thereof
US20160188595A1
Dynamic In-Memory Construction of a Knowledge Graph
US20220019907A1
Method and apparatus for displaying knowledge graph, terminal device, and readable storage medium
WO2019057190A1
Cited By
Knowledge graph presentation method, electronic equipment and storage medium
CN120821879A