Data analysis method and data analysis apparatus
Patent Information
- Application Number
- CN202611226799.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2046-08-13
AI Technical Summary
Existing technologies suffer from low accuracy in understanding fuzzy queries with multiple intents and significant resource waste when dealing with such queries.
By parsing the graph enhancement network to identify multiple mixed intents in natural language queries, semantic subgraphs are independently extracted and dedicated search paths and inference path trees are constructed to achieve multi-dimensional parallel data analysis.
It significantly improves the accuracy of natural language semantic understanding and data analysis results, avoids invalid calculations, and saves computing resources.
Smart Images

Figure CN122713398B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data analysis technology, and in particular relates to a data analysis method and a data analysis device. Background Technology
[0002] With the explosive growth of enterprise data assets, data analytics has become a core competitive advantage. Existing natural language processing (NLP)-based data analytics solutions mainly fall into two categories: the first category relies on keyword matching and fixed rules, which can only handle simple sentences; the second category incorporates pre-trained models such as BERT and GPT, which can handle complex queries and multi-turn dialogues, and is currently more widely used.
[0003] However, existing technologies suffer from low accuracy in understanding fuzzy multi-intent queries and significant resource waste when dealing with multi-intent queries. Summary of the Invention
[0004] In view of this, embodiments of this application provide a data analysis method and a data analysis apparatus to solve the problems of low accuracy in understanding multi-intent fuzzy queries and excessive resource waste in existing data analysis methods.
[0005] A first aspect of this application provides a data analysis method, comprising: responding to a query analysis command, inputting query text into a parsing graph enhancement network to obtain a semantic association graph and multiple intent features output by the parsing graph enhancement network, wherein the semantic association graph includes nodes representing keywords in the query text and edges representing the association relationships between different keywords; for any intent feature, inputting the intent feature and a semantic subgraph into an intent path decoding network to obtain a set of data paths output by the intent path decoding network, wherein the semantic subgraph is extracted from the semantic association graph based on the intent feature, and the set of data paths includes at least one search path constructed from different nodes and edges; for any search path, reasoning about the data analysis command based on the query text to obtain a reasoning path tree, wherein the data analysis command is generated based on the search path, the root node of the reasoning path tree represents the query text, each level of child node corresponds to the execution steps of a single data analysis command, and the edges between different nodes represent data flow relationships; and generating an analysis report corresponding to the query text based on the multiple reasoning path trees with different intent features.
[0006] A second aspect of this application provides a data analysis apparatus, comprising: an obtaining module, configured to, in response to a query analysis command, input query text into a parsing graph enhancement network to obtain a semantic association graph and multiple intent features output by the parsing graph enhancement network, wherein the semantic association graph includes nodes representing keywords in the query text and edges representing association relationships between different keywords; and a path decoding module, configured to, for any one of the intent features, input the intent feature and a semantic subgraph into an intent path decoding network to obtain a set of data paths output by the intent path decoding network, wherein the semantic subgraph is based on the intent feature from the... Extracted from the semantic association graph, the data path set includes at least one search path constructed from different nodes and edges; the inference module is used to infer the data analysis instruction based on the query text for any of the search paths to obtain an inference path tree, wherein the data analysis instruction is generated based on the search path, the root node of the inference path tree represents the query text, each level of child node corresponds to the execution steps of a single data analysis instruction, and the edges between different nodes represent data flow relationships; the report generation module is used to generate an analysis report corresponding to the query text based on multiple inference path trees with different intent features.
[0007] According to a third aspect of this application, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0008] According to a fourth aspect of this application, a computer-readable storage medium is also provided, on which a computer program or instructions are stored, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.
[0009] According to a fifth aspect of this application, a computer program product is also provided, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.
[0010] The beneficial effects of this application's embodiments compared to existing technologies are as follows: By accurately identifying multiple mixed intents in natural language queries, semantic subgraphs are independently extracted for different intents, and dedicated search paths and inference path trees are constructed, achieving multi-dimensional parallel data analysis. This effectively solves the problem of one-sided single-path analysis in existing technologies, significantly improving the accuracy of natural language semantic understanding and data analysis results. Simultaneously, it abandons the traditional single fixed analysis logic, matching analysis paths on demand, avoiding invalid calculations, significantly saving computing power, and eliminating waste of computing resources. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This diagram illustrates an application scenario of the data analysis method according to an embodiment of this application. Figure 2 A flowchart illustrating the data analysis method of an embodiment of this application is shown; Figure 3 A flowchart illustrating the parsing process of the parsing graph enhancement network according to an embodiment of this application is shown; Figure 4 A structural block diagram of a data analysis apparatus according to an embodiment of this application is shown; Figure 5 A block diagram schematically illustrates an electronic device suitable for implementing the above-described method according to an embodiment of this application. Detailed Implementation
[0013] To make the inventive objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0014] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0015] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0016] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0017] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."
[0018] Furthermore, in the description of this application, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0019] Natural language processing (NLP) data analysis solutions based on keyword matching and fixed rules can only handle simple sentence structures. Analysis solutions incorporating pre-trained models such as BERT and GPT can handle complex queries and multi-turn dialogues. However, pre-trained model-based analysis solutions have two core limitations: (1) The accuracy of understanding mixed queries with multiple intentions and colloquial and vague expressions is low, especially when the same word has different meanings in different data sources, it cannot automatically disambiguate; (2) The analysis is usually limited to a single data source (such as a structured database), making it difficult to automatically integrate unstructured text and semi-structured logs for collaborative analysis. Furthermore, the analysis process is not transparent and the results are not traceable.
[0020] In view of this, embodiments of this application provide a data analysis method and a data analysis apparatus to solve the problems of low accuracy in understanding multi-intent fuzzy queries and excessive resource waste in existing data analysis methods.
[0021] In this embodiment, by accurately identifying multiple mixed intents in natural language queries, semantic subgraphs are independently extracted for different intents, and dedicated search paths and inference path trees are constructed to achieve multi-dimensional parallel data analysis. This effectively solves the problem of one-sided single-path analysis in existing technologies, significantly improving the accuracy of natural language semantic understanding and data analysis results. At the same time, it abandons the traditional single fixed analysis logic, matching analysis paths on demand, avoiding invalid calculations, significantly saving computing power, and eliminating waste of computing resources.
[0022] Figure 1 The diagram illustrates an application scenario of the data analysis method according to an embodiment of this application. For example... Figure 1As shown, application scenario 100 according to an embodiment of this application may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables. For example, a user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send information, etc.
[0023] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be electronic devices such as smartphones, wearable devices, personal computers, intelligent voice interaction devices, smart home appliances, intelligent vehicles, in-vehicle terminals, aircraft, unmanned vending terminals, and extended reality devices. Extended reality devices can include virtual reality devices, augmented reality devices, and mixed reality devices. A client application for the target application can be installed and run on the terminal devices. This target application can include, but is not limited to, financial transaction applications, payment applications, shopping applications, web browser applications, search applications, instant messaging tools, email clients, and social media platform software (these are just examples). Furthermore, this application embodiment does not limit the form of the target application, and it can include, but is not limited to, applications, mini-programs, etc., installed on the terminal devices, and can also be in the form of web pages.
[0024] Server 105 can be a server providing various services, such as a backend management server supporting websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process received user requests and other data, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and basic cloud computing services such as big data. The server can be the backend server of the aforementioned target application, used to provide backend services to the clients of the target application.
[0025] It should be noted that the data analysis method provided in the embodiments of this application can generally be executed by server 105 and / or terminal devices 101-103. Accordingly, the data analysis device provided in the embodiments of this application can generally be set in server 105 and / or terminal devices 101-103.
[0026] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0027] Figure 2 A flowchart illustrating a data analysis method according to an embodiment of this application is shown.
[0028] Please see Figure 2 One embodiment of a data analysis method in this application may include operations S201 to S204: In operation S201, in response to the query analysis command, the query text is input into the parsing graph augmentation network to obtain the semantic association graph and multiple intent features output by the parsing graph augmentation network. The semantic association graph includes nodes representing keywords in the query text and edges representing the association relationships between different keywords.
[0029] In operation S202, for any intention feature, the intention feature and semantic subgraph are input into the intention path decoding network to obtain the data path set output by the intention path decoding network. The semantic subgraph is extracted from the semantic association graph based on the intention feature, and the data path set includes at least one search path constructed from different nodes and edges.
[0030] In operation S203, for any search path, the data analysis instruction is reasoned based on the query text to obtain a reasoning path tree. The data analysis instruction is generated based on the search path, the root node of the reasoning path tree represents the query text, each level of child node corresponds to the execution steps of a single data analysis instruction, and the edges between different nodes represent the data flow relationship.
[0031] In operation S204, an analysis report corresponding to the query text is generated based on multiple inference path trees with different intent features.
[0032] The query analysis commands and corresponding query text are generated by the user through interaction with a terminal electronic device. Specifically, this may include: the user manually inputting, speaking, or selecting a preset query template to enter natural language query text in the interactive interface of an electronic device equipped with a data analysis system; the electronic device responds to the user's input in real time, automatically generating and outputting the corresponding query analysis commands for the system to execute subsequent data analysis processes, thus enabling the user to perform code-free natural language data query and analysis.
[0033] The system responds in real-time to user-triggered query analysis commands, collecting the natural language query text input by the user. The raw query text is then fed into a pre-defined semantic graph augmentation network for deep semantic parsing. For example, by calculating the attention weights of each word (keyword), it accurately outputs multiple sets of intent features corresponding to the query text, effectively identifying scenarios such as mixed multiple intents and colloquial / vague expressions in user queries. Simultaneously, based on the attention weights of the core keywords obtained from the parsing, the original association graph is updated, thereby outputting a semantic association graph related to the query text. This graph uses each keyword as an independent node, with semantic associations and co-occurrence relationships between keywords as edges, fully reconstructing the semantic structure of the query text and outputting a stable semantic association graph and multi-dimensional intent features.
[0034] For each independent intent feature output by the parsing graph enhancement network, a differentiated path decoding operation is performed. Specifically, using the current intent feature as a constraint, the semantic subgraph with the highest matching degree is accurately extracted from the global semantic association graph. Then, the intent feature and the semantic subgraph are jointly input into the intent path decoding network. This network uses a graph attention mechanism to perform deep feature fusion and iteratively decodes node by node in an autoregressive manner, ultimately generating at least one search path constructed in an ordered manner from valid nodes and related edges. All search paths are aggregated to form a complete set of data paths, covering the association retrieval paths of multi-source data.
[0035] For each search path in the data path set, the system performs instruction reasoning and path construction based on the core requirements of the original natural language query text. The system generates corresponding data analysis instructions based on the search path. It supplements the analysis process with causal inference logic to establish causal relationships and confidence levels, thereby constructing a hierarchical and traceable directed inference path tree. This inference path tree fully covers the query source, step-by-step execution steps, associated data nodes, and related information.
[0036] The system traverses all search paths and inference path trees corresponding to all intent features, integrates multi-dimensional analysis results from multiple intents, paths, and sources, and completes the fusion and summary of multi-branch analysis data. Based on all inference path trees, the system first generates a complete analysis report that is highly adapted to the user's original query text and provides accurate results.
[0037] According to embodiments of this application, by accurately identifying multiple mixed intents in natural language queries, semantic subgraphs are independently extracted for different intents, and dedicated search paths and inference path trees are constructed to achieve multi-dimensional parallel data analysis. This effectively solves the problems of low accuracy in understanding multi-intent fuzzy queries and one-sided single-path analysis in existing technologies, significantly improving the accuracy of natural language semantic understanding and data analysis results. At the same time, it abandons the traditional single fixed analysis logic, matches analysis paths on demand, avoids invalid calculations, significantly saves computing power, and eliminates waste of computing resources.
[0038] Figure 3 A flowchart illustrating the parsing process of the parsing graph enhancement network according to an embodiment of this application is shown.
[0039] According to an embodiment of this application, the parsing graph enhancement network includes a semantic encoding layer, a keyword enhancement layer, and a multi-intent classification layer; wherein the keyword enhancement layer internally includes a dimension projection submodule for dimension mapping, which calculates the attention score after matching the dimension with the learnable query vector.
[0040] Please see Figure 3 The query text is input into the parsing graph augmentation network, and the semantic association graph and multiple intent features output by the parsing graph augmentation network are obtained, including operations S301 to S304: In operation S301, the query text is encoded using a semantic coding layer to obtain a sequence of word vectors representing multiple keywords.
[0041] In operation S302, the keyword enhancement layer is used to process the word vector sequence to obtain the attention weights of multiple keywords.
[0042] In operation S303, the word vector sequence is processed using a multi-intent classification layer to obtain multiple intent categories, where each intent category includes multiple intent features.
[0043] In operation S304, the initial association graph is updated based on word vector sequences, attention weights, and the association relationships between different keywords to obtain a semantic association graph. The initial association graph is constructed based on business data storage resources.
[0044] This embodiment, based on the data analysis method of the aforementioned embodiments, specifically defines the structure of the parsing graph enhancement network and the generation process of semantic graphs and intent features. The parsing graph enhancement network of this application is a three-level parsing architecture built based on an improved BERT-base model, specifically including a semantic encoding layer, a keyword enhancement layer, and a multi-intent classification layer. The input of this network is the user's natural language query text Q. In some embodiments, the character length of the query text Q does not exceed 128 characters.
[0045] In the specific execution process, the query text Q is first encoded using a semantic encoding layer. Based on the 12-layer Transformer structure and 768-dimensional hidden layer parameters of the standard BERT-base model, the input query text Q is converted into a word vector sequence with uniform dimensions. The specific form of the word vector sequence is H = [h1, h2, ..., hn], where n is the character length of the query text, and each vector hi is a 768-dimensional feature vector, completing the basic semantic feature extraction of the query text. Subsequently, a keyword enhancement layer optimizes the word vector sequence H. This layer adds an attention structure. The input word vector sequence H and a 256-dimensional learnable query vector are used. Attention scores for each word are calculated position-by-position through dot product operations, and then normalized using a softmax function to obtain attention weights α of length n. This effectively highlights the core semantic words in the query text and weakens redundant semantic interference.
[0046] In some embodiments, the dot product operation can be implemented as follows: First, set the dimension-matching linear projection matrix W. att ∈R 768×256 R is a real number, and it projects each 768-dimensional word vector hi in the word vector sequence H into a 256-dimensional intermediate vector. Then project the 256-dimensional intermediate vector. The original attention scores for each word are calculated by performing positional dot product operations on the 256-dimensional learnable query vector of the same dimension. After normalization by the softmax function, attention weights α of length n can be obtained.
[0047] Next, the word vector sequence is processed through a multi-intent classification layer to extract the 768-dimensional global classification label position [CLS] vector h_cls from the model output, which is then input into a multi-label classifier. This classifier consists of two fully connected layers and a sigmoid activation function. The first fully connected layer reduces the 768-dimensional vector to 128 dimensions, and the second fully connected layer further outputs an 8-dimensional feature vector. Finally, the sigmoid activation function processes the output intent vector I∈[0,1]^8. This 8-dimensional intent vector corresponds to eight independent intent categories: comparison, trend, anomaly, attribution, prediction, association, clustering, and summarization. The value of each dimension of the vector corresponds to the confidence probability of the intent it belongs to. Each intent category corresponds to an independent intent feature, comprehensively covering the three core tasks of enterprise data analysis: descriptive analysis (comparison, trend, clustering, summarization), diagnostic analysis (anomaly, attribution), and predictive analysis (prediction, association). Moreover, the semantics of each intent category are mutually exclusive, which can accurately achieve a one-to-one mapping between intents and subsequent analysis tasks.
[0048] The semantic association graph in the above embodiments is obtained by updating an initial association graph pre-built based on business data storage resources. The initial association graph is stored in the form of a graph database and is defined as graph G. The node set V of the initial association graph covers three types of multi-source data entities: database table names and field names in structured data sources, named entities such as customer names, product models, and locations in unstructured documents, and event types and field paths in semi-structured logs. The edge set E of the initial association graph is used to represent the semantic or business association relationships between entities. Each association edge is accompanied by a weight w, with the weight value ranging from [0,1]. The initial weight is calculated based on the co-occurrence frequency of entities. When the number of co-occurrences of two entities in the same query or the same document exceeds a preset threshold of 5 times, an association edge between the entities can be established, and the normalized co-occurrence probability is used as the initial edge weight.
[0049] In the actual parsing process, the system combines the word vector sequence obtained by encoding, keyword attention weights, and the association relationships between different keywords and entities to dynamically and incrementally update the node feature weights and edge association weights of the initial association graph, adapting in real time to the specific semantics of the current query, and finally outputting a semantic association graph that accurately matches the query text.
[0050] According to the embodiments of this application, a three-level hierarchical parsing network architecture is adopted, which is optimized and modified based on a standardized pre-trained model, taking into account both the generality of semantic encoding and the ability to focus keywords. An independent keyword enhancement layer accurately highlights core words and suppresses invalid semantic interference, while a multi-intent classification layer achieves refined and comprehensive multi-intent recognition, with intent categories precisely matched to data analysis tasks. Simultaneously, an initial association graph is constructed based on multi-source business data, and the graph weights are dynamically updated in conjunction with query semantics, achieving deep coupling between semantic parsing and graph enhancement. This effectively improves the semantic understanding accuracy of complex, colloquial, and multi-intent queries, reduces semantic ambiguity, and features a streamlined model structure, strong classification mutual exclusion, and effective control of computational complexity, ensuring the efficiency and stability of data analysis.
[0051] In one illustrative embodiment, the automated and complete construction process of the initial association graph is described by way of example. This embodiment relies on a multi-source heterogeneous data system and completes the initial association graph construction based on business data storage resources. The constructed graph is defined as G, and the overall storage carrier is an independent graph database. The graph includes a set of nodes V and a set of edges E. Nodes cover three types of objects: structured data table fields, unstructured document named entities, and semi-structured log event fields. Edges carry the semantics and business relationships between entities, and each edge is accompanied by a weight w in the range of 0 to 1. The entire construction process is divided into six consecutive stages: business data storage resource integration, unified data source access, entity extraction, relationship extraction, edge weight initialization, and graph entry verification.
[0052] (1) Integration of business data storage resources The system pre-computes the interface adaptation and permission access of various business data storage resources, serving as the underlying data source for the initial graph construction. The business data storage resources are divided into three types of storage media and configured with standardized read channels.
[0053] The first type is relational database storage resources, which are used to carry structured business data of enterprises, including business data tables such as sales, customers, and products, as well as fields and field comments. The system establishes long connections through the database connection pool to read data table metadata and business detail data in batches.
[0054] The second category is distributed file storage resources, which are used to store unstructured business documents, including text files such as customer files, product descriptions, business feedback, and industry analysis documents. The original text of the documents is retrieved in batches by directory through the file indexing interface.
[0055] The third category is time-series log storage resources, which are used to retain semi-structured logs generated by system operation, interface requests, and business tracking. They have built-in fields such as event identifiers, parameter field paths, and operation timestamps, and support batch retrieval of log samples by time interval.
[0056] All business data storage resources are configured with a unified data synchronization task, which periodically pulls incremental data to synchronize to the data cleaning intermediate queue, while reserving a real-time reading channel to ensure that the map construction process can simultaneously read the existing full data and the newly added business data.
[0057] (2) Unified access to multiple business data sources The system pulls raw data from the three types of business data storage resources that have been integrated, performs unified cleaning and preprocessing, removes null values, special garbled characters, and invalid characters without business meaning, standardizes field names and text case format, and after cleaning, splits the data into three types: structured, unstructured, and semi-structured, and sends them to the corresponding entity extraction submodule.
[0058] (3) Automated extraction method for multiple types of entities For the three types of heterogeneous data from different business data storage resources, an appropriate entity extraction strategy is adopted. All extracted entities are uniformly classified into node set V, and different types of nodes are accompanied by 3-dimensional one-hot encoding for subsequent network feature construction.
[0059] For structured data output from relational database storage resources, an extraction method combining rule matching and industry terminology thesaurus matching is adopted to directly extract the data table name and field name as the basic entity. At the same time, business terms appearing in the field comments are extracted to supplement the entity. Words that match the preset business terminology thesaurus are uniformly included in the entity set, and the node type is marked as structured.
[0060] For unstructured document text output from distributed file storage resources, an improved BERT model is used to complete named entity recognition. The maximum length of the input text is 128 tokens. Based on the labeled entity dataset, the model outputs business entities such as customer name, product model, and region name. The labeled node type is unstructured.
[0061] For the semi-structured log data output from time-series log storage resources, an extraction logic combining regular expression matching and JSON path parsing is used to extract event type identifiers and parameter field paths from the log as entities, and the node type is marked as a semi-structured class.
[0062] All extracted entities undergo global deduplication. Entities with consistent textual descriptions and referring to the same business object are merged into a single node. Each node is assigned a globally unique identifier, which serves as the basis for subsequent relationship binding and weight calculation.
[0063] (4) Global Entity Relationship Automated Extraction Method The global entity relationship automatic extraction method is divided into three parallel branches: single data source internal relationship extraction, cross data source entity alignment, and cross data source association edge construction. All extraction results are uniformly stored in the set E as candidate edges, distinguishing between undirected co-occurring edges, single-source business directed edges, and cross-source association directed edges. The entire extraction process traverses the full data samples read from the three types of business data storage resources.
[0064] 1) Single data source internal relation extraction, including two sub-branches: co-occurrence relation extraction and business logic relation extraction: Co-occurrence relation extraction is carried out on all original data units. It traverses each relational database query record, each distributed file storage business document, and each time-series log text, and counts the entity pairs ea and eb that appear simultaneously in the same data unit of the same data source. Any pair of entity pairs that co-occurs in the same data unit will generate a candidate undirected edge. The co-occurrence frequency of entities is recorded synchronously for subsequent weight calculation.
[0065] Business logic relationship extraction relies on the business association information inherent in single-type storage resources: the binding of foreign and domestic keys in relational databases generates directed edges for business associations; the triggering of subsequent events in time-series logs generates time-series directed edges; causal directed edges are generated from causal entity pairs from the same data source mined by historical analysis samples. These directed edges are marked with causal attributes separately, and their subsequent initial weight is higher than that of ordinary co-occurrence edges.
[0066] 2) Cross-data source entity alignment steps Global entity alignment is performed on all entity collections from three types of data sources: structured, unstructured, and semi-structured. This is used to identify heterogeneous entities that refer to the same business object but are stored in different data sources. The alignment process is as follows: ① Entity normalization preprocessing: Clean all entity names and business description texts uniformly, unify capitalization, remove special symbols, and standardize units of measurement.
[0067] ② Hybrid Similarity Matching: A two-dimensional matching rule is used to determine whether heterogeneous entities belong to the same business object. Rule Matching: Matches globally unique identifiers such as preset business synonyms, product codes, customer unique IDs, and device numbers. If a match is found, the entity is considered an aligned entity. Semantic Similarity Matching: Sentence-BERT is used to encode entity descriptions from different data sources, and cosine similarity is calculated. If the similarity is greater than 0.8, the entity is considered an aligned entity.
[0068] ③ Align entity grouping: Group heterogeneous entities from multiple sources that are determined to refer to the same business object into the same entity equivalence group. Each group contains at least two types of entities from structured databases, unstructured documents, and semi-structured logs.
[0069] 3) Constructing cross-data source association edges (achieving multi-source data connectivity) For each group of cross-source equivalent entities that has been aligned, a cross-source connected directed edge is constructed between every two entities from different data sources within the group. This serves as the basic path for cross-data source flow in the graph. The generation rules are as follows: ① Cross-source edge generation conditions: Entities from different data sources that have completed entity alignment and are assigned to the same equivalence group are forced to generate candidate cross-source edges, without being subject to the co-occurrence number threshold; ② Initial weight calculation for cross-source edges: Cross-source connected edges are basic business related edges, with a fixed basic weight of 0.6; if entities in the equivalence group have a high co-occurrence relationship with a single data source, a gain of 0.2 is added, with a maximum weight of 1.0; ③ Edge labeling distinction: All cross-data source related edges are individually marked with a cross_source identifier. In the subsequent semantic subgraph extraction and path decoding stages, this type of edge allows jumps to other data source entities, realizing multi-source data linkage retrieval. The cross_source identifier is a unique attribute marker (label / field identifier) for graph related edges, stored in the metadata of each edge, and is a boolean marker that distinguishes between "edges within the same data source" and "edges connected across data sources".
[0070] After completing the three extraction processes, all candidate edges are deduplicated. Multiple candidate edges generated repeatedly in the same group of entities are merged, and the corresponding co-occurrence times are accumulated to finally obtain the edge corresponding to the unique entity.
[0071] (5) Specific formula for calculating the initial weights of graph edges The weights are calculated in two ways: the initial weights of ordinary co-occurring undirected edges and the initial weights of business causal directed edges. All weights are ultimately constrained to the range of 0 to 1.
[0072] Let count be the total number of times entity pairs ea and eb co-occur globally, and max_count be the highest co-occurrence frequency among all entity pairs globally. The normalized basic weight calculation expression is: w_base=count / max_count The system sets a co-occurrence threshold of 5. If the cumulative co-occurrence count of an entity pair is less than 5, no corresponding edge will be generated. Weight calculation will only be performed when count ≥ 5. Finally, the initial weight of the ordinary undirected edge is directly taken as w_base.
[0073] The causal edge is superimposed with a fixed gain coefficient on the normalized co-occurrence weights. The gain coefficient is 0.7, and the calculation expression is as follows: w_cause=min(w_base+0.7,1) The upper limit of the calculation result is controlled to 1 to avoid the overflow of weight values. All causal directed edges are accompanied by a timestamp field to record the construction time.
[0074] For brand-new entity pairs that appear for the first time and have no historical co-occurrence records, if they are subsequently added to the graph through real-time user query and parsing processes, their initial weight value should be set to 0.3.
[0075] (6) Initial association map data entry and integrity verification After all nodes, candidate edges, and calculated weight values are organized, they are batch-written into an independent graph database to complete the initial association graph storage. The storage fields synchronously retain the entity's unique identifier, node type, edge-connected entity, edge type, edge weight, and causal edge timestamp.
[0076] After being stored in the database, a two-layer verification process is executed. The first layer is logical verification, which checks for isolated edges that do not correspond to the corresponding nodes and deletes them directly, and filters out low-association undirected edges with a weight of less than 0.3. The second layer is business verification, which randomly selects some entity nodes, traverses the associated edges, and checks whether the entity co-occurrence frequency obtained from the statistics of various business data storage resources matches the formula logic with the weight calculation results. After verification, an initial association graph that can be called by the parsed graph enhancement network is obtained.
[0077] The initial association graph continuously receives incremental data based on the underlying business data storage resources. During subsequent user queries and data analysis reasoning processes, the graph will be continuously updated dynamically, forming a closed-loop architecture of bidirectional enhancement of parsing and graph, and knowledge circulation between analysis and graph.
[0078] According to an embodiment of this application, the data analysis method further includes: for any keyword, if the multiple attention weights of the keyword satisfy the weight dispersion condition, and the keyword corresponds to multiple nodes in the semantic association graph, adjusting the multiple attention weights.
[0079] This embodiment, based on the data analysis methods of any of the aforementioned embodiments, adds a keyword semantic disambiguation and attention weight adaptive adjustment process to adapt to accurate semantic parsing in scenarios with polysemous keywords and fuzzy queries. After obtaining the attention weights corresponding to each keyword through the keyword enhancement layer and constructing a semantic association graph, the system performs ambiguity discrimination and weight optimization processing for each keyword in the query text.
[0080] Specifically, the system determines whether the multiple attention weights of each keyword meet the preset weight dispersion condition. The weight dispersion condition is used to characterize the state where the attention features of the current keyword are not focused and the semantic direction is ambiguous. At the same time, it matches the semantic association graph to detect whether the keyword corresponds to multiple different entity nodes in the graph, that is, whether the keyword has multiple semantics and can be associated with multiple types of business entities in an ambiguous scenario.
[0081] When a keyword simultaneously meets the dual conditions of dispersed attention weight and corresponding to multiple nodes in the semantic association graph, it is determined that the keyword has semantic ambiguity. The system will combine the business association degree and entity co-occurrence relationship of each associated node in the semantic association graph to adaptively correct and readjust the multiple attention weights corresponding to the keyword, weaken the weight ratio of irrelevant entities, strengthen the attention weight corresponding to the entity that best matches the current query context, and complete the real-time semantic disambiguation of the keyword.
[0082] The adjusted attention weights can be re-participated in the incremental update of the semantic association graph and the calculation of intent features, correcting the semantic bias caused by ambiguous words and ensuring that the subsequently extracted semantic subgraphs and decoded search paths are consistent with the user's true query intent.
[0083] According to embodiments of this application, for scenarios involving polysemous keywords and colloquial fuzzy queries, a weight-dispersion discrimination and graph-assisted disambiguation mechanism is added to accurately identify semantic ambiguity issues in the query text. By adaptively adjusting weights by combining attention weight distribution features with entity association relationships in the semantic association graph, the parsing bias caused by single words corresponding to multiple data sources and multiple semantics is effectively resolved, eliminating inaccurate semantic understanding and intent confusion defects caused by weight dispersion. This further improves the accuracy of semantic parsing for complex natural language queries, ensuring the effectiveness and accuracy of subsequent subgraph extraction, path decoding, and instruction reasoning, and adapting to various fuzzy and polysemous real-world business query scenarios.
[0084] According to embodiments of this application, adjusting multiple attention weights includes: generating a query vector based on keyword vectors in a word vector sequence and multiple related global classification label vectors, wherein the related global classification label vectors are determined based on query text related to the query text; determining a target node from multiple nodes based on the similarity between the query vector and multiple nodes corresponding to the keyword in a semantic association graph; determining a multi-hop subgraph of the target node from the semantic association graph, wherein the multi-hop subgraph includes multi-level neighbor nodes related to the target node; and adjusting the attention weight parameters of the keyword enhancement layer based on the neighbor nodes in the multi-hop subgraph, so as to output the adjusted attention weights based on the adjusted keyword enhancement layer.
[0085] This embodiment, based on the aforementioned semantic disambiguation embodiment, further refines the specific execution steps of attention weight adjustment and defines the logic for refined disambiguation and parameter update. After determining that the keyword attention weights are dispersed and correspond to multiple graph entity nodes, the following weight adjustment process is executed.
[0086] First, a query vector is generated based on the keyword vector in the word vector sequence and multiple related global classification tag vectors. Specifically, the 768-dimensional keyword vector v_token corresponding to the ambiguous keyword in the word vector sequence H is extracted, and a context vector ctx composed of related global classification tag vectors is constructed. For example, the average of the global classification tag [CLS] vectors from the three most recent queries in the current session can be taken; if there are fewer than three queries, zero vectors are used for padding. The keyword vector and the context vector are concatenated to obtain the 1536-dimensional original query vector q. raw Set the learnable linear projection matrix , Given real numbers, project the 1536-dimensional original query vector onto a 128-dimensional normalized query vector. The 128-dimensional query vector is used for subsequent similarity calculation with the 128-dimensional embedding vector of the graph node. The relevant global classification label vector is generated from the historical query text.
[0087] Secondly, based on the similarity between the 128-dimensional query vector and the keywords in the semantic association graph, the target node is determined. For all candidate entity nodes corresponding to the keyword, a two-layer GCN (Graph Convolutional Network) trained by a pre-trained unsupervised graph autoencoder is used to output the 128-dimensional embedding vector emb(e) of each candidate node. The training process aims to minimize the cross-entropy loss of graph edge reconstruction, iterating for 100 rounds with a learning rate of 0.001. The dot product similarity between the projected 128-dimensional query vector q and the 128-dimensional embedding vector emb(e) of each node is calculated, and the entity node with the highest similarity is selected as the target node e. .
[0088] Then, the multi-hop subgraph of the target node is determined from the semantic association graph. Specifically, the first-order neighbor nodes with edge weights greater than 0.5, which are centered on the target node, are retrieved, along with the second-order neighbor nodes corresponding to the first-order neighbors. This forms a two-hop multi-hop subgraph containing multi-level neighbor nodes, which serves as the basis for this semantic disambiguation and weight correction.
[0089] Finally, the attention weight parameters of the keyword enhancement layer are adjusted based on the neighbor nodes in the multi-hop subgraph. The subgraph entities and query segmented words are matched using synonyms or vector similarity. The keyword enhancement layer calculates the attention score (logit) by linearly projecting the 768-dimensional word vectors to 256 dimensions and then performing a dot product with the learnable query vector. Based on this calculation logic, for successfully matched related words, their attention score (logit) before softmax normalization is multiplied by an amplification factor of 1.2–2.0, and then softmax normalization is performed again to update the attention weight parameters of the keyword enhancement layer, outputting the adjusted attention weights. The condition for satisfying the attention weight dispersion criterion is that the ratio of the largest to the second largest keyword attention weight is within a preset threshold of 1.3–1.5.
[0090] In the above embodiments, the lower limit of the amplification coefficient of 1.2 is mainly adapted to query scenarios with weak ambiguity and relatively clear contextual direction. In such scenarios, the keywords only have slight semantic confusion, and there is no need to significantly increase the attention logit corresponding to the target semantics. The small amplification of 1.2 can slightly widen the score gap between the matching entity's corresponding word and irrelevant word, which completes the basic disambiguation correction without excessively distorting the attention distribution of the original semantic encoding output, thus preserving the original semantic features of the model. The upper limit of the amplification coefficient of 2.0 is for extreme portmantically similar queries with strong ambiguity and multiple candidate entities with similar semantics. When the word corresponds to 3 or more business entities in the graph and there are very few contextual clues, the amplification of 2.0 can quickly widen the logit gap between the target word and the interference word, ensuring that the attention weight is concentrated on the correct semantics after softmax normalization. At the same time, limiting the upper limit of the coefficient to 2.0 can avoid the extreme weight shift caused by excessively large values, prevent a single word from completely suppressing other effective keywords, and avoid the loss of complete query semantics. The range of 1.2 to 2.0 can be dynamically selected based on the degree of ambiguity in the business scenario. For regular standard business queries, 1.2 to 1.4 is selected, while for fuzzy, colloquial, and ambiguous queries, 1.6 to 2.0 is selected, balancing the disambiguation accuracy and the integrity of the original semantics under different levels of ambiguity.
[0091] The threshold for the ratio of the maximum attention weight to the second-largest attention weight is set between 1.3 and 1.5. This is a result of comprehensively balancing the sensitivity of ambiguity recognition and the computational cost of the model. If the threshold is lower than 1.3, the probability of falsely triggering the disambiguation process will increase significantly. Even slight fluctuations in the attention value during the query will be judged as semantic ambiguity, leading to frequent calls to the semantic association graph to retrieve multi-hop subgraphs, additional computational consumption for graph database queries and vector similarity calculations, and a decrease in the overall parsing response speed. If the threshold is higher than 1.5, the sensitivity of ambiguity recognition will be greatly reduced. A large number of polysemous words and colloquial vague expressions with only a small weight dispersion will not be recognized. The graph-assisted disambiguation step will be skipped and the biased attention weight will be directly output, resulting in a decrease in the accuracy of subsequent intent classification and subgraph extraction. The range of 1.3 to 1.5 can be flexibly adjusted to adapt to different business scenarios. In back-end analysis scenarios with standardized data and unified professional terminology, 1.5 is selected to reduce invalid graph calls. In front-end query scenarios with free input from ordinary business personnel and a lot of colloquial content, 1.3 is selected to improve the ability to capture ambiguity, forming a stable balance between computational cost and semantic parsing accuracy.
[0092] According to embodiments of this application, graph-linked disambiguation is introduced in real time during the parsing process, achieving bidirectional closed-loop co-evolution between the parsing engine and the knowledge graph. Compared to the passive processing methods of traditional fixed dictionary disambiguation and post-rule disambiguation, this embodiment intervenes in ambiguity correction in real time during semantic parsing. By fusing historical query context to construct query vectors, relying on graph convolutional networks to accurately match optimal semantic nodes, and combining multi-hop subgraphs to mine deep business relationships, the attention weight distribution of ambiguous words is accurately corrected. This effectively solves the semantic understanding bias problem caused by polysemous words and colloquial vague expressions, significantly improving the parsing accuracy of multi-intent and ambiguous natural language queries. At the same time, by iteratively updating model parameters through adaptive weights, the semantic focusing capability is continuously optimized, significantly improving the overall stability and reliability in scenarios of joint analysis of multi-source heterogeneous data.
[0093] According to an embodiment of this application, intent features and semantic subgraphs are input into an intent path decoding network to obtain a set of data paths output by the intent path decoding network. This includes iteratively performing the following steps: In the t-th iteration, the intent path decoding network generates an attention score for each candidate node based on the t-th hidden state parameter and the node features of candidate nodes in the semantic subgraph, where the 0th hidden state parameter is obtained by linearly transforming the intent features; based on the attention score, a target node is selected from multiple candidate nodes and added to the path node set; the t-th hidden state parameter is updated based on the node features of the target node to obtain the (t+1)-th hidden state parameter, and the (t+1)-th iteration is performed based on the (t+1)-th hidden state parameter; if a preset iteration termination condition is met, a beam search method is used to process the path node set to obtain at least one search path, where the search path includes multiple target nodes.
[0094] This embodiment, based on any of the above embodiments, refines and defines the specific iterative decoding process for generating the data path set by the intent path decoding network, adapting to autoregressive generation scenarios with multiple nodes and multiple paths. The intent path decoding network of this application adopts a two-layer graph attention network (GAT) structure, with each layer configured with 4 attention heads, and the network output dimension is set to 256 dimensions.
[0095] Before decoding, the node features of the semantic subgraph are initialized. For each candidate node v in the semantic subgraph, a 128-dimensional initial feature vector x_v is generated. This feature vector is composed of three types of features: a 64-dimensional semantic attribute embedding of the node name, obtained by pre-training the node name using the Word2Vec model; a 3-dimensional one-hot encoding of the node type, used to distinguish between structured, unstructured, and semi-structured data node types; and a 61-dimensional node structure topology feature, composed of four parts: basic global topology indicators, adjacent edge weight statistics, cross-source association features, and subgraph local connectivity features. The dimension allocation and calculation method of each part are as follows: (1) Basic global topology metrics (3-dimensional): node degree, PageRank value, clustering coefficient; (2) Statistical characteristics of adjacent edge weights (16 dimensions): mean, variance, maximum, minimum, median, upper quartile, lower quartile, mode, first-order difference mean, first-order difference variance, proportion of cross-source edges, proportion of edges from the same source, number of high-weight edges (weight ≥ 0.5), number of low-weight edges (weight < 0.3), number of causal directed edges, number of ordinary undirected edges; (3) Cross-source association topology features (12 dimensions): number of first-order cross-source neighbors, number of second-order cross-source neighbors, average weight of cross-source edges, variance of cross-source edge weights, size of cross-source equivalent entity groups, average length of cross-source jump paths from different data sources, maximum depth of cross-source paths, minimum depth of cross-source paths, types of data sources connected by cross-source edges, proportion of structured entities in cross-source neighbors, proportion of unstructured entities in cross-source neighbors, and proportion of semi-structured entities in cross-source neighbors; (4) Local subgraph connectivity features (30 dimensions): total number of nodes and edges in the two-hop subgraph centered on the current node, average degree of the subgraph, density of the subgraph, transitivity of the subgraph, modularity of the subgraph, mean of the local shortest path, length of the local longest path, number of local triangular rings, number of local quadrilateral rings, count of entities from various data sources in the two-hop neighbors, sum of edge weights in the subgraph, standard deviation of edge weights in the subgraph, total number of causal edges in the subgraph, total number of cross-source edges in the subgraph, proportion of high-weight edges in the subgraph, proportion of low-weight edges in the subgraph, local centrality, local proximity centrality, local betweenness centrality, local eigenvector centrality, mean of entity co-occurrence frequency in the subgraph, variance of entity co-occurrence frequency in the subgraph, number of newly added entities in the subgraph, number of isolated nodes in the subgraph, number of local connected branches, mean number of nodes in each connected branch, local path diversity index, mean of local association confidence, and variance of local association confidence. The sum of the four feature dimensions is 3 + 16 + 12 + 30 = 61 dimensions. After all features are Min-Max normalized to the [0,1] interval, they are concatenated to form a complete 61-dimensional node structure feature. The initial feature vectors of all candidate nodes are stacked to form a node feature matrix X of size |V_sub|×128, providing basic feature support for iterative decoding.
[0096] The decoding process uses an autoregressive iterative approach to generate path sequences node by node. The specific iterative execution steps are as follows: First, initialize the 0th hidden state parameter. Then, linearly transform the 8-dimensional intent vector I output by the multi-intent classification layer through the 256×8-dimensional learnable matrix W_init to obtain the initial hidden state parameter h0, thus completing the initial state construction for decoding.
[0097] In the t-th iteration, the intent path decoding network calculates the attention scores for all candidate nodes based on the current t-th hidden state parameter h_t and the node features x_v of each candidate node. First, the hidden state h_t and the node features x_v are concatenated to obtain a 384-dimensional concatenation vector z_v=[h_t;x_v]; then a learnable linear projection matrix is set. The 384-dimensional concatenated vector z_v is projected and mapped to a 256-dimensional vector. The specific calculation formula is: fraction ,in Given a 256-dimensional learnable vector, after projection and The dimension is uniformly set to 256, allowing for inner product operations. After calculating the attention scores of all candidate nodes, the candidate node with the highest attention score that has not been visited is selected as the target node and added to the current path node set.
[0098] After completing a single node selection, the 128-dimensional node feature x_{v_t} of the currently selected target node is taken, that is... Set a learnable linear projection matrix The 128-dimensional node features are projected and mapped to 256-dimensional feature vectors. Combine the current t-th hidden state h_t with the projected 256-dimensional node features. The GRU unit, which is a common input, updates the hidden state of the network to obtain the hidden state parameters at the (t+1)th digit. The input dimension and hidden layer dimension of the GRU unit are both configured to be 256 dimensions. After the update is completed, the next round of iterative decoding process is entered based on the hidden state parameters at the (t+1)th time, and the node scoring, node filtering, and hidden state update operations are executed cyclically.
[0099] The preset iteration termination condition is that the decoder selects a preset virtual end symbol node in the graph, or the number of nodes in the current path exceeds 5 nodes; iteration stops when either condition is met. After iteration, a beam search method with a beam size of 3 is used to filter and optimize the set of path nodes generated in all iterations, generating multiple valid node paths in parallel. The final output is a set of data paths containing at least one search path. Each search path consists of multiple ordered target nodes, each corresponding to a different sub-data analysis task.
[0100] According to embodiments of this application, by integrating multi-dimensional features of node semantic attributes, types, and topological structures, candidate node scoring and screening are accurately completed, and temporal hidden state updates ensure the logical coherence of nodes within the search path. Simultaneously, a cluster search mechanism is employed to generate multiple optimal paths in parallel, effectively avoiding the local optima defects of single-path generation and adapting to multi-intent and multi-source heterogeneous data analysis scenarios. Furthermore, the decoded data paths can be automatically converted into multi-source data analysis execution instructions, ensuring complete consistency between the generated instructions and the real data, solving the problems of path disconnection from data sources and poor instruction adaptability in traditional decoding methods. This end-to-end decoding process exhibits strong closed-loop integrity and robustness, significantly improving the accuracy of multi-source data retrieval paths and providing reliable instruction and data support for subsequent causal inference, data analysis, and report generation.
[0101] In some embodiments, the semantic subgraph can be generated based on the correlation between intent features and nodes in the semantic association graph, according to multiple nodes whose correlation satisfies the correlation condition and their respective neighbor nodes. Specifically, the final semantic subgraph is constructed based on the matching relationship between nodes in the intent subgraph and target keywords, wherein the target keywords are keywords whose attention weights satisfy the weight threshold.
[0102] Based on any of the aforementioned embodiments, this embodiment refines and limits the specific extraction and construction methods of the semantic subgraph. It constructs an accurate semantic subgraph based on intent features, node relevance, and high-weight target keywords through multi-level filtering, achieving a high degree of matching between the subgraph content and the current query intent and core keywords, and eliminating irrelevant and redundant nodes.
[0103] The specific subgraph construction process is as follows: First, for each activated intent category output by the multi-intent classification layer, such as the intent category corresponding to an intent feature with a confidence level greater than a preset threshold (e.g., 0.5), the system selects the 10 entity nodes with the highest correlation to that intent category from the semantic association graph based on preset correlation rules. The quantification of correlation is differentiated across system operation phases: During the system warm-up phase, based on historical query log statistics, the frequency of entity nodes appearing in queries for each intent category is statistically labeled, and the normalized frequency result is used as the correlation between the node and the intent; during the system cold-up phase without historical logs, the Sentence-BERT model is used to vectorize the intent category name and the entity names in the graph, respectively, and the semantic correlation is obtained by calculating their cosine similarity, ensuring that the new system can successfully complete node selection.
[0104] After selecting highly relevant entity nodes, the system iterates through the two-hop neighbor nodes corresponding to each preferred entity node, merges and deduplicates all core entity nodes and multi-level neighbor nodes, generates an initial candidate semantic subgraph, and initially locks the graph association range corresponding to the current intent.
[0105] To further focus on the user's true query semantics and filter out irrelevant noise nodes, the system performs a secondary precise screening based on keyword weight thresholds. In this embodiment, keywords with attention weights greater than the weight threshold of 0.5 are identified as target keywords. Following the preset entity-vocabulary correspondence rules, all entity nodes in the initial candidate semantic subgraph are matched with the target keywords. Finally, only the successfully matched entity nodes and their corresponding two-hop neighbor nodes are retained, while redundant and invalid nodes are simplified, thus constructing the final semantic subgraph that adapts to the current query intent and core keywords.
[0106] According to embodiments of this application, a two-layer subgraph extraction mechanism, employing initial screening based on intent relevance and refined screening based on high-weight keywords, effectively filters irrelevant graph nodes and noise information, significantly improving the matching accuracy between semantic subgraphs and query intent and core semantics. It also adapts to both cold and hot start scenarios, relying on a dual calculation logic of historical statistical frequency and semantic similarity to ensure the stability and effectiveness of subgraph extraction at different operational stages. By anchoring attention weights to target keywords that meet the criteria to constrain subgraph boundaries, it addresses the problems of generalization and insufficient semantic focus in traditional subgraph extraction, providing more accurate graph semantic support for subsequent path decoding, instruction reasoning, and data analysis, effectively improving overall analysis accuracy and computational efficiency.
[0107] According to an embodiment of this application, a reasoning path tree is obtained by reasoning about data analysis instructions based on query text, including: generating data analysis instructions corresponding to the search path based on the type of the terminal node in the search path; executing the data analysis instructions using an execution engine to obtain data analysis results; and recording the data analysis instructions and data analysis results in a tree structure using a reasoning path recorder to obtain the reasoning path tree, wherein the root node of the reasoning path tree represents the query text.
[0108] This embodiment, based on the previous embodiments, refines and defines the specific process of generating inference path trees by reasoning data analysis instructions based on search paths. This embodiment relies on multiple search paths obtained through parsing to achieve adaptive generation, parallel execution, and fully traceable tree-structured inference records of multi-source data analysis instructions.
[0109] In the specific implementation process, data analysis instructions matching multi-source heterogeneous data are first generated differently based on the type of the terminal node of each search path. If the terminal node is a structured field node, the system automatically extracts the data table name, field name, filtering conditions, and table join relationships in the path, and generates a structured query statement containing aggregation queries, conditional filtering, and JOIN relationships according to a preset SQL template. If the terminal node is an unstructured entity node, a text analysis structured call instruction containing API call type, data source identifier, and custom parameters is generated, supporting various text tasks such as sentiment analysis, entity recognition, and topic modeling. If the terminal node is a semi-structured log field node, corresponding regular expression extraction rules or JSON path parsing expressions are automatically generated according to the field format. All generated data analysis instructions and corresponding path identifiers are encapsulated into a parallel executable execution plan, which is then uniformly scheduled and run by the execution engine.
[0110] The execution engine then parses and runs each data analysis instruction within the execution plan, collecting the input data source, execution parameters, and final output results for each instruction to obtain complete data analysis results. Simultaneously, the inference path recorder records the entire analysis process in a structured tree format, constructing an inference path tree. The root node of the inference path tree corresponds to the user's original query text, each level of child node corresponds to a single instruction execution step, and each child node fully records attributes such as data path identifier, operation type, and result statistical summary. Directed edges between nodes represent complete data flow relationships.
[0111] In diagnostic analysis scenarios, if the confidence probability of the "attribution" category in the intent vector is greater than 0.7, the system automatically triggers the causal discovery inference process. For structured data scenarios, causal discovery algorithms, such as the PC (Peter-Clark) algorithm, are directly invoked. Multivariate historical observations are used as input, and the output is a causal graph between data. To ensure the statistical reliability of causal relationships, the Bootstrap method is used to evaluate the stability of causal edges in the causal graph. The Bootstrap configuration is fixed: N = 200 resampling times, with each sampling consisting of 75% of the original dataset samples with replacement. The frequency of each causal edge appearing in the causal graph obtained from the 200 Bootstrap samplings (i.e., Bootstrap support rate) is used as the confidence level of that causal edge. Causal chains with a confidence level higher than 0.8 are selected as valid causal chains to eliminate spurious associations caused by data noise. If the analysis process involves unstructured data, features are first extracted from text and document data and converted into numerical feature vectors. Then, an alignment process between structured data and unstructured features is executed. The alignment method includes three steps: (1) Primary key association matching: Extract the unique primary key (customer ID, product number, order number) stored in the unstructured document and perform exact matching with the primary key of the structured data table to establish row-level association mapping; (2) Unified time granularity: The generation timestamps of unstructured texts are standardized into a unified time dimension of structured data (day / month / quarter, consistent with the granularity of query analysis), and multiple unstructured features within the same time window are aggregated by mean. (3) Dimensional standardization and alignment: Structured numerical fields are standardized using Z-score, and unstructured text feature vectors are normalized to the [0,1] interval using Min-Max to eliminate dimensional differences; After aligning the primary key, time, and numerical dimensions, the aligned unstructured numerical variables and structured observation variables are merged and input into the PC (Peter-Clark) algorithm to perform causal mining.
[0112] Finally, the selected high-confidence causal chains are embedded as special inference nodes into the inference path tree, and statistical evidence such as the p-value of the PC algorithm and the support rate of causal edges obtained from 200 Bootstrap samplings are labeled to improve the attribution analysis logic. The Bootstrap self-service resampling configuration is set to a total of 200 samplings, with 75% of the original data samples being resampled with replacement each time.
[0113] For example, when a user queries "reasons for the decline in sales this month", the root node of the query is the original query text, and the first-level child nodes correspond to the execution steps such as sales SQL query, user comment sentiment analysis, and system log anomaly parsing in sequence; if a high confidence trigger of attribution intent is detected, a causal chain node of "increased negative comments → decreased order conversion rate → decreased sales" is further added, forming a complete traceable and explainable multi-level inference path tree.
[0114] According to embodiments of this application, multi-source adapted data analysis instructions are adaptively generated based on the type of the end node of the search path, enabling collaborative analysis of heterogeneous data including structured, unstructured, and semi-structured data, breaking through the limitations of traditional single-data-source analysis. The parallel execution of multiple types of instructions by the execution engine effectively improves data analysis efficiency. Relying on a tree structure to record the query source, execution steps, data flow, and analysis results throughout the process, coupled with a causal chain embedding mechanism for diagnostic scenarios, the overall analysis process becomes transparent and traceable, and the results are interpretable, significantly improving the credibility and practicality of complex business data analysis, and providing complete and rigorous reasoning basis for the subsequent generation of structured analysis reports.
[0115] According to embodiments of this application, an analysis report corresponding to the query text is generated based on multiple inference path trees with different intent features, including: for any intent feature, traversing multiple inference path trees corresponding to the intent feature to generate a corresponding structured report, and integrating the multiple structured reports; using a text generation model to perform language conversion on the integrated structured reports to obtain an intent analysis report corresponding to the intent feature; and integrating the intent analysis reports corresponding to different intent features to obtain an analysis report corresponding to the query text.
[0116] Based on all the aforementioned embodiments, this embodiment specifically defines the process of fusing multiple intents and multiple inference path trees to generate the final query analysis report. It adopts a two-stage generation strategy that combines structured pre-generation with model polishing to avoid the black box problem of pure large model generation and achieve traceable and high-fidelity analysis report output.
[0117] The specific report generation steps are as follows: First, for each independent intent feature, the system traverses all inference path trees corresponding to that intent feature, parses the complete inference process and analysis results tree by tree, and generates a structured report corresponding to each inference path tree. A single structured report uniformly includes three parts: core conclusions, a list of evidence, and a description of the inference steps. The core conclusions are quantitative or categorical conclusions extracted from the data analysis results; the evidence list includes evidence description text, corresponding data path identifiers, and subgraph identifiers of the association graph, allowing for precise tracing of the original analysis basis; the description of the inference steps is a standardized step text derived from the temporal nodes of the inference path tree. After generating a single-tree structured report, the system merges and integrates multiple structured reports under the same intent feature, removing redundant content and unifying the conclusion logic.
[0118] Secondly, the integrated single-intent structured report is input into the text generation model for language conversion and refinement. This embodiment uses an improved T5-base model fine-tuned with business data to perform natural language conversion. The model is trained on paired data of 200,000 structured reports and human-made standard reports, using cross-entropy loss as the training objective, with a maximum output text length limit of 512 characters. The model converts machine-readable structured report objects into fluent and logically coherent natural language paragraphs, generating intent analysis reports corresponding to a single intent. Simultaneously, interactive markers are added to each piece of evidence text within the report. The front-end can recognize these markers and display corresponding data path details and semantic subgraphs, enabling traceable display of analysis results.
[0119] Finally, the entire intent analysis report corresponding to all intent features is traversed, and the independent intent analysis content of multiple dimensions and multiple scenarios is globally integrated and summarized. The logic of the full text is unified, the primary and secondary relationships of the analysis are sorted out, and finally a complete data analysis report that highly matches the user's original query text and covers the results of multi-intent and multi-dimensional analysis is generated.
[0120] According to the embodiments of this application, the traditional analysis method, which only outputs the final result, is abandoned. Instead, it relies on a reasoning path recorder to completely retain the data flow relationships and intermediate results throughout the entire analysis process, achieving full traceability of the analysis workflow. A two-stage generation architecture of "structured report draft + natural language polishing" is adopted. First, the multi-dimensional analysis results of multiple reasoning path trees are structurally integrated, avoiding the black-box defects of end-to-end model generation and ensuring that the report's reasoning is rigorous and the conclusions are well-founded. By generating separate intents and integrating them globally, it adapts to multi-intent mixed query scenarios, avoiding the problems of one-sided and redundant report content. Simultaneously, based on a fine-tuning model, the structured content is accurately converted into natural language, improving report readability. The output report also includes interactive evidence links, connecting the analysis conclusions with the underlying data and knowledge graph, effectively improving the credibility and practicality of the data analysis results, and adapting to complex business analysis scenarios in enterprises.
[0121] According to embodiments of this application, the data analysis method further includes: updating the semantic association graph using a reasoning path tree, so as to perform data analysis on the next query text based on the updated semantic association graph.
[0122] This embodiment, based on any of the above embodiments, specifies the specific process of iteratively updating the semantic association graph based on the reasoning path tree and constructing a knowledge loop continuous learning mechanism. After completing a single data analysis and generating a complete analysis report and reasoning path tree, this embodiment can reuse the reasoning knowledge from this analysis to iteratively optimize the semantic association graph in reverse. Relying on the updated semantic association graph, it can undertake the data analysis task of the next user query text, realizing the system's autonomous evolution.
[0123] The specific graph update process is as follows: The system automatically scans and parses the inference path tree corresponding to this data analysis, deeply mines the entity relationships and causal reasoning information generated during the analysis process, and extracts the association features and causal links between various business variables and entity nodes as new knowledge material to update the semantic association graph. The system automatically writes back the new entity relationships and effective causal chains discovered during the analysis process to the semantic association graph, supplementing the original business association logic not covered by the graph and enriching the knowledge dimensions of the graph.
[0124] Meanwhile, the system incorporates user feedback to refine and iteratively correct graph weights. "Helpful" and "Not Helpful" interactive buttons are provided on the analysis results display interface to collect user evaluations of the analysis results. To avoid real-time fluctuations in graph weights, the system processes all user feedback data in batches every 24 hours. For analysis tasks where users click "Helpful," the weights of all graph association edges involved in the inference path tree are increased by 0.02; for analysis tasks where users click "Not Helpful," the corresponding association edge weights are decreased by 0.01, continuously correcting the accuracy of graph association weights based on human feedback.
[0125] Through a dual update mechanism of automatic knowledge writing and batch correction based on user feedback, the semantic association graph can continuously iterate and evolve after each data analysis task, accumulating business knowledge. The updated semantic association graph will be used in the entire process of semantic parsing, subgraph extraction, path decoding and data analysis of the next query text, continuously optimizing the subsequent data analysis results.
[0126] According to embodiments of this application, a closed-loop knowledge cycle continuous learning mechanism is constructed to overcome the shortcomings of traditional graphs, which are static and cannot iteratively update knowledge. By automatically writing back the entity relationships and causal chains mined from the analysis to the graph, and combining user feedback to fine-tune edge weights in batches, the dynamic evolution and precise optimization of the semantic association graph are achieved. Effective reuse of the effective knowledge from each data analysis solves the problems of opaque traditional analysis processes and the inability to accumulate and reuse analytical knowledge. This enables the system to continuously adapt to the changing patterns of business data, steadily improve the accuracy of subsequent natural language parsing, intent recognition, and data reasoning, and significantly enhance the system's long-term intelligent analysis capabilities and scenario adaptability.
[0127] According to an embodiment of this application, updating a semantic association graph using a reasoning path tree includes: determining the association coefficient between every two variables in the reasoning path tree; if the association coefficient is greater than a preset threshold, determining that there is a target association relationship between the two variables corresponding to the association coefficient; if there is no target edge in the semantic association graph corresponding to the target association relationship, adding a target edge between the corresponding nodes in the semantic association graph based on the target association relationship, and configuring the weight of the target edge; if there is a target edge in the semantic association graph, adjusting the weight of the target edge.
[0128] This embodiment, based on the data analysis methods of any of the above embodiments, specifies a detailed process for updating the semantic association graph based on the inference path tree, thereby achieving automated accumulation of data analysis knowledge and dynamic iterative updating of the graph, and constructing a sustainable learning knowledge loop mechanism. After generating the data analysis results and the complete inference path tree, this embodiment utilizes the multivariate analysis data retained in the inference path tree to mine variable relationships and synchronously update the semantic association graph. The optimized graph is then used for subsequent data analysis of user query text.
[0129] The specific map update steps are as follows: First, the system traverses and parses the inference path tree corresponding to a single analysis task, extracts all business variables involved in the analysis process, and calculates the correlation coefficient between any two variables one by one. Specifically, it includes two types of correlation evaluation indicators: Pearson correlation coefficient and mutual information value, which quantify the degree of correlation between variables.
[0130] Secondly, a target correlation is determined based on preset thresholds. In this embodiment, the preset correlation determination thresholds are: an absolute value of the Pearson correlation coefficient of 0.7 and a mutual information value of 0.5. When the absolute value of the Pearson correlation coefficient between two variables is greater than 0.7, or the mutual information value is greater than 0.5, a valid strong correlation is determined between the two sets of variables, and this is identified as the target correlation.
[0131] Subsequently, the system searches the semantic association graph to check if a target edge matching the target association exists within the graph. If no corresponding association edge is constructed in the semantic association graph, an undirected target edge is added between the entity nodes corresponding to the two variables, with an initial weight of 0.6, completing the knowledge entry of the new association. If the target association edge already exists in the semantic association graph, the weight of the original target edge is iteratively increased, with a single weight increment of 0.05, and the maximum weight of the association edge is limited to 1.0 to avoid weight value overflow and invalidation.
[0132] Furthermore, the system synchronously mines causal reasoning knowledge in the reasoning path tree, and adds the effective causal chains output by the causal discovery algorithm in the aforementioned diagnostic analysis scenario to the semantic association graph in the form of directed edges. The initial weight of this type of causal directed edge is set to 0.7, and each edge is accompanied by a generated timestamp to accurately retain the basis for causal reasoning and enrich the causal logic dimension of the graph.
[0133] According to embodiments of this application, by quantitatively calculating the Pearson correlation coefficient and mutual information value of variables in the inference path tree, and combining this with preset thresholds, strong correlations between variables are accurately screened. A hierarchical mechanism of initializing newly added related edges and iteratively updating the weights of existing related edges is adopted to achieve automatic backwriting of analyzed knowledge into the semantic association graph. Simultaneously, the causal chains obtained from the analysis are entered into the graph as directed edges with timestamps, enriching the causal logic dimension of the graph and constructing a closed-loop knowledge cycle system. This embodiment solves the shortcomings of traditional data analysis processes being opaque and unable to accumulate and reuse knowledge, breaking the limitations of static and solidified knowledge graphs, enabling the system to have autonomous and continuous learning capabilities, dynamically adapting to changes in business data, effectively improving the accuracy of subsequent semantic parsing, intent recognition, and data reasoning, and enhancing the system's intelligence and adaptability to business scenarios.
[0134] This embodiment, based on the aforementioned data analysis, report generation, and forward iterative update of the knowledge graph, further refines the process of dynamically updating the semantic association graph in reverse based on the parsing results and user feedback. This enables refined iterative optimization of the graph after a single query parsing task is completed, adapts to the dynamic evolution characteristics of business data, and improves the timeliness and accuracy of graph knowledge.
[0135] After each user query parsing and data analysis task is completed, the system automatically extracts all entity pairs (e_a, e_b) corresponding to the query text and traverses the semantic association graph to check if the corresponding association edges exist. If no corresponding association edge is found in the graph, a new association edge is added between the two entity nodes, with an initial weight of 0.3, completing the accumulation and recording of new entity association knowledge. If the association edge corresponding to the entity pair already exists in the graph, the edge weight is dynamically updated using an exponential decay cumulative method. The weight update formula is: New weight = Old weight + 0.1 × e^(-0.01 × Interval days).
[0136] The interval in days is defined as the time difference between the current query parsing time and the query time of the most recent co-occurrence of the entity pair. If this is the first time the entity pair has co-occurred, the default interval in days is 0, and the weight increment is 0.1. In this embodiment, 0.1 is the empirical maximum increment value, and 0.01 is the decay rate coefficient, corresponding to a weight half-life of approximately 69 days. This value can be adaptively optimized based on the business data update frequency. For business data with high-frequency iterations, the decay coefficient can be appropriately increased to adapt to the dynamic change rhythm of the data.
[0137] Simultaneously, the system leverages user feedback to achieve precise correction of graph weights. Users can confirm and correct the analysis results by clicking the "Correct" or "Incorrect" button on the results display interface. The system uses this feedback as a reinforcement signal: clicking "Correct" increases the weight of the corresponding associated edge by 0.05, while clicking "Incorrect" decreases it by 0.05. This human-machine collaboration optimizes the rationality and accuracy of graph associations, continuously iterating and improving the quality of the semantic association graph, providing more business-relevant knowledge support for subsequent queries and parsing.
[0138] According to embodiments of this application, by constructing a dynamic update mechanism for the reverse iterative graph of the parsing results and an exponential decay weighted update method, the latest business characteristics and historically valid knowledge of entity associations are taken into account, avoiding the knowledge lag and rigid iteration problems caused by traditional fixed-weight updates. Combined with user feedback for correctness, refined weight correction is achieved, forming a dual optimization system of machine mining and human-machine collaboration, effectively improving the timeliness, accuracy, and business adaptability of the semantic association graph. It overcomes the defects of static graph knowledge solidification, enabling adaptive evolution of the graph after each parsing task, continuously optimizing the accuracy of subsequent natural language semantic parsing and data analysis, and adapting to various dynamically iterative business data analysis scenarios.
[0139] In one specific embodiment, the training process of the data analysis model is illustrated.
[0140] First, the data analysis model in this embodiment includes three core network structures: parsing graph enhancement network, intent path decoding network, and text generation model. The entire model runs on the graph convolutional network that is paired with the semantic association graph to complete the pre-training work. The structural parameters and business definitions of each network module are consistent with those in the aforementioned embodiment.
[0141] The parsing graph augmentation network uses a modified standard BERT-base model as its basic skeleton. The input text is uniformly limited to a maximum length of 128 tokens. The semantic encoding layer contains 12 Transformer Encoder layers, with 12 multi-head attention heads. Word embeddings and hidden layers are uniformly 768-dimensional, and GELU is used as the internal activation function. The final output is a 768-dimensional word vector sequence. The output of the semantic encoding layer is fed into the keyword enhancement layer. This layer adds a 768×256 learnable linear projection matrix and configures a 256-dimensional learnable query vector. The original 768-dimensional word vectors are uniformly mapped to 256 dimensions by the projection matrix. Attention scoring is performed using dot product and normalized using Softmax. The output is a keyword attention weight vector corresponding to the text length and a weighted feature result. The projection matrix participates in the joint training of the network. The multi-intent classification layer extracts the 768-dimensional vector of the model's CLS position as input and builds a two-layer fully connected classification structure. The first layer maps the 768-dimensional features to 128 dimensions and uses the GELU activation function. The second layer outputs 8-dimensional features and uses the Sigmoid activation function to finally generate intent vectors covering 8 types of business analysis needs. The 8 intents correspond to comparison, trend, anomaly, attribution, prediction, association, clustering, and summarization, respectively.
[0142] A graph convolutional network is used to pre-train entity node embeddings for semantic association graphs. The overall structure adopts a two-layer graph autoencoder. The initial input features of the nodes are 128-dimensional random vectors. The output dimension of each graph convolutional network layer is kept at 128 dimensions and ReLU is used as the activation function. The decoder completes the reconstruction of the graph adjacency matrix by inner product operation. After training, it outputs 128-dimensional entity node embedding vectors. After the module completes pre-training, the parameters are frozen throughout and it will not participate in the subsequent network fine-tuning process. Another 1536×128 learnable linear projection matrix is added to participate in the joint fine-tuning training of the parsing graph enhancement network.
[0143] Before processing the semantic subgraph, the intent path decoding network performs node feature concatenation. Each node fuses three types of features to form a 128-dimensional overall vector, including a 64-dimensional Word2Vec semantic embedding, 3-dimensional one-hot encoding of data types, and 61-dimensional node topological structure features. The network encoding part uses a two-layer graph attention network, each layer equipped with four attention heads. Each attention head outputs 64-dimensional features, and after concatenation, each layer outputs a uniform 256-dimensional feature. The attention scoring calculation uses LeakyReLU as the activation function with a slope of 0.2. The network input node features are fixed at 128 dimensions, of which the 61-dimensional topological structure features consist of global topology, adjacency weights, cross-source associations, and local subgraphs, as described earlier. Figure 4 The class indicators are concatenated and generated. A 256-dimensional learnable vector 'a' and a 384×256 learnable linear projection matrix are also configured. , and participate in network joint training.
[0144] The autoregressive decoding stage uses a linear transformation matrix to convert the 8-dimensional intent vector into a 256-dimensional initial hidden state. The matrix size is 256×8. The decoding unit uses a gated recurrent unit, and both the input and hidden layer dimensions are maintained at 256. The attention score of candidate nodes is calculated using a 256-dimensional learnable vector. An additional 128×256 learnable linear projection matrix is added. It is used for node feature dimension alignment, and the attention score of candidate nodes is calculated by relying on 256-dimensional learnable vectors. The projection matrix and GRU parameters participate in joint training.
[0145] The hidden state is continuously updated during the iteration process. Both the training and inference phases use a bundle search with a bundle size of 3 to generate paths. The maximum number of nodes in the path is limited to 5. The iteration terminates when the preset virtual end node of the graph is retrieved.
[0146] The text generation model is fine-tuned and optimized based on the T5-base architecture. Both the encoder and decoder are set to 12 layers, the hidden layer dimension is 768, the number of multi-head attention heads is 12, the activation function is GELU, the model input is labeled structured report text, the maximum length of the input sequence is 384 tokens, and the output is a natural language analysis report with a maximum output text length of 512 tokens.
[0147] The entire training dataset comprises 150,000 sets, divided into 120,000 training samples, 20,000 validation samples, and 10,000 test samples. The dataset is categorized into three classes to suit different network training tasks. The training samples for the parsing graph augmentation network total 80,000, combining 50,000 publicly available enterprise data analysis query corpora and 30,000 internally annotated colloquial query texts. Each sample includes the original query text, core keywords and ambiguous word annotations, 8-dimensional multi-label intent annotations, and mappings between text entities and graph nodes. The single-sample input for the intent path decoding network includes a standard intent vector, a manually constructed semantic subgraph, and the corresponding annotated optimal search path sequence. Labels cover structured query paths, unstructured text call paths, and log parsing paths. The text generation model fine-tuning dataset contains 30,000 paired samples. The input is a structured report draft with standardized labels, and the output is a manually written business analysis document.
[0148] The entire training process is divided into three phases. The first phase involves independent pre-training of a semantic association graph convolutional network using AdamW as the optimizer. The base learning rate is set to 0.001, and the training is performed for 100 epochs. The loss function is the graph autoencoder reconstruction cross-entropy loss. The batch size for each training run is 256, and the weight decay coefficient is set to 10. -4 The training process does not use early stopping, and all entity node embedding vectors are fixed upon completion. In the second stage, the three core networks are pre-trained independently in stages. First, the parsing graph augmentation network is trained, using AdamW as the optimizer and a base learning rate of 2×10⁻⁶. -4 Weight decay 10 -5 The training process consisted of 30 rounds. The keyword reinforcement layer was initialized with two types of learnable parameters: a 768×256 dimension projection matrix and a 256-dimensional query vector. If the validation set loss did not decrease for five consecutive rounds, early stopping was triggered. The batch size was 64. Multi-task joint loss was used to optimize the parameters. The total loss was composed of a weighted sum of intent classification loss and attention regularization loss. The intent classification loss used multi-label binary cross-entropy, and the attention regularization loss used mean squared error loss. The balance coefficient was set to 0.3. In each round of training, a temporary graph was updated based on sample entity pairs to simulate bidirectional reinforcement logic.
[0149] The intent path decoding network was then trained using 40,000 samples. All parameters of the parsing graph augmentation network were frozen during training. The AdamW optimizer was used with a learning rate of 1.5 × 10⁻⁶. -4 Weight decay 10 -5The model underwent 40 training epochs with a batch size of 32. The loss function used was cross-entropy loss generated by autoregressive paths, with manually labeled standard paths as the optimization objective. Finally, the text generation model was fine-tuned. Initialization was performed using open-source T5-based weights, with AdaFactor as the optimizer and a learning rate of 0.001. The model underwent 25 training epochs with a batch size of 16, and the loss function used was standard autoregressive cross-entropy loss.
[0150] The third stage involves joint fine-tuning of the entire model. All parameters of the parsing graph augmentation network, intent path decoding network, and text generation model are unfrozen, while the graph convolutional network remains frozen. AdamW is used as the optimizer, and the learning rate is reduced to 5×10⁻⁶. -5 The weight decay is adjusted to 10. -6 The training process consisted of 15 rounds, with a single batch size of 16. The overall joint loss was a fusion of the losses from the three network branches and the graph-assisted loss, with the graph-assisted loss balance coefficient set at 0.1.
[0151] During the aforementioned stages, attention regularization loss To constrain the attention weights in the keyword enhancement layer from extreme word monopolies and excessive weight dispersion, the mean square error between the predicted attention distribution and the uniform baseline distribution is used for calculation.
[0152] In the formula: n is the total length of the query text segmentation. Let be the normalized attention weight for the i-th word. When the weight distribution approaches uniformity and the weights of ambiguous words become dispersed, the loss value increases, and backpropagation constrains the network to converge to an attention distribution focused on the core keywords. Total branch loss: , Binary cross-entropy loss is used for multi-label intention classification.
[0153] Map-assisted loss It is used to constrain the embedding of entity nodes in the semantic association graph and the cross-source edge weight distribution to conform to the statistical laws of real business associations. It is composed of the graph edge reconstruction loss plus the cross-source edge weight regularization term:
[0154] in, To reconstruct the cross-entropy loss from the adjacency matrix of a graph autoencoder; E is the cross-source edge regularization balance coefficient. cross This is the set of all cross-source related edges marked with the `cross_source` identifier. To correspond to the cross-source edge weights, this loss constraint keeps the cross-source connected edge weights around the baseline of 0.6, avoiding extreme offsets in the cross-source path weights.
[0155] Total joint loss of the entire model:
[0156] in, To decode the intention path, an autoregressive cross-entropy loss is generated. The T5 standard autoregressive loss is used for the text generation model.
[0157] The training process fully replicates the bidirectional closed-loop data flow. Sample queries are first fed into the parsing graph enhancement network to complete semantic disambiguation and update the temporary graph. The generated intent vector and extracted semantic subgraph are fed into the intent path decoding network to generate multi-source data execution instructions. After simulating the execution engine running the instructions, a complete inference path tree is constructed. Variable relationships are extracted and the temporary graph is updated synchronously. The inference path tree generates a structured report, which is then fed into the text generation model to output a complete analysis document. The entire link loss is uniformly backpropagated to update the parameters of the three types of networks. When the lumped loss does not decrease for three consecutive rounds, the training is terminated and the final model weights are saved.
[0158] The entire training process uses a unified set of fixed hyperparameters. All Transformers and graph attention network layers have a uniform dropout probability of 0.1. The gradient pruning threshold is set to 1.0, and the learning rate uses a cosine annealing decay strategy. The warm-up steps account for 10% of the total training steps. Business judgment thresholds are uniformly fixed. The criterion for keyword attention weight dispersion is that the ratio of the largest to the second largest weight is less than 1.4. The criterion for strong graph entity association is that the absolute value of the Pearson correlation coefficient is greater than 0.7 or the mutual information value is greater than 0.5. The graph edge weight update decay coefficient is set to 0.01. The weight amplification coefficient in the disambiguation stage is randomly sampled between 1.2 and 2.0. Bootstrap causality evaluation: 200 samples, 75% of each sample; loss function: attention regularization loss (balance coefficient 0.3), graph auxiliary loss including edge reconstruction + cross-source weight regularization (balance coefficient 0.1).
[0159] After the model completes offline training and saves its weights, it enters the online inference stage. Online operation no longer involves backpropagation to update network parameters; instead, it continuously maintains the semantic association graph to achieve iterative knowledge circulation. Each time a user query completes inference, an inference path tree is generated. The system automatically calculates variable association coefficients to uncover new entity relationships and adds or adjusts the graph's association edge weights according to exponential decay rules. The results provided by the user interface are processed in batches and the corresponding association edge weights are fine-tuned every 24 hours. The updated semantic association graph is directly used for disambiguation and semantic subgraph extraction in the next round of queries, continuously achieving the technical effect of bidirectional co-evolution between the parsing module and the graph, and between the analysis module and the graph.
[0160] Figure 4 A structural block diagram of a data analysis apparatus according to an embodiment of this application is shown.
[0161] like Figure 4 As shown, the data analysis device 400 includes an acquisition module 410, a path decoding module 420, an inference module 430, and a report generation module 440.
[0162] The module 410 is used to respond to the query analysis command by inputting the query text into the parsing graph augmentation network and obtaining the semantic association graph and multiple intent features output by the parsing graph augmentation network. The semantic association graph includes nodes representing keywords in the query text and edges representing the association relationships between different keywords.
[0163] The path decoding module 420 is used to input the intent feature and semantic subgraph into the intent path decoding network for any intent feature, and obtain the data path set output by the intent path decoding network. The semantic subgraph is extracted from the semantic association graph based on the intent feature, and the data path set includes at least one search path constructed from different nodes and edges.
[0164] The reasoning module 430 is used to reason about the data analysis instructions based on the query text for any search path, and obtain a reasoning path tree. The data analysis instructions are generated based on the search path, the root node of the reasoning path tree represents the query text, each level of child node corresponds to the execution steps of a single data analysis instruction, and the edges between different nodes represent the data flow relationship.
[0165] The report generation module 440 is used to generate an analysis report corresponding to the query text based on multiple inference path trees with different intent features.
[0166] According to embodiments of this application, by accurately identifying multiple mixed intents in natural language queries, semantic subgraphs are independently extracted for different intents, and dedicated search paths and inference path trees are constructed to achieve multi-dimensional parallel data analysis. This effectively solves the problems of low accuracy in understanding multi-intent fuzzy queries and one-sided single-path analysis in existing technologies, significantly improving the accuracy of natural language semantic understanding and data analysis results. At the same time, it abandons the traditional single fixed analysis logic, matches analysis paths on demand, avoids invalid calculations, significantly saves computing power, and eliminates waste of computing resources.
[0167] According to embodiments of this application, any multiple modules among the obtaining module 410, path decoding module 420, inference module 430, and report generation module 440 can be merged into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this application, at least one of the obtaining module 410, path decoding module 420, inference module 430, and report generation module 440 can be at least partially implemented as hardware circuits, such as field-programmable gate arrays, programmable logic arrays, systems-on-a-chip, systems-on-a-substrate, systems-on-package, application-specific integrated circuits, or other reasonable means of integrating or packaging circuits, or implemented in software, hardware, or firmware, or in any appropriate combination of any of these three implementation methods. Alternatively, at least one of the obtaining module 410, path decoding module 420, inference module 430, and report generation module 440 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0168] Figure 5 A block diagram schematically illustrates an electronic device suitable for implementing the above-described method according to an embodiment of this application.
[0169] like Figure 5 As shown, an electronic device 500 according to an embodiment of this application includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory 502 or a program loaded from a storage portion 508 into a random access memory 503. The processor 501 may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a dedicated microprocessor. The processor 501 may also include onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for executing different steps of the method flow according to an embodiment of this application.
[0170] Random access memory 503 stores various programs and data required for the operation of electronic device 500. Processor 501, read-only memory 502, and random access memory 503 are interconnected via bus 504. Processor 501 executes various steps of the method flow according to embodiments of this application by executing programs in read-only memory 502 and / or random access memory 503. It should be noted that the programs may also be stored in one or more memories other than read-only memory 502 and random access memory 503. Processor 501 may also execute various steps of the method flow according to embodiments of this application by executing programs stored in said one or more memories.
[0171] According to embodiments of this application, the electronic device 500 may further include an input / output interface 505, which is also connected to a bus 504. The electronic device 500 may also include one or more of the following components connected to the input / output interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube, liquid crystal display, etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card, such as a local area network card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 510 as needed so that computer programs read from it can be installed into the storage section 508 as needed.
[0172] Embodiments of this application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0173] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include the read-only memory 502, and / or random access memory 503, and / or one or more memories other than read-only memory 502 and random access memory 503 described above.
[0174] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this application.
[0175] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 509, and / or installed from a removable medium 511. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0176] In embodiments of this application, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by processor 501, it performs the functions defined in the system of this application embodiment. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0177] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0178] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A data analysis method, characterized in that, include: In response to a query analysis command, the query text is input into a parsing graph augmentation network to obtain a semantic association graph and multiple intent features output by the parsing graph augmentation network. The semantic association graph includes nodes representing keywords in the query text and edges representing the association relationships between different keywords. For any of the aforementioned intent features, the intent features and semantic subgraphs are input into the intent path decoding network to obtain a set of data paths output by the intent path decoding network. The semantic subgraphs are extracted from the semantic association graph based on the intent features. The set of data paths includes at least one search path constructed from different nodes and edges. For any of the search paths, the data analysis instructions are reasoned based on the query text to obtain a reasoning path tree. The data analysis instructions are generated based on the search path. The root node of the reasoning path tree represents the query text. Each level of child node corresponds to the execution steps of a single data analysis instruction. The edges between different nodes represent data flow relationships. Based on multiple inference path trees with different intent features, an analysis report corresponding to the query text is generated; The parsing graph enhancement network includes a semantic encoding layer, a keyword enhancement layer, and a multi-intent classification layer; The query text is input into a parsing graph enhancement network to obtain a semantic association graph and multiple intent features output by the network, including: The query text is encoded using the semantic encoding layer to obtain a word vector sequence that represents multiple keywords; The word vector sequence is processed using a keyword enhancement layer to obtain attention weights for multiple keywords; The word vector sequence is processed using a multi-intent classification layer to obtain multiple intent categories, wherein the intent categories are determined based on multiple intent features; The initial association graph is updated based on the word vector sequence, the attention weight, and the association relationship between different keywords to obtain the semantic association graph, wherein the initial association graph is constructed based on business data storage resources; The step of inputting the intent features and semantic subgraph into the intent path decoding network to obtain the data path set output by the intent path decoding network includes iteratively performing the following steps: In the t-th iteration, the intent path decoding network generates an attention score for each candidate node based on the t-th hidden state parameter and the node features of the candidate nodes in the semantic subgraph, wherein the 0th hidden state parameter is obtained by linearly transforming the intent features; Based on the attention score, a target node is selected from the multiple candidate nodes, and the target node is added to the path node set; The hidden state parameter of the tth node is updated based on the node features of the target node to obtain the hidden state parameter of the (t+1)th node, and the (t+1)th iteration is performed based on the hidden state parameter of the (t+1)th node. If the preset iteration termination condition is met, the set of path nodes is processed using a cluster search method to obtain at least one search path, and the search path includes multiple target nodes.
2. The data analysis method according to claim 1, characterized in that, Also includes: For any of the aforementioned keywords, if the multiple attention weights of the keyword satisfy the weight dispersion condition, and the keyword corresponds to multiple nodes in the semantic association graph, the multiple attention weights are adjusted. The satisfying of the weight dispersion condition includes the weight ratio of the maximum attention weight to the second largest attention weight of the keyword satisfying a preset threshold, wherein the preset threshold is 1.3 to 1.
5.
3. The data analysis method according to claim 2, characterized in that, Adjusting multiple attention weights, including: A query vector is generated based on the keyword vector in the word vector sequence and multiple related global classification tag vectors, wherein the related global classification tag vectors are determined based on the query text related to the query text; Based on the similarity between the query vector and the keyword and the corresponding nodes in the semantic association graph, the target node is determined from the multiple nodes; A multi-hop subgraph of the target node is determined from the semantic association graph, wherein the multi-hop subgraph includes multi-level neighbor nodes related to the target node; Based on the neighbor nodes in the multi-hop subgraph, the attention weight parameters of the keyword enhancement layer are adjusted to obtain the adjusted attention weights based on the adjusted keyword enhancement layer output weights.
4. The data analysis method according to claim 1, characterized in that, Based on the query text, the data analysis instructions are reasoned to obtain a reasoning path tree, including: Generate data analysis instructions corresponding to the search path based on the type of the end node in the search path; The data analysis instructions are executed using the execution engine to obtain the data analysis results; The data analysis instructions and the data analysis results are recorded in a tree structure using an inference path recorder to obtain the inference path tree, wherein the root node of the inference path tree represents the query text.
5. The data analysis method according to claim 1, characterized in that, Based on multiple inference path trees with different intent features, an analysis report corresponding to the query text is generated, including: For any of the stated intent features, traverse the multiple inference path trees corresponding to the stated intent features, generate corresponding structured reports, and integrate the multiple structured reports. The integrated structured report is converted into a language using a text generation model to obtain an intent analysis report corresponding to the intent features. The intent analysis reports corresponding to different intent features are integrated to obtain an analysis report corresponding to the query text.
6. The data analysis method according to any one of claims 1 to 5, characterized in that, Also includes: The semantic association graph is updated using the inference path tree, and the next query text is analyzed based on the updated semantic association graph.
7. The data analysis method according to claim 6, characterized in that, Updating the semantic association graph using the inference path tree includes: Determine the correlation coefficient between every two variables in the inference path tree; If the correlation coefficient is greater than a preset threshold, then it is determined that there is a target correlation relationship between the two variables corresponding to the correlation coefficient; If the semantic association graph does not have a target edge corresponding to the target association, a target edge is added between the corresponding nodes in the semantic association graph based on the target association, and the weight of the target edge is configured. If the semantic association graph contains the target edge, the weight of the target edge is adjusted.
8. A data analysis device, characterized in that, include: The module is used to respond to query analysis instructions by inputting query text into the parsing graph enhancement network to obtain the semantic association graph and multiple intent features output by the parsing graph enhancement network. The semantic association graph includes nodes representing keywords in the query text and edges representing the association relationships between different keywords. The path decoding module is used to input the intent feature and semantic subgraph into the intent path decoding network for any of the intent features to obtain a set of data paths output by the intent path decoding network. The semantic subgraph is extracted from the semantic association graph based on the intent feature. The set of data paths includes at least one search path constructed from different nodes and edges. The reasoning module is used to reason about the data analysis instructions based on the query text for any of the search paths, and obtain a reasoning path tree. The root node of the reasoning path tree represents the query text, each level of child node corresponds to the execution steps of a single data analysis instruction, and the edges between different nodes represent the data flow relationship. The report generation module is used to generate an analysis report corresponding to the query text based on multiple inference path trees with different intent features; The parsing graph enhancement network includes a semantic encoding layer, a keyword enhancement layer, and a multi-intent classification layer. The query text is input into a parsing graph enhancement network to obtain a semantic association graph and multiple intent features output by the network, including: The query text is encoded using the semantic encoding layer to obtain a word vector sequence that represents multiple keywords; The word vector sequence is processed using a keyword enhancement layer to obtain attention weights for multiple keywords; The word vector sequence is processed using a multi-intent classification layer to obtain multiple intent categories, wherein the intent categories are determined based on multiple intent features; The initial association graph is updated based on the word vector sequence, the attention weight, and the association relationship between different keywords to obtain the semantic association graph, wherein the initial association graph is constructed based on business data storage resources; The step of inputting the intent features and semantic subgraph into the intent path decoding network to obtain the data path set output by the intent path decoding network includes iteratively performing the following steps: In the t-th iteration, the intent path decoding network generates an attention score for each candidate node based on the t-th hidden state parameter and the node features of the candidate nodes in the semantic subgraph, wherein the 0th hidden state parameter is obtained by linearly transforming the intent features; Based on the attention score, a target node is selected from the multiple candidate nodes, and the target node is added to the path node set; The hidden state parameter of the tth node is updated based on the node features of the target node to obtain the hidden state parameter of the (t+1)th node, and the (t+1)th iteration is performed based on the hidden state parameter of the (t+1)th node. If the preset iteration termination condition is met, the set of path nodes is processed using a cluster search method to obtain at least one search path, and the search path includes multiple target nodes.
Citation Information
Patent Citations
Knowledge graph-based traffic engineering large model intelligent question-answering system and method
CN120407752A
Automatic function chain generation method and device based on graph database and medium
CN120909559A
