Data query method and device for travel SaaS platform, electronic equipment and storage medium
By constructing a knowledge base and business rule templates for the travel industry, the accuracy problem of data query in existing travel SaaS platforms has been solved. This enables accurate identification of user intent and accurate generation of query statements, thereby improving the accuracy and efficiency of data query.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING BAILONG MAYUN TECH CO LTD
- Filing Date
- 2026-01-30
- Publication Date
- 2026-06-05
AI Technical Summary
Existing SaaS platforms lack an understanding of the terminology and complex business logic specific to the travel industry when querying business data, leading to parsing failures or the generation of incorrect SQL query statements, which in turn results in data query failures or data that does not meet user needs.
By building a knowledge base for the travel industry, configuring entity dictionaries and business rule templates, the system can accurately identify entities in user input, generate accurate query statements, and improve the accuracy of data queries.
It achieves accurate identification of user intent and accurate generation of query statements, ensuring that the target data returned is more in line with user needs, and improving the accuracy and efficiency of data query.
Smart Images

Figure CN122152980A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of ride-hailing data processing technology, and in particular to a data query method, apparatus, electronic device and storage medium for ride-hailing SaaS platforms. Background Technology
[0002] Currently, SaaS platforms use general-purpose natural language to SQL query tools to retrieve business data. These tools typically provide an input box where users enter natural language statements such as "show last month's sales figures," and the system attempts to convert them into SQL (Structured Query Language) and return the results.
[0003] This data query method uses a general model to convert natural language into query statements. However, it lacks an understanding of the terminology and complex business logic specific to the travel industry, which can lead to parsing failures or the generation of incorrect SQL query statements. Consequently, data queries may fail or the retrieved data may not meet the user's needs. Summary of the Invention
[0004] Therefore, it is necessary to provide a data query method, device, electronic device, and storage medium for travel SaaS platforms to address the aforementioned technical issues. This method can accurately identify entities in user input content through a proprietary travel domain knowledge base, thereby accurately identifying the user's search intent. Furthermore, when generating query statements based on the identified entities, the generated query statements are more accurate, thus improving the accuracy of data queries.
[0005] According to a first aspect of certain exemplary embodiments of this application, a data query method for a travel SaaS platform is provided, comprising: receiving input content from a front-end user of the travel SaaS platform; performing semantic parsing on the input content to obtain semantic text; identifying text entities in the semantic text; obtaining one or more target entities matching the text entities from a travel domain knowledge base, wherein the travel domain knowledge base is configured with an entity dictionary, and the entity dictionary is configured with geographical entities, business entities, and time entities; determining the user intent based on the one or more target entities; if the user intent is a data query, identifying a predefined business rule template based on the user intent; generating a query statement based on the one or more target entities and the predefined business rule template; and sending the query statement to a target database; receiving target data returned by the target database; and feeding back the target data to the front-end user.
[0006] In one example of this implementation, the travel domain knowledge base is configured with an indicator dictionary, which contains multiple business indicators and calculation rules for each business indicator. The process of generating a query statement based on one or more target entities and predefined business rule templates includes: identifying target business indicators in the predefined business rule templates; reading the calculation rules for the target business indicators from the indicator dictionary of the travel domain knowledge base; and generating a query statement based on the calculation rules for the target business indicators, one or more target entities, and the business rule templates.
[0007] In one example of this implementation, a query statement is generated based on the calculation rules of the target business metric, one or more target entities, and a business rule template. This includes: obtaining relevant business data of the target business metric from the business database based on the calculation rules and one or more target entities, and obtaining the metric data of the target business metric based on the obtained relevant business data and the calculation rules; obtaining the entity data of each target entity from the business database; mapping the metric data of the target business metric and the entity data of each target entity to the business rule template; and generating a query statement based on the mapped business rule template.
[0008] In one example of this implementation, multiple target entities include geographic entities, business entities, and time entities. The target business metric includes a response rate, calculated using the ratio of responded orders to total orders. The process involves: retrieving relevant business data for the target business metric from a business database based on the calculation rules and one or more target entities; and obtaining the target business metric's indicator data based on the retrieved business data and the calculation rules. This includes: retrieving geographic data, order data, and time data from the business database based on the response rate calculation rules and in conjunction with the geographic entities, business entities, and time entities. The relevant business data for the target business metric includes geographic data, order data, and time data, with order data determined based on geographic data and time data. The response rate indicator data is then calculated based on the retrieved order data. Finally, the indicator data for the target business metric and the entity data of each target entity are mapped to a business rule template, including: mapping the geographic data, time data, and the response rate indicator data to corresponding positions in the business rule template.
[0009] In one example of this implementation, receiving input from a front-end user of the travel SaaS platform includes: receiving voice content and / or text content input by the front-end user of the travel SaaS platform; performing semantic parsing on the input content to obtain semantic text, including: when the input content includes voice content, extracting acoustic features from the voice content using a third-party automatic speech recognition engine to obtain preliminary text, correcting errors in the preliminary text based on context to obtain corrected text, extracting structured semantic information from the corrected text, and obtaining semantic text based on the structured semantic information; when the input content includes text content, extracting structured semantic information from the text content, and obtaining semantic text based on the structured semantic information.
[0010] In one example of this implementation, a data query method for a travel SaaS platform further includes: identifying the data query type of the query statement; if the data query type is a predefined common query type, caching the target data and configuring the cache time of the target data; and when the content of the query statement input by the front-end user is received again within the cache time, retrieving the target data from the cache and providing feedback.
[0011] In one example of this implementation, the target data is fed back to the front-end user, including: identifying the data structure of the target data; if the data structure includes a time series, the target data is rendered to the front-end using a line chart rendering method, and the data is rendered as an interactive chart and embedded in the front-end interface; if the data structure includes a geographical distribution, the target data is rendered to the front-end using a map rendering method, and the data is rendered as an interactive chart and embedded in the front-end interface; if the data structure includes a proportional relationship, the target data is rendered to the front-end using a pie chart rendering method, and the data is rendered as an interactive chart and embedded in the front-end interface.
[0012] According to a second aspect of certain exemplary embodiments of this application, a data query apparatus for a travel SaaS platform is provided, comprising: a parsing module, configured to receive input content from a front-end user of the travel SaaS platform, perform semantic parsing on the input content to obtain semantic text; an acquisition module, configured to identify text entities in the semantic text, and acquire one or more target entities matching the text entities from a travel domain knowledge base, wherein the travel domain knowledge base is configured with an entity dictionary, and the entity dictionary is configured with geographic entities, business entities, and time entities; a determination module, configured to determine the user intent based on one or more target entities; a generation and sending module, configured to, if the user intent is a data query, identify a predefined business rule template based on the user intent, generate a query statement based on one or more target entities and the predefined business rule template, and send the query statement to a target database; and a data feedback module, configured to receive target data returned by the target database and feed back the target data to the front-end user.
[0013] According to a third aspect of certain exemplary embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above methods.
[0014] According to a fourth aspect of certain exemplary embodiments of this application, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.
[0015] The aforementioned data query method, apparatus, electronic device, and storage medium for a travel SaaS platform include: receiving input content from a front-end user of the travel SaaS platform; performing semantic parsing on the input content to obtain semantic text; identifying text entities in the semantic text; obtaining one or more target entities matching the text entities from a travel domain knowledge base, wherein the travel domain knowledge base is configured with an entity dictionary, which includes geographical entities, business entities, and time entities; determining the user intent based on the one or more target entities; if the user intent is a data query, identifying a predefined business rule template based on the user intent; generating a query statement based on the one or more target entities and the predefined business rule template; and sending the query statement to a target database; receiving the target data returned by the target database; and feeding back the target data to the front-end user. Therefore, the entity dictionary configured in the travel domain knowledge base can accurately identify target entities in the user's input content, thereby improving the accuracy of intent recognition when determining the user's intent based on the identified target entities. Furthermore, when generating a query statement based on the identified target entities and business rule templates, the accuracy of the query statement can be improved, making the target data returned when querying the target database based on the query statement more consistent with the front-end user's query needs. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating a data query method for a travel SaaS platform, as shown in some exemplary embodiments of this application. Figure 2 This is a schematic diagram illustrating the overall process of a data query method for a travel SaaS platform, as shown in some exemplary embodiments of this application. Figure 3 This is a structural block diagram of a data query device for a travel SaaS platform, as shown in some other exemplary embodiments of this application. Figure 4 This is a diagram of the internal structure of an electronic device in some other exemplary embodiments of this application. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0018] The following detailed descriptions are provided to aid the reader in gaining a comprehensive understanding of the methods, apparatus, electronic devices, storage media, and / or computer program products described herein. However, after understanding the disclosure of this application, various changes, modifications, and equivalents of the methods, apparatus, storage media, and / or computer program products described herein will become apparent. For example, the order of operations described herein is merely illustrative and is not limited to those orders set forth herein, but may be changed as will become clear after understanding the disclosure of this application, except for operations that must occur in a specific order. Furthermore, for clarity and conciseness, descriptions of features known in the art may be omitted.
[0019] The features described herein may be implemented in different forms and should not be construed as limited to the examples described herein. Rather, the examples described herein are provided only to illustrate some of the many feasible ways of implementing the methods, electronic devices, and / or storage media described herein, many of which will become clear upon understanding this application.
[0020] The terminology used herein is for the purpose of describing various examples only and is not intended to limit disclosure. Unless the context clearly indicates otherwise, the singular form is intended to include the plural form as well. The terms “comprising,” “including,” and “having” indicate the presence of the described features, quantities, operations, components, elements, and / or combinations thereof, but do not exclude the presence or addition of one or more other features, quantities, operations, components, elements, and / or combinations thereof. Unless otherwise stated, “ / ” means “or,” for example, A / B can mean A or B; “and / or” in the text is merely a description of the relationship between related objects, indicating that three relationships can exist, for example, A and / or B can mean: A alone, A and B simultaneously, and B alone. Furthermore, in the description of embodiments of the invention, “multiple” means two or more.
[0021] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains upon understanding this application. Unless expressly defined herein, terms (such as those defined in a general dictionary) shall be interpreted as having a meaning consistent with their meaning in the context of the relevant field and in this application, and shall not be interpreted in an idealized or overly formalistic manner.
[0022] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in some of the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0023] Furthermore, in the description of the examples, detailed descriptions of well-known related structures or functions will be omitted when it is believed that such detailed descriptions would lead to a vague interpretation of this application.
[0024] In the following description, embodiments will be described in detail with reference to the accompanying drawings. However, embodiments may be implemented in various forms and are not limited to the examples described herein.
[0025] Definitions of abbreviations and key terms: NLP: Natural Language Processing. It is a branch of artificial intelligence that aims to enable computers to understand, interpret, and generate human language.
[0026] ASR: Automatic Speech Recognition. A technology that converts human speech into text.
[0027] SQL: Structured Query Language. A standard language used for managing and querying relational databases.
[0028] SaaS: Software as a Service. A model for delivering software applications via the internet.
[0029] Middle and back-office systems: These refer to internal systems that are not user-facing and are used by enterprises for operations, management, data analysis, and decision support.
[0030] Domain Knowledge Graph: A semantic knowledge base based on graph structure, used to describe the collection of concepts (such as "orders" and "drivers"), entities (such as "Pudong Airport") and the relationships between them in the travel domain.
[0031] In some exemplary embodiments of this application, a data query method for a travel SaaS platform is provided. For example... Figure 1 The present invention provides a data query method for a travel SaaS platform, comprising the following steps: Step S101: Receive input from the front-end user of the travel SaaS platform, perform semantic parsing on the input to obtain semantic text.
[0032] In this embodiment, the front end of the travel SaaS platform provides a voice input button, integrating a third-party ASR (Automatic Speech Recognition) engine to convert speech streams into text in real time. Simultaneously, the front end of the travel SaaS platform provides an intelligent text input box, supporting auto-completion and example suggestions. When receiving a user's data query request, the front end sends the user's input to the back end NLP (Natural Language Processing) engine. The user's input may include speech and / or text content.
[0033] Furthermore, data query requests from front-end users can be rewritten to avoid inefficient queries and thus performance bottlenecks. These data query requests are used to request target data based on the input from the front-end user. Specifically, query timeout limits and resource limits can be set for data query requests to prevent a single slow query from consuming too many resources and causing overall service lag.
[0034] In one example of this embodiment, receiving input from the front-end user of the travel SaaS platform includes: receiving voice content and / or text content input by the front-end user of the travel SaaS platform; wherein, performing semantic parsing on the input content to obtain semantic text includes: when the input content includes voice content, extracting acoustic features from the voice content using a third-party automatic speech recognition engine to obtain preliminary text, correcting errors in the preliminary text based on context to obtain corrected text, extracting structured semantic information from the corrected text, and obtaining semantic text based on the structured semantic information; when the input content includes text content, extracting structured semantic information from the text content, and obtaining semantic text based on the structured semantic information.
[0035] Specifically, when the input content is speech, the speech content is processed as follows: The user clicks the "Voice Input" button on the interface to activate the speech acquisition function, and the backend receives the user's speech stream. The system-integrated third-party ASR engine extracts acoustic features and matches language models to the real-time speech stream, converting the speech content into corresponding preliminary text. The converted preliminary text is automatically filled into the input box, and finally, the frontend sends the preliminary text to the backend Natural Language Understanding (NLP) engine for semantic parsing.
[0036] When the input is text, the text is processed as follows: the user manually enters the query text directly into the "intelligent text input box." During the input process, the system combines the entity dictionary and indicator dictionary from the domain knowledge base to match keywords in real time, automatically completing possible entities, business indicators, or complete sentence structures to improve input efficiency. After the user completes the input, the input box sends the query request in text form to the backend NLP engine for subsequent semantic parsing and SQL generation.
[0037] Step S102: Identify text entities in semantic text, and obtain one or more target entities that match the text entities from the travel domain knowledge base. The travel domain knowledge base is configured with an entity dictionary, which is configured with geographical entities, business entities, and time entities.
[0038] In this embodiment, a natural language understanding engine is used to identify text entities in semantic text and retrieve one or more target entities that match the text entities from a travel domain knowledge base. A domain knowledge base is configured, with a built-in travel domain knowledge base. The built-in travel domain knowledge base includes an entity dictionary and a metric dictionary. The entity dictionary defines geographical entities (airports, train stations, business districts), business entities (orders, drivers, vehicles), and time entities (holidays, peak hours), etc. The metric dictionary defines business metrics such as "response rate," "completion rate," and "average duration" and their calculation rules (e.g., response rate = number of responded orders / total number of orders).
[0039] Step S103: Determine the user intent based on one or more target entities.
[0040] In this embodiment, a NER model is used to identify one or more target entities in the travel domain from the query text and link them to standard concepts in the domain knowledge base and specific fields in the business database. Then, based on one or more target entities, it is determined whether the user's intent is to query data, perform an operation, or ask a question.
[0041] Step S104: If the user's intent is a data query, then the predefined business rule template is identified based on the user's intent, a query statement is generated based on one or more target entities and the predefined business rule template, and the query statement is sent to the target database.
[0042] In this embodiment, if the user intent is to query data, a well-structured SQL query statement is generated based on one or more identified target entities and the user intent, combined with a predefined business rule template. The SQL query statement is then submitted to a data warehouse (such as ClickHouse) or a business database to perform the data query operation.
[0043] In one example of this implementation, the travel domain knowledge base is configured with an indicator dictionary, which contains multiple business indicators and calculation rules for each business indicator. Step S104 above, which generates a query statement based on one or more target entities and a predefined business rule template, includes: identifying the target business indicators in the predefined business rule template; reading the calculation rules of the target business indicators from the indicator dictionary of the travel domain knowledge base; and generating a query statement based on the calculation rules of the target business indicators, one or more target entities, and the business rule template.
[0044] The process of generating a query statement based on the calculation rules of the target business indicators and one or more target entities and business rule templates includes: obtaining relevant business data of the target business indicators from the business database according to the calculation rules and one or more target entities, and obtaining indicator data of the target business indicators according to the obtained relevant business data and calculation rules; obtaining entity data of each target entity from the business database; mapping the indicator data of the target business indicators and the entity data of each target entity to the business rule template; and generating a query statement based on the mapped business rule template.
[0045] Furthermore, the multiple target entities include geographic entities, business entities, and time entities. The target business metric includes the response rate, and the calculation rule includes determining the response rate by the ratio of the number of responded orders to the total number of orders. The process involves obtaining relevant business data for the target business metric from the business database based on the calculation rule and one or more target entities, and then obtaining the metric data for the target business metric based on the obtained relevant business data and the calculation rule. This includes: obtaining geographic data, order data, and time data from the business database based on the response rate calculation rule and in conjunction with geographic entities, business entities, and time entities, wherein the relevant business data for the target business metric includes geographic data, order data, and time data, and the order data is determined based on the geographic data and time data; and calculating the response rate metric data based on the obtained order data. This involves mapping the target business metrics data and the entity data of each target entity to the business rule template, including mapping geographic data, time data, and response rate metrics data to the corresponding locations in the business rule template.
[0046] For example, a predefined business rule template: Query the target business metrics for a [geographic entity] within the [time entity] range for a [business entity]. The metrics are calculated according to [calculation rules], and the result is [metric data]. The travel domain knowledge base's metric dictionary pre-stores the calculation rules for "response rate." That is, response rate = (number of responded orders ÷ total number of orders) × 100%, and this metric needs to be calculated by associating order data with three dimensions: geographic, time, and business type. The business database includes: an order core table, a geographic information table, a business type table, and a time dimension table, all linked by a unique code. Specifically: The aforementioned preset business rule template is parsed, and the target business indicator to be filled in the template is identified as the response rate. Based on the identified response rate, its predefined calculation rule is accurately retrieved from the indicator dictionary of the travel domain knowledge base: Response rate = (Number of responded orders ÷ Total number of orders) × 100%. At the same time, the supplementary instructions of the indicator dictionary are obtained: Geographic, time, and business entity dimension data must be synchronously associated during the calculation.
[0047] Based on the calculation rule of Response Rate = Number of Responding Orders ÷ Total Number of Orders × 100%, and considering three target entities—geographic entity, business entity, and time entity—relevant business data is filtered and obtained from the business database by dimension. Order data is precisely limited based on geographic and time data. The metric data for calculating the response rate is as follows: Based on the above order data and calculation rule, the response rate is calculated.
[0048] Retrieve entity data for each target entity from the business database. Map geographic data, time data, and response rate metrics to corresponding placeholders in the predefined business rule template, creating structured template content. Based on this mapped structured template content, generate query statements that fit the actual usage scenarios in the travel industry.
[0049] Step S105: Receive the target data returned by the target database and provide feedback of the target data to the front-end user.
[0050] In this embodiment, the target data returned by the target database is fed back to the front-end user in response to the front-end user's data query request.
[0051] In one example of this embodiment, step S105 above, feeding back target data to the front-end user, includes: identifying the data structure of the target data; if the data structure includes a time series, then rendering the target data to the front-end using a line chart rendering method, and rendering the data as an interactive chart and embedding it into the front-end interface; if the data structure includes a geographical distribution, then rendering the target data to the front-end using a map rendering method, and rendering the data as an interactive chart and embedding it into the front-end interface; if the data structure includes a proportional relationship, then rendering the target data to the front-end using a pie chart rendering method, and rendering the data as an interactive chart and embedding it into the front-end interface.
[0052] Specifically, the adaptive rendering engine automatically selects the optimal visualization scheme for data rendering based on the data structure returned by the SQL. For example, if the data structure includes time series, geographical distribution, or proportional relationships, the optimal visualization scheme automatically selects options such as line charts, maps, and pie charts. The data is rendered as interactive charts that can be drilled down and filtered, and embedded in the front-end interface for users to view. Optionally, NLG (Natural Language Generation) technology is used to generate a one- or two-sentence text conclusion to directly answer the user's query.
[0053] In one example of this embodiment, after receiving the target data returned by the target database in step S105 above, the method further includes: identifying the data query type of the query statement; if the data query type is a predefined common query type, then caching the target data and configuring the cache time of the target data; when the content of the query statement input by the front-end user is received again within the cache time, the target data is retrieved from the cache and fed back.
[0054] Specifically, this involves configuring common query types. When the data type of the target data returned by the target database is identified as a configured common query type, the target data is cached. This allows the target data to be retrieved from the cache and used to respond to the front-end user's data query request the next time, thereby improving the response speed of the front-end user's data query request.
[0055] The aforementioned data query method for a travel SaaS platform includes: receiving input from a front-end user of the travel SaaS platform; performing semantic parsing on the input to obtain semantic text; identifying text entities in the semantic text; obtaining one or more target entities matching the text entities from a travel domain knowledge base, wherein the travel domain knowledge base is configured with an entity dictionary, which includes geographical entities, business entities, and time entities; determining the user intent based on one or more target entities; if the user intent is a data query, identifying a predefined business rule template based on the user intent; generating a query statement based on one or more target entities and the predefined business rule template; and sending the query statement to the target database; receiving the target data returned by the target database; and feeding back the target data to the front-end user. Therefore, the entity dictionary configured in the travel domain knowledge base can accurately identify target entities in the user's input, thereby improving the accuracy of intent recognition when determining the user's intent based on the identified target entities. Furthermore, generating a query statement based on the identified target entities and business rule template can improve the accuracy of the query statement, making the target data returned when querying the target database based on the query statement more consistent with the front-end user's query needs.
[0056] A specific example of a data query method for a travel SaaS platform based on the above embodiments is provided below, such as... Figure 2 As shown: The configuration data layer comprises a domain knowledge graph and a business database. The domain knowledge graph contains a thesaurus, metrics, and entities, while the business database contains the target data queried by front-end users, i.e., various business data.
[0057] A multimodal interactive front-end is configured, providing voice input buttons and text input boxes to receive user voice and text input. The natural language understanding engine performs semantic parsing on the user-inputted voice and / or text content. The domain knowledge graph in the data layer provides vocabulary, metrics, and entity support for the semantic parsing process. After completing semantic parsing, the natural language understanding engine generates an SQL query statement and sends it to the query execution and optimizer. The query execution and optimizer receives the generated SQL query statement and submits it to the business database in the data layer for execution. After the business database returns the structured data from the query, it visualizes and renders this structured data, displaying it on the front-end interface through interactive charts.
[0058] In summary, this application provides a data query method for travel SaaS platforms, specifically offering the following technical solutions: (1) Domain-adaptive natural language understanding: A knowledge base containing a dictionary, entity library and business rules specific to the travel domain was constructed, and an NLP model was trained or fine-tuned based on this to enable it to accurately understand the query intent of the middle and back-end operations personnel.
[0059] (2) Multimodal interaction integration: Innovatively combining voice input and text input to provide users with a more convenient and natural way to query, and reducing the threshold of use through front-end guidance and feedback.
[0060] (3) End-to-end integration from query to visualization: The system not only completes the conversion from natural language to SQL, but also automatically converts the query results into the most suitable interactive visualization charts, realizing the "question and answer" analysis experience and directly transforming data into insights.
[0061] This application provides a data query method for travel SaaS platforms, achieving the following technical effects: (1) Improve operational efficiency: Reduce the multi-step click operation that originally took several minutes to a voice or text interaction in seconds, enabling operators to obtain data insights with almost no delay, thereby discovering problems and making decisions faster.
[0062] (2) Effectively reduces the system's usage threshold and training costs: Users can perform efficient queries using their most familiar natural language without having to memorize complex backend navigation paths and indicator definitions. (3) A more intelligent and natural human-computer interaction paradigm has been realized: By integrating voice and natural language, the rigid and mechanical interaction mode of traditional back-end systems has been changed, providing a “human-like dialogue” experience and reducing the user’s operational cognitive load.
[0063] It should be understood that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order constraint on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0064] In some exemplary embodiments of this application, such as Figure 3As shown, a data query device for a travel SaaS platform is provided, including a parsing module 301, an acquisition module 302, a determination module 303, a generation and sending module 304, and a data feedback module 305. The parsing module 301 receives input from the front-end user of the travel SaaS platform, performs semantic parsing on the input to obtain semantic text; the acquisition module 302 identifies text entities in the semantic text, retrieves one or more target entities matching the text entities from a travel domain knowledge base, wherein the travel domain knowledge base is configured with an entity dictionary, which includes geographical entities, business entities, and time entities; the determination module 303 determines the user intent based on one or more target entities; the generation and sending module 304, if the user intent is a data query, identifies a predefined business rule template based on the user intent, generates a query statement based on one or more target entities and the predefined business rule template, and sends the query statement to the target database; the data feedback module 305 receives the target data returned by the target database and feeds the target data back to the front-end user.
[0065] In one example of this embodiment, the travel domain knowledge base is configured with an indicator dictionary, which contains multiple business indicators and calculation rules for each business indicator. Generating a query statement based on one or more target entities and a predefined business rule template includes: identifying target business indicators in the predefined business rule template; reading the calculation rules for the target business indicators from the indicator dictionary of the travel domain knowledge base; and generating a query statement based on the calculation rules for the target business indicators, one or more target entities, and the business rule template.
[0066] In one example of this embodiment, generating a query statement based on the calculation rules of the target business indicator and one or more target entities and a business rule template includes: obtaining relevant business data of the target business indicator from the business database according to the calculation rules and one or more target entities, and obtaining indicator data of the target business indicator according to the obtained relevant business data and calculation rules; obtaining entity data of each target entity from the business database; mapping the indicator data of the target business indicator and the entity data of each target entity to the business rule template; and generating a query statement based on the mapped business rule template.
[0067] In one example of this embodiment, multiple target entities include geographic entities, business entities, and time entities. The target business metric includes a response rate, and the calculation rule includes determining the response rate by the ratio of the number of responded orders to the total number of orders. The process involves: obtaining relevant business data of the target business metric from the business database according to the calculation rule and one or more target entities; and obtaining the metric data of the target business metric based on the obtained relevant business data and the calculation rule. This includes: obtaining geographic data, order data, and time data from the business database according to the response rate calculation rule and in conjunction with the geographic entities, business entities, and time entities, wherein the relevant business data of the target business metric includes geographic data, order data, and time data, and the order data is determined based on the geographic data and time data; calculating the response rate metric data based on the obtained order data; and mapping the metric data of the target business metric and the entity data of each target entity to a business rule template, including: mapping the geographic data, time data, and the response rate metric data to the corresponding positions in the business rule template.
[0068] In one example of this embodiment, receiving input content from a front-end user of the travel SaaS platform includes: receiving voice content and / or text content input by the front-end user of the travel SaaS platform; performing semantic parsing on the input content to obtain semantic text, including: when the input content includes voice content, extracting acoustic features from the voice content using a third-party automatic speech recognition engine to obtain preliminary text, correcting errors in the preliminary text based on context to obtain corrected text, extracting structured semantic information from the corrected text, and obtaining semantic text based on the structured semantic information; when the input content includes text content, extracting structured semantic information from the text content, and obtaining semantic text based on the structured semantic information.
[0069] In one example of this embodiment, a data query device for a travel SaaS platform further includes a data caching module, which is used to identify the data query type of the query statement; if the data query type is a predefined common query type, the target data is cached and the cache time of the target data is configured; when the content of the query statement input by the front-end user is received again within the cache time, the target data is retrieved from the cache and fed back.
[0070] In one example of this embodiment, feeding back target data to the front-end user includes: identifying the data structure of the target data; if the data structure includes a time series, rendering the target data to the front-end using a line chart rendering method, and rendering the data as an interactive chart and embedding it into the front-end interface; if the data structure includes a geographical distribution, rendering the target data to the front-end using a map rendering method, and rendering the data as an interactive chart and embedding it into the front-end interface; if the data structure includes a proportional relationship, rendering the target data to the front-end using a pie chart rendering method, and rendering the data as an interactive chart and embedding it into the front-end interface.
[0071] For specific limitations regarding a data query device for a travel SaaS platform, please refer to the limitations of a data query method for a travel SaaS platform described above, which will not be repeated here. Each module in the aforementioned data query device for a travel SaaS platform can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in an electronic device, or stored in the memory of an electronic device in software form, so that the processor can call and execute the operations corresponding to each module.
[0072] In some exemplary embodiments of this application, an electronic device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, this electronic device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores business data related to ride-hailing services. The network interface communicates with external terminals via a network. When executed by the processor, the computer program implements a data query method for a ride-hailing SaaS platform.
[0073] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0074] In some exemplary embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of a data query method for a travel SaaS platform as described in any of the above exemplary embodiments.
[0075] In some exemplary embodiments of this application, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of a data query method for a travel SaaS platform as described in any of the exemplary embodiments above.
[0076] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0077] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0078] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A data query method for a travel SaaS platform, characterized in that, The method includes: Receive input from front-end users of the travel SaaS platform, perform semantic parsing on the input to obtain semantic text; The system identifies text entities in semantic text and retrieves one or more target entities that match the text entities from a travel domain knowledge base, wherein the travel domain knowledge base is configured with an entity dictionary, and the entity dictionary is configured with geographical entities, business entities and time entities; The user intent is determined based on the one or more target entities; If the user intent is a data query, then a predefined business rule template is identified based on the user intent, a query statement is generated based on the one or more target entities and the predefined business rule template, and the query statement is sent to the target database; Receive the target data returned by the target database and then feed back the target data to the front-end user.
2. The method according to claim 1, characterized in that, The travel domain knowledge base is configured with an indicator dictionary, which contains multiple business indicators and calculation rules for each business indicator. The step of generating a query statement based on the one or more target entities and a predefined business rule template includes: Identify the target business indicators in the predefined business rule templates, and read the calculation rules of the target business indicators from the indicator dictionary of the travel domain knowledge base; A query statement is generated based on the calculation rules of the target business indicators, the one or more target entities, and the business rule template.
3. The method according to claim 2, characterized in that, The step of generating a query statement based on the calculation rules of the target business indicators, the one or more target entities, and the business rule template includes: According to the calculation rules and the one or more target entities, relevant business data of the target business indicators are obtained from the business database, and indicator data of the target business indicators are obtained according to the obtained relevant business data and the calculation rules. Retrieve entity data for each target entity from the business database; Map the indicator data of the target business metrics and the entity data of each target entity to the business rule template; Generate query statements based on the business rule template after mapping.
4. The method according to claim 3, characterized in that, The multiple target entities include the geographic entity, the business entity, and the time entity; the target business metric includes the response rate; and the calculation rule includes determining the response rate by the ratio of the number of responded orders to the total number of orders. The step of obtaining relevant business data of the target business indicator from the business database according to the calculation rules and the one or more target entities, and obtaining indicator data of the target business indicator according to the obtained relevant business data and the calculation rules, includes: According to the calculation rules of the response rate, and in combination with the geographic entity, the business entity and the time entity, geographic data, order data and time data are obtained from the business database. The relevant business data of the target business indicator includes geographic data, order data and time data, and the order data is determined based on the geographic data and the time data. The response rate metric is calculated based on the acquired order data. The step of mapping the indicator data of the target business metrics and the entity data of each target entity to the business rule template includes: Map the geographic data, the time data, and the response rate metrics to the corresponding locations in the business rule template.
5. The method according to claim 1, characterized in that, The input content received from the front-end user of the travel SaaS platform includes: Receive voice and / or text input from front-end users of the travel SaaS platform; The step of performing semantic parsing on the input content to obtain semantic text includes: When the input content includes speech content, acoustic features are extracted from the speech content by a third-party automatic speech recognition engine to obtain preliminary text. Errors are corrected in the preliminary text based on the context to obtain corrected text. The structured semantic information of the corrected text is extracted, and semantic text is obtained based on the structured semantic information. When the input content includes text content, the structured semantic information of the text content is extracted, and semantic text is obtained based on the structured semantic information.
6. The method according to claim 1, characterized in that, The method further includes: Identify the data query type of the query statement; If the data query type is a predefined common query type, then the target data will be cached, and the cache time of the target data will be configured. When the query statement input by the front-end user is received again within the cache period, the target data is retrieved from the cache and fed back.
7. The method according to claim 1, characterized in that, The step of feeding back the target data to the front-end user includes: The data structure for identifying the target data; If the data structure includes a time series, the target data is rendered to the front end using a line chart rendering method, and the data is rendered as an interactive chart and embedded into the front end interface; If the data structure includes geographical distribution, then map rendering is used to render the target data to the front end, and the data is rendered as an interactive chart and embedded into the front end interface; If the data structure includes proportional relationships, the target data is rendered to the front end using a pie chart rendering method, and the data is rendered as an interactive chart and embedded in the front end interface.
8. A data query device for a travel SaaS platform, characterized in that, The device includes: The parsing module is used to receive input content from front-end users of the travel SaaS platform, perform semantic parsing on the input content, and obtain semantic text; The acquisition module is used to identify text entities in semantic text and acquire one or more target entities that match the text entities from the travel domain knowledge base, wherein the travel domain knowledge base is configured with an entity dictionary, and the entity dictionary is configured with geographical entities, business entities and time entities; The determination module is used to determine the user intent based on the one or more target entities; The generation and sending module is used to identify a predefined business rule template based on the user intent if the user intent is a data query, generate a query statement based on the one or more target entities and the predefined business rule template, and send the query statement to the target database. The data feedback module is used to receive target data returned by the target database and provide feedback of the target data to the front-end user.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.