A Smart Questioning Method and System Based on Index Hierarchical Bifurcation Position
By acquiring and comparing indicator paths, locating the differentiation positions of candidate indicators, obtaining difference attributes, and generating targeted disambiguation items, the accuracy problem of matching multiple candidate indicators in natural language queries is solved, reducing the difficulty of user operation and improving the accuracy and efficiency of queries.
Patent Information
- Application Number
- CN202611336097.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-17
AI Technical Summary
In natural language queries, the same natural language expression often matches multiple candidate indicators with similar semantics but different statistical objects, statistical quantity types or statistical calibers. Existing methods are difficult to accurately determine the key differences between candidate indicators, leading to problems such as misselection or high operational threshold.
By acquiring users' natural language queries, extracting query indicators and conditions, retrieving indicator paths from multiple candidate indicators, comparing content at each level, locating differentiation positions, obtaining difference attributes, generating targeted disambiguation items, guiding users to supplement information, and determining target indicators.
Narrowing the scope of disambiguation, reducing interference from irrelevant information, improving the matching accuracy of natural language queries, reducing the difficulty for users to choose among multiple professional indicators, and providing a clear indicator basis.
Smart Images

Figure CN123115185A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data query and natural language processing technology, and in particular to an intelligent data query method and system based on the bifurcation position of the indicator hierarchy. Background Technology
[0002] As the number of indicators in statistical data platforms, business data platforms, and comprehensive data management platforms continues to increase, users typically need to identify target indicators from a large number of hierarchical statistical indicators and further combine them with query conditions such as region, time, and statistical period to obtain the corresponding data results. To lower the barrier to data querying, natural language interaction can be used to receive user query requests and convert natural language into corresponding data query requests through semantic recognition, entity extraction, or vector retrieval.
[0003] However, in actual data collection, the same natural language expression often matches multiple candidate indicators with similar semantics but different statistical objects, statistical types, or statistical definitions. For example, when a user enters "query grain situation," multiple indicators such as total grain output, summer grain output, grain sown area, and summer grain sown area may be matched simultaneously. These indicators usually have a long common path at higher levels of the indicator classification system, and only differentiate at lower levels.
[0004] Current methods typically involve directly selecting the top-ranked indicators based on semantic similarity, or displaying all candidate indicators to the user for a second selection. The former is prone to incorrect selection due to semantic similarity among candidate indicators, while the latter requires users to understand the differences between multiple specialized indicators, thus presenting a significant operational barrier. Furthermore, when there are many candidate indicators, directly comparing all indicator names or attributes generates a large amount of comparative information irrelevant to the current ambiguity, making it difficult to accurately pinpoint the location and differences that truly cause indicator confusion.
[0005] Therefore, it is necessary to provide an intelligent question-and-answer method that can determine the position where candidate indicators first diverge by utilizing the hierarchical relationship of the indicators themselves, and generate targeted disambiguation content based on the differences corresponding to that position. Summary of the Invention
[0006] This application provides an intelligent query method and system based on the bifurcation position of the indicator hierarchy to solve the problems of difficulty in determining the key differences between candidate indicators and insufficient targeting of the disambiguation process when natural language queries match multiple similar candidate indicators.
[0007] This application provides the following solution: According to the first aspect, an intelligent data query method based on the bifurcation position of indicator hierarchy is provided, comprising: acquiring a user's natural language query, and extracting query indicators and query conditions from the natural language query; retrieving multiple candidate indicators in an indicator library according to the query indicators, and acquiring the indicator path of each candidate indicator in a preset indicator hierarchy structure; comparing the indicator content corresponding to each level in the multiple indicator paths, determining a common level range that is consistently maintained in the multiple indicator paths, and determining the target level position where the indicator content first differs after the common level range; acquiring the indicator content corresponding to each candidate indicator at the target level position, and determining the difference attributes between the indicator content; generating a target disambiguation item according to the difference attributes, and determining a target indicator from the multiple candidate indicators according to the user's supplementary input for the target disambiguation item; performing a data query according to the target indicator and the query conditions to generate intelligent data query results.
[0008] According to the second aspect, an intelligent data query system based on the bifurcation position of an indicator hierarchy is provided, comprising: a query parsing module, used to acquire a user's natural language query and extract query indicators and query conditions from the natural language query; an indicator retrieval module, used to retrieve multiple candidate indicators in an indicator library according to the query indicators and acquire the indicator path of each candidate indicator in a preset indicator hierarchy structure; a hierarchy comparison module, used to compare the indicator content corresponding to each level in the multiple indicator paths, determine a common hierarchy range that is consistently maintained in the multiple indicator paths, and determine the target hierarchy position where the indicator content first differs after the common hierarchy range; a difference determination module, used to acquire the indicator content corresponding to each candidate indicator at the target hierarchy position and determine the difference attributes between the indicator content; a disambiguation processing module, used to generate a target disambiguation item according to the difference attributes and determine the target indicator from multiple candidate indicators according to the user's supplementary input for the target disambiguation item; and a data query execution module, used to execute a data query according to the target indicator and the query conditions to generate intelligent data query results.
[0009] According to the specific embodiments provided in this application, the following technical effects are disclosed: This application obtains the indicator paths of multiple candidate indicators within a preset indicator hierarchy, compares each indicator path layer by layer, and can locate the target hierarchy where candidate indicators differentiate from common levels to different indicator contents. Furthermore, it extracts the difference attributes between the corresponding indicator contents at this location, generating targeted disambiguation items to guide users in supplementing information that can actually distinguish candidate indicators. Compared to methods that directly determine the target indicator based solely on indicator name similarity, this application can narrow the disambiguation scope, reduce the interference of irrelevant indicator information on the recognition results, lower the difficulty for users to directly select among multiple professional indicators, improve the matching accuracy between natural language queries and actual target indicators, and provide a clearer indicator foundation for subsequent structured data queries.
[0010] Of course, any product implementing this application does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments 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 A flowchart of the intelligent question-answering method based on the bifurcation position of the indicator hierarchy provided in the embodiments of this application; Figure 2 This is a schematic diagram of the preset indicator hierarchy structure and candidate indicator path provided in the embodiments of this application; Figure 3 A schematic diagram illustrating the alignment of multiple indicator paths and the determination of target hierarchical positions provided in the embodiments of this application; Figure 4 The structural block diagram of the intelligent questioning system based on the bifurcation position of the index hierarchy provided in the embodiments of this application. Detailed Implementation
[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0014] Figure 1 A flowchart illustrating the intelligent query method based on the bifurcation position of the indicator hierarchy provided in this application embodiment. Figure 1 As shown, the method may include the following steps: Step 101: Obtain the user's natural language query and extract query indicators and query conditions from the natural language query.
[0015] Step 102: Retrieve multiple candidate indicators from the indicator library based on the query indicator, and obtain the indicator path of each candidate indicator in the preset indicator hierarchy structure.
[0016] Step 103: Compare the indicator content corresponding to each level in multiple indicator paths, determine the common level range that remains consistent in multiple indicator paths, and determine the target level position where the indicator content first appears different after the common level range is determined.
[0017] Step 104: Obtain the indicator content corresponding to each candidate indicator at the target level position, and determine the difference attributes between the indicator contents.
[0018] Step 105: Generate a target disambiguation item based on the difference attribute, and determine the target indicator from multiple candidate indicators based on the user's supplementary input for the target disambiguation item.
[0019] Step 106: Perform a data query based on the target indicators and the query conditions to generate intelligent query results.
[0020] As can be seen from the above process, this application, by obtaining the indicator paths of multiple candidate indicators in a preset indicator hierarchy and comparing each indicator path layer by layer, can locate the target level where candidate indicators differentiate from common levels to different indicator contents. Furthermore, it extracts the difference attributes between the corresponding indicator contents at this position, thereby generating targeted disambiguation items to guide users to supplement information that can actually distinguish candidate indicators. Compared to directly determining the target indicator based solely on indicator name similarity, this application can narrow the disambiguation range, reduce the interference of irrelevant indicator information on the recognition results, lower the difficulty for users to directly select among multiple professional indicators, improve the matching accuracy between natural language queries and actual target indicators, and provide a clearer indicator foundation for subsequent structured data queries.
[0021] The following describes in detail each step of the above process and the effects that can be further produced, with reference to the embodiments.
[0022] Step 101 specifically involves: obtaining the user's natural language query, and extracting query indicators and query conditions from the natural language query.
[0023] First, the system receives natural language text input by users through the query interface, business system interaction window, or other data query entry points. Semantic parsing is then performed on this text to identify content representing the user's actual query object and content defining the query scope. Natural language queries can be in the form of complete statements, or in colloquial, abbreviated, or short sentences with query intent. For example, user input such as "Check the grain situation in City A last year," "How was the summer grain yield in County A over the past three years?" or "Compare the grain yields of City A and City B this year" can all be considered as natural language queries as described in this application. The natural language queries can first undergo text normalization processing, including removing interjections without actual query meaning, recognizing time expressions, standardizing regional names, and converting colloquial expressions into corresponding query semantics, thereby obtaining query text that facilitates subsequent structured extraction.
[0024] Query metrics are primarily used to characterize the data or statistical objects that users wish to obtain. They can be identified from words or phrases in natural language queries that have an indicator-like function. For example, in the query "Query the grain output of City A last year," "grain output" can be identified as the query metric. In the query "Check the grain situation in County A in recent years," "grain situation" can be identified as the initial query metric, which can then be used to retrieve possible corresponding total grain output, grain sown area, or other grain-related candidate metrics from the metric database. In other words, the query metrics extracted here are not required to uniquely correspond to a specific formal metric in the metric database; their main function is to form the input for candidate metric retrieval.
[0025] Query criteria are used to limit the data range corresponding to the query indicator. These criteria can include one or more of the following: region, time, statistical period, statistical granularity, comparison object, target unit, and query mode. For example, for "querying grain output in City A in 2025," "City A" can be extracted as the region criterion, and "2025" as the time criterion. For "comparing grain output in City A and City B over the past three years," "City A" and "City B" can be extracted as region criterions, and "past three years" as the time range. The corresponding query mode is then determined based on the "comparison." Extracting query criteria and query indicators separately ensures that the subsequent candidate indicator identification process primarily revolves around the indicator semantics, while the data acquisition process can further limit the actual data range to be accessed using query criteria such as region and time.
[0026] In practice, query field types can be pre-defined, and different semantic fragments in the natural language query can be mapped to corresponding fields. For example, index fields, region fields, time fields, statistical period fields, and unit fields can be set. When a semantic fragment may correspond to multiple fields, the final field type can be determined based on its semantic relationship with adjacent words.
[0027] Step 102 specifically involves: retrieving multiple candidate indicators from the indicator library based on the query indicator, and obtaining the indicator path of each candidate indicator in the preset indicator hierarchy structure.
[0028] After obtaining the query metrics corresponding to the user's natural language query, this query metric is not directly used as the final formal metric for data retrieval. Instead, it is first used as a search condition to search for multiple formal metrics that are semantically or name-related to it in a pre-established metric library. The metric library can store information such as metric name, metric code, metric alias, metric keywords, metric attributes, hierarchical identifiers, and hierarchical relationships. During retrieval, multiple candidate metrics can be determined based on the degree of textual matching, synonym correspondence, or semantic similarity between the query metric and the metric name. For example, when the query metric is "grain situation," candidate metrics such as total grain output, summer grain output, grain sown area, and summer grain sown area can be retrieved. At this point, instead of directly selecting one candidate metric, further disambiguation is performed using the positional relationship of each candidate metric in the metric hierarchy.
[0029] Figure 2 This diagram illustrates the preset indicator hierarchy structure and candidate indicator path provided in the embodiments of this application. The preset indicator hierarchy structure is used to describe the subordinate relationships between different indicators in the indicator library. Multiple indicator levels can be set in a manner that refines from broad statistical categories to specific statistical indicators. For example, indicator levels such as "agriculture," "crop farming," "grain," and "total grain output" can be set sequentially. Higher levels are used to describe broader statistical categories, while lower levels are used to represent statistical objects or specific indicators formed by further subdivision based on higher-level categories.
[0030] Each candidate indicator is associated with a corresponding hierarchical identifier and a parent indicator. The hierarchical identifier indicates the corresponding indicator's position within the preset indicator hierarchy. For example, the highest level can be set as the first level, followed by the second, third, and fourth levels. The parent indicator indicates the indicator directly subordinate to the current indicator. For instance, the parent indicator of "total grain output" could be "grain," the parent indicator of "grain" could be "crop farming," and the parent indicator of "crop farming" could be "agriculture." By storing these hierarchical identifiers and parent indicators for each indicator, the corresponding indicator hierarchy can be restored step-by-step along the hierarchical relationships without traversing the entire indicator database.
[0031] Specifically, when obtaining the indicator path for a candidate indicator, the system starts with that candidate indicator, reads its associated parent indicators, and continues to read the next higher-level indicator, and so on, searching upwards in the same manner until the preset highest indicator level is found. The preset highest indicator level can be the top-level category of the entire indicator system, or it can be a pre-specified starting level for the current business domain. For example, for the candidate indicator "summer grain yield," the system first finds its parent indicator "grain," then finds "grain's" parent indicator "crop farming," and continues searching until "crop farming's" parent indicator "agriculture," ending the search when "agriculture" is the preset highest indicator level.
[0032] After completing the hierarchical search, candidate indicators and their respective superior indicators are obtained, along with the hierarchical identifiers for each indicator. These are then combined to form the indicator path for each candidate indicator based on their hierarchical relationship. For example, the indicator path for "total grain output" can be represented as "Agriculture—Planting—Grain—Total Grain Output," and the indicator path for "Summer Grain Output" can be represented as "Agriculture—Planting—Grain—Summer Grain Output." This indicator path not only indicates what the candidate indicator itself is, but also indicates from which superior indicators it is derived, thus providing a basis for subsequent hierarchical alignment and path comparison between different candidate indicators.
[0033] In one specific implementation, a unique indicator code, a hierarchical identifier, and a parent indicator code can be stored for each indicator. For example, the candidate indicator "total grain output" has a fourth-level identifier, and its parent indicator code points to the third-level "grain". The system continues to obtain the second-level "crop farming" and the first-level "agriculture" based on this parent indicator code. Ultimately, the path corresponding to the candidate indicator can be stored as an ordered relationship composed of multiple indicator codes and hierarchical identifiers. By performing the above processing on multiple candidate indicators respectively, multiple indicator paths that can be compared layer by layer can be obtained.
[0034] Step 103 specifically involves: comparing the indicator content corresponding to each level in multiple indicator paths, determining the common level range that remains consistent across multiple indicator paths, and determining the target level position where the indicator content first differs after determining the common level range.
[0035] After obtaining the indicator paths corresponding to each candidate indicator, instead of directly comparing the names of the candidate indicators themselves, we compare multiple candidate indicators layer by layer according to the hierarchical relationship in the indicator paths, starting from the highest level. This determines at which levels these candidate indicators share the same affiliation and at which level differentiation begins. In this way, the differences between candidate indicators can be located to a specific hierarchical position, providing a foundation for subsequently extracting difference attributes only for the indicator content at that level.
[0036] Specifically, the first step is to align the positions of multiple indicator paths based on their hierarchical identifiers. Position alignment means placing indicator content with the same hierarchical identifier in the same comparison position, ensuring that comparisons between different indicator paths are based on the same level. For example, if the preset indicator hierarchy includes first, second, third, and fourth levels, then the first-level indicator content in each path is matched with each other, the second-level indicator content with each other, and so on. Position alignment using hierarchical identifiers avoids misalignment of comparison positions caused by differences in indicator name length, path storage order, or the depth of specific indicators.
[0037] After completing the position alignment, the indicator content corresponding to multiple indicator paths is compared layer by layer in descending order of level. Whether the indicator content is consistent can be determined based on the unique indicator code of the corresponding indicator, or based on other identification information used to uniquely identify indicators in the indicator library.
[0038] A common level range refers to one or more levels where the content of multiple candidate indicators remains consistent, starting from the preset highest indicator level. Taking the three candidate indicators mentioned above as an example, since the content of the indicators corresponding to the first to third levels are "agriculture," "crop farming," and "grain," respectively, the first to third levels can be defined as the common level range.
[0039] After determining the common level range, comparisons continue to lower levels. When at least two candidate indicators differ for the first time at a level following the common level range, that level is designated as the target level. For example, at the fourth level, the three candidate indicators "total grain output," "summer grain output," and "grain sown area" have already differed, therefore the fourth level is the target level. The target level reflects the position where multiple candidate indicators first diverge as they extend downwards along the common indicator path. Therefore, compared to directly comparing complete candidate indicator names, it more accurately identifies the level at which the indicator ambiguity to be resolved occurs.
[0040] In another scenario, some candidate indicators may still have the same content at the target level. As long as at least two candidate indicators at that level have different content, it can be designated as the target level. For example, if candidate indicators A and B both correspond to "grain yield" at the fourth level, and candidate indicator C corresponds to "grain sown area" at the fourth level, then the fourth level still belongs to the level where differentiation first occurs. The differences between candidate indicators A and B that have not yet been eliminated can continue to be processed in subsequent disambiguation processes without affecting the determination of the fourth level as the current target level.
[0041] Step 104 specifically involves: obtaining the indicator content corresponding to each candidate indicator at the target level position, and determining the difference attributes between the indicator contents.
[0042] After determining the target hierarchical position where multiple indicator paths first diverge, instead of comparing the complete paths of the candidate indicators as a whole, this application reads the indicator content corresponding to each candidate indicator at that target hierarchical position and further analyzes the differences in statistical meaning among these indicator contents. Since the names of different candidate indicators may have high textual similarity, comparing only the names may not accurately describe the actual differences between the candidate indicators. Therefore, this application further decomposes the indicator content corresponding to the target hierarchical position into several attributes that can describe its statistical meaning, and determines the difference attributes used for subsequent disambiguation by comparing the specific values of different indicator contents on each attribute.
[0043] Figure 3 This diagram illustrates the alignment of multiple indicator paths and the determination of target level positions in embodiments of this application. Specifically, a set of attributes can be pre-associated with each indicator content in an indicator library. Once the target level position is determined, the corresponding attribute set is read from the indicator library based on the indicator identifier corresponding to each candidate indicator at that position. The attribute set includes at least one of statistical objects, statistical quantity types, statistical ranges, and statistical calibers. In different application scenarios, one or more attributes can be selected based on the actual indicator description method used in the indicator library, or other attributes that can reflect the statistical meaning of the indicators can be further configured based on the above attributes. The purpose of this step is to convert the relatively abstract differences in indicator names between different candidate indicators into structured attribute differences that can be directly compared.
[0044] The term "statistical object" indicates the specific object on which the corresponding indicator is statistically analyzed. For example, in the field of grain statistics, the statistical object can be all grain, summer grain, wheat, rice, or corn; in the field of population statistics, the statistical object can be the resident population, the registered population, or the employed population. Taking "total grain output" and "summer grain output" as examples, both can be classified as output, but the former corresponds to the statistical object of all grain, while the latter corresponds to the statistical object of summer grain. Therefore, the term "statistical object" reflects the difference between the two.
[0045] The statistical type is used to represent the quantity actually measured, accumulated, or calculated for a statistical object. For example, it can include output, area, quantity, amount, proportion, average value, or growth rate. Taking "total grain output" and "grain sown area" as examples, both can represent all grain, but the statistical type for "total grain output" is output, while the statistical type for "grain sown area" is area. Therefore, the "statistic type" can be used to distinguish between these two candidate indicators. The statistical type can be obtained directly from the pre-configured type identifier in the indicator library, or it can be determined based on the statistical fields in the indicator definition.
[0046] Statistical scope is used to further define the data boundaries covered by the statistical object. For example, for the same grain output indicator, the statistical scope can be used to further distinguish data from all regions, large-scale business entities, specific administrative regions, or a certain business scope. The difference between statistical scope and the aforementioned statistical object is that the statistical object mainly indicates "what is being statistically analyzed," while the statistical scope mainly indicates "within the scope of the statistics." For example, if two candidate indicators both have industrial enterprises as their statistical object, but one indicator corresponds to all industrial enterprises while the other only corresponds to large-scale industrial enterprises, then the two can have different attribute values in terms of statistical scope.
[0047] Statistical caliber refers to the statistical rules or calculation boundaries used when generating corresponding indicator data. Statistical caliber can reflect whether an indicator uses current prices, comparable prices, period-end values, cumulative values over a period, local caliber, or other preset statistical standards. For example, two candidate indicators may both represent a certain output value, and have the same statistical object and scope, but one uses current prices while the other uses comparable prices; in this case, their statistical calibers differ. By comparing statistical calibers as attributes, indicators with similar names but different actual statistical rules can be further distinguished.
[0048] After obtaining the attribute set corresponding to each candidate indicator, the attributes of the same type for different indicator contents are compared, and the attribute value of each attribute on different candidate indicators is determined. For example, for the four candidate indicators "total grain output," "summer grain output," "grain sown area," and "summer grain sown area," we can obtain the following: the statistical object of total grain output is all grain, and the statistical quantity type is output; the statistical object of summer grain output is summer grain, and the statistical quantity type is output; the statistical object of grain sown area is all grain, and the statistical quantity type is area; the statistical object of summer grain sown area is summer grain, and the statistical quantity type is area. If the candidate indicators have the same statistical scope, and the attribute value corresponding to the statistical scope remains consistent, then this attribute does not need to be used to distinguish the current candidate indicators.
[0049] Furthermore, the attribute values corresponding to each attribute are compared. When an attribute has at least two different attribute values across different indicator contents, it indicates that the attribute can reflect the statistical differences between at least some candidate indicators, and therefore the attribute is identified as a difference attribute. Conversely, when an attribute has the same attribute value across all candidate indicators, it means that the attribute cannot distinguish the current candidate indicator, and it is not identified as a difference attribute. For example, the four candidate indicators mentioned above have two attribute values for "statistical object" ("total grain" and "summer grain"), and two attribute values for "statistical type" ("yield" and "area"). Therefore, the statistical object and statistical type can be identified as difference attributes.
[0050] In one specific implementation, attributes and their corresponding values can be associated with candidate indicators in a structured form. For example, for the candidate indicator "summer grain yield," the recorded statistical object is summer grain, the statistical quantity type is yield, the statistical scope is a preset statistical area, and the statistical caliber is an annual cumulative caliber. Other candidate indicators are recorded using the same fields. By sequentially comparing the attribute values corresponding to the same attribute fields, the system can obtain the attributes that actually differ among the multiple candidate indicators without needing to re-perform natural language semantic judgment on the indicator names.
[0051] Step 105 specifically involves: generating a target disambiguation item based on the difference attributes, and determining a target indicator from multiple candidate indicators based on the user's supplementary input for the target disambiguation item.
[0052] After obtaining the distinguishing attributes among multiple candidate indicators, instead of directly providing all candidate indicator names to the user for selection, the system further assesses the ability of different distinguishing attributes to differentiate candidate indicators, prioritizing the use of distinguishing attributes that can differentiate more candidate indicators with fewer interactions to generate disambiguation content. The user's supplementary input for this disambiguation content indicates the attribute values they actually need. Based on this, the system gradually eliminates candidate indicators that do not match the user's intent, ultimately determining a single target indicator.
[0053] Specifically, for each difference attribute obtained in the aforementioned steps, the attribute values of multiple candidate indicators on that difference attribute are read, and the candidate indicators are grouped according to the attribute values. Candidate indicators with the same attribute value are grouped into the same group, and candidate indicators with different attribute values are grouped into different groups. Since the candidate indicators in the same group have the same attribute value on the current difference attribute, it is not possible to further determine which candidate indicator in the group the user actually needs using only this difference attribute. Therefore, this application refers to two candidate indicators in the same group that cannot be distinguished from each other as an undifferentiated candidate indicator pair.
[0054] For example, there are four candidate indicators: "total grain output," "summer grain output," "grain sown area," and "summer grain sown area." The differential attributes identified in the aforementioned processing include the statistical type and the statistical object. Specifically, the statistical type for both "total grain output" and "summer grain output" is output, while the statistical type for both "grain sown area" and "summer grain sown area" is area. After grouping by statistical type, "total grain output" and "summer grain output" are still indistinguishable, thus forming an undifferentiated candidate indicator pair; "grain sown area" and "summer grain sown area" also form an undifferentiated candidate indicator pair. At this point, the number of undifferentiated candidate indicator pairs corresponding to the statistical type is two.
[0055] If we group the data according to the statistical objects, both "total grain output" and "grain sown area" fall under the category of all grain, thus forming one undifferentiated candidate indicator pair; both "summer grain output" and "summer grain sown area" fall under the category of summer grain, thus forming another undifferentiated candidate indicator pair. Therefore, we can count the number of undifferentiated candidate indicator pairs that still exist after grouping for each differential attribute. The fewer the number of undifferentiated candidate indicator pairs, the more candidate indicators can be distinguished using only that differential attribute, thus indicating that the differential attribute has a stronger current distinguishing ability.
[0056] In one specific implementation, assuming there are candidate indicators A, B, C, and D, after grouping using the first difference attribute, only A and B remain in the same group, meaning there is one undifferentiated candidate indicator pair. After grouping using the second difference attribute, A and B, as well as C and D, are in their respective same groups, meaning there are two undifferentiated candidate indicator pairs. In this case, the first difference attribute can distinguish more candidate indicators individually, therefore the first difference attribute is selected as the target difference attribute.
[0057] After selecting the target difference attribute, it is necessary to further determine whether the target difference attribute can distinguish all candidate indicators. If there are still undistinguished candidate indicator pairs, the remaining difference attributes are then examined for these undistinguished candidate indicators. The remaining difference attributes referred to here are those attributes that have been identified as difference attributes but have not yet been selected for the current disambiguation process. For each remaining difference attribute, it is determined how many previously undistinguished candidate indicator pairs can be transformed into a distinguishable state after being added to the target difference attribute, and the difference attribute that reduces the number of undistinguished candidate indicator pairs the most is selected first.
[0058] For example, after initially selecting the "Statistical Type," "Total Grain Output" and "Summer Grain Output" remain indistinguishable because both belong to output, and "Grain Sown Area" and "Summer Grain Sown Area" also remain indistinguishable because both belong to area. At this point, we examine the remaining difference attribute, "Statistical Object." For the first undifferentiated candidate indicator pair, the statistical object of "Total Grain Output" is all grain, and the statistical object of "Summer Grain Output" is summer grain; therefore, the two can be distinguished using the statistical object. For the second undifferentiated candidate indicator pair, the statistical object of "Grain Sown Area" is all grain, and the statistical object of "Summer Grain Sown Area" is summer grain; similarly, they can be distinguished. Therefore, after adding the statistical object, both of the original undifferentiated candidate indicator pairs are eliminated.
[0059] To minimize the number of undifferentiated candidate indicator pairs, this can be determined by comparing the number of undifferentiated candidate indicator pairs before and after adding different remaining differential attributes. For example, if there are currently five undifferentiated candidate indicator pairs, using statistical range reduces them to three, and using statistical scope reduces them to one. In this case, statistical scope can be prioritized as the next differential attribute. After selecting each new differential attribute, the remaining undifferentiated candidate indicator pairs can be re-determined, and the above comparison can be repeated for the remaining differential attributes. This gradually increases the number of differential attributes that truly have further differentiating effects, without having to use all differential attributes at once.
[0060] After sequentially selecting one or more difference attributes for joint differentiation, at least one of the selected difference attributes must differ between any two candidate indicators. For example, if candidate indicators A and B differ in their statistical objects, A and C differ in their statistical types, and B and D differ in their statistical types, then even if a single difference attribute cannot distinguish all candidate indicators on its own, as long as the combination of multiple sequentially selected difference attributes can make any two candidate indicators have identifiable attribute differences, it is considered that there are no undifferentiated candidate indicator pairs. If the remaining difference attributes at the current target level cannot further reduce the number of undifferentiated candidate indicator pairs, then according to the subsequent implementation method, the still undifferentiated candidate indicators can be formed into an undifferentiated indicator group, and new difference attributes can be searched for at the next target level position in the indicator path.
[0061] After determining the selection order of the difference attributes, a target disambiguation term is generated based on the sequentially selected difference attributes and their corresponding attribute values. The target disambiguation term can be a single disambiguation problem or multiple consecutive disambiguation problems organized according to the selected difference attributes. For example, if the first selected difference attribute is a statistical type, and its attribute values include yield and area, then the target disambiguation term "Do you need to query yield or sown area?" can be generated. After the user selects yield, if the remaining "total grain yield" and "summer grain yield" still need to be distinguished using statistical objects, then the disambiguation term "Do you need to query all grain or summer grain?" can be further generated.
[0062] As an feasible method, after selecting one or more differential attributes to group candidate indicators according to the aforementioned approach, there may still be several candidate indicators with the same attribute values, and other differential attributes available at the current target level cannot further separate these candidate indicators. For example, if there are candidate indicators A, B, and C, and C has been distinguished from A and B at the target level based on the type of statistical measure, but A and B have the same attribute values in terms of statistical object, statistical type, statistical range, and statistical caliber, then continuing to use these differential attributes at the current target level will no longer allow A and B to form different groups. In this case, A and B still constitute an undifferentiated candidate indicator pair.
[0063] The system further identifies candidate indicators that still belong to undifferentiated candidate indicator pairs and groups these candidate indicators into an undifferentiated indicator group. This does not involve reprocessing all candidate indicators; rather, it only retains those that remain ambiguous. For example, if the original candidate indicators are A, B, C, and D, after the aforementioned difference attribute processing, C and D can be uniquely distinguished, while only A and B remain indistinguishable. Therefore, the undifferentiated indicator group only includes A and B. C and D, which have already been distinguished, no longer participate in subsequent hierarchical comparisons, thus narrowing the scope of subsequent processing.
[0064] After forming undifferentiated indicator groups, for candidate indicators within each group, comparisons are performed along their respective indicator paths, starting from the original target level position. Specifically, based on the level identifier, starting from the level immediately below the target level position, the indicator content corresponding to each candidate indicator in the undifferentiated indicator group at the same level position is compared sequentially. If the immediately below level is still the same, the comparison continues until at least two candidate indicators are found to have different indicator content, and the level at which the first difference occurs is determined as the next target level position. Therefore, the next target level position is not searched again starting from the highest level, but rather a local search continues along the indicator path from the original target level position.
[0065] For example, candidate indicators A and B both correspond to "grain output" at the original target level, and the statistical objects, statistical types, and statistical scopes at that position are the same, so they cannot be distinguished at this time. Continuing to compare along the two indicator paths, the next level of difference for candidate indicator A corresponds to "total annual grain production," and candidate indicator B corresponds to "summer grain production." This level can then be determined as the next target level. At this point, it is only necessary to analyze the attributes of the corresponding indicator content for "total annual grain production" and "summer grain production," without needing to re-analyze other already distinguished candidate indicators.
[0066] After determining the next target level, the attribute set of the corresponding indicator content is obtained according to the aforementioned method for determining differential attributes, and the attribute values corresponding to the same attribute are compared. If the statistical object of candidate indicator A at this position is all grain, and the statistical object of candidate indicator B is summer grain, then the statistical object can be determined as the differential attribute corresponding to the next target level. Through the newly added differential attribute, A and B, which were originally indistinguishable, can form different attribute values, thereby eliminating the corresponding undifferentiated candidate indicator pairs.
[0067] The disambiguation process can simultaneously retain both the valid difference attributes already obtained at the original target level and the newly obtained difference attributes at the next target level, organizing the disambiguation content according to their distinguishing relationship with candidate indicators. For example, the original target level might first generate "Are you querying for yield or area?" using the "statistic type." If, after the user selects "yield," two indistinguishable candidate indicators still exist, then the "statistical object" obtained from the next target level would be used to generate "Are you querying for total grain or summer grain?" This forms a progressively deeper disambiguation process from the previous level to the next, rather than listing all candidate indicators to the user at once.
[0068] It should be noted that this partial drill-down method is mainly applicable when the indicator path corresponding to the candidate indicator does not have comparable subsequent levels after the original target level position. When the original target level position is already at the end of the corresponding indicator path, preset indicator extension attributes or other indicator description information can be used for further differentiation without continuing to perform level position search.
[0069] Preferably, before generating the target disambiguation item, the query conditions are matched with the data availability range corresponding to multiple candidate indicators. This is to perform a preliminary filtering of candidate indicator validity using the user-defined query conditions. While candidate indicators obtained through indicator name and semantic retrieval may be semantically related to the query indicator, this does not necessarily mean that these candidate indicators actually have queriedable data within the user-specified region, time, or statistical granularity. Without filtering, the system might provide the user with a disambiguation option that ultimately yields no data, causing unnecessary interaction.
[0070] In practice, the available data range for each indicator can be pre-stored in the indicator library or the data directory associated with the indicator library. The geographical range is used to represent the geographical area or administrative level where the corresponding indicator actually has data, such as national, provincial, municipal, county, or specific region; the time range is used to represent the start and end time of the corresponding indicator having valid data and the statistical period it covers; the statistical granularity is used to represent the finest query level that the data can support, such as annual, quarterly, monthly, and provincial, municipal, or county statistical granularity.
[0071] When a user's query includes relevant conditions, each condition is compared with the available data range of the candidate indicators. For example, if a user enters "query relevant grain indicators for County A in 2025," the query will return the geographical condition "County A" and the time condition "2025." For candidate indicator A, if its available geographical range includes County A and its time range covers 2025, then this candidate indicator is considered to have available data overlap with the current query. For candidate indicator B, if its data only covers the city level and does not include county-level data, then its geographical range does not overlap with the query requirement corresponding to "County A," and candidate indicator B can be excluded. Similarly, if candidate indicator C's data only covers 2020 to 2023, but the user requests a query for 2025, then candidate indicator C can also be excluded.
[0072] Matching the statistical granularity can further prevent situations where, although both geographical and temporal coverage are achieved, the data granularity fails to meet user requirements. For example, if a user wants to query data for each month of 2025, but a candidate indicator only has annual summary values, then although the candidate indicator covers the year 2025, its statistical granularity is annual, which does not meet the query requirement of monthly granularity. Therefore, it can be determined that there is no usable data intersection between it and the current query conditions. Conversely, if the user only queries annual data for 2025, and the candidate indicator has monthly data that can be aggregated into annual data according to preset rules, then it can be determined whether it belongs to the candidate indicator with usable data intersection based on the aggregation methods supported by the data source.
[0073] After matching conditions such as geographical scope, time range, and statistical granularity, candidate indicators that do not have any overlapping available data will be excluded from the current candidate indicator set. This exclusion mainly applies to the current natural language query and does not require the corresponding indicator to be deleted from the indicator database. For example, "summer grain output" may have data in city A but not in county A. Therefore, when querying for county A, this candidate indicator can be temporarily excluded, but it can still be retrieved as a candidate indicator when the user queries for city A in a subsequent query.
[0074] Because the number of candidate indicators changes, the originally determined common level range and target level position may also change. Therefore, after filtering candidate indicators, the indicator path comparison is re-executed based on the remaining candidate indicators. For example, the indicator paths of the original four candidate indicators may diverge after the third level. After two of the candidate indicators are excluded because there is no data matching the query conditions, the remaining two candidate indicators may remain consistent up to the fourth level. In this case, the original target level position can no longer accurately represent the first divergence position of the current candidate indicators. Therefore, it is necessary to re-compare the remaining candidate indicators in order from high level to low level, redetermine the common level range, and redetermine the target level position where the indicator content first differs after the common level range.
[0075] After the user inputs supplementary information for the target disambiguation item, the system matches the supplementary input with the values of each attribute of the corresponding difference attribute. For example, if the user inputs "I want to see yield" in response to "Do you need to query yield or sown area?", it can be determined that the user selected a statistical type of difference attribute, with the corresponding attribute value being yield. At this point, "Total Grain Yield" and "Summer Grain Yield," which are statistical types of yield, are retained, while other candidate indicators with the statistical type of area are excluded. If multiple candidate indicators still exist, subsequent disambiguation items are generated according to the already determined difference attribute order, and supplementary input is accepted.
[0076] When the user further inputs "view summer grain", this supplementary input can be matched with "summer grain" in the statistical object attributes, and "summer grain yield" can be retained from the remaining candidate indicators if the statistical object is summer grain. At this point, only one candidate indicator remains, so "summer grain yield" is determined as the target indicator.
[0077] Furthermore, after generating the target disambiguation item based on the difference attributes, the system provides the target disambiguation item to the user and receives the user's selection or natural language supplementary explanation regarding the disambiguation content. Instead of requiring the user to directly select the final indicator from multiple professional indicator names, the system converts the user's supplementary input into confirmation of a certain difference attribute and its specific value, and uses this confirmation result to gradually narrow down the range of candidate indicators until a unique target indicator is determined from multiple candidate indicators.
[0078] Specifically, the first step is to determine the target difference attribute and its value corresponding to the user's supplementary input. The target difference attribute refers to the difference attribute targeted by the current target disambiguation item, and the attribute value is the specific value indicated by the user's supplementary input. For example, if the current target disambiguation item is "Do you need to query yield or sown area?", the target difference attribute is a statistical measure, and the corresponding selectable attribute values include yield and area. When the user inputs "query yield" or selects the "yield" option, it can be determined that the corresponding target difference attribute is a statistical measure, and the attribute value is yield. As another example, if the target disambiguation item is "Do you need to query all grains or summer grains?", and the user inputs "summer grains", it can be determined that the target difference attribute is a statistical object, and the corresponding attribute value is summer grains.
[0079] For supplementary content input in natural language, semantic matching can be performed between the user input and the attribute values corresponding to the target disambiguation item. For example, statistical types include "yield" and "area," and the user inputs "I want to see how many acres were planted." Although the word "area" does not appear directly, it can be mapped to the area attribute value based on the statistical meaning of "how many acres." To avoid incorrect mapping of supplementary input, candidate indicator filtering can be performed only when it clearly corresponds to a certain attribute value; if the supplementary input is still ambiguous, the current candidate indicator set can be kept unchanged, and the corresponding disambiguation prompt can be output again.
[0080] After determining the target difference attribute and its value, candidate indicators with corresponding attribute values for that target difference attribute are retained from the current candidate indicators, while other candidate indicators are excluded. The current candidate indicators referred to here are those that remain after the aforementioned indicator retrieval, data availability range filtering, and disambiguation processing; it is not required to re-select from all initially retrieved candidate indicators each time. Therefore, each valid user input further narrows down the candidate range based on the current candidate indicator set.
[0081] For example, currently there are four candidate indicators: "Total Grain Output," "Summer Grain Output," "Grain Sown Area," and "Summer Grain Sown Area." The first two indicators are statistically classified as output, while the latter two are statistically classified as area. When a user enters "output" in addition to "Do you need to query output or sown area?", the system retains "Total Grain Output" and "Summer Grain Output," while excluding "Grain Sown Area" and "Summer Grain Sown Area." After this disambiguation process, the number of candidate indicators is reduced from four to two.
[0082] If only one candidate indicator remains after filtering, it means that the user's current input has uniquely identified the required indicator. In this case, the candidate indicator should be directly selected as the target indicator. For example, if only "total grain output" and "grain sown area" remain as candidate indicators, and the user selects output as the statistical type, only "total grain output" satisfies the corresponding attribute value. Therefore, "total grain output" can be directly selected as the target indicator without generating new disambiguation content.
[0083] If multiple candidate indicators remain after filtering, it indicates that the current target difference attribute can only exclude some candidate indicators and is insufficient to uniquely determine the target indicator. In this case, the next difference attribute that can distinguish the currently retained candidate indicators is determined from the difference attributes that have not yet been used for disambiguation. The difference attributes that have not yet been used for disambiguation refer to attributes that have been determined to have a distinguishing effect during the aforementioned difference attribute selection process, but have not yet been filtered based on user input during the current interaction. The next difference attribute can be determined according to the previously determined difference attribute selection order, or the distinguishing ability of each unused difference attribute can be reassessed for the remaining candidate indicators, and the difference attribute that can further differentiate the current candidate indicators into different attribute values can be selected.
[0084] For example, after a user selects "output," the remaining options are "total grain output" and "summer grain output." Both candidate indicators are of the output type, so they cannot be further distinguished by statistical type. However, their statistical objects differ; the former corresponds to all grain, and the latter to summer grain. In this case, the statistical object can be identified as the next disambiguation attribute, and a next target disambiguation term can be generated based on its attribute values "all grain" and "summer grain," such as "Do you need to query all grain or summer grain?"
[0085] Then, the user provides supplementary input regarding the next target disambiguation item, and the current candidate indicators are filtered using the same method as described above. For example, if the user inputs "summer grain," the next disambiguation attribute is determined as the statistical object, with the attribute value being "summer grain." From the currently remaining "total grain output" and "summer grain output," "summer grain output," which has "summer grain" as the statistical object, is retained, while "total grain output" is excluded. Since only one candidate indicator is retained at this point, "summer grain output" is determined as the final target indicator.
[0086] If one round of disambiguation is insufficient to uniquely determine the target indicator, the above process can be repeated. This involves selecting distinguishing attributes from those not yet used for disambiguation to generate new target disambiguation items, receiving supplementary user input, and continuing the filtering process. This forms a cyclical process of "generating disambiguation items, receiving supplementary input, filtering candidate indicators, and determining the remaining quantity" until only one candidate indicator remains in the current candidate indicator set.
[0087] In one implementation, if all the difference attributes corresponding to the current target level position have been used for disambiguation, but there are still multiple indistinguishable candidate indicators, the process can be connected with the aforementioned undistinguished indicator group processing method. The remaining candidate indicators are then grouped into an undistinguished indicator group, and the process continues along the corresponding indicator path to find the next target level position after the target level position. New difference attributes are obtained from this group, and the new difference attributes are then used to generate disambiguation items. This avoids the disambiguation process being unable to continue due to the limited attributes available at the current level.
[0088] Through the above processing, each user-supplemented input corresponds to a clear difference attribute and attribute value, resulting in a justified reduction of the candidate indicator set. For example, four candidate indicators can first be reduced to two based on "yield or area," and then further reduced to one based on "total grain or summer grain."
[0089] Step 106 specifically involves: performing a data query based on the target indicator and the query conditions to generate intelligent query results.
[0090] After identifying the target indicators that the user actually needs to query through the aforementioned candidate indicator retrieval and disambiguation processing, the target indicators are converted into query objects that can be recognized by specific data sources. Furthermore, query conditions such as time, region, and statistical period extracted from natural language queries are converted into structured query parameters that the corresponding data source can execute, thereby accessing the corresponding data resources and obtaining actual statistical data. This step primarily completes the transformation from "knowing what the user wants to query" to "actually obtaining the corresponding data from the data source," enabling the aforementioned indicator disambiguation results to be further translated into specific data query results.
[0091] Specifically, the first step is to obtain the indicator code and data source corresponding to the target indicator. The indicator code can be a unique identifier pre-set for each official indicator in the indicator library to avoid confusion when different indicator names are similar or when the same indicator has abbreviations or aliases. For example, "summer grain yield" can correspond to a preset indicator code, which is further associated with the data table, data interface, or data service where the actual data for that indicator is stored. The data source indicates the location where the actual statistical data is stored or provided; it can correspond to a data table in a database, a thematic dataset in a data warehouse, or a data service interface provided by other business systems. Therefore, after determining the target indicator, the unique indicator code and corresponding data source can be obtained simultaneously based on the relationship between the target indicator and the indicator library.
[0092] Furthermore, the query conditions are converted into query fields and field values corresponding to the data source. Since the query conditions extracted from natural language primarily use user-oriented semantic expressions, such as "City A," "2025," and "Year," and different data sources may actually use different field names and field codes, conversion is necessary based on a pre-defined field mapping relationship. For example, the geographical condition "City A" in the natural language query can be converted into a geographical code field and its corresponding geographical code value in the data source; "2025" can be converted into an annual field and its value 2025; and "First Quarter" can be converted into a statistical period field and its corresponding quarter code. For cases where different data sources use different field names, the corresponding field mapping relationship can be pre-saved for each data source, enabling the same query condition to be converted into the query fields actually supported by the target data source.
[0093] For example, if a user's final target indicator is "summer grain output" and the query conditions are "City A, 2025", the system can first obtain the indicator code and corresponding statistical database based on "summer grain output". Then, it can convert "City A" into the regional code corresponding to the regional field in the database, and convert "2025" into the value of the year field. After this conversion, the query requirement, originally derived from natural language, is transformed into structured content such as indicator code, regional field, regional field value, time field, and time field value.
[0094] Subsequently, a structured query request is generated based on the indicator code, query fields, and field values. The structured query request can be configured according to the access method of the data source. When the data source is a relational database, the database query conditions can be constructed based on the above content; when the data source provides data through a data service interface, the above content can be organized into interface call parameters; when the data source is a unified data query service, a structured query object containing indicator codes and multiple query condition fields can also be formed. This application does not limit the specific query language; its key lies in determining the query object through the indicator code corresponding to the target indicator and limiting the data range through the query fields and field values.
[0095] After accessing the corresponding data source based on a structured query request, target data that meets the target indicator and query conditions can be obtained. For example, after executing a query based on the indicator code of "summer grain output," the regional code corresponding to City A, and the time field corresponding to 2025, the statistical value of the summer grain output of City A in 2025 can be obtained. For single-value queries, the target data can be a single statistical value; for queries that include multiple time points, multiple regions, or other range conditions, the target data can also include multiple interrelated data records. For example, if a user queries "summer grain output of City A in the past three years," multiple target data corresponding to the three years can be obtained.
[0096] After obtaining the target data, it is associated with target indicators and query conditions to preserve the complete query semantics corresponding to the statistical data. For example, the target data can be associated with information such as "summer grain output," "City A," and "2025," and further associated with the data unit, statistical period, or data source identifier corresponding to the indicator. The resulting intelligent query results not only contain specific numerical values but also clearly define the indicator object and query scope corresponding to the numerical value, avoiding ambiguity caused by returning only numerical values.
[0097] The intelligent query results can be output in an appropriate format based on the query type. For example, for a single indicator and a single time condition, query results can be generated that include the indicator name, region, time, statistical value, and unit; for multiple time points, target data can be organized in chronological order to form trend results; and for multiple regions, corresponding data lists or comparison results can be generated.
[0098] The aforementioned steps identify a difference in the attribute values of different candidate indicators on a particular attribute, thus defining that attribute as a differing attribute. However, the existence of a difference in an attribute does not necessarily mean that simply changing that attribute will actually alter the indicator matching result between the two candidate indicators. Therefore, before formally using this differing attribute to generate user-oriented disambiguation items, it is possible to further verify whether the differing attribute has an actual distinguishing effect on indicator identification through attribute value substitution.
[0099] Specifically, from one or more dissimilarity attributes that are ready to generate the target disambiguation term, select one as the dissimilarity attribute to be verified, and select two candidate indicators with different attribute values on this dissimilarity attribute. For example, candidate indicator A is "total grain output" and candidate indicator B is "grain sown area". Both of them statistically represent all grain, but the statistical types are output and area, respectively. In this case, the "statistic type" can be determined as the dissimilarity attribute to be verified, and candidate indicator A and candidate indicator B can be used as two candidate indicators for verification.
[0100] Then, using the attribute combination of one of the candidate indicators as the basis for verification, all attributes except the attribute to be verified remain unchanged. Only the attribute value of the candidate indicator on the attribute to be verified is replaced with the attribute value corresponding to the other candidate indicator. For example, based on "total grain output," whose statistical object is all grain and whose statistical quantity type is output, keeping other attributes such as "statistical object is all grain" unchanged, only the statistical quantity type is replaced from "output" to "area," thus forming the verification attribute combination of "statistical object is all grain and statistical quantity type is area." In other words, this verification process intentionally controls other attributes from changing, so that whether the rematch result changes is mainly affected by the change in the attribute to be verified.
[0101] After forming the verification attribute combination, the indicator matching is performed again in the indicator database based on this combination. The rematch can employ the same or corresponding indicator retrieval mechanism as the aforementioned candidate indicator retrieval, using the statistical object, statistical type, statistical range, and statistical caliber in the verification attribute combination as retrieval constraints to find matching formal indicators. Taking the above example again, if the search result changes from "total grain + area" to "grain sown area" after rematching "total grain output," it indicates that changing only the statistical type, while keeping other attributes unchanged, can cause a corresponding change in the matching target.
[0102] When the attribute to be verified changes from the attribute value of the first candidate indicator to the attribute value of the second candidate indicator, the rematched indicator also changes accordingly from the first candidate indicator to the second candidate indicator, or at least makes the second candidate indicator a target matching result that conforms to the combination of the verification attributes. For example, if the attribute to be verified is replaced by "yield" with "area", and the indicator matching result changes simultaneously from "total grain yield" to "grain sown area", it can be considered that the attribute to be verified has a relatively clear independent distinguishing role, so the attribute to be verified is retained for subsequent generation of target disambiguation terms.
[0103] For example, a target disambiguation term such as "Do you want to query output or sown area?" can be generated based on the statistical type. When the user selects "output", the query can be biased towards "total grain output", and when the user selects "area", the query can be biased towards "grain sown area". Since this attribute has been verified by the aforementioned replacement, there is a corresponding relationship between the changes in its attribute value and the indicator matching results. Therefore, using this attribute for queries has a clearer indicator differentiation significance.
[0104] In another scenario, if the attribute value of the differential attribute to be verified is replaced, and the re-matched candidate indicators do not change as expected, then the differential attribute to be verified is insufficient to independently determine the difference between the two candidate indicators. For example, candidate indicator A and candidate indicator B differ not only in their statistical types but also in their statistical objects. When only the statistical type of candidate indicator A is replaced with that of candidate indicator B, while retaining the original statistical object of candidate indicator A, the resulting combination of verification attributes may not stably match either A or B. This indicates that the actual difference between two candidate indicators needs to be reflected by multiple attributes.
[0105] According to another embodiment, an intelligent questioning system based on the bifurcation position of the indicator hierarchy is provided. Figure 4 A schematic block diagram of an intelligent question-and-answer system based on the bifurcation position of an indicator hierarchy is shown according to one embodiment. Figure 4 As shown, the system includes: The query parsing module 401 is used to obtain the user's natural language query and extract query indicators and query conditions from the natural language query.
[0106] The indicator retrieval module 402 is used to retrieve multiple candidate indicators in the indicator library according to the query indicator, and obtain the indicator path of each candidate indicator in the preset indicator hierarchy structure.
[0107] The hierarchical comparison module 403 is used to compare the indicator content corresponding to each level in multiple indicator paths, determine the common hierarchical range that is consistent in multiple indicator paths, and determine the target hierarchical position where the indicator content is different for the first time after the common hierarchical range is determined.
[0108] The difference determination module 404 is used to obtain the indicator content corresponding to each candidate indicator at the target level position, and determine the difference attributes between the indicator content.
[0109] The disambiguation processing module 405 is used to generate a target disambiguation item based on the difference attribute, and to determine the target indicator from multiple candidate indicators based on the user's supplementary input for the target disambiguation item.
[0110] The query execution module 406 is used to perform data queries based on the target indicators and the query conditions to generate intelligent query results.
[0111] As an implementable approach, when the indicator retrieval module 402 obtains the indicator path of each candidate indicator in the preset indicator hierarchy structure, the following steps are taken: the preset indicator hierarchy structure includes multiple indicator levels set according to the indicator hierarchy relationship, and each candidate indicator is associated with a corresponding level identifier and a superior indicator; starting from each candidate indicator, according to the superior-subordinate relationship between indicators, the corresponding superior indicator is searched level by level in the preset indicator hierarchy structure until the preset highest indicator level is reached; the found superior indicators and their corresponding level identifiers are obtained, and the candidate indicator, superior indicators and their corresponding level identifiers are determined as the indicator path corresponding to the candidate indicator.
[0112] As an implementable approach, the hierarchical comparison module 403 determines the first target hierarchical position where the indicator content differs after determining a continuous and consistent common hierarchical range among multiple indicator paths, including: aligning the positions of multiple indicator paths according to hierarchical identifiers so that indicator content of the same level is in the corresponding comparison position; comparing the indicator content corresponding to each indicator path layer by layer in order from high level to low level; determining the continuous hierarchical range where the indicator content of all candidate indicators is consistent as the common hierarchical range; and determining the first hierarchical position where the indicator content of at least two candidate indicators differs after the common hierarchical range as the target hierarchical position.
[0113] As an implementable approach, when the difference determination module 404 acquires the indicator content corresponding to each candidate indicator at the target level position and determines the difference attributes between the indicator content, it includes: acquiring the attribute set of the indicator content corresponding to each candidate indicator at the target level position, wherein the attribute set includes at least one of statistical object, statistical quantity type, statistical range, and statistical caliber; comparing the attribute sets of different indicator content and determining the attribute value corresponding to each attribute; and determining the attribute with different attribute values between different indicator content as the difference attribute.
[0114] As an implementable approach, the disambiguation processing module 405, when generating a target disambiguation item based on the difference attributes, includes: grouping multiple candidate indicators according to the attribute values of each difference attribute, and determining undifferentiated candidate indicator pairs that still have the same attribute values after grouping; selecting the difference attribute with the fewest corresponding undifferentiated candidate indicator pairs as the target difference attribute; for the candidate indicator pairs that are still undifferentiated under the target difference attribute, continuing to select the difference attribute that reduces the number of undifferentiated candidate indicator pairs the most from the remaining difference attributes, until there are no undifferentiated candidate indicator pairs; and generating the target disambiguation item based on the sequentially selected difference attributes and their corresponding attribute values.
[0115] As an implementable approach, the disambiguation processing module 405 further includes: when the remaining difference attributes cannot reduce the number of undifferentiated candidate indicator pairs, determining the candidate indicators that still belong to the undifferentiated candidate indicator pairs, and generating an undifferentiated indicator group; for the candidate indicators in the undifferentiated indicator group, continuing to compare the indicator content in the corresponding indicator path after the target level position, determining the next target level position where the indicator content first differs; obtaining the difference attributes between the corresponding indicator content of each candidate indicator at the next target level position; continuing to reduce the undifferentiated candidate indicator pairs according to the difference attributes corresponding to the next target level position, and generating the target disambiguation item according to the difference attributes corresponding to the two target level positions before and after.
[0116] As an implementable approach, before generating the target disambiguation item, the disambiguation processing module 405 further includes: matching the query conditions with the data availability ranges corresponding to multiple candidate indicators, wherein the data availability ranges include at least one of geographical range, time range, and statistical granularity; excluding candidate indicators that do not have an intersection with the query conditions in terms of available data; and redetermining the common level range and target level position based on the candidate indicators retained after exclusion.
[0117] As an implementable approach, when the disambiguation processing module 405 determines the target indicator from multiple candidate indicators based on the user's supplementary input for the target disambiguation item, the process includes: determining the target difference attribute and attribute value corresponding to the supplementary input; retaining candidate indicators with corresponding attribute values on the target difference attribute from the current candidate indicators; when only one candidate indicator is retained, determining that candidate indicator as the target indicator; when multiple candidate indicators are still retained, determining the next difference attribute that can distinguish the retained candidate indicator from the difference attributes that have not yet been used for disambiguation, and generating the next target disambiguation item based on the next difference attribute; obtaining the user's supplementary input for the next target disambiguation item, and continuing to filter candidate indicators based on the supplementary input until only one candidate indicator is retained, and determining it as the target indicator.
[0118] As an implementable approach, the query execution module 406 performs data queries based on the target indicator and the query conditions to generate intelligent query results, including: obtaining the indicator code and data source corresponding to the target indicator; converting the query conditions into query fields and field values corresponding to the data source; generating a structured query request based on the indicator code, query fields, and field values, and obtaining the corresponding target data based on the structured query request; and associating the target data with the target indicator and query conditions to generate the intelligent query results.
[0119] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A smart questioning method based on the bifurcation position of indicator hierarchy, characterized in that, include: Obtain the user's natural language query, and extract query indicators and query conditions from the natural language query; Based on the query indicators, multiple candidate indicators are retrieved from the indicator library, and the indicator path of each candidate indicator in the preset indicator hierarchy is obtained. Compare the indicator content corresponding to each level in multiple indicator paths, determine the common level range that remains consistent in multiple indicator paths, and determine the target level position where the indicator content first appears after the common level range. Obtain the indicator content corresponding to each candidate indicator at the target level position, and determine the difference attributes between the indicator contents; A target disambiguation item is generated based on the difference attributes, and a target indicator is determined from multiple candidate indicators based on the user's supplementary input for the target disambiguation item. Data queries are performed based on the target indicators and query conditions to generate intelligent query results.
2. The method according to claim 1, characterized in that, The step of obtaining the indicator path of each candidate indicator in the preset indicator hierarchy includes: The preset indicator hierarchy structure includes multiple indicator levels set according to the indicator hierarchy relationship, and each candidate indicator is associated with a corresponding level identifier and a superior indicator. Starting from each candidate indicator, based on the hierarchical relationship between the indicators, the corresponding superior indicator is searched level by level in the preset indicator hierarchy structure until the preset highest indicator level is reached. Obtain the found superior indicators and their corresponding hierarchical identifiers, and determine the candidate indicator, superior indicators and their corresponding hierarchical identifiers as the indicator path corresponding to the candidate indicator.
3. The method according to claim 2, characterized in that, The step of determining a common hierarchical range that remains consistent across multiple indicator paths, and determining the target hierarchical position where the indicator content first differs after the common hierarchical range, includes: Align the positions of multiple indicator paths according to the hierarchical identifier, so that the content of indicators at the same level is placed in the corresponding comparison position; The content of each indicator path is compared layer by layer in order from the highest level to the lowest level. The continuous levels where the content of all candidate indicators is consistent are defined as the common level range. The first level whose corresponding indicator content differs from that of at least two candidate indicators after the common level range is determined as the target level position.
4. The method according to claim 1, characterized in that, The step of obtaining the indicator content corresponding to each candidate indicator at the target level position and determining the difference attributes between the indicator content includes: Obtain the attribute set of each candidate indicator corresponding to the indicator content at the target level position. The attribute set includes at least one of statistical object, statistical quantity type, statistical range and statistical caliber. Compare the attribute sets of different indicator contents and determine the attribute values corresponding to each attribute; The attribute whose attribute values differ among different indicator contents is defined as the difference attribute.
5. The method according to claim 4, characterized in that, The step of generating the target disambiguation term based on the difference attributes includes: Multiple candidate indicators are grouped according to the attribute values of each difference attribute, and undifferentiated candidate indicator pairs that still have the same attribute value after grouping are identified. Select the attribute with the fewest pairs of undifferentiated candidate indicators as the target difference attribute; For candidate indicator pairs that are still not distinguished under the target difference attribute, continue to select the difference attribute that reduces the number of undistinguished candidate indicator pairs the most from the remaining difference attributes, until there are no undistinguished candidate indicator pairs left. The target disambiguation term is generated based on the selected difference attributes and their corresponding attribute values.
6. The method according to claim 5, characterized in that, Also includes: When none of the remaining difference attributes can reduce the number of undifferentiated candidate indicator pairs, candidate indicators that still belong to the undifferentiated candidate indicator pairs are determined, and an undifferentiated indicator group is generated. For candidate indicators in the undifferentiated indicator group, continue to compare the indicator content in the corresponding indicator path after the target level position to determine the next target level position where the indicator content is different for the first time. Obtain the difference attributes between the corresponding indicator contents of each candidate indicator at the next target level position; Based on the difference attributes corresponding to the next target level position, the undifferentiated candidate index pairs are further reduced, and the target disambiguation term is generated based on the difference attributes corresponding to the two target level positions.
7. The method according to claim 1, characterized in that, Before generating the target disambiguation term, the method further includes: The query conditions are matched with the data availability ranges corresponding to multiple candidate indicators, wherein the data availability ranges include at least one of geographical range, time range, and statistical granularity. Candidate indicators that do not have any available data intersection with the query conditions are excluded; The common level range and target level position are redefined based on the candidate indicators retained after exclusion.
8. The method according to claim 7, characterized in that, The step of determining the target indicator from multiple candidate indicators based on the user's supplementary input regarding the target disambiguation item includes: Determine the target difference attribute and attribute value corresponding to the supplementary input; Retain candidate indicators from the current candidate indicators that have the corresponding attribute values on the target difference attribute; When only one candidate indicator is retained, that candidate indicator is determined as the target indicator. When multiple candidate indicators are still retained, the next difference attribute that can distinguish the retained candidate indicators is determined from the difference attributes that have not yet been used for disambiguation, and the next target disambiguation item is generated based on the next difference attribute. Obtain the user's supplementary input for the next target disambiguation item, and continue to filter candidate indicators based on the supplementary input until only one candidate indicator is retained, and then determine it as the target indicator.
9. The method according to claim 1, characterized in that, The step of performing a data query based on the target indicator and the query conditions to generate intelligent query results includes: Obtain the indicator code and data source corresponding to the target indicator; Convert the query conditions into query fields and field values corresponding to the data source; A structured query request is generated based on the indicator code, query field, and field values, and the corresponding target data is obtained based on the structured query request. The target data is associated with the target indicators and query conditions to generate the intelligent query results.
10. An intelligent query system based on the bifurcation position of an indicator hierarchy, characterized in that, include: The query parsing module is used to obtain the user's natural language query and extract query indicators and query conditions from the natural language query; The indicator retrieval module is used to retrieve multiple candidate indicators in the indicator library according to the query indicator, and obtain the indicator path of each candidate indicator in the preset indicator hierarchy structure. The hierarchical comparison module is used to compare the indicator content corresponding to each level in multiple indicator paths, determine the common hierarchical range that is consistently maintained in multiple indicator paths, and determine the target hierarchical position where the indicator content is different for the first time after the common hierarchical range is determined. The difference determination module is used to obtain the indicator content corresponding to each candidate indicator at the target level position, and determine the difference attributes between the indicator content; The disambiguation processing module is used to generate a target disambiguation item based on the difference attributes, and to determine the target indicator from multiple candidate indicators based on the user's supplementary input for the target disambiguation item. The query execution module is used to perform data queries based on the target indicators and the query conditions, and generate intelligent query results.
