Active recognition and intelligent display method of scene interface based on knowledge graph
Through the knowledge graph to identify and analyze the interface content, build entity relationships, and achieve intelligent display, it solves the problem of users understanding and locating information in complex systems, and improves the efficiency of information acquisition and the visual expression of system content.
Patent Information
- Application Number
- CN202410320077.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-20
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-03-20
AI Technical Summary
In existing systems, it is difficult for users to find relevant content quickly and efficiently, and in systems that highly integrate professional knowledge, users are limited in understanding system content. Existing technologies cannot effectively solve this problem.
Using the scene interface identification and intelligent display method based on knowledge graph, by parsing interface labels, extracting key information, constructing the mapping relationship between interface entities and non-interface entities, and using the TF-IDF algorithm and shortest path algorithm to analyze correlations and realize knowledge cards Intelligent display and push.
Through the visual expression and real-time update of the knowledge graph, it helps users quickly understand the system structure, accurately push relevant content, simplify the system interface and enrich the content, and achieve rapid positioning and display of information.
Smart Images

Figure CN118193725B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a scene interface recognition and intelligent display method based on a knowledge graph. Background Art
[0002] With the rapid development of computer and network technology, more and more government departments, enterprises and other units have realized the research and development and application of related systems, making the work of government, enterprises and other units more efficient. However, at this stage, the functions of many systems are constantly iterating and updating, their integration is getting higher and higher, and the content is getting more and more complex, making it difficult for users to find relevant content quickly and efficiently. In addition, the system integrates a lot of professional knowledge, which also causes some troubles for some users to understand.
[0003] At present, when browsing the system website, it is still necessary to manually interpret the information in the interface and find the location of the target information by understanding the interface. In a system with highly integrated professional knowledge, this method is not only inefficient, but also difficult to explain the professional knowledge in the system in detail, which affects the user's understanding of the system content. There is still no corresponding effective solution to the above problems. Summary of the invention
[0004] The purpose of the present invention is to propose a method for active recognition and intelligent display of scene interfaces based on knowledge graphs to solve one or more technical problems existing in the prior art and at least provide a beneficial choice or create conditions.
[0005] A scene interface recognition and intelligent display method based on knowledge graph, wherein the method extracts the current interface content, and then combines the interface content with the knowledge graph content to realize intelligent display and scheduling of knowledge cards.
[0006] Parse the current system interface and obtain all tags in the current interface;
[0007] The specific method of obtaining all tags in the current interface is as follows: when jumping to the new interface content, the server obtains the request for the current interface content, and then uses the BeautifulSoup tool to parse the web page content, further obtains all tags in the current interface, and stores them in the form of an array;
[0008] Get the tag content, extract the key information, and traverse the interface entities corresponding to the tag in the knowledge graph;
[0009] The method of obtaining the tag content and searching for the corresponding entity specifically includes: traversing the tags according to the above array subscripts, screening and removing the tags without text content; extracting the tag key information by using the TF-IDF algorithm, traversing the knowledge graph by using the key information, searching for the corresponding entity, establishing a mapping relationship between the entity and the tag content, and constructing an interface entity set N;
[0010] According to the entity relationships in the knowledge graph, query the non-interface entities related to the above entities;
[0011] The query of non-interface entities related to the interface entity is specifically as follows: based on the length of the node representing the entity relationship in the knowledge graph, according to the scene requirements and computing power conditions, a certain length range is independently set, all non-interface entities within the length that can reach the interface entity are searched, and a non-interface entity set M is constructed;
[0012] Analyzing the shortest path between the non-interface entity and each interface entity;
[0013] The specific method of the shortest path analysis is: using each non-interface entity in the set M as a starting point and each interface entity in the set N as an end point, searching for all reachable paths in the knowledge graph, determining the shortest path according to the path length, and recording the unique identifiers of all passed nodes;
[0014] The main algorithm steps of the shortest path analysis are:
[0015] Initialize the distance matrix , where M represents non-interface entity, N represents interface entity, a1 represents the current shortest distance from non-interface entity Ma to interface entity N1, and the remaining variables are as described in Example a1. The shortest distance from non-interface entity to interface entity in the initial matrix is set to infinity;
[0016] ;
[0017] Repeat the traversal of all non-interface entities in M and calculate the shortest distance from the non-interface entity to all interface entities in the set: (1) is to obtain the neighbor node of the starting point, (2) is to determine whether there is an interface entity in the neighbor node, if so, determine the distance from the node to the starting entity, if it is less than the distance currently stored in the distance matrix, then update the value in the distance matrix and record the node, (3) is to use the neighbor node as the starting point and repeat the above operation. The number of repetitions can be set according to the actual computing power. The value stored in the distance matrix each time is the shortest distance from the starting non-interface entity to each interface entity. The recorded node is the entity node on the shortest path. Infinity in the distance matrix within the number of repetitions means that there is no shortest path between the corresponding non-interface entity and the interface entity.
[0018] According to the mutual relationship between interface entities and non-interface entities, a local knowledge graph is constructed;
[0019] The construction of the local knowledge graph specifically includes: constructing the local knowledge graph based on the relationship R between the above-mentioned interface entities, non-interface entities and entities in the shortest path;
[0020] Strong correlation analysis between non-interface entities and interface entities.
[0021] The strong correlation analysis between the non-interface entity and the interface entity comprehensively considers the strong correlation between the non-interface entity and the current system interface and the strong correlation between the non-interface entity and the single interface entity to ensure the intelligent push service of the optimal information. The specific method is:
[0022] Determine the strong correlation between the non-interface entity and the current system interface. The system interface content is composed of all interface entities and their attribute information. According to the distance matrix between the non-interface entity and the interface entity, query the longest distance among all the shortest paths, and construct the distance weight assignment standard accordingly.
[0023] According to the distance weight assignment standard and the shortest path distance between the non-interface and each interface entity, the path is assigned a corresponding distance weight, and the total distance weight of all the shortest paths from the non-interface entity to each interface entity is calculated. The larger the total distance weight, the stronger the correlation between the non-interface entity and the current system interface.
[0024] Determine the strong correlation between non-interface entities and a single interface entity in the local knowledge graph, and extract all non-interface entities based on the distance matrix. To a single interface entity The shortest distance between them, constructing a distance set , according to the distance set Classify the strength of the association between each non-interface entity and a single interface entity;
[0025] Combining the strong correlation between non-interface entities and the current system interface and the shortest distance between non-interface entities and a single interface entity, different weights are assigned to comprehensively judge the strong correlation between non-interface entities and interface entities.
[0026] Furthermore, the specific steps of the main algorithm of the strong correlation analysis are:
[0027] The algorithm obtains the distance matrix from non-interface entities to interface entities, and the longest non-infinite distance in the query distance matrix is , the shortest distance is , construct the distance weight standard, assign distance weight to the shortest path from non-interface entity to interface entity through reverse calculation, and set the shortest distance from non-interface entity to interface entity as ,but ;when for hour, , construct the distance weight matrix according to the distance matrix and the reverse calculation formula , the sum of the shortest path weights from a single non-interface entity to all interface entities That is, the correlation strength between the non-interface entity and the system interface;
[0028] Among them, the distance matrix Represents all non-interface entities that need to be judged for their relevance to the current interface. , Represents all interface entities in the current system interface. ,gather All non-interface entities To a certain interface entity The shortest path set, according to the reverse calculation formula, non-interface entities Interface Entity The strength of the correlation ,in represents the non-infinite maximum value, Represents non-interface entities To interface entity The shortest distance, ,when for hour, ;
[0029] According to the formula The correlation strength between non-interface entities and interface entities is comprehensively calculated, where is the strong correlation between non-interface entities and interface entities after weighted calculation, is the correlation strength between the non-interface entity and the system interface, is the weight of the correlation strength between the non-interface entity and the system interface, is the correlation strength between the non-interface entity and the single interface entity, is the weight of the correlation strength between non-interface entities and a single interface entity, , is the subjective weight value.
[0030] The association strength between non-interface entities and interface entities in the local knowledge graph is obtained, and the color depth is used as the division standard in the local knowledge graph according to the association strength to launch the non-interface content that the user is most likely to be interested in, realizing intelligent push service.
[0031] Furthermore, the specific methods for intelligently displaying and scheduling knowledge cards mainly include:
[0032] Build a knowledge card framework, and display the entity attribute information of the local knowledge graph and the local knowledge graph;
[0033] The specific steps of constructing the knowledge card framework are as follows: the knowledge card framework is divided into two parts, the upper part displays the interface entities and related non-interface entity attribute information, and the lower part displays the local knowledge graph constructed based on the interface entities, non-interface entities, shortest path intermediate entities, etc.
[0034] Display the local knowledge graph constructed above in the knowledge card;
[0035] The construction of the display content in the upper part is as follows: according to the extracted interface information of the mouse position, the corresponding interface entity information is searched, and according to the association strength between the entity relationship and the non-interface entity, the interface entity and the non-interface entity are displayed in the corresponding position of the knowledge card in a structured form;
[0036] The construction of the display content in the lower part is as follows: obtain the local knowledge graph, visualize it on the corresponding interface, distinguish it by color and size according to the strong correlation between non-interface entities and interface entities, and highlight the visualization effect;
[0037] Monitor the mouse movement position, obtain the mouse position and surrounding text information, and use the TF-IDF algorithm to obtain the key information, traverse the corresponding interface entities and attribute information in the local knowledge spectrum, and analyze the strong correlation between non-interface entities and interface entities. According to the strength of the correlation, the non-interface entities and interface entities are displayed in a structured manner, and the interface entity and related non-interface entity attribute information are highlighted in the knowledge card. This process is updated in real time as the mouse position moves, realizing the intelligent push of knowledge card content;
[0038] The intelligent push of knowledge card content is specifically as follows: monitor the mouse movement position, obtain the text information at the mouse position, use the TF-IDF algorithm to extract the key information, and query the corresponding interface entity in the local knowledge graph based on the information. Based on the entity relationship and the strong correlation between the non-interface entity and the interface entity, the interface entity and the non-interface entity obtained above are highlighted at the center of the upper and lower parts of the knowledge card respectively. The highlighted content in the upper part is the interface entity and non-interface entity and attribute information; the highlighted content in the lower part is the node representing the interface entity and the non-interface entity;
[0039] When you need to know detailed information about the content displayed in the knowledge card, you can stop updating the knowledge card content by listening to the left-button click event of the mouse. At this time, you can further click on the knowledge card content with the mouse; when you click the mouse again in the system interface or jump to a new system interface, the linkage function between the mouse and the knowledge card is restored.
[0040] The beneficial effects of the present invention are as follows: the knowledge base content is visualized through the knowledge graph, providing a data basis for the recognition and intelligent scheduling of the scene interface; by obtaining the current interface label, the corresponding position in the knowledge graph is queried; based on the entity relationship, non-interface entity information is queried, and the correlation between non-interface entities and interface entities is analyzed based on the strong association algorithm to assist users in determining the area of interest; by monitoring the mouse position, relying on the constructed local knowledge graph, the entity attribute information and the position of the entity in the knowledge graph are displayed in real time in the knowledge card, helping users to quickly understand the system structure and accurately push relevant content; by constructing knowledge cards, the system interface is simplified while the system content is enriched; by constructing hyperlinks in the knowledge cards, users are helped to quickly locate and display information, and the system is assisted in completing the scheduling of knowledge content. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to further explain the present invention in detail, the present invention is provided with the following drawings and specific embodiments for explanation, and the drawings and embodiments do not constitute a limitation on the present invention. The drawings are as follows:
[0042] Figure 1 It is a related step of the present invention for extracting current interface information and constructing a local knowledge graph;
[0043] Figure 2 It is a step of analyzing the strong correlation between non-interface entities and interface entities in the local knowledge graph constructed by the present invention;
[0044] Figure 3 It is a knowledge card construction framework of the present invention;
[0045] Figure 4 It is a flow chart of a knowledge card content display and intelligent scheduling method of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects of the present invention, so as to fully understand the purpose, scheme and effect of the present invention. It should be noted that the embodiments and features in the embodiments of this application can be combined with each other without conflict.
[0047] like Figures 1 to 4 As shown, the present invention provides a method for constructing and supplementing a knowledge graph, which is as follows:
[0048] Taking Deqing SDGs knowledge service system as an example, a knowledge graph sample built based on the knowledge base is shown:
[0049] S110, represents Deqing SDGs knowledge base;
[0050] S120, indicating that the data in the knowledge base is stored according to a triple structure, wherein the triple is represented as: ,in:
[0051] is the entity set in the knowledge base, including different entities;
[0052] is the set of relations in the knowledge base, including Different kinds of relationships;
[0053] belong Represents the set of triples in the knowledge base;
[0054] S130 represents the knowledge graph constructed according to the triple structure based on the Deqing SDGs knowledge base.
[0055] Preferably, based on the constructed knowledge graph example, the present invention provides a method for identifying the current interface of the system and querying non-interface content, the main steps are as follows: Figure 1 As shown, specifically:
[0056] S210, parsing the tag information in the current interface of the system. A web page may contain multiple hypertext markup language (html) tags, and the tag content may be text, pictures, voice, video, etc. By obtaining the html file of the current web page, all html tags in the page are found;
[0057] S220, classify the above html tags according to tag types such as text tags, image tags, audio tags, etc., remove non-text tags and obtain tag text content;
[0058] S230, using the TF-IDF algorithm to extract key information of the tag, using the key information to traverse the knowledge graph, find the corresponding entity therein, establish a mapping relationship between the entity and the tag content, and construct an interface entity set N;
[0059] S240. Based on the above-mentioned interface entities and in combination with entity relationships, search for non-interface entities related to the interface entities in the knowledge graph. Based on the length of the node representing the entity relationship in the knowledge graph, search for all non-interface entities that can reach the interface entity within the length, and construct a non-interface entity set M. The length can be set according to the actual scenario requirements and the supported computing power conditions. For example, the edge between two entity nodes represents a unit length of 1. If the length is set to a, it means that M is the set of all non-interface entities whose shortest distance to any interface entity does not exceed a. The smaller a is, the smaller the calculation amount is, and the fewer non-interface entities are in the set;
[0060] S250. In order to analyze the strong correlation between non-interface entities and interface entities, ensure the accurate push of system content, and build the integrity of the local knowledge graph, the present invention designs a shortest path algorithm for analyzing the shortest distance from non-interface entities to interface entities and recording entity information in the path, as follows:
[0061] Initialize a The matrix, matrix is an unrestricted matrix, not limited to size, where M is the number of non-interface entities and N is the number of interface entities, for each cell , set its initial value to infinity, indicating that To Entity The path does not exist yet;
[0062] Repeat the process of traversing all non-interface entities in M and calculating the shortest distance from all non-interface entities in the set to the interface entities: (1) Obtain the neighboring node of the starting point; (2) Determine whether there is an interface entity in the neighboring node. If so, determine the distance from the entity to the starting entity. If it is less than the distance currently stored in the distance matrix, update the value in the distance matrix and record the node; (3) Repeat the process with the neighboring node as the starting point.
[0063] Complete calculation: The number of repetitions can be set according to the actual computing power. The value stored in the distance matrix each time is the shortest distance from the non-interface entity to each interface entity, and the recorded node is the entity node on the shortest path. Infinity in the distance matrix within the number of repetitions means that there is no shortest path between the corresponding non-interface entity and the interface entity;
[0064] ;
[0065] S260, constructing a local knowledge graph based on the above-mentioned interface entities, non-interface entities, shortest path intermediate entities, entity relationships, etc., wherein the graph includes content in the current interface and content related to the interface;
[0066] The above method searches for the corresponding entity by identifying the current interface label, searches for related non-interface entities based on entity relationships, and then uses the non-interface entity as the starting point and each interface entity as the end point to query the shortest path according to the shortest path query algorithm, and records the intermediate nodes. A local knowledge graph is constructed based on interface entities, non-interface entities, and intermediate nodes of the shortest path. The knowledge graph will be updated in real time as the current interface changes, so the local knowledge graph plays an important role in the intelligent display of system content.
[0067] In order to ensure the accurate push of system content, the present invention not only constructs the above-mentioned local knowledge graph, but also considers the correlation between non-interface entities and the current system interface and the correlation between non-interface entities and a single interface entity, and designs an algorithm for comprehensively determining the correlation between non-interface entities and interface entities, thereby inferring the non-interface entity information that users are more likely to be interested in. The main steps of the algorithm are as follows: Figure 2 As shown, the details are as follows:
[0068] S310, constructing a distance weight standard, according to the distance matrix between the non-interface entity and the interface entity, querying the longest distance and the shortest distance in all the shortest paths as the distance weight assignment standard, where the non-infinite longest distance is , the shortest distance is ;
[0069] S320, construct a distance weight matrix, and assign corresponding distance weights to the paths according to the distance weight assignment standard and the shortest path distance between the non-interface and each interface entity. Distance weights are assigned to the shortest path from the non-interface entity to the interface entity through reverse calculation. For example, the shortest distance from the non-interface entity to the interface entity is ,but ;when for hour, , construct the distance weight matrix according to the distance matrix and the reverse calculation formula ;
[0070] S330, calculate the correlation between non-interface entities and system interfaces. According to the distance weight matrix, calculate the total distance weight of all shortest paths from non-interface entities to each interface entity. The larger the total distance weight, the stronger the correlation between the non-interface entity and the current interface content. The sum of the shortest path weights from non-interface entities to interface entities is. That is, the correlation strength between the non-interface entity and the system interface;
[0071] S340, calculate the correlation between the non-interface entity and the single interface entity. Represents all non-interface entities that need to be judged for their relevance to the current interface. Represents the interface entity in the current system interface. Collection All non-interface entities To a certain interface entity The shortest path set of According to the reverse calculation formula, non-interface entities Interface Entity The strength of the correlation ,in represents the non-infinite maximum value, Represents non-interface entities To interface entity The shortest distance, ,when for hour, .
[0072] S350, comprehensive analysis of strong correlation between non-interface entities and interface entities. According to the formula The correlation strength between non-interface entities and interface entities is calculated comprehensively. is the strong correlation between non-interface entities and interface entities after weighted calculation, is the correlation strength between the non-interface entity and the system interface, is the weight of the correlation strength between the non-interface entity and the system interface, is the correlation strength between the non-interface entity and the single interface entity, It is the weight of the correlation strength between non-interface entities and a single interface entity. , The weight value can be set manually according to the scene requirements to meet the actual requirements of different application scenarios.
[0073] S360, obtaining the association strength between the non-interface entities and the interface entities in the local knowledge graph, and using the color depth as a division standard in the local knowledge graph according to the association strength, to push out the non-interface content that the user is most likely to be interested in, and realize intelligent push service;
[0074] For example, when a knowledge card displays a local knowledge graph, non-interface entities with high weight scores have dark colors, while non-interface entities with low weight scores have light colors.
[0075] The above describes a method for judging the strong correlation between entities in a knowledge graph. By comprehensively calculating the strong correlation analysis between non-interface entities and interface entities, the non-interface content that is more relevant to the current interface of the system can be accurately located. The content is displayed in the knowledge card. Traditional knowledge cards only present the interface content that needs to be displayed in the knowledge card. Although the system content is enriched, the content is still not displayed in a structured form, which makes it difficult to better help users understand the system content. In combination with the above content, the present invention provides a method for designing a knowledge card. The main process is as follows: Figure 3 As shown, the details are as follows:
[0076] The present invention divides the knowledge card into two parts for display. The upper part is a structured display of the system content, including interface entities, related non-interface entities and attribute information; the lower part is the local knowledge graph constructed by the above S260, and is intelligently displayed according to the strong correlation between entities.
[0077] S410, the display of system content mainly displays the interface entities, non-interface entities and entity attribute information in the local knowledge graph in the knowledge card. The content display method is: according to user needs, the interface entity to be displayed in the knowledge card is obtained, and according to the strength of the correlation between the non-interface entity and the interface entity, the non-interface entity with strong correlation in the local knowledge graph is obtained, and according to the strength of the correlation, the interface entity and the non-interface entity are summarized in the upper display box of the knowledge card for intelligent display by using color and size level classification.
[0078] S420, the display of the local knowledge graph specifically includes: all nodes and edge information of the local knowledge graph. Step S350 obtains the strength of the correlation between the non-interface entity and a certain interface entity, obtains the interface entity that needs to be displayed in the knowledge card according to user needs, and highlights the interface entity and the strongly associated non-interface entity in the center of the display box below the knowledge card according to the strength of the correlation between the non-interface entity and the interface entity. By changing the size, color, brightness, etc. of the nodes, the strength of the correlation between the interface entity and the non-interface entity is displayed, so that the user has a clearer intuitive feeling. For example: Figure 3 In the local knowledge graph displayed in the figure, "interface entity 1" is the interface entity that needs to be consulted currently, "non-interface entity 1", "non-interface entity 2" and "non-interface entity 3" are non-interface entities that have a strong correlation with the interface entity, and their node sizes are higher than the "non-interface entity 4" with a weaker correlation. The above is only to help understand the content of the present invention, and the technology contained therein is not limited to the above content.
[0079] The above-mentioned knowledge card construction method better displays the knowledge structure of the system and the more detailed and comprehensive content of the system, realizing the simplification, integration and intelligence of the system. At the same time, in order to make the system more intelligent, the present invention designs a method for actively obtaining the content of knowledge cards. The main steps are as follows: Figure 4 As shown, specifically including:
[0080] S510 and S520 monitor the information of the mouse position. For example, in the callback function of the mouse move event (mousemove), the event.target attribute is used to obtain the text information around the mouse pointer, and the TF-IDF algorithm is used to obtain the key information therein.
[0081] S530, traversing the local knowledge graph according to the acquired key information to find the corresponding entity and attribute information. Through the acquired entity, according to the entity relationship and the correlation between the non-interface entity and the interface entity obtained above, the non-interface entity related to the entity is acquired to construct an information set;
[0082] S550, step S530 obtains information such as interface entities and related non-interface entities based on the mouse position, entity relationships, etc., and through the degree of association between the non-interface entity obtained in S350 and the current interface, the related non-interface entity information can be classified into classes according to the strength of the association. While realizing the above process, the queried information is highlighted in the center area of the upper and lower parts of the knowledge card;
[0083] Preferably, S540, the entity attribute information in the knowledge graph includes the corresponding location information of the entity in the system. Therefore, when the user browses the content displayed partially on the knowledge card, he can jump to the location of the information in the system by clicking on a certain entity information with the mouse. The function is mainly used to help users locate the information location, especially the non-interface information content displayed in the knowledge card, which can directly jump to the information interface that they want to know. The user can directly jump to the specific location of the entity content represented by the node by clicking the node in the local knowledge graph with the mouse;
[0084] When the user moves the mouse to a certain position, the upper and lower parts of the knowledge card will simultaneously push the information related to the element information at the position to the corresponding display area. The content of the upper part will be distinguished and highlighted by color, size, etc. according to the interface entity corresponding to the element information and the non-interface entity type related to the interface entity. In the local knowledge graph of the lower part, the interface entity corresponding to the element information and the non-interface entity related to the interface entity are distinguished and highlighted in the above manner to help users better understand the information displayed by the knowledge card. The highlighted content can be customized according to user needs, including the display quantity and display level. When you need to know the detailed information of the content displayed in the knowledge card, you can stop updating the knowledge card content by listening to the left mouse click event. At this time, you can further click on the knowledge card content with the mouse; when you click the mouse again in the system interface or jump to the new system interface, the linkage function between the mouse and the knowledge card is restored.
[0085] Through the identification and display method in the above embodiment, the present invention can obtain the content in the current interface and the non-current interface related to the current interface in a simple way, and through the strong correlation analysis algorithm in the present invention, the correlation between the content in the non-current interface and the content of the current interface is obtained, so as to judge the system content that the user may be interested in. According to the knowledge graph combined with the knowledge card, the present invention realizes the intelligent display of the system content, which not only simplifies the system interface, but also enriches the system content, and helps users understand the professional knowledge in the system through detailed explanatory information. Users will not be limited to the traditional blind search for required information by jumping to the corresponding interface through fixed system buttons, but can jump to the interface of interest through the content displayed on the knowledge card and the knowledge graph. The present invention can realize a more professional, integrated, simplified and intelligent system.
[0086] Although the description of the present invention has been quite detailed and has been described in particular with respect to several described embodiments, it is not intended to be limited to any of these details or embodiments or any particular embodiment, so as to effectively cover the intended scope of the present invention. In addition, the present invention is described above with the embodiments foreseeable by the inventors, and its purpose is to provide a useful description, and those non-substantial changes to the present invention that are not currently foreseen may still represent equivalent changes of the present invention.
Claims
1. A scene interface recognition and intelligent display method based on knowledge graph, characterized in that: The method is to extract the current interface content and the content corresponding to the current mouse position, specifically including: parsing the current page, and obtaining all tags in the current page, and obtaining key information according to the tag content; the content corresponding to the mouse position specifically includes: monitoring the mouse movement position, obtaining text information around the mouse movement position, and obtaining key information according to the text information around the mouse movement position; combining the extracted key information of the current interface content and the content corresponding to the current mouse position with the knowledge graph content to realize intelligent display and scheduling of knowledge cards; The extraction of the current interface content and the content corresponding to the current mouse position comprises the following steps: Parse the current system interface and obtain all tags in the current interface; Get the tag content, extract the key information, traverse the interface entities corresponding to the tags in the knowledge graph, establish the mapping relationship between the entities and the tag content, and construct the interface entity set N; According to the entity relationship in the knowledge graph, query the non-interface entities related to the interface entity and construct a non-interface entity set M; Analyzing the shortest paths between each non-interface entity in the non-interface entity set M and each interface entity in the interface entity set N, and constructing a distance matrix between the non-interface entities and the interface entities; According to the mutual relationship between interface entities and non-interface entities, a local knowledge graph is constructed; The construction of the local knowledge graph specifically includes: constructing the local knowledge graph based on the relationship R between the above-mentioned interface entities, non-interface entities and entities in the shortest path; Strong correlation analysis between non-interface entities and interface entities; The strong correlation analysis between the non-interface entity and the interface entity comprehensively considers the strong correlation between the non-interface entity and the current system interface and the strong correlation between the non-interface entity and the single interface entity to ensure the intelligent push service of the optimal information. The specific method is: Determine the strong correlation between the non-interface entity and the current system interface. The system interface content is composed of all interface entities and their attribute information. According to the distance matrix between the non-interface entity and the interface entity, query the longest distance among all the shortest paths, and construct the distance weight assignment standard accordingly. According to the distance weight assignment standard and the shortest path distance between the non-interface and each interface entity, the path is assigned a corresponding distance weight, and the total distance weight of all the shortest paths from the non-interface entity to each interface entity is calculated. The larger the total distance weight, the stronger the correlation between the non-interface entity and the current system interface. Determine the strong correlation between non-interface entities and single interface entities in the local knowledge graph, and extract all non-interface entities M according to the distance matrix. j The shortest distance to a single interface entity i, constructing a distance set {a i ,b i ,c i ,d i ,e i }, according to the distance set {a i ,b i ,c i ,d i ,e i }Divide the strength of the association between each non-interface entity and a single interface entity; Combining the strong correlation between non-interface entities and the current system interface and the shortest distance between non-interface entities and a single interface entity, different weights are assigned to comprehensively judge the strong correlation between non-interface entities and interface entities. The specific method for intelligently displaying and scheduling knowledge cards includes: Construct a knowledge card framework, and display the entity attribute information of the local knowledge graph and the local knowledge graph. Specifically, the knowledge card framework is divided into two parts, the upper part displays the interface entity and the related non-interface entity attribute information, and the lower part displays the local knowledge graph constructed based on the interface entity, non-interface entity, and the shortest path intermediate entity, and the above-constructed local knowledge graph is displayed in the knowledge card; The construction of the display content in the upper part is as follows: according to the extracted interface information of the mouse position, the corresponding interface entity information is searched, and according to the association strength between the entity relationship and the non-interface entity, the interface entity and the non-interface entity are displayed in the corresponding position of the knowledge card in a structured form; The construction of the display content in the lower part is as follows: obtain the local knowledge graph, visualize it on the corresponding interface, distinguish it by color and size according to the strong correlation between non-interface entities and interface entities, and highlight the visualization effect; Monitor the mouse movement position, obtain the mouse position and surrounding text information, and use the TF-IDF algorithm to obtain the key information, traverse the corresponding interface entities and attribute information in the local knowledge spectrum, and analyze the strong correlation between non-interface entities and interface entities. According to the strength of the correlation, the non-interface entities and interface entities are displayed in a structured manner, and the interface entity and related non-interface entity attribute information are highlighted in the knowledge card. This process is updated in real time as the mouse position moves, realizing the intelligent push of knowledge card content.
2. The scene interface recognition and intelligent display method based on knowledge graph according to claim 1 is characterized in that: The extracting of the current interface content and the content corresponding to the current mouse position also includes the following steps: Parse the current system interface and obtain all tags in the current interface. Specifically, when jumping to the new interface content, the server obtains the request for the current interface content, and then uses the BeautifulSoup tool to parse the web page content, further obtains all tags in the current interface, and stores them in the form of an array; The method of obtaining the tag content, extracting the key information therein, traversing the interface entities corresponding to the tag in the knowledge graph, establishing a mapping relationship between the entity and the tag content, and constructing the interface entity set N is specifically as follows: traversing the tags according to the above array subscripts, screening and removing the tags without text content; extracting the key information of the tags by using the TF-IDF algorithm, traversing the knowledge graph by using the key information, and searching for the entities corresponding thereto; establishing a mapping relationship between the entity and the tag content, and constructing the interface entity set N; The method of querying non-interface entities related to the interface entity based on the entity relationship in the knowledge graph and constructing the non-interface entity set M is as follows: based on the length of the node representing the entity relationship in the knowledge graph, the length range is independently set according to the scene requirements and computing power conditions, and all non-interface entities within the length that can reach the interface entity are searched. The shortest paths between each non-interface entity in the non-interface entity set M and each interface entity in the interface entity set N are analyzed to construct the distance matrix between the non-interface entities and the interface entities. Specifically, each non-interface entity in the set M is used as a starting point and each interface entity in the set N is used as an end point. All reachable paths are searched in the knowledge graph, and the shortest path is determined according to the path length, and the unique identifiers of all passed nodes are recorded. The steps of the shortest path analysis algorithm are: Initialize the distance matrix M×N, where M represents non-interface entities, N represents interface entities, and a1 represents non-interface entity M a The current shortest distance to the interface entity N1, the remaining variables are as in Example a1, and the shortest distance from the non-interface entity to the interface entity in the distance matrix is set to infinity; Repeat the traversal of all non-interface entities in M, and calculate the shortest distance from the non-interface entity to all interface entities in the set: Step 1 is to obtain the neighboring node of the starting point, Step 2 is to determine whether there is an interface entity in the neighboring node, if so, determine the distance from the node to the starting entity, if it is less than the distance currently stored in the distance matrix, then update the value in the distance matrix and record the node, Step 3 is to use the neighboring node as the starting point, repeat the above steps, and the number of repetitions can be set according to the actual computing power. The value stored in the distance matrix each time is the shortest distance from the starting non-interface entity to each interface entity, and the recorded node is the entity node on the shortest path. Infinity in the distance matrix within the number of repetitions means that there is no shortest path between the corresponding non-interface entity and the interface entity.
3. The scene interface recognition and intelligent display method based on knowledge graph according to claim 2 is characterized in that: The specific steps of the strong correlation analysis algorithm are: The algorithm obtains the distance matrix from the non-interface entity to the interface entity, and the longest non-infinite distance in the query distance matrix is s max =max{a ij ……e ij }, the shortest distance is s min =min{a ij ……e ij }, construct the distance weight standard, assign distance weight to the shortest path from non-interface entity to interface entity through reverse calculation, set the shortest distance from non-interface entity to interface entity as x, then P x =s max +s min -x; when x is ∞, P x =0, construct the distance weight matrix P according to the distance matrix and the reverse calculation formula MN , the sum of the shortest path weights from a single non-interface entity to all interface entities P j That is, the correlation strength between the non-interface entity and the system interface; Among them, the distance matrix M j represents all non-interface entities that need to be judged for their relevance to the current interface, j∈(a,b,c,d,e), N i Represents all interface entities in the current system interface, i∈(1,2,3,4,5), the set {a i ,b i ,c i ,d i ,e i } indicates that all non-interface entities M j The shortest path set to a certain interface entity i, according to the reverse calculation formula, the correlation strength φ between non-interface entity j and interface entity i j =max{a i ,b i ,c i ,d i ,e i }+1-y i , where max{a i ,b i ,c i ,d i ,e i } represents the non-infinite maximum value, y i represents the shortest distance from non-interface entity j to interface entity i, y∈(a,b,c,d,e), when y i When ∞, φ j =0; According to the formula W = P j ×P1+φ j ×P2 comprehensively calculates the correlation strength between non-interface entities and interface entities, where W is the strong correlation between non-interface entities and interface entities after weighted calculation, and P j is the correlation strength between the non-interface entity and the system interface, P1 is the weight of the correlation strength between the non-interface entity and the system interface, φ j is the correlation strength between the non-interface entity and the single interface entity, P2 is the weight of the correlation strength between the non-interface entity and the single interface entity, and P1 and P2 are subjective weight values.
4. The scene interface recognition and intelligent display method based on knowledge graph according to claim 1 is characterized in that: The smart push of knowledge card content is specifically implemented as follows: Monitor the mouse movement position, obtain the text information at the mouse position, use the TF-IDF algorithm to extract the key information, and query the corresponding interface entity in the local knowledge graph based on the key information. According to the entity relationship and the strong correlation between the non-interface entity and the interface entity, highlight the center position of the upper and lower parts of the knowledge card respectively. The upper part highlights the interface entity and the non-interface entity and the attribute information; the lower part highlights the node representing the interface entity and the non-interface entity. Obtain URL information from the entity attributes of interface entities and non-interface entities, establish hyperlinks in the entity information displayed in the knowledge card and the local knowledge graph, and implement system auxiliary scheduling in the knowledge card; The auxiliary scheduling of the system implemented in the knowledge card is specifically as follows: when constructing the knowledge graph as mentioned above, each entity attribute information contains the corresponding position. When displaying the local knowledge graph content in the knowledge card, the entity information in the knowledge card is linked to the location of the entity in the system, so as to help users to more quickly access the content of interest and realize direct auxiliary scheduling of different interfaces in the system.
