A Method and System for Automatic Querying and Processing List Data Based on Intelligent Algorithms
By constructing heterogeneous semantic graphs and multi-hop reasoning, and combining structural and semantic constraints to generate query strategies, the problem of insufficient cross-modal understanding in traditional list data query methods is solved, and data query with high accuracy and flexibility is achieved.
Patent Information
- Application Number
- CN202610042533.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-14
- Publication Date
- 2026-05-26
- Estimated Expiration
- 2046-01-14
AI Technical Summary
Traditional list data query methods lack cross-modal semantic understanding capabilities, cannot effectively utilize heterogeneous modal information such as images and text, resulting in low accuracy in complex queries, and lack the ability to perform multi-hop reasoning to find the query path that best matches the user's intent in complex data structures.
By constructing a heterogeneous semantic graph, the list data and heterogeneous modal supplementary data are modeled into a unified semantic graph. Multi-hop reasoning is performed, the semantic coherence score of candidate paths is calculated, the highest-scoring path is selected, and legality verification is performed by combining structural constraints and semantic constraints during the decoding process. Attention distribution is dynamically adjusted to generate a query strategy that satisfies both structural legality and semantic consistency.
It improves the flexibility and accuracy of list data queries, significantly increases the success rate of complex queries, and ensures that the generated query strategy satisfies both structural validity and semantic consistency, avoiding semantic bias and structural errors in traditional methods.
Smart Images

Figure CN121501855B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data query technology, and in particular to a method and system for automatic querying and processing of list data based on intelligent algorithms. Background Technology
[0002] List data querying and processing is a fundamental task in the field of data processing. With the development of information technology, the scale of list data continues to expand and its structure becomes increasingly complex. Traditional list data querying methods mainly rely on predefined query syntax and rules, requiring users to master specific query languages or commands to access the desired data. In recent years, the development of intelligent algorithms has brought new possibilities to list data querying. By introducing natural language understanding, semantic analysis, and multimodal information fusion technologies, the data querying process has become more intelligent and user-friendly.
[0003] In practical applications, user query intent often contains implicit information. Single-modal list data may not provide a complete semantic understanding foundation, while supplementary information from images, text, or other sources may be crucial for understanding user query intent. Therefore, how to effectively integrate heterogeneous modal data to enhance the accuracy and efficiency of list data queries has become a key research focus.
[0004] The main defects and shortcomings of existing technologies include:
[0005] First, traditional list data query methods lack cross-modal semantic understanding capabilities and cannot effectively utilize heterogeneous modal information such as images and text related to list data to assist in understanding the query intent, resulting in low accuracy when processing complex queries containing implicit semantics.
[0006] Secondly, existing query systems typically use fixed rules or simple models for path searching, lacking multi-hop reasoning capabilities based on semantic coherence. This makes it difficult to find the query path that best matches the user's intent in complex data structures, especially when the query target needs to cross multiple data levels or associate multiple information types. Summary of the Invention
[0007] This invention provides a method and system for automatic querying and processing of list data based on intelligent algorithms, which can solve the problems in the prior art.
[0008] A first aspect of this invention provides a method for automatically querying and processing list data based on intelligent algorithms, comprising:
[0009] Obtain the list data to be queried and the heterogeneous modal supplementary data semantically associated with the list data to be queried, wherein the heterogeneous modal supplementary data provides semantic extension information of the list data to be queried;
[0010] The hierarchical structure of the query list data and the semantic relationship of the heterogeneous modal supplementary data are modeled into a unified heterogeneous semantic graph. The nodes in the heterogeneous semantic graph represent the structural elements of the query list data and the semantic units of the heterogeneous modal supplementary data, and the edges in the heterogeneous semantic graph represent the structural relationships and cross-modal semantic associations between nodes.
[0011] Multi-hop reasoning is performed on the heterogeneous semantic graph, traversing candidate paths from the query start node to the target data node, calculating the semantic coherence score for each candidate path, and selecting the path with the highest semantic coherence score as the semantic path;
[0012] The semantic path is input into the policy decoder, which uses a sequence-to-sequence generation framework to decode the graph node sequence in the semantic path into a query operation sequence.
[0013] During the decoding process, the legality of each decoding output is verified based on the structural constraints of the data to be queried and the semantic constraints of the heterogeneous modal supplementary data. When the decoding output does not meet the structural constraints or the semantic constraints, the attention distribution of the decoder is adjusted and the decoding output is regenerated until the generated query operation sequence simultaneously satisfies both structural legality and semantic consistency, thus obtaining the final query strategy sequence.
[0014] Multi-hop reasoning is performed on the heterogeneous semantic graph, traversing candidate paths from the query origin node to the target data node, calculating the semantic coherence score for each candidate path, and selecting the path with the highest semantic coherence score as the semantic path, including:
[0015] Multi-hop reasoning is performed on the heterogeneous semantic graph. In each hop reasoning, the set of neighboring nodes of the current node is obtained, and the reachability between the set of neighboring nodes and the set of target data nodes is used to determine whether to continue to expand the reasoning path. Multi-hop reasoning is repeated until a node in the set of target data nodes is reached or the preset maximum number of reasoning hops is reached, thereby obtaining a set of candidate paths from the query starting node to each node in the set of target data nodes.
[0016] For each candidate path in the candidate path set, path decomposition is performed, decomposing each candidate path into a node sequence and an edge sequence. The node sequence contains all the nodes traversed by the candidate path, and the edge sequence contains all the edges traversed by the candidate path. The node features of each node in the node sequence and the edge type of each edge in the edge sequence are extracted.
[0017] Node-level coherence components are calculated based on the node feature similarity between adjacent nodes in the node sequence, and edge-level coherence components are calculated based on the edge type consistency between adjacent edges in the edge sequence. A cross-layer penalty coefficient is calculated based on the number of heterogeneous semantic graph layers traversed by the node sequence. The node-level coherence components and edge-level coherence components are then weighted and aggregated, and the cross-layer penalty coefficient is applied for adjustment to obtain the semantic coherence score for each candidate path.
[0018] The candidate path with the highest semantic coherence score is selected as the semantic path.
[0019] Node-level coherence components are calculated based on the node feature similarity between adjacent nodes in the node sequence, edge-level coherence components are calculated based on the edge type consistency between adjacent edges in the edge sequence, and cross-layer penalty coefficients are calculated based on the number of heterogeneous semantic graph layers traversed by the node sequence, including:
[0020] Calculate the vector similarity between the node feature vectors of each pair of adjacent nodes in the node sequence, normalize the vector similarity of all adjacent node pairs, and then calculate the average value to obtain the node-level coherence component;
[0021] Traverse each pair of adjacent edges in the edge sequence, determine whether the edge type identifiers of each pair of adjacent edges are consistent, count the number of adjacent edge pairs with consistent edge type identifiers in the edge sequence, calculate the edge type consistency coefficient based on the ratio of the number of adjacent edge pairs with consistent edge type identifiers to the total number of edge pairs in the edge sequence, and use the edge type consistency coefficient as the edge-level coherence component;
[0022] Identify consecutive node segments belonging to the same heterogeneous semantic graph level in the node sequence, and count the number of different heterogeneous semantic graph levels traversed by the node sequence;
[0023] A cross-layer complexity index is constructed based on the ratio of the number of different heterogeneous semantic graph layers traversed by the node sequence to the preset number of layer benchmarks, and the reciprocal of the cross-layer complexity index is used as the cross-layer penalty coefficient.
[0024] The semantic path is input into the policy decoder, which uses a sequence-to-sequence generation framework to decode the graph node sequence in the semantic path into a query operation sequence, including:
[0025] Extract the graph node sequence from the semantic path and parse the operation dependency rules corresponding to the query list data. The operation dependency rules define the pre-dependencies and mutual exclusions between query operations.
[0026] An operation dependency graph is constructed based on the operation dependency rules. The dependency nodes in the operation dependency graph represent query operations in a predefined query operation vocabulary, and the dependency edges in the operation dependency graph represent the dependency relationships between query operations.
[0027] The graph node sequence is input into the bidirectional encoder of the policy decoder. The forward encoding submodule and the backward encoding submodule of the bidirectional encoder encode the graph node sequence in forward and reverse order, respectively, and fuse them to generate a bidirectional context representation sequence.
[0028] Initialize the constraint-aware decoder of the policy decoder, set the generated query operation set to an empty set, and set the decoding position index to point to the starting position of the bidirectional context representation sequence;
[0029] In each decoding step, a topological traversal is performed on the operation dependency graph based on the generated query operation set to identify dependency nodes whose prerequisite dependencies are fully satisfied by the generated query operation set. The corresponding query operations are added to the candidate query operation set, and query operations that have a mutually exclusive relationship with the generated query operation set are excluded, thus obtaining a valid candidate query operation set.
[0030] Extract the bidirectional context representation corresponding to the decoding position index, calculate the original generation probability of each query operation in the predefined query operation vocabulary, normalize the generation probability of query operations that do not belong to the set of valid candidate query operations, and select the query operation with the highest probability as the decoding output.
[0031] Based on the generated set of query operations, a topological traversal is performed on the operation dependency graph to identify dependency nodes whose prerequisites are fully satisfied by the generated set of query operations. The corresponding query operations are added to the candidate set of query operations, and query operations that are mutually exclusive with the generated set of query operations are excluded. The resulting valid candidate set of query operations includes:
[0032] Extract the list of prerequisite conditions for all dependent nodes in the operation dependency graph. The list of prerequisite conditions records the set of preceding query operations that must be completed before the query operation corresponding to each dependent node is executed.
[0033] Traverse each dependency node in the operation dependency graph, and for each dependency node, extract all the preceding query operation identifiers from the preceding dependency condition list of the dependency node, and determine whether all the preceding query operation identifiers exist in the generated query operation set.
[0034] If so, mark the dependent node as a dependency-satisfied node, extract the query operation corresponding to the dependency-satisfied node, and add it to the initial candidate query operation set;
[0035] Extract the mutual exclusion rules defined in the operation dependency graph. The mutual exclusion rules record query operation pairs that are not allowed to exist in the same query operation sequence at the same time. Traverse each query operation in the initial candidate query operation set and retrieve the mutual exclusion query operation identifier that forms a mutual exclusion relationship with the query operation in the mutual exclusion rules.
[0036] Determine whether the mutual exclusion query operation identifier exists in the generated query operation set. If so, remove the current query operation from the initial candidate query operation set. After removing the mutual exclusion query operation from the initial candidate query operation set, the valid candidate query operation set is obtained.
[0037] The validity verification of each decoding output step, based on the structural constraints of the query list data and the semantic constraints of the heterogeneous modal supplementary data, includes:
[0038] After each decoding step of the strategy decoder generates a query operation, all query operations in the generated query operation set are extracted. The generated query operation set is then subjected to structural legality verification according to the structural definition rules of the data to be queried. It is determined whether the generated query operation set violates the hierarchical access order constraints, field reference constraints, or operation combination constraints of the data to be queried, and the structural legality verification result is obtained.
[0039] For query operations involving heterogeneous modal supplementary data in the generated query operation set, extract the semantic unit identifier of the heterogeneous modal supplementary data referenced by the query operation, match and verify the semantic unit identifier with the semantic type of the corresponding node in the heterogeneous semantic graph, determine whether the access method of the query operation to the heterogeneous modal supplementary data conforms to the semantic type definition of the semantic unit and whether it satisfies the propagation constraint of cross-modal semantic association in the heterogeneous semantic graph, and obtain the semantic consistency verification result;
[0040] When the structure validity check result or the semantic consistency check result indicates that there is a constraint violation, locate the decoding step corresponding to the first query operation in the generated query operation set that violates the constraint.
[0041] A second aspect of this invention provides an automatic query and processing system for list data based on intelligent algorithms, comprising:
[0042] The first unit is used to acquire the list data to be queried and the heterogeneous modal supplementary data semantically associated with the list data to be queried, wherein the heterogeneous modal supplementary data provides semantic extension information of the list data to be queried;
[0043] The second unit is used to model the hierarchical structure of the query list data and the semantic relationship of the heterogeneous modal supplementary data into a unified heterogeneous semantic graph. The nodes in the heterogeneous semantic graph represent the structural elements of the query list data and the semantic units of the heterogeneous modal supplementary data, and the edges in the heterogeneous semantic graph represent the structural relationships and cross-modal semantic associations between nodes.
[0044] The third unit is used to perform multi-hop reasoning on the heterogeneous semantic graph, traverse candidate paths from the query start node to the target data node, calculate the semantic coherence score of each candidate path, and select the path with the highest semantic coherence score as the semantic path;
[0045] The fourth unit is used to input the semantic path into the policy decoder, and the policy decoder uses a sequence-to-sequence generation framework to decode the graph node sequence in the semantic path into a query operation sequence.
[0046] The fifth unit is used to perform legality verification on the decoding output at each step during the decoding process based on the structural constraints of the data to be queried in the list and the semantic constraints of the heterogeneous modal supplementary data. When the decoding output does not meet the structural constraints or the semantic constraints, the attention distribution of the decoder is adjusted and the decoding output is regenerated until the generated query operation sequence simultaneously meets the structural legality and semantic consistency, thus obtaining the final query strategy sequence.
[0047] A third aspect of the present invention,
[0048] An electronic device is provided, comprising:
[0049] processor;
[0050] Memory used to store processor-executable instructions;
[0051] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0052] Fourth aspect of the embodiments of the present invention,
[0053] A computer-readable storage medium is provided, having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0054] The beneficial effects of this application are as follows:
[0055] By unifying the hierarchical structure of list data and the semantic relationships of heterogeneous modal data into a heterogeneous semantic graph, the problem of inconsistent semantic expression between different modal data is effectively solved, providing a unified semantic space for subsequent multi-hop reasoning.
[0056] By performing multi-hop reasoning on heterogeneous semantic graphs, the system can automatically discover the best semantic path from the query origin to the target data, rather than relying on predefined query rules, thus improving the flexibility and accuracy of queries.
[0057] During the decoding process, structural and semantic constraints are combined for legality verification. By dynamically adjusting the attention distribution, the generated query operation sequence is ensured to simultaneously satisfy structural legality and semantic consistency, effectively avoiding semantic bias and structural errors in traditional query methods.
[0058] When the decoded output does not meet the constraints, the system can automatically adjust and regenerate, demonstrating its self-correction and optimization capabilities, and significantly improving the success rate and accuracy of complex list data queries. Attached Figure Description
[0059] Figure 1 This is a flowchart illustrating the automatic query and processing method for list data based on intelligent algorithms according to an embodiment of the present invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0061] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0062] Figure 1 This is a flowchart illustrating the automatic query and processing method for list data based on intelligent algorithms according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0063] Obtain the list data to be queried and the heterogeneous modal supplementary data semantically associated with the list data to be queried, wherein the heterogeneous modal supplementary data provides semantic extension information of the list data to be queried;
[0064] The hierarchical structure of the query list data and the semantic relationship of the heterogeneous modal supplementary data are modeled into a unified heterogeneous semantic graph. The nodes in the heterogeneous semantic graph represent the structural elements of the query list data and the semantic units of the heterogeneous modal supplementary data, and the edges in the heterogeneous semantic graph represent the structural relationships and cross-modal semantic associations between nodes.
[0065] Multi-hop reasoning is performed on the heterogeneous semantic graph, traversing candidate paths from the query start node to the target data node, calculating the semantic coherence score for each candidate path, and selecting the path with the highest semantic coherence score as the semantic path;
[0066] The semantic path is input into the policy decoder, which uses a sequence-to-sequence generation framework to decode the graph node sequence in the semantic path into a query operation sequence.
[0067] During the decoding process, the legality of each decoding output is verified based on the structural constraints of the data to be queried and the semantic constraints of the heterogeneous modal supplementary data. When the decoding output does not meet the structural constraints or the semantic constraints, the attention distribution of the decoder is adjusted and the decoding output is regenerated until the generated query operation sequence simultaneously satisfies both structural legality and semantic consistency, thus obtaining the final query strategy sequence.
[0068] For example, the list data to be queried can be a structured product catalog, such as a product list on an e-commerce platform, containing fields such as product ID, name, price, and category. Heterogeneous modal supplementary data includes text descriptions, user reviews, image feature vectors, and other information related to these products. This heterogeneous modal data provides semantic extension information to the list data. For instance, for a smartphone product, the list data might only contain basic specifications, while the heterogeneous modal supplementary data includes detailed feature descriptions, user experience descriptions, product images, and other information, enriching the understanding of the product from different perspectives.
[0069] After acquiring the data, the hierarchical structure of the query list data and the semantic relationships of the heterogeneous modal supplementary data are modeled into a unified heterogeneous semantic graph. During the construction of the heterogeneous semantic graph, the structure of the query list data is parsed to identify its hierarchical relationships. Taking an e-commerce product catalog as an example, "electronic products" is used as the parent node, "smartphones" as the child node, and specific phone models as leaf nodes. Simultaneously, the heterogeneous modal supplementary data is parsed to identify its semantic units. For example, in the user review "excellent screen display," semantic units such as "screen" and "display effect" are extracted.
[0070] During the node creation phase, a corresponding node is created for each structural element and semantic unit. A semantic unit refers to the smallest unit of information with independent semantic meaning extracted from heterogeneous modal supplementary data. Structural elements of list data, such as "price range: 1000-2000 yuan," are created as structural nodes, with structural attributes including data type (range value) and location information (price filtering criteria). Semantic units of heterogeneous modal data, such as "high-definition screen," are created as semantic nodes, with semantic attributes including semantic type (product characteristic) and sentiment tendency (positive).
[0071] Edge creation includes three categories: structural association edges, cross-modal association edges, and semantic association edges. Structural association edges represent the structural relationships within list data, such as the inclusion relationship between "brand" and "model". Cross-modal association edges represent the associations between list data and heterogeneous modal data, such as the association between a product ID and its user reviews. Semantic association edges represent the semantic relationships within heterogeneous modal data, such as the attribute relationship between "screen" and "resolution". Each edge is assigned a specific edge type identifier and edge weight for subsequent path reasoning.
[0072] After constructing the heterogeneous semantic graph, multi-hop reasoning is performed on the graph to find the optimal semantic path from the query start node to the target data node. Assuming the user's query intent is "find a mid-range phone with good camera performance," "mid-range phone" is identified as the query start node, and phone products containing specific camera performance features are identified as target data nodes. The multi-hop reasoning process consists of three stages: path traversal, path scoring, and path selection.
[0073] During the path traversal phase, a depth-first search algorithm is used to traverse all possible paths in the graph. Starting from the "mid-range phone" node, the path might traverse to the "price range: 2000-4000 yuan" node, then to the "rear camera" node, and finally connect to the "photo quality" semantic node, ultimately reaching the specific phone model node that meets the criteria. In practical applications, a maximum hop count limit is set, typically controlled at 5-7 hops, to balance search breadth and computational efficiency.
[0074] In the path scoring phase, a semantic coherence score is calculated for each candidate path. The semantic coherence score considers multiple factors: semantic similarity between nodes, edge weights, path length, etc. For the path "mid-range phone → price range: 2000-4000 yuan → rear camera → photo quality → phone model A", the semantic coherence between adjacent nodes is calculated. For example, a high semantic similarity between "rear camera" and "photo quality" will improve the coherence score; conversely, if the path contains nodes irrelevant to the query intent, such as "charging power," the overall coherence score will decrease.
[0075] Among multiple candidate paths, the path with the highest semantic coherence score is selected as the final semantic path. For example, two paths might be compared: "mid-range phone → price range → processor → camera performance → phone model B" and "mid-range phone → price range → rear camera → camera performance → phone model A". Since the latter is more semantically coherent, it is selected as the best semantic path.
[0076] After obtaining the semantic path, it is input into the policy decoder, which decodes the graph node sequence into a query operation sequence using a sequence-to-sequence generation framework. The decoder employs an attention-based architecture, taking the node sequence in the semantic path as input to generate the corresponding query operation sequence. For the example path above, the decoder might generate the following query operation sequence: "Filter price range (2000-4000 yuan) → Filter camera pixels (not less than 48 million) → Sort (in descending order by photo rating) → Return results".
[0077] During the decoding process, the validity of each decoding output is verified based on the structural constraints of the list data to be queried and the semantic constraints of the heterogeneous modal supplementary data. Structural constraints ensure that the generated query operation conforms to the structural specifications of the list data, such as the requirement that filter condition fields must exist in the list data. Semantic constraints ensure that the query operation is semantically consistent with the user's intent. Figure 1 For example, when the decoder generates the "filter battery capacity" operation, it detects that this operation is not semantically directly related to the user's photo-taking needs and does not meet semantic constraints. Therefore, it adjusts the decoder's attention distribution to focus more on node information related to taking photos, such as "rear camera" and "image processing chip".
[0078] When the decoded output does not meet structural or semantic constraints, error correction is achieved by adjusting the attention weight distribution of the decoder. Specifically, the negative attention weights of nodes that violate the constraints are increased to reduce their impact on generating the next operation, while the positive attention weights of nodes that meet the constraints are increased. Through this adaptive adjustment mechanism, the decoder can regenerate more reasonable query operations.
[0079] After repeated adjustments and verifications, a query strategy sequence that simultaneously satisfies structural validity and semantic consistency was finally generated, such as "filter price range (2000-4000 yuan) → filter camera pixels (not less than 48 million) → filter photo rating (not less than 4.5 points) → sort (in descending order by photo rating) → return results". This query strategy sequence can accurately express the user's query intent and can be directly executed on the database of the query list, returning results that meet the user's needs.
[0080] Through the above implementation methods, the present invention realizes the integrated utilization of list data and heterogeneous modal data. By constructing heterogeneous semantic graphs and multi-hop reasoning, it generates semantically rich and structurally compliant query strategies, which significantly improves the intelligence level and user experience of list data query.
[0081] In one optional implementation, multi-hop reasoning is performed on the heterogeneous semantic graph, traversing candidate paths from the query origin node to the target data node, calculating the semantic coherence score for each candidate path, and selecting the path with the highest semantic coherence score as the semantic path, including:
[0082] Multi-hop reasoning is performed on the heterogeneous semantic graph. In each hop reasoning, the set of neighboring nodes of the current node is obtained, and the reachability between the set of neighboring nodes and the set of target data nodes is used to determine whether to continue to expand the reasoning path. Multi-hop reasoning is repeated until a node in the set of target data nodes is reached or the preset maximum number of reasoning hops is reached, thereby obtaining a set of candidate paths from the query starting node to each node in the set of target data nodes.
[0083] For each candidate path in the candidate path set, path decomposition is performed, decomposing each candidate path into a node sequence and an edge sequence. The node sequence contains all the nodes traversed by the candidate path, and the edge sequence contains all the edges traversed by the candidate path. The node features of each node in the node sequence and the edge type of each edge in the edge sequence are extracted.
[0084] Node-level coherence components are calculated based on the node feature similarity between adjacent nodes in the node sequence, and edge-level coherence components are calculated based on the edge type consistency between adjacent edges in the edge sequence. A cross-layer penalty coefficient is calculated based on the number of heterogeneous semantic graph layers traversed by the node sequence. The node-level coherence components and edge-level coherence components are then weighted and aggregated, and the cross-layer penalty coefficient is applied for adjustment to obtain the semantic coherence score for each candidate path.
[0085] The candidate path with the highest semantic coherence score is selected as the semantic path.
[0086] In performing multi-hop reasoning on heterogeneous semantic graphs, the first step is to determine the query start node and the target data node set. The query start node is typically the query entity or concept input by the user, while the target data node set consists of nodes containing the required information. The core objective of multi-hop reasoning is to find the optimal semantic path from the start node to the target node to achieve accurate knowledge acquisition.
[0087] During multi-hop inference, the system iteratively explores neighboring nodes, starting from the query originating node. During each hop, all neighboring nodes of the current node are acquired, forming a neighbor set. For each neighboring node, its reachability to the target data node set is evaluated. Reachability evaluation can be achieved by calculating semantic similarity between nodes or using a pre-trained reachability prediction model. If a neighboring node is reachable from the target data node, it is added to the inference path, and the process continues; otherwise, the branch is abandoned to avoid ineffective expansion.
[0088] To prevent the inference process from getting stuck in an infinite loop, a maximum inference hop count threshold is set, such as five or eight hops. The inference process terminates when the preset maximum hop count is reached or the target data node has been reached. In this way, a set of candidate paths from the query starting node to each node in the target data node set can be obtained, and each candidate path represents a possible semantic association.
[0089] For the obtained candidate path set, detailed path decomposition is required. Each candidate path is decomposed into two key components: a node sequence and an edge sequence. The node sequence contains all the nodes traversed by the path, such as [node1, node2, ..., noden]; the edge sequence contains all the edges traversed by the path, such as [edge1, edge2, ..., edgen-1].
[0090] For each node in the node sequence, extract its node features. Node features can be pre-computed embedding vectors, attribute lists, or text descriptions. For example, in a medical knowledge graph, the features of a disease node might include symptom descriptions, pathogenesis, and other information. Simultaneously, extract the edge type of each edge in the edge sequence, such as relation types like "cause," "treat," and "contain."
[0091] Semantic coherence assessment is a core step in path selection, encompassing two dimensions: node-level coherence and edge-level coherence. Node-level coherence is calculated based on the feature similarity between adjacent nodes. For any pair of adjacent nodes in a node sequence, the cosine similarity or other semantic similarity measure between their node feature vectors is calculated. The average similarity of all adjacent node pairs yields the node-level coherence component.
[0092] Edge-level coherence focuses on the consistency of types between adjacent edges. For adjacent edge pairs in an edge sequence, it assesses whether their edge types belong to semantically related or consistent relation categories. For example, "cause" and "lead to" can be considered highly consistent edge types, while "cause" and "treat" have a weaker semantic association. The consistency score of adjacent edge pairs is calculated using an edge type compatibility matrix or a pre-trained edge type representation model, and the average value is taken as the edge-level coherence component.
[0093] Heterogeneous semantic graphs typically contain multiple semantic levels, such as entity, concept, and attribute layers. When a path crosses different semantic levels, additional semantic noise may be introduced. Therefore, a cross-level penalty coefficient is calculated based on the number of heterogeneous semantic graph layers traversed by the node sequence. Specifically, if the number of cross-level transformations in the path is k, the cross-level penalty coefficient can be set to [value missing]. ,in This is an adjustable penalty intensity parameter.
[0094] The final semantic coherence score is obtained by weighting and aggregating node-level coherence components and edge-level coherence components, and then adjusting it by applying a cross-layer penalty coefficient.
[0095]
[0096] Finally, the path with the highest semantic coherence score is selected from all candidate paths as the final semantic path. This path not only connects the query starting point with the target data, but also ensures semantic coherence and interpretability, which is helpful for subsequent knowledge reasoning and question answering.
[0097] In one optional implementation, a node-level coherence component is calculated based on the node feature similarity between adjacent nodes in the node sequence, an edge-level coherence component is calculated based on the edge type consistency between adjacent edges in the edge sequence, and a cross-layer penalty coefficient is calculated based on the number of heterogeneous semantic graph layers traversed by the node sequence, including:
[0098] Calculate the vector similarity between the node feature vectors of each pair of adjacent nodes in the node sequence, normalize the vector similarity of all adjacent node pairs, and then calculate the average value to obtain the node-level coherence component;
[0099] Traverse each pair of adjacent edges in the edge sequence, determine whether the edge type identifiers of each pair of adjacent edges are consistent, count the number of adjacent edge pairs with consistent edge type identifiers in the edge sequence, calculate the edge type consistency coefficient based on the ratio of the number of adjacent edge pairs with consistent edge type identifiers to the total number of edge pairs in the edge sequence, and use the edge type consistency coefficient as the edge-level coherence component;
[0100] Identify consecutive node segments belonging to the same heterogeneous semantic graph level in the node sequence, and count the number of different heterogeneous semantic graph levels traversed by the node sequence;
[0101] A cross-layer complexity index is constructed based on the ratio of the number of different heterogeneous semantic graph layers traversed by the node sequence to the preset number of layer benchmarks, and the reciprocal of the cross-layer complexity index is used as the cross-layer penalty coefficient.
[0102] Calculating node-level coherence components requires calculating the vector similarity between the feature vectors of each pair of adjacent nodes in the node sequence. Assuming two adjacent nodes in the node sequence are node i and node j, and their feature vectors are represented as Vi and Vj, cosine similarity can be used to calculate their vector similarity:
[0103] For each pair of adjacent nodes in the node sequence, the cosine similarity between their feature vectors is calculated, resulting in a set of vector similarity values. To normalize these similarity values, the Min-Max normalization method can be used to map each similarity value to the interval [0,1].
[0104] After normalization, the average of all normalized similarity values is calculated to obtain the node-level coherence component. The higher the value of this component, the higher the feature similarity between adjacent nodes in the node sequence, and the better the node-level coherence.
[0105] Secondly, the calculation of edge-level coherence components requires traversing each pair of adjacent edges in the edge sequence and determining whether their edge type identifiers are consistent. Assuming there are n edges in the edge sequence, there are n-1 pairs of adjacent edges. For each pair of adjacent edges, check if their edge type identifiers are the same. If they are the same, the pair of adjacent edges is considered to have the same type.
[0106] The number of adjacent edge pairs with the same edge type identifier in the edge sequence is denoted as `consistent_count`. The total number of edge pairs in the edge sequence is n-1, or `total_pairs`. The edge type consistency coefficient is calculated by dividing `consistent_count` by `total_pairs`, representing the proportion of edges in the edge sequence that maintain the same type. This edge type consistency coefficient is used as the edge-level coherence component. The higher the value of this component, the more consistent the types of adjacent edges in the edge sequence, and the better the edge-level coherence.
[0107] Then, for the calculation of the cross-level penalty coefficient, the first step is to identify consecutive node segments in the node sequence that belong to the same heterogeneous semantic graph level. Specifically, the node sequence is traversed, and consecutive nodes belonging to the same level are grouped into one node segment. For example, if the level of the nodes in the node sequence is [A, A, B, B, B, C, A], then four node segments can be identified: [A, A], [B, B, B], [C], and [A].
[0108] The number of different heterogeneous semantic graph layers traversed by the node sequence is denoted as layer_count. In the example above, the number of layers is 3, namely A, B, and C.
[0109] A cross-layer complexity metric is constructed based on the ratio of the number of different heterogeneous semantic graph layers traversed by the node sequence to a preset baseline number of layers. The preset baseline number of layers can be set according to specific application scenarios, let's assume it's `base_layer_count`. The cross-layer complexity metric is calculated as `layer_count` divided by `base_layer_count`.
[0110] The reciprocal of the cross-level complexity metric is used as the cross-level penalty coefficient. The lower the coefficient, the more levels the node sequence traverses, the higher the path complexity, and the greater the penalty required.
[0111] In practical applications, such as knowledge graph reasoning tasks, the node-level coherence component, edge-level coherence component, and cross-layer penalty coefficient calculated above can be used to evaluate the quality of the reasoning path. Specifically, these three components can be weighted and combined to obtain the overall coherence score of the path:
[0112] The node-level coherence component is multiplied by a weight α, the edge-level coherence component by a weight β, and the cross-layer penalty coefficient by a weight γ. These are then summed to obtain the final path coherence score. α, β, and γ are weight parameters that can be adjusted according to specific task requirements to satisfy... .
[0113] In this way, the coherence of paths in heterogeneous semantic graphs can be comprehensively evaluated, providing a basis for subsequent path sorting, filtering, and application.
[0114] In one optional implementation, the semantic path is input to a policy decoder, and the policy decoder decodes the sequence of graph nodes in the semantic path into a sequence of query operations using a sequence-to-sequence generation framework, including:
[0115] Extract the graph node sequence from the semantic path and parse the operation dependency rules corresponding to the query list data. The operation dependency rules define the pre-dependencies and mutual exclusions between query operations.
[0116] An operation dependency graph is constructed based on the operation dependency rules. The dependency nodes in the operation dependency graph represent query operations in a predefined query operation vocabulary, and the dependency edges in the operation dependency graph represent the dependency relationships between query operations.
[0117] The graph node sequence is input into the bidirectional encoder of the policy decoder. The forward encoding submodule and the backward encoding submodule of the bidirectional encoder encode the graph node sequence in forward and reverse order, respectively, and fuse them to generate a bidirectional context representation sequence.
[0118] Initialize the constraint-aware decoder of the policy decoder, set the generated query operation set to an empty set, and set the decoding position index to point to the starting position of the bidirectional context representation sequence;
[0119] In each decoding step, a topological traversal is performed on the operation dependency graph based on the generated query operation set to identify dependency nodes whose prerequisite dependencies are fully satisfied by the generated query operation set. The corresponding query operations are added to the candidate query operation set, and query operations that have a mutually exclusive relationship with the generated query operation set are excluded, thus obtaining a valid candidate query operation set.
[0120] Extract the bidirectional context representation corresponding to the decoding position index, calculate the original generation probability of each query operation in the predefined query operation vocabulary, normalize the generation probability of query operations that do not belong to the set of valid candidate query operations, and select the query operation with the highest probability as the decoding output.
[0121] For example, the policy decoder is a transformation module that converts a sequence of graph nodes in a semantic path into a sequence of query operations. It adopts an encoder-decoder architecture and consists of two main sub-modules:
[0122] The bidirectional encoder section comprises a forward encoding submodule and a backward encoding submodule, which encode the input graph node sequence in ascending and descending order, respectively, and generate a bidirectional context representation sequence by fusing bidirectional information. This bidirectional encoding mechanism can capture the contextual semantic information of each position in the graph node sequence.
[0123] The constraint-aware decoder part dynamically senses and applies operation dependency rules during the decoding process. It maintains a set of generated query operations and performs a topological traversal based on the operation dependency graph in each decoding step to ensure that the generated sequence of query operations conforms to predefined dependencies and mutual exclusion relationships.
[0124] Extract the graph node sequence from the semantic path and parse the operation dependency rules corresponding to the query list data. The graph node sequence can be represented as: ,in This represents the i-th node on the semantic path. Operation dependency rules include two types of relationships: prerequisite dependencies and mutual exclusions. Prerequisite dependencies indicate that a query operation must be executed after another query operation; mutual exclusions indicate that certain query operations cannot appear simultaneously in the same query operation sequence.
[0125] Taking product search on an e-commerce platform as an example, the prerequisite for the "sort by price" operation is "querying the product list," because the product list must be obtained before sorting can be performed. Furthermore, there is a mutual exclusion relationship between "sort by price ascending" and "sort by price descending," because two opposite sorting methods cannot be used simultaneously. Operation dependency rules are typically stored in configuration files, containing a set of triples, with dependency types that can be either "prerequisite dependency" or "mutually exclusive."
[0126] Construct an operation dependency graph based on operation dependency rules. Here, V represents the set of nodes, corresponding to query operations in the predefined query operation vocabulary; E represents the set of edges, corresponding to the dependencies between query operations. For each pair of operations with a pre-dependent relationship, a directed edge is added to the graph from operation A to operation B, indicating that B depends on A. For mutual exclusion relationships, the mutual exclusion operation pairs are recorded in the auxiliary structure of the graph.
[0127] The extracted graph node sequence is input into the bidirectional encoder of the policy decoder. The bidirectional encoder consists of a forward encoding submodule and a backward encoding submodule. The forward encoding submodule is arranged according to n1 to n... m Process the node sequence sequentially to generate the forward hidden state sequence. The backward encoding submodule is configured according to n m Process the node sequence up to n1 in order to generate the backward hidden state sequence. Subsequently, the forward and backward hidden states are fused to obtain a bidirectional context representation sequence. This indicates that the forward and backward hidden states are connected.
[0128] The constraint-aware decoder of the policy decoder is initialized by setting the generated query operation set S to an empty set and pointing the decoding position index p to the starting position of the bidirectional context representation sequence, i.e., p=1. The generated query operation set is used to record the query operations generated during the decoding process.
[0129] In each step of the decoding process, a topological traversal is performed in the operation dependency graph G based on the generated query operation set S. First, dependent nodes that meet the conditions are identified, i.e., nodes whose predecessor dependencies are fully satisfied by operations in S. Specifically, for each node v in the operation dependency graph G, it is checked whether all its incoming edges correspond to predecessor nodes already in S; if so, v is added to the candidate query operation set T.
[0130] Next, exclude query operations from T that are mutually exclusive with operations in S. For each operation t in T, check if any operation exists. If such a mutual exclusion relationship exists, then remove t from T. After these two steps, a set of valid candidate query operations is obtained. .
[0131] Extract the bidirectional context representation cp corresponding to the decoded position index p, and calculate the original generation probability of each query operation in the predefined query operation vocabulary. Where 'op' represents the query operation in the vocabulary. Operations that do not belong to the set of valid candidate queries will be excluded. The probability of generating the query operation is set to zero, and then the remaining probabilities are normalized.
[0132] Choose the normalized probability Highest query operation As the output of the current decoding step, Add to the generated query operation set S. Update the decoded position index. If p exceeds the length of the bidirectional context representation sequence or has reached the preset maximum decoding length, the decoding process ends; otherwise, the next decoding step continues.
[0133] After the decoding process is complete, the query operations in the generated query operation set S are arranged in the order of generation to form the final query operation sequence. This sequence satisfies the pre-dependencies and mutual exclusions defined in the operation dependency rules, while also respecting the user's query intent implied in the semantic path.
[0134] Through the constraint-aware decoding process of the above-mentioned policy decoder, the sequence of graph nodes in the semantic path is transformed into a sequence of query operations that satisfy the operation dependency rules, providing effective guidance for subsequent execution of query operations.
[0135] In one optional implementation, a topological traversal is performed on the operation dependency graph based on the generated query operation set to identify dependency nodes whose prerequisite dependencies are fully satisfied by the generated query operation set. The corresponding query operations are added to the candidate query operation set, and query operations that have a mutually exclusive relationship with the generated query operation set are excluded. The resulting effective candidate query operation set includes:
[0136] Extract the list of prerequisite conditions for all dependent nodes in the operation dependency graph. The list of prerequisite conditions records the set of preceding query operations that must be completed before the query operation corresponding to each dependent node is executed.
[0137] Traverse each dependency node in the operation dependency graph, and for each dependency node, extract all the preceding query operation identifiers from the preceding dependency condition list of the dependency node, and determine whether all the preceding query operation identifiers exist in the generated query operation set.
[0138] If so, mark the dependent node as a dependency-satisfied node, extract the query operation corresponding to the dependency-satisfied node, and add it to the initial candidate query operation set;
[0139] Extract the mutual exclusion rules defined in the operation dependency graph. The mutual exclusion rules record query operation pairs that are not allowed to exist in the same query operation sequence at the same time. Traverse each query operation in the initial candidate query operation set and retrieve the mutual exclusion query operation identifier that forms a mutual exclusion relationship with the query operation in the mutual exclusion rules.
[0140] Determine whether the mutual exclusion query operation identifier exists in the generated query operation set. If so, remove the current query operation from the initial candidate query operation set. After removing the mutual exclusion query operation from the initial candidate query operation set, the valid candidate query operation set is obtained.
[0141] In performing a topological traversal of an operation dependency graph to identify candidate query operations, it is first necessary to understand the structure of the operation dependency graph. An operation dependency graph is a directed graph where nodes represent query operations and edges represent dependencies between operations. Each dependent node has a corresponding list of prerequisite dependencies, recording the set of preceding query operations that must be completed before the current query operation can be executed.
[0142] Based on the method of performing topological traversal in the operation dependency graph using the generated set of query operations, the first step is to extract the list of pre-dependent conditions for all dependent nodes in the operation dependency graph. This list is stored in key-value pairs, where the key is the identifier of the dependent node, and the value is the set of pre-dependent query operation identifiers corresponding to that node. For example, for dependent node A, its list of pre-dependent conditions might be {B, C}, indicating that query operations B and C must be completed before query operation A can be executed.
[0143] Next, traverse each dependency node in the operation dependency graph. For each dependency node, extract all preceding query operation identifiers from its preceding dependency condition list. Determine whether the preceding dependencies of this dependency node have been fully satisfied by checking whether all of these preceding query operation identifiers exist in the set of generated query operations.
[0144] Assuming the generated query operation set is Now, examine the dependent node A, whose pre-dependency list is {B, C}. Since both B and C exist in set S, A's pre-dependencies have been fully satisfied. Therefore, A can be marked as a dependency-satisfied node, and its corresponding query operation can be added to the initial candidate query operation set.
[0145] After checking all dependent nodes, an initial set of candidate query operations T is obtained. However, these candidate query operations may be mutually exclusive with some operations in the already generated set of query operations, so further filtering is required.
[0146] Next, we extract the mutual exclusion rules defined in the operation dependency graph. These rules record query operation pairs that are not allowed to coexist in the same query operation sequence. For example... This indicates that query operations A and E are mutually exclusive, and B and F are mutually exclusive.
[0147] Iterate through each query operation in the initial candidate query operation set T, and retrieve the identifier of the mutually exclusive query operation that forms a mutually exclusive pair with that query operation from the mutual exclusion rules. For example, for candidate query operation A, it is found that it is mutually exclusive with query operation E.
[0148] Determine if these mutually exclusive query operation identifiers exist in the already generated query operation set S. If they exist, remove the current query operation from the initial candidate query operation set T. For example, if E exists in set S, remove A from set T, because A and E are mutually exclusive and cannot exist in the same query operation sequence simultaneously.
[0149] After removing mutually exclusive query operations from the initial candidate query operation set, the valid candidate query operation set R is obtained.
[0150] In practical applications, adjacency lists or adjacency matrices can be used to represent operation dependency graphs. The list of prerequisite dependencies can be implemented using a hash table, where the key is the identifier of the dependent node and the value is the set of identifiers of the preceding query operations for that node. Mutual exclusion rules can be represented by a set of operation pairs, or a hash table can be used for fast lookup.
[0151] The above method effectively identifies the set of next query operations that can be executed based on the currently generated set of query operations, thus supporting the dynamic construction of query operation sequences. This method is particularly suitable for scenarios that require executing a series of query operations according to specific dependencies, such as data analysis pipelines, ETL processes, or complex query optimization.
[0152] In a data analytics platform, users may need to perform a series of interdependent data queries and transformations. For example, a user might first perform query B to obtain raw data, then perform query C to clean the data, and finally perform query D to extract features. After completing these three operations, the system can identify the set of next executable queries using the methods described above, such as data aggregation operation A and visualization operation G. However, if operation A is mutually exclusive with an already executed operation (such as D), then A will be excluded, and only G will be recommended to the user as the next executable operation.
[0153] This approach guides users to execute queries in a logical order, avoiding errors or performance issues caused by improper order, while ensuring the correctness and efficiency of the query sequence.
[0154] In one optional implementation, validating the output of each decoding step based on the structural constraints of the query list data and the semantic constraints of the heterogeneous modal supplementary data includes:
[0155] After each decoding step of the strategy decoder generates a query operation, all query operations in the generated query operation set are extracted. The generated query operation set is then subjected to structural legality verification according to the structural definition rules of the data to be queried. It is determined whether the generated query operation set violates the hierarchical access order constraints, field reference constraints, or operation combination constraints of the data to be queried, and the structural legality verification result is obtained.
[0156] For query operations involving heterogeneous modal supplementary data in the generated query operation set, extract the semantic unit identifier of the heterogeneous modal supplementary data referenced by the query operation, match and verify the semantic unit identifier with the semantic type of the corresponding node in the heterogeneous semantic graph, determine whether the access method of the query operation to the heterogeneous modal supplementary data conforms to the semantic type definition of the semantic unit and whether it satisfies the propagation constraint of cross-modal semantic association in the heterogeneous semantic graph, and obtain the semantic consistency verification result;
[0157] When the structure validity check result or the semantic consistency check result indicates that there is a constraint violation, locate the decoding step corresponding to the first query operation in the generated query operation set that violates the constraint.
[0158] In intelligent data query systems, to ensure that the generated query operations conform to the data structure of the query list and the semantic constraints of the heterogeneous modal supplementary data, it is necessary to perform legality verification on each step of the decoding output of the policy decoder.
[0159] When the policy decoder begins decoding and generating query operations, it first establishes a query operation set to store the generated query operations. After each decoding step is completed, the entire set of generated query operations is immediately extracted and subjected to structural validity and semantic consistency checks.
[0160] Structural validity verification primarily checks whether the set of query operations conforms to the structural definition rules of the list data to be queried. In practice, it verifies the generated set of query operations one by one based on the predefined hierarchical access order constraints, field reference constraints, and operation combination constraints of the list data to be queried. For example, regarding hierarchical access order constraints, it checks whether parent entities are accessed before child entities; for field reference constraints, it verifies whether the referenced field names exist in the corresponding data entities; and for operation combination constraints, it checks whether the use of specific combined operations is legal, such as whether the order of filtering and sorting operations is correct.
[0161] When a violation of hierarchical access order constraints is detected, such as accessing "Order Details" before accessing "Order," the system records the violation and its corresponding decoding step. Similarly, if a query operation references a non-existent field, such as referencing the "Product Price" field in the "User" entity, it will also be marked as a violation of field reference constraints.
[0162] For query operations involving heterogeneous modal supplementary data, semantic consistency verification is also required. First, the semantic unit identifiers referenced in the query operation are extracted, such as image region IDs or video clip timestamps. Then, these identifiers are matched and verified against the semantic types of the corresponding nodes in the heterogeneous semantic graph. For example, if a query operation attempts to access a semantic unit defined as an image object in text form, the system will determine that it violates the semantic type definition.
[0163] In a real-world application scenario, suppose a user uploads a product image as query input. The system constructs a heterogeneous semantic graph containing visual objects identified in the image, such as "watch" and "price tag". When the policy decoder generates the query operation "FILTER(product.category, EQUALS, IMAGE_OBJECT_3.category)", the system verifies whether "IMAGE_OBJECT_3" exists in the heterogeneous semantic graph and whether its semantic type is "product category". If "IMAGE_OBJECT_3" actually represents "price tag" instead of "product category", the operation will be marked as violating semantic consistency.
[0164] In addition, the system also checks the propagation constraints of cross-modal semantic associations. For example, when a query operation attempts to extract price information from an image object and compare it with a price range in the database, the system verifies whether there is a valid semantic association path between the price tag in the image and the queried product entity. If no such association path exists, the operation will be judged as violating the propagation constraints of cross-modal semantic associations, even if the semantic types match.
[0165] When the system detects a constraint violation in the structural validity or semantic consistency check results, it pinpoints the exact decoding step corresponding to the first query operation that violated the constraint. This location information is crucial for subsequent query correction; it can be used to backtrack the decoding process, adjust the decoding strategy, or provide the user with appropriate error messages.
[0166] In multi-round interactive query scenarios, this validity verification mechanism can effectively prevent the accumulation of errors. For example, a user first requests "find all red products," and then points to an object in an image saying "similar in price." If the system detects in the second round of interaction that the object pointed to in the image is actually a logo rather than a price tag, it can immediately detect the semantic inconsistency and avoid generating invalid queries.
[0167] Through the dual verification mechanism of structural legality verification and semantic consistency verification, the intelligent data query system can ensure that the generated query operations not only comply with the data structure constraints, but also are consistent with the semantic expression of heterogeneous modal supplementary data, thereby improving query accuracy and user experience.
[0168] This invention relates to an automatic list data query and processing system based on intelligent algorithms, comprising:
[0169] The first unit is used to acquire the list data to be queried and the heterogeneous modal supplementary data semantically associated with the list data to be queried, wherein the heterogeneous modal supplementary data provides semantic extension information of the list data to be queried;
[0170] The second unit is used to model the hierarchical structure of the query list data and the semantic relationship of the heterogeneous modal supplementary data into a unified heterogeneous semantic graph. The nodes in the heterogeneous semantic graph represent the structural elements of the query list data and the semantic units of the heterogeneous modal supplementary data, and the edges in the heterogeneous semantic graph represent the structural relationships and cross-modal semantic associations between nodes.
[0171] The third unit is used to perform multi-hop reasoning on the heterogeneous semantic graph, traverse candidate paths from the query start node to the target data node, calculate the semantic coherence score of each candidate path, and select the path with the highest semantic coherence score as the semantic path;
[0172] The fourth unit is used to input the semantic path into the policy decoder, and the policy decoder uses a sequence-to-sequence generation framework to decode the graph node sequence in the semantic path into a query operation sequence.
[0173] The fifth unit is used to perform legality verification on the decoding output at each step during the decoding process based on the structural constraints of the data to be queried in the list and the semantic constraints of the heterogeneous modal supplementary data. When the decoding output does not meet the structural constraints or the semantic constraints, the attention distribution of the decoder is adjusted and the decoding output is regenerated until the generated query operation sequence simultaneously meets the structural legality and semantic consistency, thus obtaining the final query strategy sequence.
[0174] A third aspect of the present invention provides an electronic device, comprising:
[0175] processor;
[0176] Memory used to store processor-executable instructions;
[0177] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0178] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0179] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
[0180] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for automatic querying and processing of list data based on intelligent algorithms, characterized in that: include: Obtain the list data to be queried and the heterogeneous modal supplementary data semantically associated with the list data to be queried, wherein the heterogeneous modal supplementary data provides semantic extension information of the list data to be queried; The hierarchical structure of the query list data and the semantic relationship of the heterogeneous modal supplementary data are modeled into a unified heterogeneous semantic graph. The nodes in the heterogeneous semantic graph represent the structural elements of the query list data and the semantic units of the heterogeneous modal supplementary data, and the edges in the heterogeneous semantic graph represent the structural relationships and cross-modal semantic associations between nodes. Multi-hop reasoning is performed on the heterogeneous semantic graph, traversing candidate paths from the query start node to the target data node, calculating the semantic coherence score for each candidate path, and selecting the path with the highest semantic coherence score as the semantic path; The semantic path is input to the policy decoder, which uses a sequence-to-sequence generation framework to decode the sequence of graph nodes in the semantic path into a sequence of query operations, including: Extract the graph node sequence from the semantic path and parse the operation dependency rules corresponding to the query list data. The operation dependency rules define the pre-dependencies and mutual exclusions between query operations. An operation dependency graph is constructed based on the operation dependency rules. The dependency nodes in the operation dependency graph represent query operations in a predefined query operation vocabulary, and the dependency edges in the operation dependency graph represent the dependency relationships between query operations. The graph node sequence is input into the bidirectional encoder of the policy decoder. The forward encoding submodule and the backward encoding submodule of the bidirectional encoder encode the graph node sequence in forward and reverse order, respectively, and fuse them to generate a bidirectional context representation sequence. Initialize the constraint-aware decoder of the policy decoder, set the generated query operation set to an empty set, and set the decoding position index to point to the starting position of the bidirectional context representation sequence; In each decoding step, a topological traversal is performed on the operation dependency graph based on the generated query operation set to identify dependency nodes whose prerequisite dependencies are fully satisfied by the generated query operation set, including: Extract the list of prerequisite conditions for all dependent nodes in the operation dependency graph. The list of prerequisite conditions records the set of preceding query operations that must be completed before the query operation corresponding to each dependent node is executed. Traverse each dependency node in the operation dependency graph, and for each dependency node, extract all the preceding query operation identifiers from the preceding dependency condition list of the dependency node, and determine whether all the preceding query operation identifiers exist in the generated query operation set. If so, mark the dependent node as a dependency-satisfied node and extract the query operation corresponding to the dependency-satisfied node; The corresponding query operation is added to the candidate query operation set, and query operations that are mutually exclusive with the generated query operation set are excluded to obtain the effective candidate query operation set; Extract the bidirectional context representation corresponding to the decoded position index, calculate the original generation probability of each query operation in the predefined query operation vocabulary, normalize the generation probability of query operations that do not belong to the set of valid candidate query operations after setting it to zero, select the query operation with the highest probability as the decoded output, and add the decoded output to the set of generated query operations; During the decoding process, the legality of each decoding output is verified based on the structural constraints of the query list data and the semantic constraints of the heterogeneous modal supplementary data, including: After each decoding step of the strategy decoder generates a query operation, all query operations in the generated query operation set are extracted. The generated query operation set is then subjected to structural legality verification according to the structural definition rules of the data to be queried. It is determined whether the generated query operation set violates the hierarchical access order constraints, field reference constraints, or operation combination constraints of the data to be queried, and the structural legality verification result is obtained. For query operations involving heterogeneous modal supplementary data in the generated query operation set, extract the semantic unit identifier of the heterogeneous modal supplementary data referenced by the query operation, match and verify the semantic unit identifier with the semantic type of the corresponding node in the heterogeneous semantic graph, determine whether the access method of the query operation to the heterogeneous modal supplementary data conforms to the semantic type definition of the semantic unit and whether it satisfies the propagation constraint of cross-modal semantic association in the heterogeneous semantic graph, and obtain the semantic consistency verification result; When the structure validity check result or the semantic consistency check result indicates that there is a violation of constraints, locate the decoding step position corresponding to the first query operation that violates the constraints in the generated query operation set; When the decoded output does not satisfy the structural constraints or the semantic constraints, the attention distribution of the decoder is adjusted and the decoded output is regenerated until the generated query operation sequence simultaneously satisfies structural validity and semantic consistency, thus obtaining the final query strategy sequence.
2. The method according to claim 1, characterized in that, Multi-hop reasoning is performed on the heterogeneous semantic graph, traversing candidate paths from the query origin node to the target data node, calculating the semantic coherence score for each candidate path, and selecting the path with the highest semantic coherence score as the semantic path, including: Multi-hop reasoning is performed on the heterogeneous semantic graph. In each hop reasoning, the set of neighboring nodes of the current node is obtained, and it is determined whether to continue to expand the reasoning path based on the reachability between the set of neighboring nodes and the set of target data nodes. Multi-hop reasoning is repeated until a node in the set of target data nodes is reached or the preset maximum number of reasoning hops is reached, thereby obtaining a set of candidate paths from the query starting node to each node in the set of target data nodes. For each candidate path in the candidate path set, path decomposition is performed, decomposing each candidate path into a node sequence and an edge sequence. The node sequence contains all the nodes traversed by the candidate path, and the edge sequence contains all the edges traversed by the candidate path. The node features of each node in the node sequence and the edge type of each edge in the edge sequence are extracted. Node-level coherence components are calculated based on the node feature similarity between adjacent nodes in the node sequence, and edge-level coherence components are calculated based on the edge type consistency between adjacent edges in the edge sequence. A cross-layer penalty coefficient is calculated based on the number of heterogeneous semantic graph layers traversed by the node sequence. The node-level coherence components and edge-level coherence components are then weighted and aggregated, and the cross-layer penalty coefficient is applied for adjustment to obtain the semantic coherence score for each candidate path. The candidate path with the highest semantic coherence score is selected as the semantic path.
3. The method according to claim 2, characterized in that, Node-level coherence components are calculated based on the node feature similarity between adjacent nodes in the node sequence, edge-level coherence components are calculated based on the edge type consistency between adjacent edges in the edge sequence, and cross-layer penalty coefficients are calculated based on the number of heterogeneous semantic graph layers traversed by the node sequence, including: Calculate the vector similarity between the node feature vectors of each pair of adjacent nodes in the node sequence, normalize the vector similarity of all adjacent node pairs, and then calculate the average value to obtain the node-level coherence component; Traverse each pair of adjacent edges in the edge sequence, determine whether the edge type identifiers of each pair of adjacent edges are consistent, count the number of adjacent edge pairs with consistent edge type identifiers in the edge sequence, calculate the edge type consistency coefficient based on the ratio of the number of adjacent edge pairs with consistent edge type identifiers to the total number of edge pairs in the edge sequence, and use the edge type consistency coefficient as the edge-level coherence component; Identify consecutive node segments belonging to the same heterogeneous semantic graph level in the node sequence, and count the number of different heterogeneous semantic graph levels traversed by the node sequence; A cross-layer complexity index is constructed based on the ratio of the number of different heterogeneous semantic graph layers traversed by the node sequence to the preset number of layer benchmarks, and the reciprocal of the cross-layer complexity index is used as the cross-layer penalty coefficient.
4. The method according to claim 1, characterized in that, Based on the generated set of query operations, a topological traversal is performed on the operation dependency graph to identify dependency nodes whose prerequisites are fully satisfied by the generated set of query operations. The corresponding query operations are added to the candidate set of query operations, and query operations that are mutually exclusive with the generated set of query operations are excluded. The resulting valid candidate set of query operations includes: Extract the list of prerequisite conditions for all dependent nodes in the operation dependency graph. The list of prerequisite conditions records the set of preceding query operations that must be completed before the query operation corresponding to each dependent node is executed. Traverse each dependency node in the operation dependency graph, and for each dependency node, extract all the preceding query operation identifiers from the preceding dependency condition list of the dependency node, and determine whether all the preceding query operation identifiers exist in the generated query operation set. If so, mark the dependent node as a dependency-satisfied node, extract the query operation corresponding to the dependency-satisfied node, and add it to the initial candidate query operation set; Extract the mutual exclusion rules defined in the operation dependency graph. The mutual exclusion rules record query operation pairs that are not allowed to exist in the same query operation sequence at the same time. Traverse each query operation in the initial candidate query operation set and retrieve the mutual exclusion query operation identifier that forms a mutual exclusion relationship with the query operation in the mutual exclusion rules. Determine whether the mutual exclusion query operation identifier exists in the generated query operation set. If so, remove the current query operation from the initial candidate query operation set. After removing the mutual exclusion query operation from the initial candidate query operation set, the valid candidate query operation set is obtained.
5. An automatic query and processing system for list data based on intelligent algorithms, used to implement the method as described in any one of claims 1-4, characterized in that, include: The first unit is used to acquire the list data to be queried and the heterogeneous modal supplementary data semantically associated with the list data to be queried, wherein the heterogeneous modal supplementary data provides semantic extension information of the list data to be queried; The second unit is used to model the hierarchical structure of the query list data and the semantic relationship of the heterogeneous modal supplementary data into a unified heterogeneous semantic graph. The nodes in the heterogeneous semantic graph represent the structural elements of the query list data and the semantic units of the heterogeneous modal supplementary data, and the edges in the heterogeneous semantic graph represent the structural relationships and cross-modal semantic associations between nodes. The third unit is used to perform multi-hop reasoning on the heterogeneous semantic graph, traverse candidate paths from the query start node to the target data node, calculate the semantic coherence score of each candidate path, and select the path with the highest semantic coherence score as the semantic path; The fourth unit is used to input the semantic path into the policy decoder, and the policy decoder uses a sequence-to-sequence generation framework to decode the graph node sequence in the semantic path into a query operation sequence. The fifth unit is used to perform legality verification on the decoding output at each step during the decoding process based on the structural constraints of the data to be queried in the list and the semantic constraints of the heterogeneous modal supplementary data. When the decoding output does not meet the structural constraints or the semantic constraints, the attention distribution of the decoder is adjusted and the decoding output is regenerated until the generated query operation sequence simultaneously meets the structural legality and semantic consistency, thus obtaining the final query strategy sequence.
6. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 4.
Citation Information
Patent Citations
Data query method and system based on natural language text
CN120492610A
Large model knowledge retrieval method based on knowledge graph enhancement
CN121256062A
