Graph path query method, device, computer equipment and storage medium
By using preset query algorithms and entity matching technology in the knowledge graph, the problem of low query efficiency in enterprise knowledge graph paths is solved, and fast and accurate path information acquisition is achieved.
Patent Information
- Application Number
- CN201811377628.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-11-19
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2038-11-19
AI Technical Summary
Due to the huge scale of the existing enterprise knowledge graph, which contains a large number of entities and entity relationships, the path query efficiency is low and it is difficult to quickly obtain the required information.
By receiving the target knowledge graph diagram instructions sent by the terminal, the preconfigured query interface information is obtained, the query request is parsed, and the preset query algorithm is used to query path information in the knowledge graph, including matching entities, depth-first traversal and natural semantic analysis, to improve query efficiency.
Significantly improves the efficiency of knowledge graph path query, can quickly match and return path information between the starting target and the ending target, and improves query efficiency and accuracy.
Smart Images

Figure CN109670049B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a graph path query method, apparatus, computer equipment, and storage medium. Background Art
[0002] Knowledge graphs, also known as scientific knowledge graphs and, in the library and information science community, knowledge domain visualizations or knowledge domain mapping maps, are a series of diverse graphics that display the development process and structural relationships of knowledge. They use visualization techniques to describe knowledge resources and their carriers, and to mine, analyze, construct, map, and display knowledge and its interconnections. Currently, commercially available enterprise-related knowledge graphs, such as Qichacha, Tianyancha, and Euler Graph, are extremely large in scale and contain a vast number of entities and their relationships. Path queries are typically time-consuming and inefficient. Summary of the Invention
[0003] Based on this, it is necessary to provide a graph path query method, device, computer equipment and storage medium that can improve query efficiency in response to the above technical problems.
[0004] A graph path query method, the method comprising:
[0005] A receiving terminal sends a graphic instruction of a target knowledge graph, obtains pre-configured query interface information according to the graphic instruction, sends the pre-configured query interface information to the terminal, and displays a query interface in the terminal according to the query interface information;
[0006] Acquire a query request sent by a terminal through the query interface, the query request carrying a starting target, an ending target, and a path identifier, parse the query request, and obtain the starting target, the ending target, and the path identifier;
[0007] According to the path identifier, a preset query algorithm corresponding to the path identifier is obtained, and according to the starting target and the ending target, the preset query algorithm is used to query the target knowledge graph to obtain path information, and the path information is sent to the terminal.
[0008] In one embodiment, a receiving terminal sends a graphic instruction of a target knowledge graph, obtains pre-configured query interface information according to the graphic instruction, sends the pre-configured query interface information to the terminal, and before displaying the query interface in the terminal according to the query interface information, further includes:
[0009] Receiving an instruction to establish the target knowledge graph, and obtaining the credit status of the target according to the instruction to establish the target knowledge graph;
[0010] A target entity and an association relationship between the target entities are identified according to the credit status of the target, and a target knowledge graph is established according to the association relationship between the target entity and the target entity.
[0011] In one embodiment, before obtaining the preset query algorithm corresponding to the path identifier according to the path identifier, the method further includes:
[0012] The path identifier and the preset query algorithm corresponding to the path identifier are obtained, and the path identifier and the preset query algorithm are associated and saved.
[0013] In one embodiment, querying the target knowledge graph using the preset query algorithm according to the starting target and the ending target to obtain path information includes:
[0014] Matching the corresponding target start entity and target end entity in the target knowledge graph according to the start target and the end target;
[0015] When the target start entity and the target end entity can be matched, query the target start entity in the target knowledge graph for associated adjacent entities to obtain an adjacent entity set;
[0016] When the target end entity is found in the adjacent entity set, path information of the target start entity and the target end entity is obtained.
[0017] In one embodiment, querying the target knowledge graph using the preset query algorithm according to the starting target and the ending target to obtain path information includes:
[0018] Matching the corresponding target start entity and target end entity in the target knowledge graph according to the start target and the end target;
[0019] When the target start entity and the target end entity can be matched, marking the target start entity;
[0020] According to the marked target starting entity, a depth-first traversal algorithm is used to query the target knowledge graph until all entities in the target knowledge graph that have paths connected to the marked target starting entity are marked, thereby obtaining the path information of the target starting entity and the target ending entity.
[0021] In one embodiment, the target start entity and the target end entity are matched in the target knowledge graph according to the start target and the end target, including
[0022] Using the natural semantic analysis algorithm to identify the starting target and the ending target, and obtain a starting keyword corresponding to the starting target and a ending keyword corresponding to the ending target;
[0023] The starting keyword and the ending keyword are searched in the target knowledge graph, and when they can be found, a target starting entity corresponding to the starting keyword and a target ending entity corresponding to the ending keyword are obtained.
[0024] In one embodiment, after sending the path information to the terminal, the method further includes:
[0025] receiving an intelligent report generation instruction sent by a terminal, and obtaining the path information according to the intelligent report generation instruction;
[0026] Obtaining information of each path node according to the path information, and calculating a preset target according to the path node information;
[0027] A preset smart report template is obtained, and the preset target is written into the preset smart report template to obtain a target smart report.
[0028] A graph path query device, comprising:
[0029] An interface acquisition module is configured to receive a graphical instruction of a target knowledge graph sent by a terminal, obtain pre-configured query interface information according to the graphical instruction, send the pre-configured query interface information to the terminal, and display a query interface in the terminal according to the query interface information;
[0030] a request acquisition module, configured to acquire a query request sent by a terminal through the query interface, the query request carrying a start target, an end target, and a path identifier, and parse the query request to obtain the start target, the end target, and the path identifier;
[0031] A path query module is used to obtain a preset query algorithm corresponding to the path identifier according to the path identifier, use the preset query algorithm to query the target knowledge graph according to the starting target and the ending target, obtain path information, and send the path information to the terminal.
[0032] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0033] A receiving terminal sends a graphic instruction of a target knowledge graph, obtains pre-configured query interface information according to the graphic instruction, sends the pre-configured query interface information to the terminal, and displays a query interface in the terminal according to the query interface information;
[0034] Acquire a query request sent by a terminal through the query interface, the query request carrying a starting target, an ending target, and a path identifier, parse the query request, and obtain the starting target, the ending target, and the path identifier;
[0035] According to the path identifier, a preset query algorithm corresponding to the path identifier is obtained, and according to the starting target and the ending target, the preset query algorithm is used to query the target knowledge graph to obtain path information, and the path information is sent to the terminal.
[0036] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0037] A receiving terminal sends a graphic instruction of a target knowledge graph, obtains pre-configured query interface information according to the graphic instruction, sends the pre-configured query interface information to the terminal, and displays a query interface in the terminal according to the query interface information;
[0038] Acquire a query request sent by a terminal through the query interface, the query request carrying a starting target, an ending target, and a path identifier, parse the query request, and obtain the starting target, the ending target, and the path identifier;
[0039] According to the path identifier, a preset query algorithm corresponding to the path identifier is obtained, and according to the starting target and the ending target, the preset query algorithm is used to query the target knowledge graph to obtain path information, and the path information is sent to the terminal.
[0040] The above-mentioned graph path query method, device, computer equipment and storage medium send a graphical instruction of the target knowledge graph through a receiving terminal, obtain pre-configured query interface information according to the graphical instruction, send the pre-configured query interface information to the terminal, and display the query interface in the terminal according to the query interface information; obtain a query request sent by the terminal through the query interface, the query request carries a starting target, an ending target and a path identifier, parse the query request, and obtain the starting target, the ending target and the path identifier; obtain a preset query algorithm corresponding to the path identifier according to the path identifier, use the preset query algorithm to query in the target knowledge graph according to the starting target and the ending target, obtain path information, and send the path information to the terminal. By querying according to the path identifier to be queried using the corresponding preset query algorithm, the query efficiency of the path in the knowledge graph can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is an application scenario diagram of a graph path query method in one embodiment;
[0042] Figure 2 Schematic diagram of a flow chart of a graph path query method in one embodiment;
[0043] Figure 3 A schematic diagram of a graph path query interface in one embodiment;
[0044] Figure 4 for Figure 3 A schematic diagram showing query results on the graph path query interface in the embodiment;
[0045] Figure 5 A schematic diagram of a process for establishing a target knowledge graph in one embodiment;
[0046] Figure 6 A schematic diagram of a process for obtaining path information in one embodiment;
[0047] Figure 7 A schematic diagram of a process for obtaining path information in another embodiment;
[0048] Figure 8 A schematic diagram of a process for matching entities in a target knowledge graph in one embodiment;
[0049] Figure 9 A schematic diagram of a process for obtaining a target intelligence report in one embodiment;
[0050] Figure 10 This is a structural block diagram of a graph path query device in one embodiment;
[0051] Figure 11 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0053] The graph path query method provided in this application can be applied to Figure 1In the application environment shown. The terminal 102 communicates with the server 104 through the network. The server 104 receives the graphical instructions of the target knowledge graph sent by the terminal 102, obtains the pre-configured query interface information according to the graphical instructions, and sends the pre-configured query interface information to the terminal 102. The server 104 obtains the query request sent by the terminal 102 through the query interface, the query request carries the starting target, the ending target and the path identifier, parses the query request, and obtains the starting target, the ending target and the path identifier. The server 104 obtains the preset query algorithm corresponding to the path identifier based on the path identifier, uses the preset query algorithm to query in the target knowledge graph according to the starting target and the ending target, obtains the path information, and sends the path information to the terminal 102. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented as an independent server or a server cluster consisting of multiple servers.
[0054] In one embodiment, Figure 2 As shown, a graph path query method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the server in the example:
[0055] S202, receiving the graphical instructions of the target knowledge graph sent by the terminal, obtaining pre-configured query interface information according to the graphical instructions, sending the pre-configured query interface information to the terminal, and displaying the query interface in the terminal according to the query interface information.
[0056] The target knowledge graph refers to a pre-established enterprise knowledge graph that displays relationships between entities, such as enterprises, individuals, and employees. Pre-configured query interface information refers to interface properties pre-configured on the server for performing enterprise knowledge graph path queries. Query interface information refers to the control information necessary to generate the query interface.
[0057] Specifically, the server receives the graphic instruction of the enterprise knowledge graph sent by the terminal. The graphic instruction can be a user clicking the graphic button of the enterprise knowledge graph interface in the terminal. When the terminal receives the click instruction, it sends the graphic instruction of the enterprise knowledge graph to the server. The server obtains the pre-configured query interface information according to the graphic instruction and returns the query interface attributes to the terminal. When the terminal receives the query interface information, it generates the enterprise knowledge graph path query interface according to the query interface information. For example, the generated enterprise knowledge graph path query interface can be as follows Figure 3 shown.
[0058] S204: Acquire a query request sent by the terminal through the query interface, the query request carrying a start target, an end target, and a path identifier, parse the query request, and obtain the start target, the end target, and the path identifier.
[0059] The start target is the starting point of the path to be queried, which can be a name, number, etc. The end target is the end point of the path to be queried. The path identifier is used to identify whether the path to be queried is the entire path between the starting and ending points or the shortest path.
[0060] Specifically, the server obtains the query request sent by the terminal through the query interface, which carries the starting target, ending target and path identifier. The server parses the query request and obtains the starting target, ending target and path identifier carried by the query request. Figure 3 As shown, the user uses the terminal to Figure 3 Enter the starting point name and end point name of the path to be queried in the interface, then click to select the shortest path to be queried, and then click the query button. At this time, the terminal sends a query request to the server, which carries the starting point name, end point name and shortest path.
[0061] S206, obtaining a preset query algorithm corresponding to the path identifier according to the path identifier, using the preset query algorithm to query in the target knowledge graph according to the starting target and the ending target, obtaining the path information, and sending the path information to the terminal.
[0062] The preset query algorithm refers to a knowledge graph query algorithm that is pre-set on the server for the path identifier. For example, if the path identifier to be queried is the shortest path, the shortest graph path search algorithm corresponding to the shortest path is pre-set on the server. For example, a single-source shortest path query algorithm, etc.
[0063] Specifically, the server obtains the preset query algorithm corresponding to the path identifier based on the path identifier, executes the query algorithm in the target knowledge graph, queries the path between the starting target and the ending target to obtain the path information, and returns the obtained path information to the terminal. The terminal displays the path on the query interface based on the path information. For example, if you want to query the shortest path between two companies, the shortest path between the two companies can be obtained as follows Figure 4 As shown. Figure 4 In the , users can also click the "icon" button to select the display path. They can choose an icon, a table, or other forms of display.
[0064] In the above-mentioned graph path query method, a graphical instruction of the target knowledge graph is sent by a receiving terminal, pre-configured query interface information is obtained according to the graphical instruction, the pre-configured query interface information is sent to the terminal, and the query interface is displayed in the terminal according to the query interface information; a query request sent by the terminal through the query interface is obtained, the query request carries the starting target, the ending target and the path identifier, the query request is parsed, and the starting target, the ending target and the path identifier are obtained; a preset query algorithm corresponding to the path identifier is obtained according to the path identifier, and the preset query algorithm is used to query in the target knowledge graph according to the starting target and the ending target to obtain path information, and the path information is sent to the terminal. By querying according to the path identifier to be queried and using the corresponding preset query algorithm, the query efficiency of the path in the knowledge graph can be improved.
[0065] In one embodiment, Figure 5 As shown, before step S202, that is, the receiving terminal sends a graphic instruction of the target knowledge graph, obtains pre-configured query interface information according to the graphic instruction, sends the pre-configured query interface information to the terminal, and displays the query interface in the terminal according to the query interface information, the following steps are also included:
[0066] S502, receiving an instruction to establish a target knowledge graph, and obtaining the credit status of the target according to the instruction to establish the target knowledge graph.
[0067] Specifically, the server receives an instruction to establish a target knowledge graph. Based on the instruction, the server can collect legally disclosed target credit status information from various channels and obtain stored undisclosed target credit status information from the server's internal database to obtain the target's credit status. In one embodiment, the undisclosed target credit status information obtained is encrypted using an encryption algorithm. In this case, it is necessary to obtain a decryption key through authorization to decrypt the encrypted target credit status information to ensure the security of the undisclosed target credit status information. The target refers to each entity in the target knowledge graph to be established. The target knowledge graph is an enterprise knowledge graph, and the entities can be enterprises, natural persons, executives, or people associated with the enterprise, etc.
[0068] S504, identifying the association relationship between target entities according to the credit status of the target, and establishing a target knowledge graph according to the association relationship between target entities.
[0069] Among them, the associated relationship refers to the relationship between target entities, which can be an investment relationship, a credit relationship, an implicit relationship, an event relationship, a credit enhancement relationship, a transaction relationship, or other relationships. Implicit relationships include kinship relationships, interbank relationships, agency relationships, etc.
[0070] Specifically, when the server obtains the target's credit status information, it can process the credit status information. It can use data warehouse technology to process the credit status information, identify the associations between each target entity, establish a target knowledge graph based on the associations between each target entity, and save the relational data in the established target knowledge graph to a graph database. The graph database can use Neo4j (a high-performance NOSQL graph database). It can also simultaneously identify the attribute information of each target entity. For example, if the target knowledge graph is an enterprise knowledge graph, the attribute information of each enterprise can include basic enterprise information, enterprise operating conditions, enterprise financial conditions, enterprise future expectations, enterprise influence, etc.
[0071] In the above embodiment, by receiving the establishment instruction of the target knowledge graph, obtaining the credit status of the target according to the establishment instruction, identifying the association relationship between the target entity and the target entity according to the credit status of the target, and establishing the target knowledge graph according to the association relationship between the target entity and the target entity, the target knowledge graph can be established in advance, and when querying the path, the established target knowledge graph query path can be used to improve query efficiency.
[0072] In one embodiment, before obtaining a preset query algorithm corresponding to the path identifier according to the path identifier, the method further includes:
[0073] Obtain a path identifier and a preset query algorithm corresponding to the path identifier, and associate the path identifier with the preset query algorithm and save the association.
[0074] Specifically, the server pre-acquires the path identifier and the preset query algorithm corresponding to the path identifier, and associates the preset query algorithm with the path identifier. For example, if the path identifier is the shortest path, the shortest path is associated with the single-source shortest path query algorithm and the association is stored. When the shortest path is to be queried, the server executes the corresponding single-source shortest path query algorithm to perform the query, thereby improving the efficiency of the path query.
[0075] In one embodiment, Figure 6 As shown, step S206, that is, using a preset query algorithm to query in the target knowledge graph according to the starting target and the ending target to obtain path information, includes the following steps:
[0076] S602: Match the corresponding target start entity and target end entity in the target knowledge graph according to the start target and the end target.
[0077] The target start entity refers to the entity in the target knowledge graph that corresponds to the start target, and this entity is the entity starting point of the query path. The target end entity refers to the entity in the target knowledge graph that corresponds to the end target, and this entity is the entity end of the query path.
[0078] Specifically, the server searches for a target start entity corresponding to the start target and a target end entity corresponding to the end target in the target knowledge graph according to the start target and the end target.
[0079] S604: When the target start entity and the target end entity can be matched, the target start entity is searched for the associated adjacent entities in the target knowledge graph to obtain an adjacent entity set.
[0080] Specifically, when the server is able to match the target start entity and the target end entity, it indicates that a path between the target start target and the target end exists in the target knowledge graph. Based on the target start entity, the server queries the target knowledge graph for associated adjacent entities to obtain an adjacent entity set. If neither the target start entity nor the target end entity is matched, it indicates that a path between the target start target and the target end does not exist in the target knowledge graph, and a prompt indicating that the query target is incorrect is directly returned to the terminal.
[0081] S606: When the target end entity is found in the adjacent entity set, path information of the target start entity and the target end entity is obtained.
[0082] Specifically, the server searches for the target terminating entity in the adjacent entity set. When a consistent target terminating entity can be found, the parent entity of the target terminating entity is obtained until the parent entity is the starting entity of the target terminating entity, and the path information of the target starting entity and the target terminating entity is obtained. When a consistent target terminating entity is not found, at this time, each entity in the adjacent entity set is used as the starting entity, and the adjacent entity is queried in the target knowledge graph based on the starting entity. The adjacent entity does not include the entities that have been queried, and the adjacent entity set is obtained. The step of searching for the target terminating entity in the adjacent entity set on the server is continued until a consistent target terminating entity can be found. The parent entity of the target terminating entity is obtained, and when the parent entity is the starting entity of the target terminating entity, the path information of the target starting entity and the target terminating entity is obtained. The path information is the shortest path information between the starting target and the ending target.
[0083] In the above embodiment, by matching the corresponding target starting entity and target ending entity in the target knowledge graph according to the starting target and the ending target, when the target starting entity and the target ending entity can be matched, the associated adjacent entities are queried in the target knowledge graph according to the target starting entity to obtain an adjacent entity set. When the target ending entity is found in the adjacent entity set, the path information of the target starting entity and the target ending entity is obtained, and the path information between the starting target and the ending target can be accurately queried.
[0084] In one embodiment, Figure 7 As shown, in step S206, a preset query algorithm is used to query the target knowledge graph according to the starting target and the ending target to obtain path information, including:
[0085] S702, matching the corresponding target start entity and target end entity in the target knowledge graph according to the start target and the end target.
[0086] S704: When the target start entity and the target end entity can be matched, the target start entity is marked.
[0087] Specifically, the server searches for the corresponding target start entity and target end entity in the target knowledge graph based on the start target and end target. If the target start entity and target end entity are matched, it indicates that a path between the start target and the end target exists in the target knowledge graph. At this time, the target start entity is marked, indicating that the target start entity has been selected. If neither the target start entity nor the target end entity is matched, it indicates that a path between the start target and the end target does not exist in the target knowledge graph, and a prompt indicating that the query target is incorrect is directly returned to the terminal.
[0088] S706, querying the target knowledge graph using a depth-first traversal algorithm according to the marked target starting entity until all entities in the target knowledge graph that have paths connected to the marked target starting entity are marked, thereby obtaining path information of the target starting entity and the target ending entity.
[0089] Specifically, the server uses a depth-first traversal algorithm to query the target knowledge graph based on the marked target starting entity until all entities in the target knowledge graph that are path-connected to the marked target starting entity are marked, thereby obtaining path information for the target starting entity and the target ending entity. For example, when using a depth-first traversal algorithm to query path information between two enterprises in an enterprise knowledge graph, the server first finds the starting enterprise and the ending enterprise in the enterprise knowledge graph, marks the starting enterprise to indicate that it has been visited, then searches for any unmarked adjacent enterprise, marks the adjacent enterprise to indicate that it has been visited, and then searches from the adjacent enterprise until all paths from the adjacent enterprise have been visited. It then determines whether there is an ending enterprise in the path. If so, the path between the starting enterprise and the ending enterprise is obtained. At this point, unmarked adjacent enterprises are searched again from the starting enterprise, and the above steps are repeated until all enterprises that are path-connected to the starting enterprise are marked. The traversal is then complete, and all paths between the starting enterprise and the ending enterprise are obtained.
[0090] In the above embodiment, by matching the corresponding target starting entity and target ending entity in the target knowledge graph according to the starting target and the ending target, when the target starting entity and the target ending entity can be matched, the target starting entity is marked, and a depth-first traversal algorithm is used to query the target knowledge graph according to the marked target starting entity, until all entities in the target knowledge graph that have a path connection with the marked target starting entity are marked, the path information of the target starting entity and the target ending entity is obtained, and the depth-first traversal algorithm can be used to query all path information between the starting target and the ending target in the target knowledge graph, so that the path to be queried can be obtained more accurately, and the query efficiency can be improved.
[0091] In one embodiment, Figure 8 As shown, matching the corresponding target start entity and target end entity in the target knowledge graph according to the start target and the end target includes the following steps:
[0092] S802: Using a natural semantic analysis algorithm to identify the start target and the end target, and obtaining a start keyword corresponding to the start target and an end keyword corresponding to the end target.
[0093] The natural language analysis algorithm is used to extract keywords from the start target and the end target, and may be an NLP (natural language processing) algorithm.
[0094] Specifically, the server uses a natural semantic analysis algorithm to identify the start target and the end target, and obtains a start keyword corresponding to the start target and an end keyword corresponding to the end target.
[0095] S804, searching for the start keyword and the end keyword in the target knowledge graph, and when they can be found, obtaining the target start entity corresponding to the start keyword and the target end entity corresponding to the end keyword.
[0096] Specifically, the start keyword and the end keyword are searched in the target knowledge. When the start keyword and the end keyword can be found, the target start entity corresponding to the start keyword and the target end entity corresponding to the end keyword are obtained.
[0097] In the above embodiment, the starting target and the ending target are identified by using a natural semantic analysis algorithm, and the starting keyword corresponding to the starting target and the ending keyword corresponding to the ending target are obtained. The starting keyword and the ending keyword are searched in the target knowledge graph. When they can be queried, the target starting entity corresponding to the starting keyword and the target ending entity corresponding to the ending keyword are obtained. The target starting entity and the target ending entity corresponding to the starting target and the ending target can be found in the target knowledge graph, which facilitates further query of the path between the starting target and the ending target, thereby improving the efficiency of the query path.
[0098] In one embodiment, Figure 9 As shown, after step S206, that is, after sending the path information to the terminal, the following steps are further included:
[0099] S902: Receive an intelligent report generation instruction sent by the terminal, and obtain path information according to the intelligent report generation instruction.
[0100] Among them, the intelligent report is used to describe the detailed information of each entity on the obtained path. For example: if the query is the path between enterprises, the obtained intelligent report describes the customer knowledge graph of each enterprise in the path, the customer basic information analysis, negative public opinion statistical analysis, risk event extraction, classification and quantification, risk event transmission and customer rating, etc.
[0101] Specifically, the server receives the intelligent report generation instruction sent by the terminal and obtains path information according to the intelligent report generation instruction. The path information can be partial path information of the preset knowledge graph or all path information of the preset knowledge graph.
[0102] S904: Obtain information of each path node according to the path information, and calculate a preset target according to the path node information.
[0103] The information of each path node includes the entity information of each node and the relationship information of each node entity, etc. The preset target is the pre-set statistical information to be written into the intelligent report.
[0104] Specifically, the server obtains information about each node along the path based on the path information, including information about each node entity and the relationships between each node entity, and calculates a preset target based on the path node information. If the obtained path information is enterprise path information, the preset target can include overall information about all enterprises in the statistical path, enterprise industry distribution, enterprise industry concentration, comparison with historical records, information about actual controllers of enterprises, enterprise regional concentration, enterprise guarantee circle information, listed enterprise information, core enterprise information, enterprise negative public opinion information, enterprise risk event information, etc.
[0105] S906: Obtain a preset smart report template, write the preset target into the preset smart report template, and obtain a target smart report.
[0106] Specifically, the server obtains a pre-set smart report template, writes the calculated preset targets into the preset smart report template, and obtains a target smart report, which is then saved. The user can download the target smart report from the server through the terminal and print it.
[0107] In the above embodiment, by receiving the intelligent report generation instruction sent by the terminal, obtaining the path information according to the intelligent report generation instruction, obtaining the information of each path node according to the path information, calculating the preset target according to the path node information, obtaining the preset intelligent report template, writing the preset target into the preset intelligent report template, obtaining the target intelligent report, and generating an intelligent report based on the path information obtained by the query, so as to facilitate further use by the user.
[0108] It should be understood that although Figure 2 、 5 The steps in the flowchart of -9 are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 2 、 5 -At least part of the steps in 9 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The order of execution of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0109] In one embodiment, Figure 10 As shown, a graph path query device 1000 is provided, comprising: an interface acquisition module 1002, a request acquisition module 1004 and a path query module 1006, wherein:
[0110] The interface acquisition module 1002 is used to receive the graphical instructions of the target knowledge graph sent by the terminal, obtain pre-configured query interface information according to the graphical instructions, send the pre-configured query interface information to the terminal, and display the query interface in the terminal according to the query interface information.
[0111] The request acquisition module 1004 is used to acquire the query request sent by the terminal through the query interface, the query request carries the starting target, the ending target and the path identifier, and parse the query request to obtain the starting target, the ending target and the path identifier.
[0112] The path query module 1006 is used to obtain the preset query algorithm corresponding to the path identifier according to the path identifier, use the preset query algorithm to query in the target knowledge graph according to the starting target and the ending target, obtain the path information, and send the path information to the terminal.
[0113] In the above embodiment, the interface acquisition module 1002 receives a graphical instruction from the terminal to send a target knowledge graph, obtains pre-configured query interface information based on the graphical instruction, sends the pre-configured query interface information to the terminal, and displays the query interface in the terminal based on the query interface information. The request acquisition module 1004 parses the start target, end target, and path identifier, and finally, the path query module 1006 obtains a preset query algorithm corresponding to the path identifier based on the path identifier. The preset query algorithm is used to query the target knowledge graph based on the start target and end target, obtain path information, and send the path information to the terminal, which can improve the efficiency of graph path query.
[0114] In one embodiment, the graph path query device 1000 further includes:
[0115] A credit status acquisition module is used to receive an instruction to create a target knowledge graph and obtain the target's credit status according to the instruction;
[0116] The graph establishment module is used to identify the association relationship between target entities based on the credit status of the target, and establish a target knowledge graph based on the association relationship between target entities.
[0117] In one embodiment, the graph path query device 1000 further includes:
[0118] The algorithm acquisition module is used to acquire the path identifier and the preset query algorithm corresponding to the path identifier, and associate the path identifier with the preset query algorithm and save it.
[0119] In one embodiment, the path query module 1006 includes:
[0120] An entity matching module is used to match the corresponding target start entity and target end entity in the target knowledge graph according to the start target and the end target;
[0121] The adjacent entity query module is used to query the associated adjacent entities in the target knowledge graph according to the target starting entity when the target starting entity and the target ending entity can be matched, and obtain the adjacent entity set;
[0122] The first path obtaining module is used to obtain path information of a target starting entity and a target ending entity when a target ending entity is found in the adjacent entity set.
[0123] In one embodiment, the path query module 1006 includes:
[0124] An entity matching module is used to match the corresponding target start entity and target end entity in the target knowledge graph according to the start target and the end target;
[0125] An entity marking module, configured to mark a target start entity when a target start entity and a target end entity can be matched;
[0126] The second path obtaining module is used to use a depth-first traversal algorithm to query the target knowledge graph according to the marked target starting entity until all entities in the target knowledge graph that have paths connected to the marked target starting entity are marked, thereby obtaining the path information of the target starting entity and the target ending entity.
[0127] In one embodiment, the entity matching module includes:
[0128] A keyword acquisition module is used to identify the starting target and the ending target using a natural semantic analysis algorithm, and obtain the starting keyword corresponding to the starting target and the ending keyword corresponding to the ending target;
[0129] The keyword search module is used to search for the starting keyword and the ending keyword in the target knowledge graph. When they can be found, the target starting entity corresponding to the starting keyword and the target ending entity corresponding to the ending keyword are obtained.
[0130] In one embodiment, the graph path query device 1000 further includes:
[0131] An instruction generation module is used to receive an intelligent report generation instruction sent by a terminal and obtain path information according to the intelligent report generation instruction;
[0132] A target calculation module is used to obtain information of each path node according to the path information and calculate the preset target according to the path node information;
[0133] The report acquisition module is used to obtain a preset intelligent report template, write the preset target into the preset intelligent report template, and obtain a target intelligent report.
[0134] For the specific definition of the graph path query device, please refer to the definition of the graph path query method above and will not be repeated here. The various modules in the above-mentioned graph path query device can be implemented in whole or in part by software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0135] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 11 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store target knowledge graph data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a graph path query method is implemented.
[0136] Those skilled in the art will understand that Figure 11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. Specifically, the computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0137] In one embodiment, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: receiving a diagram instruction of a target knowledge graph sent by a terminal, obtaining pre-configured query interface information according to the diagram instruction, sending the pre-configured query interface information to the terminal, and displaying the query interface in the terminal according to the query interface information. Obtaining a query request sent by the terminal through the query interface, the query request carries a starting target, an ending target, and a path identifier, parsing the query request, and obtaining the starting target, the ending target, and the path identifier. Obtaining a preset query algorithm corresponding to the path identifier according to the path identifier, using the preset query algorithm to query in the target knowledge graph according to the starting target and the ending target, obtaining path information, and sending the path information to the terminal.
[0138] In one embodiment, when the processor executes the computer program, it also implements the following steps: receiving an instruction to establish a target knowledge graph, and obtaining the credit status of the target according to the establishment instruction; identifying the association relationship between the target entity and the target entity according to the credit status of the target, and establishing the target knowledge graph according to the association relationship between the target entity and the target entity.
[0139] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: obtaining a path identifier and a preset query algorithm corresponding to the path identifier, and associating the path identifier with the preset query algorithm and saving the association.
[0140] In one embodiment, when the processor executes the computer program, it also implements the following steps: matching the corresponding target starting entity and target ending entity in the target knowledge graph according to the starting target and the ending target; when the target starting entity and the target ending entity can be matched, querying the associated adjacent entities in the target knowledge graph according to the target starting entity to obtain an adjacent entity set; when the target ending entity is found in the adjacent entity set, obtaining the path information of the target starting entity and the target ending entity.
[0141] In one embodiment, when the processor executes the computer program, it also implements the following steps: matching the corresponding target starting entity and target ending entity in the target knowledge graph according to the starting target and the ending target; marking the target starting entity when the target starting entity and the target ending entity can be matched; and querying the target knowledge graph using a depth-first traversal algorithm according to the marked target starting entity until all entities in the target knowledge graph that have a path connection with the marked target starting entity are marked, thereby obtaining the path information of the target starting entity and the target ending entity.
[0142] In one embodiment, when the processor executes the computer program, it also implements the following steps: using a natural semantic analysis algorithm to identify the starting target and the ending target, and obtaining the starting keyword corresponding to the starting target and the ending keyword corresponding to the ending target; searching for the starting keyword and the ending keyword in the target knowledge graph, and when they can be found, obtaining the target starting entity corresponding to the starting keyword and the target ending entity corresponding to the ending keyword.
[0143] In one embodiment, when the processor executes the computer program, it also implements the following steps: receiving an intelligent report generation instruction sent by the terminal, obtaining path information according to the intelligent report generation instruction; obtaining information of each path node according to the path information, and calculating a preset target according to the path node information; obtaining a preset intelligent report template, writing the preset target into the preset intelligent report template, and obtaining a target intelligent report.
[0144] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: a graphical instruction of a target knowledge graph sent by a receiving terminal is obtained according to the graphical instruction, pre-configured query interface information is obtained according to the graphical instruction, the pre-configured query interface information is sent to the terminal, and the query interface is displayed in the terminal according to the query interface information. A query request sent by the terminal through the query interface is obtained, the query request carries a starting target, an ending target, and a path identifier, the query request is parsed, and the starting target, the ending target, and the path identifier are obtained. A preset query algorithm corresponding to the path identifier is obtained according to the path identifier, and a query is performed in the target knowledge graph using the preset query algorithm according to the starting target and the ending target to obtain path information, and the path information is sent to the terminal.
[0145] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: receiving an instruction to establish a target knowledge graph, and obtaining the credit status of the target according to the establishment instruction; identifying the association relationship between the target entity and the target entity according to the credit status of the target, and establishing the target knowledge graph according to the association relationship between the target entity and the target entity.
[0146] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: obtaining a path identifier and a preset query algorithm corresponding to the path identifier, and associating the path identifier with the preset query algorithm and saving the association.
[0147] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: matching the corresponding target starting entity and target ending entity in the target knowledge graph according to the starting target and the ending target; when the target starting entity and the target ending entity can be matched, querying the associated adjacent entities in the target knowledge graph according to the target starting entity to obtain an adjacent entity set; when the target ending entity is found in the adjacent entity set, obtaining the path information of the target starting entity and the target ending entity.
[0148] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: matching the corresponding target starting entity and target ending entity in the target knowledge graph according to the starting target and the ending target; marking the target starting entity when the target starting entity and the target ending entity can be matched; querying the target knowledge graph using a depth-first traversal algorithm according to the marked target starting entity until all entities in the target knowledge graph that have a path connection with the marked target starting entity are marked, thereby obtaining the path information of the target starting entity and the target ending entity.
[0149] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: using a natural semantic analysis algorithm to identify the starting target and the ending target, and obtaining the starting keyword corresponding to the starting target and the ending keyword corresponding to the ending target; searching for the starting keyword and the ending keyword in the target knowledge graph, and when they can be found, obtaining the target starting entity corresponding to the starting keyword and the target ending entity corresponding to the ending keyword.
[0150] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: receiving an intelligent report generation instruction sent by the terminal, obtaining path information according to the intelligent report generation instruction; obtaining information of each path node according to the path information, and calculating a preset target according to the path node information; obtaining a preset intelligent report template, writing the preset target into the preset intelligent report template, and obtaining a target intelligent report.
[0151] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0152] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0153] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A graph path query method, the method include: Receive an instruction to create a target knowledge graph, and collect legally disclosed target credit status information from various channels and obtain stored undisclosed target credit status information from an internal database according to the instruction to create a target knowledge graph; Identify the association relationship between the target entity and the target entity according to the disclosed target credit status information and the undisclosed target credit status information, and establish a target knowledge graph according to the association relationship between the target entity and the target entity, wherein the association relationship includes investment relationship, credit relationship, implicit relationship, event relationship, credit enhancement relationship, transaction relationship and other relationships, and the implicit relationship includes kinship relationship, intercourse relationship and agency relationship; A receiving terminal sends a graphic instruction of a target knowledge graph, obtains pre-configured query interface information according to the graphic instruction, sends the pre-configured query interface information to the terminal, and displays a query interface in the terminal according to the query interface information, wherein the target knowledge graph refers to a pre-established enterprise knowledge graph, and the enterprise knowledge graph shows the association relationship between enterprise entities and enterprise entities, enterprise entities and natural person entities, and enterprise entities and employee entities; Acquire a query request sent by the terminal through the query interface, the query request carrying a start target, an end target, and a path identifier, parse the query request, and obtain the start target, the end target, and the path identifier; The method comprises: obtaining a preset query algorithm corresponding to the path identifier according to the path identifier, querying the target knowledge graph using the preset query algorithm according to the starting target and the ending target to obtain path information, and sending the path information to the terminal, including: matching the corresponding target starting entity and the target ending entity in the target knowledge graph according to the starting target and the ending target; when the target starting entity and the target ending entity can be matched, querying the associated adjacent entities in the target knowledge graph according to the target starting entity to obtain an adjacent entity set; and when the target ending entity is found in the adjacent entity set, obtaining the path information of the target starting entity and the target ending entity.
2. The method according to claim 1, It is characterized in that Before obtaining the preset query algorithm corresponding to the path identifier according to the path identifier, the method further includes: The path identifier and the preset query algorithm corresponding to the path identifier are obtained, and the path identifier and the preset query algorithm are associated and saved.
3. The method according to claim 1, It is characterized in that According to the starting target and the ending target, the preset query algorithm is used to query in the target knowledge graph to obtain path information, including: Matching the corresponding target start entity and target end entity in the target knowledge graph according to the start target and the end target; When the target start entity and the target end entity can be matched, marking the target start entity; According to the marked target starting entity, a depth-first traversal algorithm is used to query the target knowledge graph until all entities in the target knowledge graph that have paths connected to the marked target starting entity are marked, thereby obtaining the path information of the target starting entity and the target ending entity.
4. The method according to any one of claims 1 or 3, It is characterized in that According to the starting target and the ending target, the corresponding target starting entity and target ending entity are matched in the target knowledge graph, including Using a natural semantic analysis algorithm to identify the starting target and the ending target, and obtain a starting keyword corresponding to the starting target and a ending keyword corresponding to the ending target; The start keyword and the end keyword are searched in the target knowledge graph, and when they can be found, a target start entity corresponding to the start keyword and a target end entity corresponding to the end keyword are obtained.
5. The method according to claim 1, It is characterized in that After sending the path information to the terminal, the method further includes: Receiving an intelligent report generation instruction sent by a terminal, and acquiring the path information according to the intelligent report generation instruction; Obtaining information of each path node according to the path information, and calculating a preset target according to the information of each path node; Obtain a preset smart report template, write the preset target into the preset smart report template, and obtain a target smart report.
6. A graph path query device, It is characterized in that The device comprises: A credit status acquisition module, used to receive an instruction to establish a target knowledge graph, and collect legally disclosed target credit status information from various channels and obtain undisclosed target credit status information stored in an internal database according to the instruction to establish the target knowledge graph; A graph building module, used to identify the association relationship between the target entity and the target entity according to the disclosed target credit status information and the undisclosed target credit status information, and to build a target knowledge graph according to the association relationship between the target entity and the target entity, wherein the association relationship includes investment relationship, credit relationship, implicit relationship, event relationship, credit enhancement relationship, transaction relationship and other relationships, and the implicit relationship includes kinship relationship, intercourse relationship and agency relationship; An interface acquisition module, used for receiving a graphic instruction of a target knowledge graph sent by a terminal, acquiring pre-configured query interface information according to the graphic instruction, sending the pre-configured query interface information to the terminal, and displaying a query interface in the terminal according to the query interface information, wherein the target knowledge graph refers to a pre-established enterprise knowledge graph, and the enterprise knowledge graph displays the association relationship between enterprise entities and enterprise entities, enterprise entities and natural person entities, and enterprise entities and employee entities; A request acquisition module, used to acquire a query request sent by a terminal through the query interface, the query request carrying a start target, an end target and a path identifier, and parse the query request to obtain the start target, the end target and the path identifier; A path query module is used to obtain a preset query algorithm corresponding to the path identifier according to a path identifier, use the preset query algorithm to query the target knowledge graph according to the starting target and the ending target, obtain path information, and send the path information to the terminal, including: matching the corresponding target starting entity and target ending entity in the target knowledge graph according to the starting target and the ending target; when the target starting entity and the target ending entity can be matched, querying the associated adjacent entities in the target knowledge graph according to the target starting entity to obtain an adjacent entity set; when the target ending entity is found in the adjacent entity set, obtaining the path information of the target starting entity and the target ending entity.
7. The device according to claim 6, It is characterized in that The device further comprises: The algorithm acquisition module is used to acquire the path identifier and the preset query algorithm corresponding to the path identifier, and associate the path identifier with the preset query algorithm and save them.
8. The device according to claim 6, It is characterized in that The path query module includes: An entity matching module, used for matching a corresponding target start entity and a target end entity in the target knowledge graph according to the start target and the end target; An entity marking module, used for marking the target starting entity when the target starting entity and the target ending entity can be matched; The second path obtaining module is used to query the target knowledge graph using a depth-first traversal algorithm according to the marked target starting entity, until all entities in the target knowledge graph that have paths connected to the marked target starting entity are marked, and then obtain the path information of the target starting entity and the target ending entity.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
