Semantic query method and device and electronic equipment

By constructing a knowledge graph based on authority scores and community segmentation, and combining it with association rule mining techniques, the limitations of entity association analysis in natural language queries are overcome, resulting in more accurate and comprehensive query results.

CN121919338APending Publication Date: 2026-04-24CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA TELECOM CORP LTD
Filing Date
2025-12-30
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively uncover multi-level relationships between entities in natural language queries, resulting in inaccurate and incomplete query results.

Method used

By constructing a knowledge graph, utilizing entity authority scoring and community segmentation, and combining association rule mining technology, user query requirements are transformed into structured query statements. The knowledge graph is then used for retrieval and association rule mining to obtain entity information related to the query requirements.

Benefits of technology

It improves the accuracy and comprehensiveness of natural language queries, enabling in-depth analysis of potential data relationships and providing more comprehensive query results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121919338A_ABST
    Figure CN121919338A_ABST
Patent Text Reader

Abstract

The invention discloses a semantic query method and device and electronic equipment. The method comprises the steps of obtaining a query demand of a target object; the query demand is converted into a query statement corresponding to a knowledge graph, each entity in the knowledge graph corresponds to an authority score used for quantifying the relative importance of the entity in the knowledge graph, and each entity belongs to at least one community; a query result corresponding to the query statement is retrieved in the knowledge graph, the query result comprises an association result obtained by conducting association rule mining on the query requirement based on authority scores and / or communities, and association rule mining is used for determining entities associated with the query requirement from the knowledge graph. According to the method and the device, the technical problem that the query result is not accurate and comprehensive enough due to limitation of related technologies on data association analysis for natural language query is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of natural language processing and information retrieval technology, and more specifically, to a method, apparatus, and electronic device for semantic querying. Background Technology

[0002] With the rapid development of information technology, the amount of data has exploded, and the types of data have become increasingly complex and diverse. Massive amounts of data have accumulated in various fields, such as communications, finance, and e-commerce. For natural language queries, the data query methods employed by related technologies mainly rely on exact matching and predefined relationships in structured data. This approach is limited in its ability to uncover the connections between entities, especially indirect and multi-level relationships, leading to inaccurate and incomplete query results.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This application provides a method, apparatus, and electronic device for semantic querying, which at least solves the technical problem that related technologies have limitations in data association analysis for natural language queries, resulting in inaccurate and incomplete query results.

[0005] According to one aspect of the embodiments of this application, a semantic query method is provided, comprising: obtaining a query requirement of a target object; converting the query requirement into a query statement corresponding to a knowledge graph, wherein each entity in the knowledge graph corresponds to an authority score for quantifying the relative importance of the entity in the knowledge graph and each entity belongs to at least one community; retrieving query results corresponding to the query statement in the knowledge graph, wherein the query results include association results obtained by association rule mining based on the authority score and / or community of the query requirement, the association rule mining being used to determine entities associated with the query requirement from the knowledge graph.

[0006] In some embodiments of this application, the knowledge graph is constructed in the following manner: entity recognition and relation extraction are performed on the original data to obtain a first knowledge graph, wherein the entities obtained by entity recognition are nodes in the first knowledge graph, and the relationships between entities obtained by relation extraction are edges in the first knowledge graph; the authority score corresponding to the first entity in the first knowledge graph is determined to obtain a second knowledge graph; and community division is performed on all second entities in the second knowledge graph to obtain a knowledge graph.

[0007] In some embodiments of this application, determining the authority score corresponding to a first entity in a first knowledge graph to obtain a second knowledge graph includes: obtaining an initial authority score corresponding to each first entity; updating the corresponding initial authority score based on the out-degree information of each first entity in each iteration, and determining the change in authority score between all first entities and the previous iteration; if the change in authority score is less than a preset threshold, taking the updated initial authority score corresponding to each first entity in the current iteration as the authority score to obtain the second knowledge graph.

[0008] In some embodiments of this application, community partitioning is performed on all second entities in the second knowledge graph to obtain a knowledge graph, including: taking each second entity as an initial community; moving each second entity to an adjacent initial community and determining the module degree change corresponding to the moved second knowledge graph, wherein the module degree change is used to quantify the degree of influence of entity movement on the quality of community partitioning; performing initial community merging based on the module degree change to obtain an updated initial community, and performing entity movement and module degree change updates again based on the updated initial community; obtaining the community partitioning result when the updated module degree change meets preset conditions; and updating the second knowledge graph using the community partitioning result to obtain the knowledge graph.

[0009] In some embodiments of this application, retrieving query results corresponding to a query statement in a knowledge graph includes: retrieving the query statement in a graph database corresponding to the knowledge graph to obtain retrieval results, wherein the retrieval results are used to reflect information directly matching the query requirements; performing association rule mining on the retrieval results using authority scores and / or community to obtain association results, wherein the association results are at least used to reflect information associated with the target entity in the query requirements; and using the retrieval results and association results together as the query results.

[0010] In some embodiments of this application, the association result is determined in the following manner: determining frequent itemsets in the knowledge graph corresponding to the target entity of the retrieval result, wherein the frequent itemsets include combinations of entities in the knowledge graph that satisfy the support threshold; generating candidate association rules from each frequent itemset, wherein the confidence of the candidate association rules is greater than the confidence threshold; determining the target association rule from the candidate association rules based on the authority score and / or the structural information of the community; and determining the association result based on the target association rule and the retrieval result.

[0011] In some embodiments of this application, converting a query request into a query statement corresponding to a knowledge graph includes: obtaining the type of the query request, wherein the type includes voice query and image query; when the type is a voice query, converting the voice signal corresponding to the query request into first text; when the type is an image query, extracting the voice information of the image corresponding to the query request to obtain second text; and converting the first text and / or the second text into a query statement.

[0012] According to another aspect of the embodiments of this application, a semantic query apparatus is also provided, comprising: an acquisition module for acquiring query requirements of a target object; a conversion module for converting the query requirements into query statements corresponding to a knowledge graph, wherein each entity in the knowledge graph corresponds to an authority score for quantifying the relative importance of the entity in the knowledge graph and each entity belongs to at least one community; and a query module for retrieving query results corresponding to the query statements in the knowledge graph, wherein the query results include association results obtained by association rule mining based on authority scores and / or communities for the query requirements, and the association rule mining is used to determine entities associated with the query requirements from the knowledge graph.

[0013] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a memory and a processor, wherein the memory is used to store program instructions; the processor is connected to the memory and is used to execute the method for implementing the above-described semantic query.

[0014] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, the non-volatile storage medium including a stored computer program, wherein the device where the non-volatile storage medium is located executes the above-described semantic query method by running the computer program.

[0015] According to another aspect of the embodiments of this application, a computer program product is also provided, including computer instructions that, when executed by a processor, implement the above-described method for semantic query.

[0016] In this embodiment, a combination of semantic understanding and graph query is used. By parsing the user's natural language query requirements, it is transformed into a structured query on a knowledge graph. The authority scores and community affiliations of entities in the graph are used for refined retrieval. Furthermore, the potential connections in the query results are analyzed in depth through association rule mining technology. This achieves the goal of improving query accuracy and intelligence, thereby realizing the technical effect of efficiently mining implicit associations in big data. It also solves the technical problem that related technologies have limitations in data association analysis for natural language queries, resulting in inaccurate and incomplete query results. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 This is a hardware structure block diagram of a computer terminal for a semantic query method according to an embodiment of this application;

[0019] Figure 2 This is a flowchart of a semantic query method according to an embodiment of this application;

[0020] Figure 3 This is a system architecture diagram of a semantic query method according to an embodiment of this application;

[0021] Figure 4 This is a schematic diagram of the data processing flow of a semantic query method according to an embodiment of this application;

[0022] Figure 5 This is a schematic diagram of a semantic query apparatus according to an embodiment of this application. Detailed Implementation

[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0025] To better understand the embodiments of this application, the technical terms involved in the embodiments of this application are explained below:

[0026] PageRank algorithm: A graph algorithm used to evaluate the importance of entities in a knowledge graph. It determines the weight of entities in the network by calculating the links between them. In the embodiments of this application, the PageRank algorithm is used to rank entities by importance, helping the system to prioritize the display and analysis of information with higher value.

[0027] Community detection algorithms are used to identify clusters of nodes in a graph. They are divided based on the density of connections between nodes. In this application, such as the Louvain algorithm, entities in a knowledge graph are divided into different communities, thereby identifying sets of entities with similar attributes or behaviors, and supporting more refined association analysis.

[0028] Apriori algorithm: An association rule mining algorithm used to discover frequently occurring itemsets and association rules from large-scale datasets. In the embodiments of this application, the Apriori algorithm can be used to mine potential associations between entities in a knowledge graph, such as the association between a specific device model and network performance optimization requirements.

[0029] FP-Growth Algorithm: An improved association rule mining algorithm that can process large-scale datasets more efficiently than the Apriori algorithm. In the embodiments of this application, the FP-Growth algorithm can be used to mine frequent patterns from knowledge graphs, reduce computational costs, and at the same time ensure the accuracy and comprehensiveness of association rules.

[0030] The database queries used in related technologies are mainly based on Structured Query Language (SQL), which requires users to specify query conditions precisely. For fuzzy or semantically ambiguous query requirements, it often cannot provide accurate results. For example, in the field of communications, if an engineer wants to query "optimization technologies and equipment related to 5G networks", traditional queries have difficulty understanding the semantic scope of "related" and may only return records that exactly match "5G network", missing other valuable information, such as important content such as 4G to 5G transition technologies, spectrum allocation schemes, or network slicing management.

[0031] Furthermore, there are complex relationships between data from different data sources, but traditional methods struggle to analyze these relationships quickly and comprehensively. For example, in the field of communications, when analyzing the relationship between network performance and factors such as user behavior, device load, and environmental interference, traditional analysis methods are inefficient and cannot intuitively present complex relationships, making it difficult to discover potential network bottlenecks or optimization opportunities.

[0032] Furthermore, traditional systems cannot understand the semantic and contextual information in natural language queries. In communication services, when a user searches for "high-speed network packages suitable for home use," traditional search engines may only match keywords and cannot understand the specific meanings of "suitable for home use" and "high-speed." The recommended packages may not meet the user's needs. For example, they may ignore the requirements of home users for simultaneous connection of multiple devices, stability, and high bandwidth, resulting in the recommendation of unsuitable commercial packages or low-bandwidth options.

[0033] To address the aforementioned technical problems, this application provides corresponding solutions, which are detailed below.

[0034] The semantic query method embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 A hardware block diagram of a computer terminal for implementing a semantic query method is shown. Figure 1 As shown, the computer terminal 10 may include one or more processors (shown as 102a, 102b, ..., 102n in the figure) (the processor may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication functions connected via wired and / or wireless networks. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, and a BUS bus. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0035] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0036] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the semantic query method in this embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned semantic query method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0037] The transmission module 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission module 106 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission module 106 may be a radio frequency (RF) module, used for wireless communication with the Internet.

[0038] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.

[0039] It should be noted here that, in some optional embodiments, the above... Figure 1 The computer terminal shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 1 This is only one instance of a specific particular instance, and is intended to illustrate the types of components that may exist in the aforementioned computer terminal.

[0040] In the above operating environment, this application provides a method embodiment for semantic query. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than that shown here.

[0041] Figure 2 This is a flowchart of a semantic query method according to an embodiment of this application, such as... Figure 2As shown, the method includes the following steps:

[0042] Step S202: Obtain the query requirements of the target object.

[0043] In step S202 above, the query requirement refers to the information or answer that the target object hopes to obtain through the system. In the field of communications, the query requirement can be a question about network performance, device compatibility, user behavior patterns, etc. For example, "Query which 5G devices have the best performance in a specific area" or "Analyze which applications have caused a surge in user traffic usage in the past week".

[0044] In some embodiments of this application, the query requirement can be multimodal, and the original user input can be semantically extracted and parsed to obtain the query requirement. Specifically:

[0045] (1) Semantic extraction.

[0046] 1) Regarding natural language:

[0047] Natural Language Processing: The system is equipped with professional voice acquisition equipment to obtain users' voice query requests. The acquired voice will first undergo preprocessing, including noise reduction, dereverberation, and other operations to remove environmental interference and improve the accuracy of subsequent voice recognition. For example, if a user issues a voice command to "query the current network status" in an environment with strong signal interference, preprocessing will reduce the influence of surrounding electromagnetic interference, making the voice signal clearer, thereby ensuring that the voice recognition system can accurately understand the user's command and return the correct network status information.

[0048] Speech recognition: This function utilizes a speech recognition model based on Hidden Markov Models (HMMs) and deep neural networks to convert preprocessed speech signals into text. The HMM captures the temporal features of the speech, while the deep neural network extracts these features and performs classification. Let the speech signal be... The preprocessed feature vector sequence is The identified text is ,but: , ,in, This indicates speech preprocessing operations. This represents a speech recognition operation that combines a hidden Markov model and a deep neural network.

[0049] Text segmentation and part-of-speech tagging: The identified text is segmented into individual words. For example, for "query the coverage area of ​​5G network", the segmentation results are "query", "5G network", "of", and "coverage area". Then, part-of-speech tagging is performed to determine the part of speech of each word, such as "query" as a verb, "5G network" as a noun, and "coverage area" as a noun, etc.

[0050] 2) For images:

[0051] Image Acquisition and Preprocessing: Users can upload images for querying, and the system will preprocess the acquired images. First, image scaling is performed to unify images of different sizes to a suitable dimensions. The scaling formula is as follows: ,in These are the pixel coordinates of the scaled image. These are the pixel coordinates corresponding to the original image. Then, a normalization operation is performed, using the formula... ,in The mean of the image pixel values. The standard deviation is used to improve the stability of subsequent image recognition.

[0052] Image Recognition and Semantic Extraction: Image recognition models based on convolutional neural networks, such as ResNet and Inception, are used to extract features and classify preprocessed images. These models automatically learn image features through multiple layers of convolution, pooling, and fully connected layers. For example, if a user uploads an image of a communication base station, the model will identify the type of base station (e.g., macro base station, micro base station, or small base station). After identifying the device in the image, relevant information about the device in the knowledge graph is combined to extract the corresponding semantics, such as the base station's coverage area, supported frequency bands, and affiliated operator. For example, after identifying the device as a "5G small base station," semantic information such as the deployment scenario, power consumption characteristics, and coverage capabilities of 5G small base stations is obtained from the knowledge graph. Query Transformation and Execution: The semantic information obtained from image recognition is transformed into queries on the knowledge graph. For example, if an image is identified as a "5G base station antenna," the system queries the knowledge graph for information related to 5G base station antennas, including technical parameters, deployment scenarios, and compatible devices, generating a corresponding graph database query statement, such as "MATCH(d:device{name:'5G base station antenna'})-[:support]->(p:technical parameters)RETURN p.name". The query statement is then sent to the graph database for execution to obtain the relevant results.

[0053] (2) Semantic parsing.

[0054] This paper utilizes a pre-trained language model based on the Transformer architecture to perform semantic understanding on text after word segmentation and part-of-speech tagging. The text is input into the pre-trained language model and processed through multiple Transformer blocks to obtain a semantic representation of the text. Let the input text be... The semantic representation after processing by the pre-trained language model is ,pass Semantic extraction is performed, followed by semantic understanding through a fully connected layer to accurately grasp the user's query intent (i.e., query requirements). For example, semantic parsing can clarify that the user's core requirement is to obtain information on the coverage area of ​​the 5G network. During the semantic understanding process, the cosine similarity algorithm can also be used to measure the similarity between the query statement and related semantics in the knowledge graph, assisting in accurately understanding the user's intent, such as determining whether the user is interested in the signal strength of a specific area or network performance optimization suggestions.

[0055] It should be noted that the user's original input can also be in other forms such as text, which are not limited here.

[0056] Step S204: Convert the query requirement into a query statement corresponding to the knowledge graph. Each entity in the knowledge graph corresponds to an authority score used to quantify the relative importance of the entity in the knowledge graph, and each entity belongs to at least one community.

[0057] In step S204 above, the query statement is an instruction written according to a graph database query language (such as Cypher) to request data in the knowledge graph that meets specific conditions. In the knowledge graph, each entity is assigned a weight or score (authority score), reflecting its importance and influence within the entire graph. The authority score can be calculated based on the number of links to the entity and the authority of its linked entities, such as using the principles of the PageRank algorithm. Furthermore, entities in the knowledge graph are grouped into different communities based on their link patterns within the graph. Entities within a community typically have a higher link density, indicating that they share similar attributes or functions to some extent.

[0058] To accurately convert users' multimodal query requirements into structured query statements in a knowledge graph, the following steps can be performed: obtain the type of query requirement, which includes voice query and image query; if the type is a voice query, convert the voice signal corresponding to the query requirement into first text; if the type is an image query, extract the voice information of the image corresponding to the query requirement to obtain second text; and convert the first text and / or the second text into query statements.

[0059] Specifically, the system can utilize deep learning techniques, such as speech recognition models based on Hidden Markov Models (HMMs) and Deep Neural Networks (DNNs), to convert the collected speech signals into text. It can then employ image recognition models, such as ResNet or Inception, to preprocess and identify entities in the uploaded images, extracting key entity information. Next, natural language processing techniques, such as dependency parsing combined with LSTM models, are used to analyze the semantics of the image descriptions and identify relationships between entities. Finally, based on the parsed entities and relationships, query statements adapted to the knowledge graph structure are generated.

[0060] In some embodiments of this application, the knowledge graph is constructed in the following manner: entity recognition and relation extraction are performed on the original data to obtain a first knowledge graph, wherein the entities obtained by entity recognition are nodes in the first knowledge graph, and the relationships between entities obtained by relation extraction are edges in the first knowledge graph; the authority score corresponding to the first entity in the first knowledge graph is determined to obtain a second knowledge graph; and community division is performed on all second entities in the second knowledge graph to obtain a knowledge graph.

[0061] It should be noted that the first knowledge graph is a preliminary graph built based on entity recognition and relation extraction. It can be a knowledge graph from different fields, such as communications or finance, and contains entities and the basic relationships between them. The second knowledge graph is based on the first knowledge graph, and adds an authority score to each entity, so that the graph can better reflect the weight differences and importance between entities.

[0062] In some embodiments of this application, the first knowledge graph can be constructed in the following ways:

[0063] (1) Data Acquisition: Connects to various data sources through multiple interfaces and protocols. The following are some examples of interfaces and protocols:

[0064] For relational databases, the JDBC (Java Database Connectivity) interface is used. This is a standard database access interface that can easily connect to databases such as MySQL and Oracle, and obtain structured data based on pre-defined query statements. For example, it can extract basic user information, device connection records, traffic usage, etc. from communication network logs.

[0065] For data retrieved from web servers, a RESTful API interface is used. This interface communicates using the HTTP protocol and manipulates resources through different HTTP methods (such as GET, POST, PUT, and DELETE). Websites that provide publicly available data or internal enterprise web services typically offer RESTful API interfaces. When retrieving network data, taking the latest network performance report from a communication service provider's API as an example, an HTTP client sends a GET request to the specified API endpoint. Depending on the API documentation and requirements, parameters may need to be added to the request (such as the network region, time range, device type, etc.). The server returns data in JSON or XML format. The advantages of this interface are its lightweight nature, ease of use, extensibility, and cross-platform and cross-language data interaction capabilities.

[0066] For data generated in real time by sensors, a sensor data interface is used to collect this data. Different types of sensors may have different data interface protocols. In the field of communications, common network device sensors (such as base station signal sensors, network traffic sensors, and device temperature sensors) generate a large amount of network performance data. For example, some 5G base station signal sensors connect to monitoring systems via communication protocols. The system uses corresponding communication development libraries to receive the data sent by the sensors for real-time monitoring of network status and performance optimization.

[0067] (2) Data cleaning: The collected data often contains noise and duplicate data, which need to be cleaned.

[0068] In noise data processing, for numerical data, a statistical method is used to set reasonable upper and lower thresholds. For example, in network signal strength data acquisition, the normal signal strength range is usually between -110dBm and -50dBm. If the acquired data exceeds this range and remains abnormal after multiple verifications, it is judged as noise data and filtered out. This situation may be caused by equipment failure, environmental interference, or measurement error.

[0069] For text data, special characters, garbled text, and other noise are removed by regular expression matching.

[0070] When removing duplicate data, for structured data, a unique identifier field, such as the device's IMEI (International Mobile Equipment Identity), is used for judgment. If duplicate records exist, only one of them is retained. For example, in network traffic logs, multiple connection records of the same device may be duplicated due to network fluctuations or data synchronization issues. The IMEI field can be used to quickly identify and clean up redundant data.

[0071] For unstructured text data, calculate the hash value of the text. If the hash values ​​are the same and the text content is identical, it is considered duplicate data and deleted. The cosine similarity algorithm can be used to assist in determining duplicate data when assessing text similarity. Its formula is: ,in This represents the cosine similarity between vectors A and B, with values ​​ranging from -1 to 1. and They are two text vectors; and They are vectors sum vector The Values ​​in each dimension; It is a vector sum vector The dimension; if If the value is close to 1, then the two texts can be considered to be duplicates.

[0072] (3) Data Standardization: To facilitate subsequent processing, the data can be standardized. Regarding data format, the date format is standardized to "YYYY-MM-DD", such as converting "2024 / 10 / 15" to "2024-10-15"; telephone numbers are standardized to the "area code-number" format, such as "010-12345678". For data encoding, UTF-8 encoding is uniformly adopted to ensure consistency in character processing for data from different sources and to avoid data garbled characters or incorrect processing due to encoding issues.

[0073] (4) Entity Recognition: Named Entity Recognition (NER) technology is used to recognize entities with the help of deep learning models such as BERT. The following are specific examples from different fields:

[0074] In the field of communications: Training BERT models to recognize entities such as device names, network protocols, user IDs, and carrier names. For example, given the input text "User 12345 accesses the Internet via a certain carrier's 5G network using device xx, with IPv6 protocol," the model can accurately identify "User 12345" as the user ID, "5G network" as the network type, "xx device" as the device name, and "IPv6" as the network protocol.

[0075] In the financial sector: Financial news or reports require the identification of entities such as company names, stock codes, financial product names, and personal names. For example, in a report stating that "Buffett's XX company recently increased its holdings in a certain company (stock code A), and also increased its investment in fixed-income products such as bonds," a well-trained entity recognition model can accurately identify "Buffett" as a personal name, "XX company" and "XX company" as company names, "A" as a stock code, and "bonds" as a financial product name.

[0076] In e-commerce: The model needs to identify entities such as product names, brands, specifications, and user names within product descriptions and user reviews. For example, in the sentence "Xiao Li bought an xxP60 mobile phone with 8GB of RAM and 256GB of storage," the model can identify "Xiao Li" as the user name, "xxP60 mobile phone" as the product name, and "8GB of RAM and 256GB of storage" as the product specifications.

[0077] (5) Relation Extraction: Relation extraction is performed using dependency parsing and deep learning algorithms. Dependency parsing can determine the grammatical relationships between words in a sentence. Based on this, deep learning models, such as LSTM-based relation extraction models, can be combined to identify the relationships between entities. For example, from the sentence "5G networks can support high-definition video transmission," the model can extract the "support" relationship between "5G networks" and "high-definition video transmission." When measuring the similarity of relationships between different entity sets, the Jaccard similarity coefficient formula can be used. ,in It is a set and set The Jaccard similarity coefficient, with values ​​ranging from 0 to 1; and It consists of two sets of entities; It is a set and set The number of elements in the intersection of the two sets; It is a set and set The number of elements in the union of the two entities. This coefficient helps determine the similarity between different sets of entities and assists in relation extraction.

[0078] (6) Knowledge Graph Storage: The knowledge graph is stored using the graph database Neo4j. Identified entities are stored as nodes, and relationships between entities are stored as edges. Each node and edge can carry attribute information. For example, device nodes can include attributes such as device model, manufacturer, and supported network frequency bands; network protocol nodes can include attributes such as protocol version, transmission rate, and compatibility; and edges can include attributes such as connection quality, latency, and bandwidth. For instance, when describing the connection relationship between a "5G base station" and a "user equipment," the edge can include attributes such as signal strength and transmission stability.

[0079] In this way, the first knowledge graph presents the relationships between data in a graphical way, making it convenient for querying and analysis.

[0080] In some embodiments of this application, the PageRank algorithm can be used to evaluate the importance of entities in the first knowledge graph. This algorithm calculates the PageRank value of each entity by considering the number and importance of other entities pointing to a certain entity. Community detection algorithms (such as the Louvain algorithm) are used to divide the nodes in the knowledge graph into different communities. The Louvain algorithm is based on modularity optimization; by continuously merging nodes, it makes the connections within communities tighter and the connections between communities relatively sparser. In a social network knowledge graph (as an example), this algorithm can identify user groups with similar interests, behaviors, or relationships. For example, by analyzing communication behavior, traffic usage patterns, and device connection relationships between users, it can discover user groups that frequently use video streaming services. In a communication network knowledge graph, it can identify user clusters with similar network needs, providing strong support for accurately optimizing network resource allocation and personalized package recommendations.

[0081] To address the issue of quantifying the weights and importance of entities in a knowledge graph, the authority score corresponding to the first entity in the first knowledge graph can be determined in the following way to obtain the second knowledge graph: Obtain the initial authority score for each first entity; in each iteration, update the corresponding initial authority score based on the out-degree information of each first entity, and determine the change in authority score between all first entities and the previous iteration; if the change in authority score is less than a preset threshold, use the updated initial authority score of each first entity in the current iteration as the authority score to obtain the second knowledge graph.

[0082] Specifically, the PageRank algorithm can be used to calculate the authority score:

[0083] Initialization: Assign an initial PageRank value to each entity (node) in the knowledge graph. Typically, the PageRank values ​​of all nodes are initialized to be equal, and the damping coefficient is determined at the same time. .

[0084] Calculate the PageRank value for each entity: For each entity The calculation is based on the following formula:

[0085]

[0086] in, It refers to the entity All entities, It is a physical entity PageRank value, It is a physical entity out-degree (i.e., from) (Number of starting edges).

[0087] Iterative update: Repeat the previous step to continuously update the PageRank value of each entity until the PageRank value converges, that is, the change in the PageRank value of all entities between two iterations is less than the preset threshold. In each iteration, the new value is calculated based on the PageRank value obtained in the previous iteration.

[0088] To analyze the relationships between entities more deeply, the second knowledge graph can be divided into communities for all second entities in the second knowledge graph as follows: Each second entity is treated as an initial community; each second entity is moved to an adjacent initial community, and the change in modularity of the second knowledge graph after the move is determined. The change in modularity is used to quantify the impact of entity movement on the quality of community division; initial communities are merged based on the change in modularity to obtain updated initial communities; and entity movement and modularity changes are updated again based on the updated initial communities. If the updated modularity meets preset conditions, the community division result is obtained; the community division result is used to update the second knowledge graph to obtain the final knowledge graph.

[0089] Specifically, taking Louvain's algorithm as an example:

[0090] Node initialization: Each node in the knowledge graph is treated as an independent community, and each community contains only one node.

[0091] Local optimization: For each node, try moving it to an adjacent community and calculate the change in the modularity of the entire graph after the move. Modularity The calculation formula is ,in It is the total number of edges in the graph. Represents a node and Is there an edge connecting them (1 if there is an edge, 0 if there is no edge)? and These are nodes and The degree, When node and The value is 1 if they belong to the same community, otherwise it is 0. (Select to use...) The largest movement is operated if no movement is made. If the movement is greater than 0, the local optimization ends.

[0092] Merging Communities: Based on the results of local optimization, adjacent and closely connected nodes are merged into a new community, forming a new graph structure. In the new graph, each community is regarded as a super node, and the edges between communities are calculated based on the connection between the original nodes.

[0093] Further optimization and merging: Repeat the steps of local optimization and merging communities until the modularity of the graph no longer increases. The resulting community partition is the final result.

[0094] The aforementioned technical solution for constructing a knowledge graph establishes a basic framework through entity recognition and relation extraction. The introduction of authority scoring optimizes the weight distribution of entities in the graph, making subsequent queries and analyses more efficient and accurate. Community division further reveals the deep connections between entities, enhancing the depth and detail of association analysis.

[0095] Step S206: Retrieve query results corresponding to the query statement in the knowledge graph. The query results include association results obtained by association rule mining based on authority scores and / or community association of the query requirements. Association rule mining is used to identify entities associated with the query requirements from the knowledge graph.

[0096] In step S206 above, the query results are a set of information related to the user's query needs, returned by the system after executing the query statement. The query results include not only directly matched entity information but also association results further mined based on authority scores and / or community segmentation. In this embodiment, association rule mining combines the results of authority scores and community segmentation, enabling more effective identification of entities and their relationships related to the query needs, providing users with more comprehensive and in-depth information.

[0097] To discover hidden, non-directly related relationships between entities in a knowledge graph, query results corresponding to the query statement can be retrieved in the knowledge graph in the following ways: The query statement is retrieved in the graph database corresponding to the knowledge graph to obtain retrieval results, where the retrieval results reflect information directly matching the query requirements; association rules are mined on the retrieval results using authority scores and / or community data to obtain association results, where the association results at least reflect information related to the target entity in the query requirements; the retrieval results and association results are combined as the query results.

[0098] Specifically, queries can be executed using Cypher (Neo4j's dedicated query language) or similar graph database query languages. Based on the query criteria, searches are performed within the knowledge graph. Cypher returns entities and relationships that meet the criteria by matching specific nodes, edges, and their attributes. Graph database retrieval solves the problem of matching user query requirements with precise information in the knowledge graph. Especially for fuzzy and natural language queries, the query statements generated through semantic parsing can effectively locate the required information, improving the accuracy and efficiency of the query.

[0099] Subsequently, combining authority scores and community segmentation, deep association analysis is performed using association rule mining algorithms (such as the Apriori algorithm or FP-Growth algorithm). For example, the Apriori algorithm first generates frequent itemsets, and then generates association rules based on these frequent itemsets. Association rule mining can reveal deeper data insights for users. For instance, even if there are few records directly matching "5G base stations" and "high-traffic applications," by mining the associations within their respective communities, the potential connection between the two can still be revealed, supporting more comprehensive decision-making.

[0100] In some embodiments of this application, the association result is determined in the following manner: determining frequent itemsets in the knowledge graph corresponding to the target entity of the retrieval result, wherein the frequent itemsets include combinations of entities in the knowledge graph that satisfy the support threshold; generating candidate association rules from each frequent itemset, wherein the confidence of the candidate association rules is greater than the confidence threshold; determining the target association rule from the candidate association rules based on the authority score and / or the structural information of the community; and determining the association result based on the target association rule and the retrieval result.

[0101] Specifically, the Apriori algorithm or similar frequent itemset mining algorithms can be used to find entity combinations in the knowledge graph that meet a certain support threshold. The support threshold (e.g., 0.1) sets the minimum common frequency of occurrence; entity combinations below this threshold are not considered frequent itemsets. For example, for communication devices and their supported network protocols in the knowledge graph, the Apriori algorithm first scans the graph once to find all individual instances of devices and protocols, and counts their support (i.e., frequency of occurrence). Then, based on frequent 1-itemsets (single devices or protocols), it constructs possible frequent 2-itemsets (device-protocol combinations), repeating this process until no new frequent itemsets can be found, thus obtaining all device-protocol combinations that meet the support threshold.

[0102] Based on the identified frequent itemsets, candidate association rules are generated by calculating confidence levels. The confidence level measures the probability that if one entity set (antecedent) is present, another entity set (consequence) will also be present. If the confidence level is greater than a predetermined threshold (e.g., 0.8), a corresponding candidate association rule is generated. In the association analysis between communication devices and network protocols, if the frequent itemset is {device E1, protocol P1}, the confidence level that device E1 supports protocol P1 can be calculated. If the result is greater than the threshold, a candidate association rule, Device E1 -> Protocol P1, is generated.

[0103] By combining the entity's authority score and / or community segmentation, the rule most relevant to the target entity (i.e., the entity in the query) is selected from the candidate association rules and used as the target association rule. For example, if a candidate association rule involves entity E1, and E1 has a high authority score in the knowledge graph (e.g., 0.9) and strong links with other entities in its community (e.g., devices E2 and E3), then this rule is very likely to be selected as the target association rule.

[0104] Finally, based on the target association rules and the search results, the final association results are determined. The association results reflect a set of information closely related to the target entity. This information may be obtained directly from the search results or may be derived from the inference of the association rules.

[0105] In some embodiments of this application, the Apriori algorithm may include:

[0106] Generate frequent itemsets: Determine a support threshold (e.g., 0.1), scan the data in the knowledge graph, generate all possible single itemsets, calculate their support, and filter out single itemsets with support greater than the threshold to form frequent 1-itemsets. Based on the frequent 1-itemsets, generate all possible 2-itemsets, calculate their support again, filter out frequent 2-itemsets, and so on, until no new frequent itemsets can be generated.

[0107] Generate association rules: For each frequent itemset, generate association rules based on a confidence threshold. For example, for frequent itemsets... Rules can be generated Calculate the confidence level of the rule using the following formula: Association rules with a confidence level greater than the threshold are retained.

[0108] In addition, the FP-Growth algorithm can also be used to determine frequent itemsets, including:

[0109] Constructing the FP-tree: Scan the knowledge graph data, determine the support of all items, filter out frequent items, and sort them in descending order of support. Create the root node of the FP-tree, scan the data again, and for each data item, insert it into the FP-tree according to the order of frequent items, while recording the node count. If a node already exists on the insertion path, increment its count; otherwise, create a new node.

[0110] Mining frequent itemsets: Starting from the bottom of the FP-tree, for each leaf node, backtrack to the root node to form a path. Construct a conditional FP-tree based on these paths, and recursively mine frequent itemsets on the conditional FP-tree. For example, for a certain leaf node, the nodes and their counts on its path constitute the conditional FP-tree. Continue mining frequent itemsets on this tree until the conditional FP-tree is empty or no new frequent itemsets can be mined.

[0111] To facilitate understanding of the process of determining the above-mentioned correlation results, the following explanation is provided in conjunction with some specific embodiments.

[0112] In a specific implementation within the communications field, a user submits a query: "Find the 5G base stations with poor signal performance in city A and their associated network equipment."

[0113] (1) Search results: All 5G base stations in city A with signal quality below a certain threshold, as well as their attribute information, were returned.

[0114] (2) Process for determining the association results:

[0115] a. Identify frequent itemsets: Statistically analyze all network device combinations associated with 5G base stations with poor signal performance, and identify frequent itemsets that meet the support threshold. For example, it was found that "base station B1" often appears together with "router R1" and "optical cable C1".

[0116] b. Generate candidate association rules: Based on the above frequent itemsets, calculate the confidence of the association rules. For example, the confidence of "base station B1 -> router R1" is very high, exceeding the set threshold, and becomes a candidate association rule.

[0117] c. Determine the target association rule: Considering that "Router R1" has a high authority score in the knowledge graph and is in the same community as other base stations related to signal problems, the association rule "Base Station B1 -> Router R1" is identified as the target association rule.

[0118] d. Determine the associated results: Based on the search results and combined with the target association rules, the system not only returns information on 5G base stations with poor signal performance, but also provides details of network devices that are highly associated with these base stations, such as router models, manufacturers, and deployment locations.

[0119] Through steps S202 to S206, a combination of semantic understanding and graph query is used. By parsing the user's natural language query requirements, they are transformed into structured queries on a knowledge graph. The authority scores and community affiliations of entities in the graph are used for refined retrieval. Furthermore, the potential connections in the query results are analyzed in depth using association rule mining technology. This achieves the goal of improving query accuracy and intelligence, thereby realizing the technical effect of efficiently mining implicit connections in big data. In turn, it solves the technical problem that related technologies have limitations in data association analysis for natural language queries, resulting in inaccurate and incomplete query results.

[0120] Figure 3 This is a system architecture diagram of a semantic query method according to an embodiment of this application, such as... Figure 3 As shown, the system includes: a data acquisition module 302, a knowledge graph construction module 304, a semantic query module 306, an association analysis module 308, and a result display module 310.

[0121] (1) The data acquisition module 302 is responsible for acquiring raw data from various data sources (such as databases, Web services, sensors, etc.) and performing preliminary preprocessing on the data to ensure the quality and consistency of the data.

[0122] JDBC interface: Used to connect to relational databases such as MySQL and Oracle to read data. By writing SQL queries, the data acquisition module extracts specific structured data from the database.

[0123] RESTful API interfaces enable data exchange with web services. They use the HTTP protocol to make GET or POST requests to retrieve or submit data, and are particularly suitable for obtaining unstructured or semi-structured data from data sources that provide the API.

[0124] Sensor data interface: Collects real-time data from sensors, such as signal strength and network traffic from 5G base stations. The interface may use a specific communication protocol to transmit data with the sensors.

[0125] (2) The knowledge graph construction module 304 converts the collected raw data into the form of a knowledge graph, which facilitates subsequent semantic query and association analysis.

[0126] Entity recognition: Apply named entity recognition technology (such as BERT) to identify key entities in the data, such as device names, network protocols, etc.

[0127] Relation extraction: Extracting relationships between entities from data, such as "device support protocol", through dependency parsing and deep learning models (such as LSTM).

[0128] Knowledge graph storage: Graph databases (such as Neo4j) are used as storage media to store entities and relationships in the form of a graph. Each entity is a node, and each relationship is an edge, along with its corresponding attribute information.

[0129] (3) The semantic query module 306 parses the user's natural language query or image query requirements and converts them into structured query statements, which facilitates retrieval in the knowledge graph.

[0130] Speech recognition and text segmentation: Using deep learning models to convert speech into text, and then performing word segmentation and part-of-speech tagging on the text to extract key components for the query.

[0131] Image recognition: Entity recognition in images based on convolutional neural networks (such as ResNet and Inception), extracting key entities and relationships in the images.

[0132] Semantic parsing and query transformation: Use pre-trained language models (such as Transformer) to perform semantic parsing on text and transform the parsing results into graph database query statements (such as Cypher).

[0133] (4) The association analysis module 308 performs in-depth association analysis on the query results, explores the potential connections between entities, and obtains the association results.

[0134] Graph algorithm applications: The PageRank algorithm is used to evaluate entity importance, and the Louvain algorithm is used for community partitioning to help understand the strength of connections and clustering between entities.

[0135] Association rule mining: Using the Apriori algorithm or FP-Growth algorithm, based on the search results and community division, we can mine association rules between entities and reveal deeper data relationships.

[0136] (5) The results display module 310 displays the query and association analysis results in a visual and interactive manner, enhancing the readability and usability of the results.

[0137] Echarts Visualization: Using tools like Echarts, knowledge graphs can be displayed as graphical interfaces. Node size indicates importance, and edge thickness reflects the strength of relationships. For example, when displaying a graph showing the relationship between devices and network protocols, larger device nodes indicate higher frequency of use of the device in the knowledge graph, and thicker edges between devices and protocols indicate more significant support from the protocol for the device. Query results are displayed in tables, clearly presenting the information of the queried entities, such as device name, supported network frequency bands, and compatible protocol types.

[0138] Interactive features: Allows users to zoom in / out of the map, click on nodes to view detailed information, or filter results, providing an intuitive and easy-to-use results browsing experience.

[0139] It should be noted that, Figure 3 The system shown is used to perform semantic queries. Figure 2 The semantic query method shown, therefore Figure 2 The explanations and descriptions related to semantic query methods in [the document] also apply to [other methods]. Figure 3 The semantic query system shown here will not be described in detail here.

[0140] Figure 4 This is a schematic diagram of the data processing flow of a semantic query method according to an embodiment of this application, such as... Figure 4 As shown, the process includes:

[0141] Step S402, System Deployment and Data Acquisition.

[0142] Based on business needs and data distribution, the system is deployed in the data center or cloud. The data collection module connects to the data source, collects data according to preset rules, and stores the data in a temporary storage area. For example, in the field of communications, it connects to network device databases, user traffic databases, etc., to collect data such as device information and user traffic usage records.

[0143] Step S404: Knowledge graph construction and updating.

[0144] The collected data is preprocessed, and then a knowledge graph is built using the knowledge graph construction module. The knowledge graph is updated regularly or in real time to ensure the timeliness of the data, such as updating communication data every morning to add new device connection information, user traffic usage data, etc.

[0145] Step S406, semantic query and association analysis.

[0146] Users can input natural language or images to perform queries through the interface. The semantic query module processes the queries and returns the results. Simultaneously, the association analysis module performs association analysis on related entities. For example, if a user queries "What other applications do users of 5G networks use?", the semantic query module returns information on commonly used applications by users of 5G networks, and the association analysis module further analyzes the relationships between these applications, such as which applications are frequently used simultaneously or have similar network bandwidth requirements.

[0147] Step S408: Result Display and Interaction.

[0148] The results display module presents query and correlation analysis results in a visual format. Users can interact with the visualization interface, such as zooming in and out of the knowledge graph, clicking on nodes to view detailed information, and filtering query results. For example, when viewing the correlation graph of communication devices and network protocols, clicking on a device node displays detailed technical parameters, compatibility information, and other relevant information about the device.

[0149] To facilitate understanding of the overall process of semantic query, the following explanation uses some specific examples:

[0150] The data acquisition module obtains multi-source data (such as user ID, device model, base station signal strength, and application access records) through interfaces such as JDBC and RESTful API. After performing noise reduction, deduplication, and standardization on this multi-source data, the acquisition module outputs the processed data as a structured dataset to the knowledge graph construction module. The knowledge graph construction module extracts entities (such as "user," "device," "base station," and "application") from the structured dataset, identifies entity types using the BERT model, and extracts entity relationships (such as "user-use-device," "device-connection-base station," and "user-access-application") using dependency parsing and the LSTM model. Finally, the entities and relationships are stored as nodes and edges in the Neo4j graph database. At this point, the data is organized in the form of a graph, constructing a knowledge graph. Knowledge graphs serve as the underlying data structure for semantic queries, providing structured representations of entities, relationships, and attributes. Users can input natural language queries (such as "query the base stations of users who use xx device and have accessed a certain program"). The semantic query module converts the query into text through speech recognition and word segmentation, uses the Transformer model to parse the semantics (identifying "xx device", "program name", and "base station" as key entities, and "use" and "accessed" as relationships), and then converts the semantic parsing results into graph database query statements (such as Cypher), calls Neo4j to execute the retrieval, and finally outputs the semantic query results. Semantic query results (such as user lists, device and application association records) serve as input data for association analysis. The association analysis module applies the PageRank algorithm to evaluate entity importance (e.g., base station B-012 has a high PageRank value due to frequent access), uses the Louvain algorithm to segment user communities (e.g., "high-frequency user community of a certain program"), and then uses the Apriori algorithm to mine association rules (e.g., "using xx device + accessing a certain program → connecting to base station B-012", confidence level 90%), ultimately obtaining hidden associations (e.g., base station preference for specific device models and frequently accessed applications), and generating an association rule report. The association analysis results (such as community segmentation, association rules, and decision suggestions) are passed to the results display module, which visualizes the knowledge graph using ECharts, using node size to represent entity importance (e.g., larger nodes for base stations with high PageRank values) and edge thickness to represent association strength (e.g., thicker edges for high-frequency access relationships); it also provides tables to display query results (e.g., user ID, device, application, base station), thus providing users with an intuitive visual graph and interactive reports of data associations, helping users understand complex relationships and make decisions.

[0151] Figure 5 This is a structural diagram of a semantic query apparatus according to an embodiment of this application, such as... Figure 5 As shown, the device includes:

[0152] Module 502 is used to obtain the query requirements of the target object;

[0153] The conversion module 504 is used to convert the query requirements into query statements corresponding to the knowledge graph. Each entity in the knowledge graph corresponds to an authority score that quantifies the relative importance of the entity in the knowledge graph, and each entity belongs to at least one community.

[0154] The query module 506 is used to retrieve query results corresponding to the query statement in the knowledge graph. The query results include association results obtained by association rule mining based on authority scores and / or community association of the query requirements. Association rule mining is used to identify entities associated with the query requirements from the knowledge graph.

[0155] It should be noted that, Figure 5 The semantic query apparatus shown is used to perform Figure 2 The semantic query method shown, therefore Figure 2 The explanations and descriptions related to semantic query methods in [the document] also apply to [other methods]. Figure 5 The semantic query device shown will not be described in detail here.

[0156] This application also provides an electronic device, which includes a memory and a processor, wherein the memory is used to store program instructions; the processor is connected to the memory and is used to execute the steps of the semantic query method implemented in various embodiments of this application.

[0157] This application also provides a non-volatile storage medium including a stored computer program, wherein the device containing the non-volatile storage medium executes the steps of the semantic query method in various embodiments of this application by running the computer program.

[0158] This application also provides a computer program product, including computer instructions that, when executed by a processor, implement the steps of the semantic query method in various embodiments of this application.

[0159] This application also provides a computer program that, when executed by a processor, implements the steps of the semantic query method in various embodiments of this application.

[0160] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0161] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0162] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0163] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0164] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0165] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0166] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A semantic query method, characterized in that, include: Obtain the query requirements for the target object; The query requirement is converted into a query statement corresponding to the knowledge graph, wherein each entity in the knowledge graph corresponds to an authority score used to quantify the relative importance of the entity in the knowledge graph, and each entity belongs to at least one community; Retrieve query results corresponding to the query statement in the knowledge graph, wherein the query results include association results obtained by association rule mining based on the authority score and / or the community for the query request, and the association rule mining is used to determine entities associated with the query request from the knowledge graph.

2. The method according to claim 1, characterized in that, The knowledge graph is constructed in the following way: Entity recognition and relation extraction are performed on the original data to obtain a first knowledge graph, wherein the entities obtained by entity recognition are nodes in the first knowledge graph, and the relationships between the entities obtained by relation extraction are edges in the first knowledge graph. Determine the authority score corresponding to the first entity in the first knowledge graph to obtain the second knowledge graph; The knowledge graph is obtained by dividing all second entities in the second knowledge graph into communities.

3. The method according to claim 2, characterized in that, Determine the authority score corresponding to the first entity in the first knowledge graph to obtain the second knowledge graph, including: Obtain the initial authority score for each of the first entities; In each iteration, the initial authority score of each first entity is updated based on its out-degree information, and the change in authority score of all first entities compared to the previous iteration is determined. If the change in the authority score is less than a preset threshold, the updated initial authority score corresponding to each first entity in the current iteration is taken as the authority score to obtain the second knowledge graph.

4. The method according to claim 2, characterized in that, The knowledge graph is obtained by dividing all second entities in the second knowledge graph into communities, including: Each of the second entities is treated as an initial community; Each second entity is moved to an adjacent initial community, and the change in modularity of the second knowledge graph after the move is determined, wherein the change in modularity is used to quantify the degree of impact of entity movement on the quality of community partitioning; Based on the changes in modularity, the initial community is merged to obtain an updated initial community. Then, based on the updated initial community, the entity movement and modularity changes are updated again. If the updated modularity changes meet the preset conditions, the community division result is obtained. The second knowledge graph is updated using the community segmentation results to obtain the knowledge graph.

5. The method according to claim 1, characterized in that, Retrieving query results corresponding to the query statement from the knowledge graph includes: The query statement is retrieved from the graph database corresponding to the knowledge graph to obtain the retrieval results, wherein the retrieval results are used to reflect information that directly matches the query requirement; The association results obtained by performing association rule mining on the search results using the authority score and / or the community are at least used to reflect information associated with the target entity in the query requirement; The search results and the associated results are used together as the query results.

6. The method according to claim 5, characterized in that, The association results are determined in the following way: Determine the frequent itemsets in the knowledge graph that correspond to the target entities in the retrieval results, wherein the frequent itemsets include combinations of entities in the knowledge graph that satisfy a support threshold; Candidate association rules are generated from each of the frequent item sets, wherein the confidence level of the candidate association rules is greater than a confidence threshold; The target association rule is determined from the candidate association rules based on the authority score and / or the structural information of the community; The association result is determined based on the target association rule and the search result.

7. The method according to claim 1, characterized in that, The query requirement is converted into a query statement corresponding to the knowledge graph, including: Obtain the type of the query request, wherein the type includes voice query and image query; In the case where the type is a voice query, the voice signal corresponding to the query request is converted into first text; In the case where the type is the image query, the audio information of the image corresponding to the query request is extracted to obtain the second text; Convert the first text and / or the second text into the query statement.

8. A semantic query apparatus, characterized in that, include: The retrieval module is used to retrieve query requirements for the target object; The conversion module is used to convert the query requirement into a query statement corresponding to the knowledge graph, wherein each entity in the knowledge graph corresponds to an authority score used to quantify the relative importance of the entity in the knowledge graph, and each entity belongs to at least one community. The query module is used to retrieve query results corresponding to the query statement in the knowledge graph. The query results include association results obtained by association rule mining based on the authority score and / or the community's association rule mining of the query request. The association rule mining is used to determine entities associated with the query request from the knowledge graph.

9. An electronic device, characterized in that, include: A memory and a processor, the memory being used to store program instructions; the processor being connected to the memory and used to execute the method for implementing the semantic query according to any one of claims 1 to 7.

10. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored computer program, wherein the device containing the non-volatile storage medium executes the semantic query method according to any one of claims 1 to 7 by running the computer program.

11. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the semantic query method according to any one of claims 1 to 7.