Retrieval method, retrieval device, computer readable storage medium and electronic equipment
By obtaining the search conditions and the type of ontology to be retrieved, determining the candidate ontology and calculating the similarity, the problem of high complexity of traditional knowledge graph retrieval operations is solved, efficient and accurate acquisition of search results is achieved, and user operation process is simplified.
Patent Information
- Application Number
- CN202411081068.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-11-22
AI Technical Summary
Traditional knowledge graph retrieval methods have high operational complexity and low efficiency, and require the use of complex query languages such as SPARQL, which makes it difficult for users to operate and have high maintenance costs.
Provide a search method to determine the candidate ontology by obtaining the search conditions and the type of ontology to be retrieved, and determine the search results based on the similarity between the search conditions and the candidate ontology, which reduces the user's need to write a query language, improves the search efficiency and accuracy.
It simplifies knowledge graph retrieval operations, reduces the complexity and maintenance costs of graph retrieval, improves retrieval efficiency and accuracy, and users can obtain accurate results without writing complex query languages.
Smart Images

Figure CN119003695A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of information retrieval, and in particular to a retrieval method, a retrieval device, a computer-readable storage medium, and an electronic device. Background Art
[0002] Knowledge graph is a formalized knowledge representation method that uses graph structures such as nodes (entities or concepts) and edges (relationships) to represent the relationship between information. It can be used to describe entities, concepts and the relationships between them in the real world.
[0003] The retrieval capability of the graph is designed to provide users with accurate and personalized ways to obtain information. However, traditional knowledge graph retrieval methods require the use of complex query languages such as SPARQL (Protocol and RDF Query Language, a query language and data acquisition protocol developed for RDF (Resource Description Framework)), which leads to high complexity and low efficiency of retrieval operations.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a retrieval method and device, a computer-readable storage medium and an electronic device, thereby improving the problems of high complexity and low efficiency of knowledge graph retrieval operations at least to a certain extent.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to the first aspect of the present disclosure, a retrieval method is provided, comprising: in response to confirming a retrieval operation, obtaining retrieval conditions and the type of ontology to be retrieved; determining a candidate ontology based on the ontology indicated by the type of ontology to be retrieved in the target knowledge graph; and determining a retrieval result based on the similarity between the retrieval conditions and the candidate ontology.
[0008] Optionally, obtaining the ontology type to be retrieved includes: obtaining the ontology type to be retrieved according to the ontology type selected in the graph ontology type table.
[0009] Optionally, obtaining the ontology type to be retrieved includes: obtaining the ontology type to be retrieved according to the ontology type in the selected graph ontology type table.
[0010] Optionally, the method for determining the target knowledge graph includes: determining the target knowledge graph according to the knowledge graph corresponding to the selected graph ontology type table.
[0011] Optionally, the method further includes: extracting ontology types in the knowledge graph based on a preset period; and updating a graph ontology type table corresponding to the knowledge graph according to the extracted ontology types.
[0012] Optionally, the method further includes: in response to generating an ontology type change log in the knowledge graph log, updating a graph ontology type table corresponding to the knowledge graph according to the ontology type changes indicated by the ontology type change log.
[0013] Optionally, determining the search result according to the similarity between the search condition and the candidate ontology includes: determining the search result according to the candidate ontologies ranked in the top N in terms of similarity.
[0014] According to a second aspect of the present disclosure, a retrieval device is provided, comprising: a confirmation retrieval module, configured to obtain retrieval conditions and a type of ontology to be retrieved in response to a confirmation retrieval operation; a candidate ontology determination module, configured to determine a candidate ontology based on an ontology indicated by the type of ontology to be retrieved in a target knowledge graph; and a retrieval result determination module, configured to determine a retrieval result based on a similarity between the retrieval conditions and the candidate ontology.
[0015] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the retrieval method as described in the first aspect of the above embodiment is implemented.
[0016] According to a fourth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the retrieval method described in the first aspect of the above embodiment.
[0017] According to a fifth aspect of the present disclosure, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the steps of the retrieval method as described in the first aspect.
[0018] It can be seen from the above technical solutions that the search method, search device, and computer-readable storage medium and electronic device for implementing the search method in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
[0019] In the technical solutions provided in some embodiments of the present disclosure, first, in response to confirming the search operation, the search conditions and the type of ontology to be searched can be obtained, and then, according to the ontology indicated by the type of ontology to be searched in the target knowledge graph, the candidate ontology can be determined, and finally, according to the similarity between the search conditions and the candidate ontology, the search result can be determined. Compared with the related art, on the one hand, the present disclosure can determine the search results from the knowledge graph through the search conditions and the type of ontology to be searched, without the need for the user to write a search query language to perform the search, thereby reducing the operational complexity of the graph search and improving the operational efficiency of the graph search; on the other hand, the present disclosure can quickly and accurately determine the candidate ontology from the knowledge graph by searching the ontology type, thereby improving the search efficiency and accuracy.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0022] Figure 1 A schematic diagram showing an exemplary system architecture to which embodiments of the present disclosure may be applied;
[0023] Figure 2 A schematic diagram showing a flow chart of a retrieval method in an exemplary embodiment of the present disclosure;
[0024] Figure 3 A schematic diagram showing a knowledge graph in an exemplary embodiment of the present disclosure;
[0025] Figure 4 A schematic diagram showing another knowledge graph in an exemplary embodiment of the present disclosure;
[0026] Figure 5 A schematic diagram showing a knowledge graph retrieval system in an exemplary embodiment of the present disclosure;
[0027] Figure 6 An interactive schematic diagram showing a knowledge graph retrieval process in an exemplary embodiment of the present disclosure;
[0028] Figure 7 A schematic diagram showing the composition of a retrieval device in an exemplary embodiment of the present disclosure;
[0029] Figure 8 A schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0030] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0031] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0032] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0033] Knowledge graph is a structured information representation method used to describe entities, concepts and the relationships between them in the real world. It is usually represented in the form of a graph, consisting of nodes (entities or concepts) and edges (relationships).
[0034] The graph's retrieval capability is designed to provide users with accurate and personalized ways to obtain information, promote the development of intelligent question-answering systems, facilitate cross-domain knowledge discovery and application, and accelerate the advancement of semantic search and decision support technologies.
[0035] In the related technology, when the business system connects to each knowledge graph, first, it needs to read the ontology design of each knowledge graph and write it in the code or configuration file. When the knowledge graph has an ontology update, it needs to update the code or configuration file, and upgrade the retrieval capability for the corresponding scenario. It can be seen that its scalability is poor, resulting in high graph retrieval and maintenance costs. Secondly, to search for different graph ontologies, complex query languages such as SPARQL are usually used for querying. Not only does it require research and development and writing at the business system code level, it has a high degree of coupling, but it also makes the retrieval operation difficult and inefficient for users. Furthermore, it relies on the relationship between ontologies for retrieval, and due to the complex relationship between word meanings, its retrieval efficiency is low.
[0036] In order to solve the above problems, the present invention provides a search method and device, which can be applied to Figure 1 In the system architecture of the exemplary application environment shown.
[0037] like Figure 1 As shown, the system architecture 100 may include a terminal device 110 and a server 120. The terminal device 110 may be a terminal device such as a smart phone, a tablet computer, a desktop computer, a laptop computer, a smart wearable device, etc. The server 120 generally refers to a background system that provides services related to the retrieval method in this exemplary embodiment, and may be a server or a cluster formed by multiple servers. The terminal device 110 and the server 120 may be connected via a wired or wireless communication link to perform data exchange.
[0038] In an exemplary embodiment, the above-mentioned retrieval method can be performed by the terminal device 110. Accordingly, the retrieval device can be set in the terminal device 110 to implement the corresponding module functions. For example, the user enters the retrieval conditions in the terminal device 110 and selects the ontology type. The terminal device 110 determines the ontology type to be retrieved according to the selected ontology type, and then searches for the ontology of the ontology type class to be retrieved in the target knowledge graph to obtain the candidate ontology, and then calculates the similarity between the candidate ontology and the retrieval conditions, determines the retrieval results according to the similarity, and displays the retrieval results in the graphical user interface of the terminal device 110.
[0039] In an exemplary embodiment, the above-mentioned retrieval method can be performed by the server 120. Accordingly, the retrieval device can be set in the server 120 to implement the corresponding module functions. For example, after the user uses the terminal device 110 to input the retrieval conditions and select the graph ontology type, the terminal device 110 uploads the retrieval conditions and the graph ontology type selected by the user to the server 120, and the server 120 determines the ontology corresponding to the graph ontology type selected by the user from the target knowledge graph to obtain the candidate ontology, and calculates the similarity between the candidate ontology and the retrieval conditions input by the user, determines the retrieval results based on the similarity, and returns the retrieval results to the terminal device 110.
[0040] In an exemplary embodiment, the above-mentioned retrieval method can also be jointly performed by the terminal device 110 and the server 120. Accordingly, some modules of the retrieval device can be set in the terminal device 110, and some modules can be set in the server 120 to realize the corresponding module functions. For example, after the user enters the retrieval conditions and selects the graph ontology type in the terminal device 110, the terminal device 110 can determine the ontology corresponding to the graph ontology type selected by the user from the target knowledge graph to obtain the candidate ontology, and then send both the candidate ontology and the retrieval conditions to the server 120. The server 120 can calculate the similarity between the retrieval conditions and each candidate sample, and then determine the retrieval results based on the similarity, and send the retrieval results to the terminal device 110, and the terminal device 110 displays the retrieval results in the graphical user interface.
[0041] It should be understood that Figure 1 The number of terminal devices and servers in the example is only illustrative. Any number of terminal devices and servers may be provided as required. For example, the server 120 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0042] However, it is easy for those skilled in the art to understand that the above application scenarios are only used as examples and are not limited to this in the present exemplary embodiment.
[0043] Figure 2 A schematic diagram showing a flow chart of a retrieval method in an exemplary embodiment of the present disclosure is shown. Figure 2 , the method comprising:
[0044] Step S210, in response to confirming the search operation, obtaining search conditions and the type of ontology to be searched;
[0045] Step S220, determining a candidate ontology according to the ontology indicated by the ontology type to be retrieved in the target knowledge graph;
[0046] Step S230: determining a search result according to the similarity between the search condition and the candidate ontology.
[0047] exist Figure 2 In the technical solution provided by the illustrated embodiment, first, in response to confirming the search operation, the search conditions and the type of ontology to be searched can be obtained, then, according to the ontology indicated by the type of ontology to be searched in the target knowledge graph, the candidate ontology can be determined, and finally, according to the similarity between the search conditions and the candidate ontology, the search result can be determined. Compared with the related art, on the one hand, the present disclosure can determine the search results from the knowledge graph through the search conditions and the type of ontology to be searched, without the need for the user to write a search query language to perform the search, thereby reducing the operational complexity of the graph search and improving the operational efficiency of the graph search; on the other hand, the present disclosure can quickly and accurately determine the candidate ontology by searching the ontology type, thereby improving the search efficiency and the search accuracy.
[0048] Next, the specific implementation of step S210 of obtaining the search conditions and the type of ontology to be searched in response to confirming the search operation is described in detail.
[0049] Exemplarily, in the present disclosure, ontology types can be extracted from the knowledge graph in advance, and then the extracted ontology types are displayed to the user in the business system. For example, ontology types are extracted from the knowledge graph and displayed to the user in the form of a graph ontology type table in the business system.
[0050] The knowledge graph not only records the relationship between entities, but also includes the attributes, classifications, events and other information of entities. Each node of the knowledge graph can be used as an ontology of the knowledge graph. Figure 3 A schematic diagram of a knowledge graph in an exemplary embodiment of the present disclosure is shown. Figure 3 Taking the knowledge graph shown in the figure as an example, the ontology type extraction can be performed to obtain the graph ontology type list shown in Table 1 below. Table 1 can be displayed to the user through the business system, that is, the graph ontology type list shown in Table 1 is displayed in the business system client. From Table 1, we can know Figure 3 There are currently three types of ontologies in the knowledge graph shown, namely, product type ontology, product attribute type ontology, and product attribute value type ontology.
[0051] Table 1 List of graph ontology types
[0052] Ontology Type Name Ontology type encoding product product Product Attributes prodAttr Product attribute value prodAttrVal
[0053] For example, the graph ontology type list may display the ontology type name and ontology type code in the knowledge graph. Of course, the graph ontology type list may also display only the ontology type name or only the ontology type code. This exemplary embodiment does not make any special limitation on this.
[0054] Exemplarily, for each knowledge graph in the knowledge graph database, its ontology type can be extracted to obtain a graph ontology type list corresponding to each knowledge graph in the knowledge graph database, and display it in the client of the business system. When the client of the business system displays it, for each graph ontology type list, the name of the corresponding knowledge graph or the name of the graph ontology type list can also be displayed, such as the graph ontology type list of knowledge graph 1. Of course, other content related to the knowledge graph can also be displayed, and this exemplary embodiment does not specifically limit this.
[0055] For example, each knowledge graph is configured with a knowledge graph identifier, through which different knowledge graphs are distinguished, and each graph ontology type list is also configured with a graph ontology type list identifier, through which different graph ontology lists are distinguished. Based on this, the knowledge graph and its corresponding graph ontology type list can be associated through the identifier, such as binding the identifier 1 of the knowledge graph 1 and the identifier 2 of the graph ontology type list 1 corresponding to the knowledge graph. In this way, through the binding relationship, the corresponding knowledge graph 1 can be found according to the graph ontology type list 1, and the corresponding graph ontology type list 1 can be found according to the knowledge graph 1.
[0056] In an exemplary embodiment, the knowledge graph in the knowledge graph database can update the ontology according to the needs, such as adding a new ontology, deleting an ontology, or modifying an existing ontology, such as modifying the name of an existing ontology, etc. When the knowledge graph is updated, the present disclosure can automatically extract the ontology type of the updated knowledge graph to update the graph ontology type list.
[0057] Exemplarily, a specific implementation of updating the graph ontology type list may include: extracting ontology types in the knowledge graph based on a preset period; and updating the graph ontology type table corresponding to the knowledge graph according to the extracted ontology types.
[0058] For example, the ontology types of the knowledge graph in the knowledge graph database can be periodically re-extracted to update the graph ontology type list displayed on the front end of the business system based on the re-extracted ontology types. For example, the operation of extracting the ontology types in the knowledge graph is performed regularly at 1 a.m. every day, and the graph ontology type list is regenerated based on the extracted ontology types, and the newly generated graph ontology type list is displayed on the front end of the business system. When re-extracting the ontology types, the ontology types can be directly re-extracted for all knowledge graphs, or only the ontology types of the knowledge graphs with graph updates can be extracted. For example, a change mark can be used to record whether there is a change in the ontology type of the knowledge graph. When the preset period is reached, the knowledge graph with the ontology type change can be first determined by the change mark, and then the knowledge graph with the ontology type change can be extracted. The operation of updating the graph ontology type list is performed, and the extracted ontology type is updated to the graph ontology type list on the front end of the business system to achieve the update of the graph ontology type list.
[0059] Exemplarily, another specific implementation of updating the graph ontology type list may include: in response to generating an ontology type change log in the knowledge graph log, updating the graph ontology type table corresponding to the knowledge graph according to the ontology type changes indicated by the ontology type change log.
[0060] For example, the knowledge graph log can record changes in the knowledge graph in the knowledge graph database, such as adding new ontology, adding new ontology type, deleting ontology, deleting ontology type, modifying ontology, modifying ontology type, etc. The knowledge graph log can be monitored. When the ontology type change log is generated in the knowledge graph log, such as the generation of new ontology type, deletion of ontology type, modification of ontology type, etc., the graph ontology type table corresponding to the knowledge graph can be updated according to the ontology type change content indicated by the ontology type change log.
[0061] For example, in Figure 3 After adding the ontology type "offer" to the knowledge graph shown in Figure 4 Correspondingly, there will be a log record in the knowledge graph log, "New ontology offer at 3:58:51 on July 28, 2024, belonging to the new ontology type", and the graph ontology type list shown in Table 1 can be updated according to the log record to obtain the graph ontology type list shown in Table 2.
[0062] Table 2 Updated list of graph ontology types
[0063] Ontology Type Name Ontology type encoding product product Product Attributes prodAttr Product attribute value prodAttrVal Sales Items offer
[0064] In other words, in the present disclosure, the list of graph ontology types displayed on the front end of the business system can be automatically updated at a fixed time, or the list of ontology types displayed on the front end of the business system can be automatically updated in real time. In actual scenarios, you can make a choice based on actual needs, and this exemplary embodiment does not make any special limitations on this.
[0065] Through the method disclosed in the present invention, the updated graph ontology types in the knowledge graph can be automatically obtained without changing the code or configuration, and the graph ontology type table displayed by the business front-end system can be dynamically updated imperceptibly, thereby reducing the maintenance cost of the knowledge graph in knowledge graph retrieval.
[0066] Exemplarily, as mentioned above, the present disclosure can display the obtained graph ontology type list in the client of the business system and automatically update the graph ontology type list without perception. In this way, the user can perform operations in the business system client to implement knowledge graph-based retrieval. For example, the user can select an ontology type in the graph ontology type list, and then enter the search conditions. The business backend can determine the search results based on the ontology type and search conditions selected by the user through the search method in the present disclosure.
[0067] Based on this, an exemplary implementation of obtaining the ontology type to be retrieved may include: obtaining the ontology type to be retrieved according to the ontology type selected in the graph ontology type table.
[0068] For example, the user can select the ontology type to which the content to be retrieved belongs in the graph ontology type list displayed on the front-end page of the business system, thereby using the ontology type selected by the user in the graph ontology type list as the ontology type to be retrieved.
[0069] Exemplarily, in response to a selection operation on an ontology type in the graph ontology type table, the ontology type indicated by the selection operation can be determined as the ontology type to be retrieved. The selection operation can include single-clicking an ontology type in the graph ontology type table, double-clicking an ontology type in the graph ontology type table, etc. Of course, the ontology type to which the content to be retrieved belongs can also be selected from the graph ontology type table in any other manner, and this exemplary embodiment does not specifically limit this.
[0070] Exemplarily, another exemplary implementation of obtaining the ontology type to be retrieved may include: obtaining the ontology type to be retrieved according to the ontology type in the selected graph ontology type table.
[0071] For example, in some cases, some users may not be sure which ontology type the content they want to retrieve belongs to, or the user just wants to search in all ontology types. At this time, the user can select the graph ontology type table to which the content to be retrieved belongs in the graph ontology type table displayed on the front page of the business system. In response to the selection operation on the graph ontology type table, all ontology types in the selected graph ontology type table can be determined as the ontology types to be retrieved. If the user selects Table 1 above, there are 3 ontology types to be retrieved, namely, product ontology type, product attribute ontology type, and product attribute value ontology type.
[0072] The selection operation of the graph ontology type table may include the operation of single-clicking or double-clicking the logo of the graph ontology type table, such as single-clicking or double-clicking the name of the graph ontology type table, etc. Of course, the selection operation of the graph ontology type table may also include other operations, which are not specifically limited in this exemplary embodiment.
[0073] It is also possible that each graph ontology type table is configured with a search condition input window, and the graph ontology type table selected by the user can be determined based on the graph ontology type table corresponding to the search condition input window operated by the user. For example, the user enters the search condition in the search condition input window of the graph ontology type table 1 and selects ontology type 1 in the graph ontology type table 1, then the ontology type to be searched can be ontology type 1 in the graph ontology type table 1, that is, the ontology belonging to ontology type 1 in the knowledge graph 1 corresponding to the graph ontology type table 1 will be determined as the candidate ontology in the subsequent process. For another example, the user enters the search condition in the search condition input window of the graph ontology type table 1 but does not select the ontology type, then the ontology type to be searched can be all the ontology types included in the graph type table 1, that is, all the ontologies in the knowledge graph 1 corresponding to the graph ontology type table 1 will be determined as the candidate ontology in the subsequent process.
[0074] In another exemplary implementation, the user may not know which graph ontology type table corresponds to the knowledge graph to which the content he wants to search belongs, or the user needs to search in all knowledge graphs. In this case, the user can directly enter the search conditions in the Search All Contents window on the front page, and the ontology type to be searched will be automatically determined as all ontology types of all knowledge graphs.
[0075] In other words, a search all content window is configured in the front-end page, and the window is associated with all knowledge graphs in the knowledge graph database. The user can directly enter the search conditions in the window. At this time, since the user has not operated any graph ontology type table, the ontology type to be searched cannot be determined according to the user's selection. The ontology type to be searched will be automatically determined as all ontology types in all knowledge graphs, that is, all ontologies in all knowledge graphs are automatically searched according to the search conditions entered by the user in the search all content window.
[0076] In the present disclosure, when the user selects the graph ontology type table or the user selects an ontology type in the graph ontology type table, the ontology type to be retrieved can be determined based on the user's selection. When the user does not select an ontology type, all ontology types in the entire ontology type table on the front-end page of the business system can be automatically used as the ontology types to be retrieved.
[0077] In other words, in the present disclosure, the user may select an ontology type and input a search condition to perform a search, or the user may only input a search condition to perform a search, and this exemplary embodiment does not specifically limit this.
[0078] In an exemplary embodiment, the search condition can be determined according to the user's input, and the search condition can be understood as the search content input by the user. For example, if the user selects the ontology type "product" in Table 1 above on the front-end page of the business system and enters the search condition "cloud hard disk", it means that only the graph ontology nodes with product names similar to "cloud hard disk" need to be retrieved. If the user only enters the search condition "cloud hard disk", it means that all graph ontology nodes similar to "cloud hard disk" need to be retrieved.
[0079] In an exemplary embodiment, the confirming search operation may include an operation of clicking a start search control, or may include an operation of the user confirming that the search condition input is complete, etc. This exemplary embodiment does not specifically limit this.
[0080] Next, the specific implementation method of step S220 of determining the candidate ontology according to the ontology indicated by the ontology type to be retrieved in the target knowledge graph is described in detail.
[0081] Exemplarily, a method for determining a target knowledge graph includes: determining the target knowledge graph according to a knowledge graph corresponding to a selected graph ontology type table.
[0082] For example, when the user selects an ontology type in the graph ontology type table on the front-end page, the knowledge graph associated with the graph ontology type table to which the ontology type selected by the user belongs can be determined as the target knowledge graph. When the user selects a graph ontology type list on the front-end page, the knowledge graph associated with the graph ontology type table selected by the user is the target knowledge graph. For example, if the user enters the search conditions in the search window configured by graph ontology type table 1, the knowledge graph 1 corresponding to graph ontology type table 1 can be determined as the target knowledge graph. When the user does not select an ontology type or a graph ontology type table, all knowledge graphs in the knowledge graph database are target knowledge graphs.
[0083] After the target knowledge graph is determined, the ontology belonging to the ontology type to be retrieved in the target knowledge graph can be determined as a candidate ontology. For example, according to the ontology type "product" selected by the user in Table 1 above, Figure 3 All the ontologies of the "product" type in the knowledge graph shown in the figure are used to obtain the candidate ontologies shown in Table 3. Table 3 is not displayed on the front-end page and is only a schematic diagram of the retrieval process.
[0084] Table 3 Candidate ontology list
[0085] type Text value product Cloud Computer product Cloud Host product Storage disk product System disk
[0086] Next, a specific implementation of step S230 of determining the search result according to the search condition and the similarity between the candidate ontology is described.
[0087] Exemplarily, a specific implementation of step S230 may include: determining a search result based on the top N candidate ontologies ranked by similarity.
[0088] In an exemplary implementation, after the search conditions and the candidate ontology are respectively vectorized, the similarity between the vector corresponding to the search conditions and the vector corresponding to the candidate ontology is calculated to obtain the similarity between the search conditions and the candidate ontology.
[0089] Exemplarily, the search condition text and the candidate ontology text can be vectorized based on the bge-large-zh model to obtain corresponding vector representations. Of course, the vectors corresponding to the search condition text and the candidate ontology text can also be obtained by other text vectorization methods.
[0090] After obtaining the corresponding vectors, the similarity between the candidate ontology and the retrieval conditions can be determined by the similarity between the vectors, such as by the cosine similarity between the vectors. Of course, the similarity between the candidate ontology and the retrieval conditions can also be determined by other similarity calculation methods, and this exemplary embodiment does not make any special limitations on this.
[0091] After obtaining the similarity between the search conditions and the candidate ontologies, the similarity can be sorted in descending order, and the top N candidate ontologies can be selected as search results and returned to the business system front end. For example, the top N candidate ontologies can be displayed in a list in the front end page of the business system in descending order of similarity.
[0092] In an exemplary embodiment, the search results can be determined by sorting in descending order according to the similarity. For example, all candidate ontologies can be displayed in a list in the business system front-end page in the order of similarity from large to small. That is, the search result can be the result of sorting all candidate ontologies according to similarity. Taking the candidate ontologies in Table 3 as an example, the search result can be shown in Table 4.
[0093] Table 4 Search result examples
[0094] Serial number Text value 1 Storage disk 2 System disk 3 Cloud Computer 4 Cloud Host
[0095] In the present disclosure, by calculating the similarity between the search conditions and the candidate ontology to determine the search results, fuzzy search based on the knowledge graph can be implemented to improve the search efficiency.
[0096] For example, Figure 5 A schematic diagram of a knowledge graph retrieval system in an exemplary embodiment of the present disclosure is shown. Figure 5 The knowledge graph retrieval system may include a business subsystem 51, a retrieval subsystem 52 and a knowledge graph database 53.
[0097] For example, the business subsystem 51 can run in the virtual container Docker1, and the retrieval subsystem 52 can run in the virtual container Docker2, that is, the retrieval process and the ontology type extraction process run in an independent environment and do not affect each other. The retrieval subsystem 51 can extract the ontology type of the knowledge graph from the knowledge graph database 53, and send the extracted ontology type to the business subsystem 51 in the form of a graph ontology type list, and the business subsystem 51 can display the graph ontology type list on its front-end page. The user can select the ontology type to be retrieved from the graph ontology type list displayed on the front-end page of the business subsystem 51, and enter the content to be retrieved, that is, enter the search conditions. The retrieval subsystem 52 can collect all ontologies belonging to the ontology type selected by the user in the target knowledge graph of the knowledge graph database 53 to obtain candidate ontologies, and after vectorizing the retrieval conditions and the candidate ontologies respectively, determine the similarity between the candidate ontology and the retrieval conditions based on the vectors, and then sort the candidate ontologies in order of similarity from high to low and return them to the business subsystem 51. The business subsystem 51 displays the candidate ontologies in the form of a list in the front-end page according to the order of similarity from high to low, thereby displaying the retrieval results to the user.
[0098] For example, Figure 6 The following is an interactive schematic diagram showing a knowledge graph retrieval process in an exemplary embodiment of the present disclosure. Figure 6 The method may include step S601 of graph ontology extraction, step S602 of graph ontology display, step S603 of graph ontology type selection and search keyword input, step S604 of ontology extraction according to the selected ontology type, step S605 of vectorization and similarity calculation for the search keyword and the extracted ontology, step S606 of returning the extracted ontology in descending order of similarity, step S607 of updating and revising the knowledge graph ontology, step S608 of automatically extracting the updated graph ontology type, step S609 of displaying the updated graph ontology type, and step S610 of subsequent retrieval according to the updated graph ontology type.
[0099] For example, the graph retrieval subsystem 61 can provide the ability to extract the knowledge graph ontology type, and provide the extracted ontology type list to the business subsystem 51. The business subsystem 51 can display the graph ontology type list for users to view. Users can directly select the ontology type to be retrieved on the front end and enter the content to be retrieved; the graph retrieval subsystem 61 connects to the knowledge graph database 53 to collect the data of the ontology type selected by the user based on the input ontology, and obtains the collected ontology data; the graph retrieval subsystem 61 vectorizes the search content input by the user and the collected ontology data based on the bge-large-zh model, and calculates the similarity between the vectors to obtain the similarity between the collected ontology data and the input search content, and sorts the search results from high to low according to the similarity and returns them to the business subsystem 51. The knowledge graph is updated and revised according to the needs. The graph retrieval system 61 can automatically extract the updated knowledge graph ontology type to update the graph ontology type list without code upgrade or configuration file modification; the business system can directly display the updated graph ontology type list and perform subsequent searches based on the updated graph ontology type list.
[0100] In the present disclosure, fuzzy retrieval of knowledge graphs can be realized, and various knowledge graphs can be flexibly connected to realize plug-in, highly scalable knowledge graph fuzzy retrieval components and capabilities. In addition, the knowledge graph retrieval method disclosed in the present disclosure realizes fuzzy retrieval based on word vectors, which can improve the efficiency of retrieval, support flexible deployment, and does not affect the business system environment or performance.
[0101] In addition, it should be noted that the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0102] Furthermore, an exemplary embodiment of the present disclosure also provides a retrieval device. Figure 7 As shown, the retrieval device 700 includes the following program modules: a confirmation retrieval module 710, configured to obtain retrieval conditions and the type of ontology to be retrieved in response to a confirmation retrieval operation; a candidate ontology determination module 720, configured to determine a candidate ontology based on the ontology indicated by the type of ontology to be retrieved in the target knowledge graph; and a retrieval result determination module 730, configured to determine a retrieval result based on the similarity between the retrieval condition and the candidate ontology.
[0103] In an exemplary implementation, based on the aforementioned embodiment, obtaining the ontology type to be retrieved includes: obtaining the ontology type to be retrieved according to the ontology type selected in the graph ontology type table.
[0104] In an exemplary implementation, based on the aforementioned embodiment, obtaining the ontology type to be retrieved includes: obtaining the ontology type to be retrieved according to the ontology type in the selected graph ontology type table.
[0105] In an exemplary implementation, based on the aforementioned embodiment, the method for determining the target knowledge graph includes: determining the target knowledge graph according to the knowledge graph corresponding to the selected graph ontology type table.
[0106] In an exemplary embodiment, based on the aforementioned embodiment, the device also includes a first graph ontology type update module, which can be configured to: extract ontology types in the knowledge graph based on a preset period; and update the graph ontology type table corresponding to the knowledge graph according to the extracted ontology types.
[0107] In an exemplary embodiment, based on the aforementioned embodiment, the device also includes a second graph ontology type update module, which can be configured to: in response to generating an ontology type change log in the knowledge graph log, update the graph ontology type table corresponding to the knowledge graph according to the ontology type changes indicated by the ontology type change log.
[0108] In an exemplary implementation, based on the above-mentioned embodiment, determining the search result according to the similarity between the search condition and the candidate ontology includes: determining the search result according to the candidate ontologies ranked in the top N according to the similarity.
[0109] The specific details of each part of the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.
[0110] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0111] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0112] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the above-mentioned search method is implemented.
[0113] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.
[0114] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0115] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, Python, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).
[0116] Computer programs can be carried or transmitted through electrical, magnetic, optical, electromagnetic, infrared and other signals. Electronic devices can convert signals carrying computer programs into digital signals to run the computer programs. When a computer program runs on an electronic device, its code is used to enable the electronic device to execute (more specifically, it can enable the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned retrieval method, which includes the following steps: in response to confirming the retrieval operation, obtaining the retrieval conditions and the type of ontology to be retrieved; determining the candidate ontology according to the ontology indicated by the type of ontology to be retrieved in the target knowledge graph; determining the retrieval results according to the similarity between the retrieval conditions and the candidate ontology.
[0117] By executing the above method steps through a computer program, on the one hand, the search results can be determined from the knowledge graph through the search conditions and the type of ontology to be searched, without the need for the user to write a search query language to perform the search, thereby reducing the operational complexity of the graph search and improving the operational efficiency of the graph search; on the other hand, the candidate ontology can be quickly and accurately determined from the knowledge graph by searching the ontology type, thereby improving the search efficiency and accuracy.
[0118] The exemplary embodiments of the present disclosure also provide an electronic device, such as the terminal device 110 or the server 120 described above. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as a computer program. The processor executes the method steps of various exemplary embodiments of the present disclosure by executing the executable instructions. In addition, the electronic device may also include a display for displaying a graphical user interface.
[0119] Reference below Figure 8 , the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Figure 8 The electronic device 800 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0120] like Figure 8 As shown, the electronic device 800 may include: a processor 810 , a memory 820 , a bus 830 , an I / O (input / output) interface 840 , a network adapter 850 , and a display 860 .
[0121] The memory 820 may include a volatile memory, such as a RAM 821, a cache unit 822, and may also include a non-volatile memory, such as a ROM 823. The memory 820 may also include one or more program modules 824, such program modules 824 include but are not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. For example, the program module 824 may include each module in the above-mentioned device.
[0122] The processor 810 may include one or more processing units. For example, the processor 810 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.
[0123] The processor 810 can be used to execute executable instructions stored in the memory 820, such as the above-mentioned retrieval method, which includes the following steps: in response to confirming the retrieval operation, obtaining retrieval conditions and the type of ontology to be retrieved; determining candidate ontology based on the ontology indicated by the type of ontology to be retrieved in the target knowledge graph; determining the retrieval result based on the similarity between the retrieval condition and the candidate ontology.
[0124] The above method is implemented through a computer program. On the one hand, the search results can be determined from the knowledge graph through the search conditions and the type of ontology to be searched, without the need for the user to write a search query language to perform the search, thereby reducing the operational complexity of the graph search and improving the operational efficiency of the graph search; on the other hand, the candidate ontology can be quickly and accurately determined from the knowledge graph by searching the ontology type, thereby improving the search efficiency and accuracy.
[0125] The bus 830 is used to realize the connection between different components of the electronic device 800, and may include a data bus, an address bus, and a control bus.
[0126] The electronic device 800 can communicate with one or more external devices 900 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 840 .
[0127] The electronic device 800 can communicate with one or more networks through the network adapter 850. For example, the network adapter 850 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. The network adapter 850 can communicate with other modules of the electronic device 800 through the bus 830.
[0128] The electronic device 800 can display a graphical user interface through the display 860, such as an interface for displaying a list of graph ontology types, an interface for displaying search results, and the like.
[0129] although Figure 8Not shown, other hardware and / or software modules may also be provided in the electronic device 800, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0130] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0131] As can be seen from the above, the technical solution of the present disclosure can be implemented as a method, an apparatus, a system, a computer program product, a storage medium, an electronic device, etc. Those skilled in the art can understand that various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, such as being respectively referred to as a "circuit", "module" or "system".
[0132] It should be understood that the present disclosure is not limited to the specific method steps or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. Those skilled in the art will easily think of other embodiments based on the specific embodiments provided by the present disclosure. Therefore, the specific embodiments provided by the present disclosure are only exemplary, and the scope and spirit of the present disclosure are indicated by the claims, and any variations, uses or adaptive changes of the present disclosure should be covered, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the present disclosure.
Claims
1. A search method, It is characterized in that include: In response to confirming the search operation, obtaining search conditions and the type of ontology to be searched; Determine a candidate ontology according to the ontology indicated by the ontology type to be retrieved in the target knowledge graph; A search result is determined according to the similarity between the search condition and the candidate ontology.
2. The search method according to claim 1, It is characterized in that The obtaining of the ontology type to be retrieved includes: According to the ontology type selected in the graph ontology type table, the ontology type to be searched is obtained.
3. The search method according to claim 1, It is characterized in that The obtaining of the ontology type to be retrieved includes: According to the ontology type in the selected graph ontology type table, the ontology type to be searched is obtained.
4. The search method according to claim 2 or 3, It is characterized in that The target knowledge graph is determined by: The target knowledge graph is determined based on the knowledge graph corresponding to the selected graph ontology type table.
5. The search method according to claim 2 or 3, It is characterized in that The method further comprises: Extracting ontology types in the knowledge graph based on a preset period; The graph ontology type table corresponding to the knowledge graph is updated according to the extracted ontology type.
6. The search method according to claim 2 or 3, It is characterized in that The method further comprises: In response to generating an ontology type change log in the knowledge graph log, the graph ontology type table corresponding to the knowledge graph is updated according to the ontology type changes indicated by the ontology type change log.
7. The search method according to claim 1, It is characterized in that Determining the search result according to the similarity between the search condition and the candidate ontology includes: The search result is determined based on the candidate ontologies ranked in the top N in similarity order.
8. A retrieval device, It is characterized in that include: A confirmation search module is configured to obtain search conditions and the type of ontology to be searched in response to a confirmation search operation; A candidate ontology determination module is configured to determine a candidate ontology according to the ontology indicated by the ontology type to be retrieved in the target knowledge graph; The retrieval result determination module is configured to determine the retrieval result according to the similarity between the retrieval condition and the candidate ontology.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the search method according to any one of claims 1 to 7 is implemented.
10. An electronic device, It is characterized in that include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the retrieval method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Search method and device, equipment and medium
CN111382265A
Atlas retrieval method and device, electronic equipment and storage medium
CN115408503A
Retrieval method and system based on knowledge graph
CN116303895A
Cited By
Method and device for extracting website information, electronic equipment and storage medium
CN119884530A
