Data query method and device, equipment, medium and program product
By semantic parsing and structured processing of users' natural language queries, a feature configuration knowledge base is generated, which solves the problems of efficiency and accuracy in feature configuration information query, realizes fast and accurate feature interpretation, lowers the understanding threshold, and integrates information fragments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, the methods for querying feature configuration information cannot quickly and accurately generate corresponding explanatory text. This is especially problematic for business analysts without a technical background, as the understanding threshold is high, the efficiency is low, and the information is severely fragmented.
By acquiring users' natural language query statements, semantic parsing is performed to obtain feature identifiers and query intent, generating structured query items, querying the structured feature configuration knowledge base, and finally generating natural language explanatory text. Semantic enhancement and formatting verification are performed using a domain dictionary, a unified feature configuration knowledge base is constructed, and it is updated in real time.
It significantly lowers the barrier to understanding for non-technical personnel, improves the efficiency and accuracy of data queries, ensures consistency between the explanation content and online configuration, and integrates fragmented configuration information.
Smart Images

Figure CN121833781A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of big data, and in particular to a data query method, device, equipment, medium and program product. BACKGROUND
[0002] In the field of financial technology, with the in-depth development of data-driven business, feature-based decision-making has become a key technical means in core business scenarios such as risk control and precision marketing. In such scenarios, the configuration information of the feature, including its definition logic, data source and specific use scenario, is the basis for business personnel and technical operation personnel to understand, verify and optimize the decision-making model.
[0003] In some examples, the understanding and explanation of feature configuration information mainly rely on two traditional ways, one is the static technical document manually written and maintained by technical personnel, and the other is to directly consult the code, configuration file and metadata scattered in different management systems. These traditional ways have obvious limitations. The feature configuration information is usually expressed in specialized technical language and format (such as code, configuration script, database table structure), which has a high understanding threshold for non-technical business analysts, and it is difficult for them to directly and quickly obtain the required information. At the same time, the various aspects of information about the feature are often stored in multiple independent tools such as feature management platform, data source system and model repository, lacking a unified view, and requiring manual integration to form a complete explanation, which is inefficient and prone to errors.
[0004] Therefore, the data query method in the related art cannot quickly and accurately generate an explanation text of the corresponding feature according to the query statement of the user. SUMMARY
[0005] In view of the above problems, the present application provides a data query method, device, equipment, medium and program product for improving data query accuracy.
[0006] According to a first aspect of the present application, a data query method is provided, comprising: obtaining a natural language query statement input by a user; performing semantic analysis on the natural language query statement to obtain a feature identifier and a query intent, wherein the feature identifier represents a feature object indicated by the natural language query statement, and the query intent represents a query dimension of the feature identifier; generating a structured query item based on the feature identifier and the query intent; querying a structured feature configuration knowledge base based on the structured query item to obtain at least one feature configuration item, wherein the structured feature configuration knowledge base is used to store structured configuration information of the feature; and generating a natural language explanation text based on the at least one feature configuration item.
[0007] According to an embodiment of the present application, the natural language query sentence is semantically parsed to obtain the feature identifier and the query intention, including: performing natural language processing on the natural language query sentence to obtain an initial feature identifier and an initial query intention; determining a target domain dictionary corresponding to the initial feature identifier from a plurality of domain dictionaries; performing semantic enhancement processing on the initial feature identifier and the initial query intention based on the target domain dictionary respectively to obtain the feature identifier and the query intention.
[0008] According to an embodiment of the present application, based on the feature identifier and the query intention, a structured query item is generated, including: determining a feature configuration dimension to be queried based on the query intention; encapsulating the feature identifier and the feature configuration dimension to generate an initial query item; performing format checking on the initial query item to generate a structured query item.
[0009] According to an embodiment of the present application, based on the structured query item, a structured feature configuration knowledge base is queried to obtain at least one feature configuration item, including: determining at least one target data table from the structured feature configuration knowledge base based on the feature identifier in the structured query item; determining at least one feature configuration item from the at least one target data table based on the query intention in the structured query item.
[0010] According to an embodiment of the present application, the method further includes: obtaining definition information, source information and usage information of a plurality of features; performing standardized processing on the definition information, the source information and the usage information of each feature in the plurality of features to obtain a plurality of feature configuration items corresponding to each feature; and storing the plurality of feature configuration items corresponding to each feature in association to construct a structured feature configuration knowledge base.
[0011] According to an embodiment of the present application, the method further includes: in response to a feature configuration change event, obtaining changed feature configuration information; and based on the changed feature configuration information, updating the corresponding feature configuration item in the structured feature configuration knowledge base.
[0012] According to an embodiment of the present application, based on the at least one feature configuration item, a natural language explanation text is generated, including: based on the query intention, determining a target explanation template from a plurality of preset explanation templates; filling the content of the at least one feature configuration item into the target explanation template to generate an initial explanation text; and performing natural language fluency optimization processing on the initial explanation text to obtain the natural language explanation text.
[0013] A second aspect of this application provides a data query apparatus, comprising: an acquisition module for acquiring a natural language query statement input by a user; a parsing module for semantically parsing the natural language query statement to obtain feature identifiers and query intents, wherein the feature identifiers represent the feature objects indicated by the natural language query statement, and the query intents represent the query dimensions of the feature identifiers; a first generation module for generating structured query items based on the feature identifiers and query intents; a query module for querying a structured feature configuration knowledge base based on the structured query items to obtain at least one feature configuration item, wherein the structured feature configuration knowledge base is used to store structured configuration information of features; and a second generation module for generating natural language explanatory text based on at least one feature configuration item.
[0014] A third aspect of this application provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0015] A fourth aspect of this application also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.
[0016] The fifth aspect of this application also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description
[0017] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0018] Figure 1 The illustrations depict application scenarios of data query methods, apparatuses, devices, media, and program products according to embodiments of this application.
[0019] Figure 2 A flowchart illustrating a data query method according to an embodiment of this application is shown schematically.
[0020] Figure 3 A flowchart illustrating a data query method according to another embodiment of this application is shown schematically;
[0021] Figure 4 A schematic diagram illustrating the structure of a data query apparatus according to an embodiment of this application is shown; and
[0022] Figure 5 A block diagram schematically illustrates an electronic device suitable for implementing a data query method according to an embodiment of this application. Detailed Implementation
[0023] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0024] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0025] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0026] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0027] In the technical solution of this application, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant laws, regulations, and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.
[0028] In scenarios involving automated decision-making using personal information, the methods, devices, and systems provided in this application all offer users corresponding entry points for choosing to agree to or reject the automated decision-making results. If the user chooses to reject, the process proceeds to the expert decision-making stage. Here, "automated decision-making" refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests, or economic, health, and credit status through computer programs, and then making a decision. Here, "expert decision-making" refers to the activity of making decisions by personnel who specialize in a particular field, possess specialized experience, knowledge, and skills, and have reached a certain level of professional expertise.
[0029] Figure 1 The illustration shows an application scenario diagram of the data query method, apparatus, device, medium, and program product according to embodiments of this application.
[0030] like Figure 1 As shown, application scenario 100 according to this embodiment may include the financial technology field. Network 104 is used as a medium to provide a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0031] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0032] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0033] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0034] It should be noted that the data query method provided in this application embodiment can generally be executed by server 105. Correspondingly, the data query device provided in this application embodiment can generally be located in server 105. The data query method provided in this application embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the data query device provided in this application embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0035] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0036] The following will be based on Figure 1 The described scene, through Figures 2-5 The data query method according to the embodiments of this application will be described in detail.
[0037] Figure 2 A flowchart illustrating a data query method according to an embodiment of this application is shown.
[0038] like Figure 2 As shown, the data query method of this embodiment includes operations S210 to S250, and the data query method can be executed by the server.
[0039] In operation S210, the user's input natural language query statement is obtained.
[0040] In the embodiments of this application, in scenarios such as financial risk control and recommendation systems, features are used to describe the quantitative attributes of an object (such as a user or transaction) and serve as the basis for decision-making rules. For example, in a financial risk control scenario, a feature might be "the total transaction amount of a user in the past hour" or "the number of times this login address has logged in in the past 24 hours".
[0041] In the embodiments of this application, feature configuration refers to the rules that specify in detail how to obtain and use "features". For example, feature configuration may include feature definition, feature source, and feature usage. Feature definition includes the feature's unique identifier, business description, and calculation logic. Feature source specifies the source, acquisition method, update frequency, etc., of the data required to calculate this feature. Feature usage indicates which business scenarios, decision models, or rules reference this feature.
[0042] In the embodiments of this application, a natural language query statement refers to a question constructed by a user using everyday language (such as Chinese or English), rather than a formatted computer command. Natural language queries are characterized by being unstructured and are designed to express a user's question about a specific feature configuration information.
[0043] For example, a natural language query entered by a user could be, "Please explain the data source and purpose of the feature 'user's nighttime transaction volume'?"
[0044] In operation S220, the natural language query statement is semantically parsed to obtain feature identifiers and query intents. The feature identifiers represent the feature objects indicated by the natural language query statement, and the query intents represent the query dimensions of the feature identifiers.
[0045] In the embodiments of this application, semantic parsing refers to the process of using natural language processing technology to analyze the syntactic structure and lexical meaning of a query statement in order to understand its core purpose. A feature identifier is an identifier that uniquely represents the specific feature object indicated by the natural language query statement; the feature identifier can be a feature name, feature ID, etc. The query intent represents the dimension or aspect that the user wishes to query regarding the feature identifier; the query intent defines the focus of the query.
[0046] In the embodiments of this application, semantic parsing is performed on natural language query statements to obtain feature identifiers and query intents. The system uses semantic parsing technology to extract structured core elements from unstructured query statements, namely, "which feature to search" (feature identifier) and "what information about this feature to search" (query intent).
[0047] For example, after semantic parsing the natural language query "Please explain the data source and purpose of the feature 'user's nighttime transaction amount'?", we can obtain the feature identifier "user's nighttime transaction amount" and the query intent "query source and query purpose".
[0048] In operation S230, structured query items are generated based on feature identifiers and query intent.
[0049] In the embodiments of this application, a structured query term is a standardized, machine-readable query instruction. A structured query term encapsulates the feature identifiers and query intent obtained in the preceding steps into a query request that can be precisely executed in subsequent steps.
[0050] In the embodiments of this application, structured query terms are generated based on feature identifiers and query intent. This step transforms the result of semantic parsing into a precise, machine-process-oriented data structure. The structured query terms provide explicit search criteria for the next step of querying the knowledge base.
[0051] In operation S240, based on the structured query item, the structured feature configuration knowledge base is queried to obtain at least one feature configuration item, wherein the structured feature configuration knowledge base is used to store the structured configuration information of the feature.
[0052] In the embodiments of this application, the structured feature configuration knowledge base is a database used to store structured configuration information of features. The configuration information of each feature is organized and managed according to a predefined model, which facilitates computer-programmed querying.
[0053] In the embodiments of this application, the feature configuration item is a basic information unit stored in the structured feature configuration knowledge base, representing a specific configuration value of a certain dimension of the feature.
[0054] In the embodiments of this application, a structured feature configuration knowledge base is queried based on structured query items to obtain at least one feature configuration item. The system then performs a precise query in the structured feature configuration knowledge base based on the structured query items to retrieve specific configuration information related to the user's question.
[0055] For example, querying a knowledge base using structured query items can return the following feature configuration items: the configuration item "Data Source" corresponding to the "Source" dimension, and the configuration item "Association Scenarios and Association Rules" corresponding to the "Purpose" dimension.
[0056] In operation S250, natural language explanatory text is generated based on at least one feature configuration item.
[0057] In the embodiments of this application, natural language explanation text refers to the answer composed of natural language that is ultimately output to the user. Natural language explanation text is characterized by being unstructured, making it easy for users to read and understand.
[0058] In embodiments of this application, natural language explanatory text is generated based on at least one feature configuration item. The system integrates, organizes, and refines the scattered structured feature configuration items retrieved in the preceding steps, transforming them into a fluent and complete natural language description.
[0059] For example, based on the retrieved feature configuration items, the final explanatory text generated could be "The data for the feature 'user's nighttime transaction amount' comes from real-time transaction streams and is currently mainly used in real-time financial risk control scenarios, and is invoked by risk control rules."
[0060] Through the embodiments of this application, unstructured natural language queries are automatically parsed into structured query instructions and mapped to a structured feature configuration knowledge base to generate unstructured natural language interpretations, thus constructing a complete automated interpretation closed loop. The method of this embodiment significantly lowers the understanding threshold for non-technical personnel, ensures consistency between the interpretation content and online configurations by querying the knowledge base, and effectively integrates fragmented configuration information, thereby greatly improving the efficiency and accuracy of data queries.
[0061] Figure 3 A flowchart illustrating a data query method according to another embodiment of this application is shown.
[0062] like Figure 3 As shown in the embodiments of this application, semantic parsing is performed on natural language query statements to obtain feature identifiers and query intent, including operations S310 to S330. This data query method can be executed by the server.
[0063] In operation S310, natural language processing is performed on the natural language query statement to obtain the initial feature identifier and the initial query intent.
[0064] In the embodiments of this application, natural language processing refers to the technology of using computer algorithms to perform basic analysis on natural language text, which may include word segmentation, part-of-speech tagging, named entity recognition, dependency parsing, etc.
[0065] In the embodiments of this application, the initial feature identifier refers to the feature object identifier initially identified through basic natural language processing techniques, and its accuracy may be limited by a general vocabulary model. The initial query intent refers to the user's query purpose initially determined through basic analysis.
[0066] In the embodiments of this application, natural language processing is performed on the natural language query statement to obtain initial feature identifiers and initial query intent. This step is the preliminary stage of semantic parsing, aiming to extract the prototype of key information from the original query statement. Basic parsing is performed using a general language model to provide a foundation for subsequent refined processing.
[0067] For example, for the query "What is the computational logic of real-time feature X?", after basic natural language processing, we can obtain the initial feature identifier "X" and the initial query intent "computational logic".
[0068] In operation S320, the target domain dictionary corresponding to the initial feature identifier is determined from multiple domain dictionaries.
[0069] In the embodiments of this application, the domain dictionary refers to a pre-set terminology mapping table for a specific business domain (such as financial risk control or streaming computing). The content of the domain dictionary is the correspondence between professional terms and general terms or technical implementations within the domain.
[0070] In the embodiments of this application, the target domain dictionary refers to the domain dictionary that is most relevant to the features currently being queried.
[0071] In embodiments of this application, a target domain dictionary corresponding to the initial feature identifier is determined from multiple domain dictionaries. Based on the initially identified feature identifier, the system determines the possible business domain to which it belongs, thereby selecting the most suitable professional dictionary for subsequent semantic clarification.
[0072] For example, the initial feature identifier X may be associated with the concept of "real-time feature". Based on this, the system selects the target domain dictionary as "real-time computing domain dictionary" from multiple dictionaries such as "real-time computing domain dictionary" and "risk control domain dictionary".
[0073] In operation S330, semantic enhancement processing is performed on the initial feature identifier and the initial query intent based on the target domain dictionary to obtain the feature identifier and the query intent.
[0074] In the embodiments of this application, semantic enhancement processing refers to using the mapping relationship of professional terms in the target domain dictionary to calibrate, deepen or replace the preliminary parsing results in order to improve their accuracy and specificity in a specific domain.
[0075] In the embodiments of this application, semantic enhancement processing is performed on the initial feature identifier and the initial query intent based on the target domain dictionary to obtain the feature identifier and the query intent. Using the selected target domain dictionary, the initial results are transformed, converting vague general terms into precise domain terms, thereby obtaining the final accurate parsing result.
[0076] For example, semantic enhancement is performed using a "real-time computing domain dictionary," which contains mapping relationships such as "real-time feature - streaming computing feature" and "computation logic - feature definition." The process involves enhancing the initial feature identifier "X," combining it with the context to confirm that it represents a streaming computing feature, ultimately obtaining the precise feature identifier "streaming computing feature X." The initial query intent "computation logic" is then enhanced, precisely mapping it to the query dimension query intent "feature definition."
[0077] Through the embodiments of this application, semantic enhancement of the preliminary parsing results is achieved by introducing a domain dictionary, which effectively solves the terminology ambiguity problem of general natural language processing technology in professional fields and significantly improves the accuracy and professionalism of feature identification and query intent recognition.
[0078] In some embodiments, generating structured query items based on feature identifiers and query intent includes: determining the feature configuration dimension to be queried based on the query intent; encapsulating the feature identifiers and feature configuration dimensions to generate initial query items; and performing formatted validation on the initial query items to generate structured query items.
[0079] In the embodiments of this application, the feature configuration dimension refers to the different classifications or aspects of feature configuration information. It is a concretization and structured manifestation of the query intent, corresponding to different information fields or data tables in the structured feature configuration knowledge base.
[0080] In the embodiments of this application, the feature configuration dimensions to be queried are determined based on the query intent. This step maps the user's abstract query intent to specific information categories in the knowledge base that can be directly queried. The system determines which dimensions of configuration information need to be retrieved based on the intent, laying the foundation for constructing an accurate query request.
[0081] For example, if the query intent is "to inquire about the source and purpose", the system will map it to a set of feature configuration dimensions to be queried, such as: ["data source", "update frequency", "related scenarios"].
[0082] In the embodiments of this application, encapsulation refers to the process of combining multiple independent data elements into a complete data structure according to a predetermined format. The initial query item refers to the primary query data structure formed after encapsulation, which contains basic query elements.
[0083] In the embodiments of this application, the feature identifier and feature configuration dimension are encapsulated to generate an initial query item. This step integrates the query target and query scope into a preliminary, complete query request object, ensuring that subsequent query actions can simultaneously carry both "which to query" and "what to query" key information.
[0084] In the embodiments of this application, formatted validation refers to the process of checking and validating the data format and content validity of the initial query item according to predefined rules to ensure its compliance, completeness, and correct parsing by the knowledge base. A structured query item refers to the final query instruction generated after validation, which is formatted correctly and has valid content.
[0085] In the embodiments of this application, the initial query terms are formatted and validated to generate structured query terms. The initial query terms undergo "syntax" and "semantic" checks, such as checking the existence of feature identifiers, whether the configuration dimensions are within the range supported by the knowledge base, and whether the data structure conforms to specifications, thereby generating a reliable and unambiguous query instruction and avoiding subsequent query failures or erroneous results.
[0086] For example, if the initial query item is validated and the feature identifier "user's nighttime transaction amount" is found to be registered in the knowledge base, and the query fields it contains are all valid query fields supported by the knowledge base, then the initial query item is confirmed as the final structured query item.
[0087] Through the embodiments of this application, by encapsulating query elements into standardized structured query items and performing strict formatting validation, the accuracy and reliability of query instructions are ensured, and query failures or result deviations caused by non-standard or incorrect query conditions are eliminated from the process, thereby improving the robustness of the system.
[0088] In some embodiments, querying a structured feature configuration knowledge base based on a structured query item to obtain at least one feature configuration item includes: determining at least one target data table from the structured feature configuration knowledge base based on feature identifiers in the structured query item; and determining at least one feature configuration item from the at least one target data table based on the query intent in the structured query item.
[0089] In the embodiments of this application, the target data table refers to a data table in a structured feature configuration knowledge base that stores configuration information associated with a specific feature identifier. The knowledge base may include multiple data tables, which store information of different dimensions such as feature definition, source, and usage.
[0090] In the embodiments of this application, at least one target data table is determined from a structured feature configuration knowledge base based on the feature identifier in the structured query item. The system quickly locates the specific table storing information related to that feature among numerous data tables in the knowledge base, based on the explicitly specified feature identifier in the structured query item, thus narrowing the search scope for subsequent extraction of specific configuration items.
[0091] For example, the feature identifier in a structured query item is "F001". The system queries the metadata index of the knowledge base to determine the feature definition table storing the basic information of this feature (such as name and description) and the feature source table storing its data connection information as the target data tables for this query.
[0092] In the embodiments of this application, determining the feature configuration item means filtering and extracting specific configuration information records from the located target data table based on the information dimension corresponding to the query intent.
[0093] In embodiments of this application, at least one feature configuration item is determined from at least one target data table based on the query intent in the structured query item. The system accurately filters out relevant fields or records from the located target data table according to the query intent (i.e., the information dimensions the user cares about) in the structured query item, obtaining the specific configuration information required by the end user.
[0094] For example, if the query intent in a structured query item is "query source", the system will extract the values of fields such as data source address and update frequency related to feature "F001" from the identified feature source table, and return these values as the query result "feature configuration items".
[0095] Through the embodiments of this application, the query method of first locating the target data table and then extracting configuration items according to the intent achieves precision and efficiency in the query process, avoids full table scans, ensures that the returned configuration information is directly related to the user's query intent, and improves query efficiency and the accuracy of results.
[0096] In some embodiments, the method further includes: obtaining definition information, source information, and usage information of multiple features; standardizing the definition information, source information, and usage information of each feature among the multiple features to obtain multiple feature configuration items corresponding to each feature; and storing the multiple feature configuration items corresponding to each feature in association to construct a structured feature configuration knowledge base.
[0097] In the embodiments of this application, definition information refers to information describing the attributes of the feature itself, and may include, but is not limited to, the feature's unique identifier, feature name, business description, and calculation logic. Source information refers to information describing the source of the feature data, and may include, but is not limited to, the data source address, data acquisition method, and data update frequency. Usage information refers to information describing the application scenario of the feature, and usage information may include, but is not limited to, the associated business scenario, decision model, or rule.
[0098] In the embodiments of this application, definition information, source information, and usage information of multiple features are obtained. This step is the data acquisition stage for knowledge base construction. The system collects raw configuration information about multiple features from multiple dispersed data sources such as feature management platforms, metadata systems, and configuration files, preparing raw materials for subsequent integration processing.
[0099] For example, obtain the raw information of the feature "User's Nighttime Transaction Amount" from different systems. Obtain its definition information from the feature management platform: Feature ID: F001, Feature Name: User's Nighttime Transaction Amount. Obtain its source information from the data source system: Data Source: XX, Update Frequency: 5 seconds. Obtain its usage information from the model repository: Associated Scenario: Financial Risk Control Scenario, Association Rule: rule_123.
[0100] In the embodiments of this application, standardization processing refers to the process of cleaning, converting, and formatting information from different sources and with varying formats according to a predefined unified data specification. A feature configuration item refers to the smallest configuration information unit that has been standardized, has a unified format, and a clear meaning.
[0101] In the embodiments of this application, the definition information, source information, and usage information of each of the multiple features are standardized to obtain multiple feature configuration items corresponding to each feature. This step is the core of solving the problems of information fragmentation and inconsistent formats. By standardizing the collected raw information, ambiguity is eliminated, ensuring that all information can be stored and managed with the same standard and structure.
[0102] For example, the raw information obtained above is standardized. The descriptions of "data sources" from different sources are unified into two standard fields: data source type and data source address. The "update frequency" is standardized to "seconds". Standardized feature configuration items are generated for feature F001.
[0103] In the embodiments of this application, associated storage refers to the operation of logically or physically associating multiple feature configuration items belonging to the same feature based on the unique identifier of the feature, and persistently saving them to the database.
[0104] In the embodiments of this application, multiple feature configuration items corresponding to each feature are associated and stored to construct a structured feature configuration knowledge base. All standardized configuration items for the same feature are linked together using feature identifiers to form a complete feature configuration file, which is then stored in a database, thereby constructing a unified and integrated knowledge base.
[0105] For example, all standardized feature configuration items (definition, source, usage) of feature F001 are associated with its feature ID F001 and stored as a complete record in a specific data table of the knowledge base.
[0106] Through the embodiments of this application, by standardizing processing and associating storage, scattered and heterogeneous feature configuration information is integrated into a unified and well-organized structured knowledge base, which solves the problem of information fragmentation and provides a high-quality data foundation for generating accurate and complete explanatory text.
[0107] In some embodiments, the method further includes: in response to a feature configuration change event, obtaining the changed feature configuration information; and updating the corresponding feature configuration item in the structured feature configuration knowledge base based on the changed feature configuration information.
[0108] In the embodiments of this application, a feature configuration change event refers to a notification signal automatically generated and issued by the system when the definition, source, or usage information of a feature is modified, added, or deleted in the source system such as the feature management platform, data source system, or model library.
[0109] In the embodiments of this application, the modified feature configuration information refers to the latest version, complete and effective configuration data content of the feature that triggered the change event.
[0110] In the embodiments of this application, in response to a feature configuration change event, the changed feature configuration information is obtained. This step is the triggering and data collection stage to maintain the real-time nature of the knowledge base. The system captures configuration change events from the upstream system in real time through a listening mechanism and actively obtains the latest and most accurate configuration data to provide a basis for subsequent update operations.
[0111] For example, the data source A for the feature "User's Nighttime Transaction Amount" is changed to B. After this modification is submitted and takes effect in the feature management platform, the platform will publish a feature configuration change event. Upon receiving this event, this system immediately requests and retrieves the feature configuration information after the change from the platform, where the data source field has been updated to B.
[0112] In embodiments of this application, updating refers to the operation of replacing old, outdated data in the database with new, accurate data to maintain consistency between the two.
[0113] In the embodiments of this application, the corresponding feature configuration items in the structured feature configuration knowledge base are updated based on the changed feature configuration information. The system will accurately locate the corresponding record in the structured feature configuration knowledge base based on its feature identifier and complete the data overwrite to ensure that the knowledge base content is consistent with the actual online configuration status.
[0114] For example, based on the feature identifier F001 in the change information, the system locates all configuration items for that feature in the structured feature configuration knowledge base and updates the value of the feature configuration item, which is the data source address, from A to B.
[0115] Through the embodiments of this application, by listening to change events and updating the knowledge base in real time, it is ensured that the data source on which the feature configuration interpretation depends is always consistent with the online system, thereby solving the problem of outdated static documents and ensuring the accuracy and timeliness of the interpretation content.
[0116] In some embodiments, generating natural language explanation text based on at least one feature configuration item includes: determining a target explanation template from a plurality of preset explanation templates based on query intent; filling the target explanation template with the content of at least one feature configuration item to generate initial explanation text; and performing natural language fluency optimization processing on the initial explanation text to obtain natural language explanation text.
[0117] In the embodiments of this application, the interpretation template refers to a predefined natural language text skeleton containing a fixed narrative framework and variable placeholders, used to standardize the response format for different query intents. The target interpretation template refers to the specific template that best matches the current user's query intent.
[0118] In the embodiments of this application, a target explanation template is determined from a plurality of preset explanation templates based on the query intent. The system selects the most suitable text framework from the template library according to the explanation dimension corresponding to the query intent (such as query definition, query source, comprehensive explanation, etc.).
[0119] For example, if the query intent is to inquire about the source and purpose, the system will select a target explanation template from the template library that is suitable for explaining the "source" and "use" of the feature. Its content may be: "The data of feature [feature name] comes from [data source], the update frequency is [frequency], and it is mainly used for [use scenario]".
[0120] In the embodiments of this application, "filling" refers to the operation of replacing the value of a specific feature configuration item with the corresponding variable placeholder in the target explanation template. The initial explanation text refers to the preliminary explanation text obtained after the variable replacement is completed, which contains specific information but may be written in a somewhat awkward style.
[0121] In embodiments of this application, the content of at least one feature configuration item is filled into the target explanation template to generate initial explanation text. Based on the mapping relationship, the system fills the values of the feature configuration items one by one into the corresponding positions of the template, forming a draft text containing accurate factual statements.
[0122] For example, fill the above template with the following feature configuration items: Feature Name: User's Nighttime Transaction Amount, Data Source A, Frequency: 5 seconds, and Use Case: "Financial Risk Control Scenario". The generated initial explanation text will be: "The data for the feature user's nighttime transaction amount comes from A, and the update frequency is 5 seconds. It is mainly used for financial risk control scenarios."
[0123] In the embodiments of this application, natural language fluency optimization processing refers to refining the initial explanatory text, including adjusting wording, sentence structure, and adding conjunctions, to make it more in line with human language habits. The natural language explanatory text refers to the final output result obtained after optimization, characterized by fluency, ease of understanding, and conformity to natural language expression habits.
[0124] In the embodiments of this application, the initial explanatory text undergoes natural language fluency optimization processing to obtain the natural language explanatory text. This step is crucial for improving the readability of the explanatory text and the user experience. Post-processing the mechanically generated text draft eliminates any stiffness, making the final response more natural and fluent.
[0125] For example, the initial explanatory text can be optimized by changing "mainly used for" to "currently applied to" and optimizing the sentence structure to obtain the final natural language explanatory text: "The data of feature 'user's nighttime transaction amount' is obtained from A in real time and updated every 5 seconds. It is currently applied to financial risk control scenarios."
[0126] Through the embodiments of this application, rigid structured data is transformed into standardized and fluent natural language narratives by template generation and fluency optimization, which significantly reduces the understanding threshold for non-technical personnel and ensures the professionalism and readability of the explained content.
[0127] Based on the above data query method, this application also provides a data query device. The following will combine... Figure 4 The device is described in detail.
[0128] Figure 4 A schematic block diagram of a data query apparatus according to an embodiment of this application is shown.
[0129] like Figure 4 As shown, the data query device 400 of this embodiment includes an acquisition module 410, a parsing module 420, a first generation module 430, a query module 440, and a second generation module 450.
[0130] The acquisition module 410 is used to acquire the natural language query statement input by the user. In one embodiment, the acquisition module 410 can be used to perform the operation S210 described above, which will not be repeated here.
[0131] The parsing module 420 is used to perform semantic parsing on the natural language query statement to obtain feature identifiers and query intents. The feature identifiers represent the feature objects indicated by the natural language query statement, and the query intents represent the query dimensions based on the feature identifiers. In one embodiment, the parsing module 420 can be used to perform the operation S220 described above, which will not be repeated here.
[0132] The first generation module 430 is used to generate structured query items based on feature identifiers and query intent. In one embodiment, the first generation module 430 can be used to perform the operation S230 described above, which will not be repeated here.
[0133] The query module 440 is used to query the structured feature configuration knowledge base based on the structured query item to obtain at least one feature configuration item, wherein the structured feature configuration knowledge base is used to store the structured configuration information of the feature. In one embodiment, the query module 440 can be used to perform the operation S240 described above, which will not be repeated here.
[0134] The second generation module 450 is used to generate natural language interpretation text based on at least one feature configuration item. In one embodiment, the second generation module 450 can be used to perform the operation S250 described above, which will not be repeated here.
[0135] According to embodiments of this application, any multiple modules among the acquisition module 410, parsing module 420, first generation module 430, query module 440, and second generation module 450 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this application, at least one of the acquisition module 410, parsing module 420, first generation module 430, query module 440, and second generation module 450 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuitry, or implemented in software, hardware, or firmware, or in any appropriate combination of any of these three implementation methods. Alternatively, at least one of the acquisition module 410, parsing module 420, first generation module 430, query module 440 and second generation module 450 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0136] In some embodiments, the parsing module includes: a first processing submodule, configured to perform natural language processing on the natural language query statement to obtain an initial feature identifier and an initial query intent; a first determining submodule, configured to determine a target domain dictionary corresponding to the initial feature identifier from multiple domain dictionaries; and a second processing submodule, configured to perform semantic enhancement processing on the initial feature identifier and the initial query intent based on the target domain dictionary to obtain the feature identifier and the query intent.
[0137] In some embodiments, the first generation module includes: a second determining submodule, configured to determine the feature configuration dimension to be queried based on the query intent; a third processing submodule, configured to encapsulate the feature identifier and the feature configuration dimension to generate an initial query item; and a first generation submodule, configured to perform formatting validation on the initial query item to generate a structured query item.
[0138] In some embodiments, the query module includes: a third determining submodule, configured to determine at least one target data table from a structured feature configuration knowledge base based on feature identifiers in structured query items; and a fourth determining submodule, configured to determine at least one feature configuration item from at least one target data table based on query intent in structured query items.
[0139] In some embodiments, the apparatus further includes: a first processing module for acquiring definition information, source information, and usage information of multiple features; a second processing module for standardizing the definition information, source information, and usage information of each of the multiple features to obtain multiple feature configuration items corresponding to each feature; and a third processing module for associating and storing the multiple feature configuration items corresponding to each feature to construct a structured feature configuration knowledge base.
[0140] In some embodiments, the apparatus further includes: a fourth processing module, configured to obtain modified feature configuration information in response to a feature configuration change event; and a fifth processing module, configured to update the corresponding feature configuration item in the structured feature configuration knowledge base based on the modified feature configuration information.
[0141] In some embodiments, the second generation module includes: a fifth determining submodule, configured to determine a target explanation template from a plurality of preset explanation templates based on the query intent; a second generation submodule, configured to fill the target explanation template with the content of at least one feature configuration item to generate initial explanation text; and a fourth processing submodule, configured to perform natural language fluency optimization processing on the initial explanation text to obtain natural language explanation text.
[0142] Figure 5 A block diagram schematically illustrates an electronic device suitable for implementing a data query method according to an embodiment of this application.
[0143] like Figure 5 As shown, an electronic device 500 according to an embodiment of this application includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage portion 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.
[0144] RAM 503 stores various programs and data required for the operation of electronic device 500. Processor 501, ROM 502, and RAM 503 are interconnected via bus 504. Processor 501 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 502 and / or RAM 503. It should be noted that programs may also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in one or more memories.
[0145] According to embodiments of this application, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to a bus 504. The electronic device 500 may also include one or more of the following components connected to the input / output (I / O) interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 510 as needed so that computer programs read from it can be installed into the storage section 508 as needed.
[0146] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0147] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 502 and / or RAM 503 and / or one or more memories other than ROM 502 and RAM 503 described above.
[0148] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the data query method provided in the embodiments of this application.
[0149] When the computer program is executed by the processor 501, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0150] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 509, and / or installed from a removable medium 511. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0151] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by processor 501, it performs the functions defined in the system of this application embodiment. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0152] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0153] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0154] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A data query method, characterized in that, The method includes: Obtain the natural language query statement input by the user; The natural language query statement is semantically parsed to obtain feature identifiers and query intents, wherein the feature identifiers represent the feature objects indicated by the natural language query statement, and the query intents represent the query dimensions of the feature identifiers; Based on the feature identifier and the query intent, a structured query item is generated; Based on the structured query item, a structured feature configuration knowledge base is queried to obtain at least one feature configuration item, wherein the structured feature configuration knowledge base is used to store the structured configuration information of the feature; Based on the at least one feature configuration item, a natural language explanation text is generated.
2. The method according to claim 1, characterized in that, The semantic parsing of the natural language query statement to obtain feature identifiers and query intent includes: Natural language processing is performed on the natural language query statement to obtain initial feature identifiers and initial query intent; Determine the target domain dictionary corresponding to the initial feature identifier from multiple domain dictionaries; Based on the target domain dictionary, semantic enhancement processing is performed on the initial feature identifier and the initial query intent to obtain the feature identifier and the query intent.
3. The method according to claim 1, characterized in that, The step of generating structured query items based on the feature identifier and the query intent includes: Based on the query intent, determine the feature configuration dimensions to be queried; The feature identifier and the feature configuration dimension are encapsulated to generate an initial query item; The initial query item is formatted and validated to generate the structured query item.
4. The method according to claim 1, characterized in that, The step of querying the structured feature configuration knowledge base based on the structured query item to obtain at least one feature configuration item includes: Based on the feature identifier in the structured query item, at least one target data table is determined from the structured feature configuration knowledge base; Based on the query intent in the structured query item, the at least one feature configuration item is determined from the at least one target data table.
5. The method according to claim 4, characterized in that, The method further includes: Obtain definition information, source information, and usage information for multiple features; The definition information, source information, and usage information of each of the plurality of features are standardized to obtain a plurality of feature configuration items corresponding to each feature; The multiple feature configuration items corresponding to each feature are associated and stored to construct the structured feature configuration knowledge base.
6. The method according to claim 5, characterized in that, The method further includes: In response to a feature configuration change event, obtain the changed feature configuration information; Based on the changed feature configuration information, update the corresponding feature configuration items in the structured feature configuration knowledge base.
7. The method according to any one of claims 1 to 6, characterized in that, The generation of natural language explanation text based on the at least one feature configuration item includes: Based on the query intent, the target explanation template is determined from a set of preset explanation templates; Fill the target explanation template with the content of the at least one feature configuration item to generate the initial explanation text; The initial explanatory text is subjected to natural language fluency optimization processing to obtain the natural language explanatory text.
8. A data query device, characterized in that, The device includes: The acquisition module is used to acquire the natural language query statement input by the user; The parsing module is used to perform semantic parsing on the natural language query statement to obtain feature identifiers and query intents, wherein the feature identifiers represent the feature objects indicated by the natural language query statement, and the query intents represent the query dimensions of the feature identifiers; The first generation module is used to generate structured query items based on the feature identifier and the query intent; The query module is used to query the structured feature configuration knowledge base based on the structured query item to obtain at least one feature configuration item, wherein the structured feature configuration knowledge base is used to store the structured configuration information of the feature; The second generation module is used to generate natural language explanation text based on the at least one feature configuration item.
9. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.