Information acquisition method, computing device and computer readable storage medium
By receiving and processing the target language to generate query statements, determining the target database and obtaining data information, it solves the problem that non-technical personnel find it difficult to efficiently obtain battery swap operation data, and achieves fast and accurate data query and secure data acquisition.
Patent Information
- Application Number
- CN202510271262.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-08-05
AI Technical Summary
In the prior art, it is difficult for non-technical personnel to obtain battery swap operation data efficiently, and they require professional database knowledge and programming skills, resulting in inefficient data query.
By receiving the target language, processing and generating query statements, verifying the query statements to determine the target database, and obtaining data information in the target database, using the big model to calculate word segmentation, entity matching and semantic similarity, generating accurate query statements and performing permission constraints, ensuring the validity and security of the query.
It enables non-technical personnel to quickly and accurately obtain battery swap operation data, improves the efficiency and security of data query, and simplifies the data acquisition process.
Smart Images

Figure CN120429313A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of large models, and in particular to an information acquisition method, a computing device, and a computer-readable storage medium. Background Art
[0002] During the operation of battery swap stations, managers and operators need to analyze daily operational data, including station status, swapped battery consumption, and swapped vehicle data, to develop appropriate operational strategies, plans, and company goals. However, current data is typically stored in specialized database software, and managers and operators are not professional database operators. Therefore, obtaining and analyzing this data requires a certain technical background, including knowledge of database programming languages and understanding of data table structures.
[0003] Existing technologies often use visualization tools to simplify data querying, or require complex SQL (database query statements) to retrieve the required data. However, these solutions often still require users to possess certain technical skills, which can be a significant challenge for non-technical staff and lead to inefficient acquisition of relevant data in production environments. Summary of the Invention
[0004] The purpose of this application is to provide an information acquisition method, a computing device, and a computer-readable storage medium that can help determine the target database for data acquisition and improve the efficiency of acquiring data information.
[0005] To achieve the above objectives: In a first aspect, an embodiment of the present application provides an information acquisition method, comprising: receiving target language for task instructions; Processing the target language and generating a corresponding query statement; Verifying the query statement, and determining a target database to be queried based on the verified query statement; According to the verified query statement, target data information corresponding to the target language is obtained in the target database.
[0006] In one embodiment, the method for processing the target language further includes: Determine whether the information indicated in the target language is clear; If it is determined that the information indicated by the target language is unclear, obtaining indication information through multiple rounds of language interaction, updating the target language based on the indication information, and processing the updated target language; and / or, According to the processing result of the target language, the target language is updated and the updated target language is outputted to confirm the task content of the updated target language. After receiving the confirmation information, the updated target language is processed.
[0007] In one embodiment, after obtaining the target data information corresponding to the target language in the target database according to the verified query statement, the method includes: Performing computational processing on the acquired target data information according to the target language to obtain a final processing result; and / or, The target display type is determined according to a preset display rule, and the obtained target data information or the processing result is output based on the target display type.
[0008] In one embodiment, the processing of the target language and the corresponding generation of a query statement include: Perform word segmentation on the target language to obtain at least one keyword; Matching the at least one keyword with a preset proper noun to determine a target proper noun corresponding to the at least one keyword; A query statement in the target language is generated according to the target proper noun.
[0009] In one embodiment, matching the at least one keyword with a preset proper noun to determine a target proper noun corresponding to the at least one keyword includes: Performing similarity matching calculation on the at least one keyword and a preset proper noun; If the calculated similarity is greater than or equal to a preset similarity threshold, the corresponding proper noun is determined as the target proper noun; If the similarity is less than a preset similarity threshold, the target proper noun of the keyword is not obtained.
[0010] In one embodiment, obtaining target data information corresponding to the target language in the target database according to the verified query statement includes: Determining, according to a preset recall method, a definition of a proper noun or a data scalar corresponding to the target proper noun, and determining the definition of the proper noun or the data scalar as interpretation information of the target proper noun; According to the explanation information and the query statement, target data information corresponding to the target language is acquired in the target database.
[0011] In one embodiment, the verifying the query statement and determining the target database to be queried according to the verified query statement includes: Performing domain processing on the preset data according to the preset data type to determine at least one underlying database; the preset data type includes at least one of battery swap station operation data, battery swap vehicle and driver data, battery swap battery data, and battery swap transaction order data; Determine the data type of the query statement; In the at least one underlying database, a target database having a type consistent with the data type of the query statement is determined.
[0012] In one embodiment, verifying the query statement includes: Detecting the query statement to determine whether there is a preset query question; and / or, According to the preset query authority for the underlying database, authority constraints are imposed on the query statement.
[0013] In a second aspect, an embodiment of the present application provides a computing device, specifically comprising: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to perform the information acquisition method as described in the first aspect.
[0014] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the instructions in the computer-readable storage medium are executed by a processor of a computing device, the computing device is enabled to implement the information acquisition method described in the first aspect.
[0015] Embodiments of the present application provide an information acquisition method, computing device, and computer-readable storage medium, comprising: receiving a target language for performing a task instruction; processing the target language and generating a corresponding query statement; validating the query statement and determining a target database to be queried based on the validated query statement; and obtaining target data information corresponding to the target language in the target database based on the validated query statement. In this manner, determining the corresponding target database based on the query statement and querying the target data information based on the target database can help determine the target database for data acquisition and improve the efficiency of obtaining data information. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of a flow chart of an information acquisition method provided in an embodiment of the present invention; Figure 2A schematic diagram of a specific process architecture of the information acquisition method provided in an embodiment of the present invention; Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present invention; Processor 210 , memory 211 , network interface 212 , and bus system 213 . DETAILED DESCRIPTION
[0017] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0018] It should be noted that, in this document, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined by their explanation in the specific embodiment or further combined with the context of the specific embodiment.
[0019] It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, without departing from the scope of this document, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the term "if" as used herein may be interpreted as "at the time of," "when," or "in response to a determination." Furthermore, as used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It should be further understood that the terms "comprising" and "including" indicate the presence of the described features, steps, operations, elements, components, items, types, and / or groups, but do not exclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, types, and / or groups. The terms "or" and "and / or" as used herein are to be interpreted as inclusive, meaning any one or any combination. Thus, “A, B, or C” or “A, B, and / or C” means “any of: A; B; C; A and B; A and C; B and C; A, B, and C.” An exception to this definition occurs only when a combination of elements, functions, steps, or operations are inherently mutually exclusive in some manner.
[0020] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless clearly stated herein, the execution of these steps is not strictly limited in order, and they can be performed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0021] It should be noted that in this article, step codes such as S101 and S102 are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial limitation on the order. When implementing the step, those skilled in the art may execute S102 first and then S101, etc., but these should all be within the scope of protection of this application.
[0022] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0023] In the subsequent description, the use of suffixes such as "module", "component" or "unit" to represent elements is only for the purpose of facilitating the description of the present application and has no specific meaning. Therefore, "module", "component" or "unit" can be used interchangeably.
[0024] See Figure 1 The present application provides an information acquisition method, which can be implemented in software and / or hardware. In this embodiment, the information acquisition method is applied to a computing device as an example. The information acquisition method provided in this embodiment includes: Step S101: receiving a target language for performing a task instruction.
[0025] Optionally, the user's task instructions may be received in the form of real-time voice, audio files, video files, text messages, etc., and converted into a target language in text form.
[0026] Step S102: Process the target language and generate a corresponding query statement.
[0027] Optionally, processing the target language includes analyzing the target language in terms of syntax, logic, target information, language model adaptation, etc., and generating a query statement in the target language based on the processing results. The query language can be directly extracted from the target language, or it can be converted into a computer language based on the required statement type to better suit the language environment of data queries.
[0028] In one embodiment, processing the target language further includes: Determine whether the information conveyed in the target language is clear; If it is determined that the information indicated by the target language is unclear, obtaining indication information through multiple rounds of language interaction, updating the target language based on the indication information, and processing the updated target language; and / or, According to the processing result of the target language, the target language is updated and the updated target language is outputted to confirm the task content of the updated target language. After receiving the confirmation information, the updated target language is processed.
[0029] Alternatively, the target language can be analyzed using natural language processing (NLP) technology. If it is determined that the target language contains vague, incomplete, or ambiguous expressions, or contains inaccurate proper nouns or indicator names, resulting in an inability to directly match fields in the database, such as missing information in the target language, unclear objects referred to by the target language, or ambiguous meanings in the target language, the information indicated by the target language is considered unclear.
[0030] Optionally, when it is determined that the information entered by the user is unclear, multiple rounds of conversations will be initiated proactively. By asking questions, the system guides the user to supplement the missing information or clarify the information pointed to by the target language. For example: The user enters: "View the data of battery swapping transaction orders"; The system asks back: "Which time period of the battery swapping transaction order data do you want to view? Is it in 2023 or the most recent month?"; The user supplements: "In 2023"; The system continues to ask back: "Which region's battery swapping transaction order data do you want to view? Is it Beijing or the whole country?"; The user supplements: "Beijing". In this way, according to the information supplemented by the user, the expression of the target language is updated correspondingly. For example, "View the data of battery swapping transaction orders" is updated to "View the battery swapping transaction order data in Beijing in 2023".
[0031] Optionally, according to the processing result of the target language, in a preset database, relevant metric information with a similarity higher than the recall threshold to the processing result can be determined, and the target language can be updated based on the obtained relevant metric information. Then, the updated target language is output to ask the user a follow-up question to determine the true intention of the updated target language. Optionally, after the user confirms, the processing task is directly executed based on the updated target language (such as processing the updated target language).
[0032] In this way, by using the method of multiple rounds of interaction or follow-up questions to clarify the information indicated by the target language, the user's intention can be understood more accurately, avoiding incorrect execution caused by unclear information, and it is applicable to scenarios where the user is not familiar with data metrics or the expression is inaccurate, improving the intelligence level.
[0033] In one implementation, the target language is processed and a query statement is generated correspondingly, including: The target language is tokenized to obtain at least one keyword; At least one keyword is matched with preset proper nouns to determine the target proper nouns corresponding to at least one keyword; According to the target proper nouns, a query statement for the target language is generated.
[0034] Optionally, a tokenization tool (such as Jieba, HanLP, etc.) can be used to tokenize the target language, and meaningless stop words (such as "of", "is", "in", etc.) are removed, and the key words are retained as keywords.
[0035] Optionally, in a specific field (such as the field of battery swapping stations), there are some preset proper nouns or data metrics (such as "failure rate", "number of battery swapping orders", etc.), and these proper nouns are usually stored in a preset entity library.
[0036] Optionally, the keywords obtained from the segmentation are matched with pre-set proper nouns in the entity library. For example, the keyword "failure rate" is matched with "failure rate (ppm)" in the entity library. The keyword "battery swap station" is matched with "battery swap station ID" in the entity library.
[0037] Optionally, a large model (such as GPT) is used to understand the meaning of the target proper noun and its role in the query, and query logic is constructed based on the target proper noun and user intent, and the query logic is converted into specific query statements (such as SQL statements).
[0038] In this way, through word segmentation, entity alignment and semantic similarity matching, we can accurately understand user intentions and complete data query tasks accurately and quickly.
[0039] In one embodiment, matching at least one keyword with a preset proper noun to determine a target proper noun corresponding to the at least one keyword includes: Performing similarity matching calculation on at least one keyword and a preset proper noun; If the calculated similarity is greater than or equal to a preset similarity threshold, the corresponding proper noun is determined as the target proper noun; If the similarity is less than the preset similarity threshold, the target proper noun does not correspond to the acquired keyword.
[0040] Optionally, semantic similarity calculation (e.g., using a word vector model or a pre-trained language model) is used to determine the proper noun corresponding to each keyword. For example, the keyword "battery swap order" is matched to "battery swap order count" through semantic similarity.
[0041] Optionally, in specific fields (such as battery swap stations), there are some preset proper nouns or data indicators (such as "failure rate" and "number of battery swap orders"). These proper nouns are usually stored in a preset entity library. "Preset proper nouns" are a predefined set of proper nouns that may include proper nouns from various fields and types, such as names of people, places, organizations, and professional terms.
[0042] Optionally, "at least one keyword" can be a single keyword or a combination of multiple keywords. Optionally, the at least one keyword is compared with preset proper nouns one by one, and the similarity between each keyword and the proper noun is determined. Optionally, the calculated similarity is compared with a preset similarity threshold. When the similarity is greater than or equal to the preset similarity threshold, the corresponding proper noun is determined as the target proper noun. Here, if the similarity between the same keyword and multiple proper nouns is greater than or equal to the preset similarity threshold, the proper noun with the greatest similarity is determined as the target proper noun.
[0043] Optionally, if the similarity is less than a preset similarity threshold, or if a keyword cannot be matched to a corresponding proper noun, the keyword is marked as an invalid entity and does not correspond to the target proper noun for the keyword. Here, the keyword can also be recorded and analyzed to update the information in the database.
[0044] Step S103: verify the query statement, and determine the target database to be queried based on the verified query statement.
[0045] Optionally, query statements can be validated to ensure they are syntactically correct, logically sound, and conform to the target database's structure and rules. This can prevent query failures or incorrect results due to query errors. Specifically, you can use pre-defined syntax checking tools (such as the MySQL EXPLAIN statement) or custom validation rules or scripts.
[0046] Optionally, you can determine the target database type based on the characteristics of the query statement (such as table name, field name, and query logic), including MySQL, PostgreSQL, MongoDB, etc.
[0047] In one embodiment, before verifying the query statement and determining the target database to be queried based on the verified query statement, the following steps are included: Performing domain processing on the preset data according to the preset data type to determine at least one underlying database; the preset data type includes at least one of battery swap station operation data, battery swap vehicle and driver data, battery swap battery data, and battery swap transaction order data; Determine the data type of the query statement; In at least one underlying database, a target database having a type consistent with the data type of the query statement is determined.
[0048] Optionally, battery swap station operation data includes basic information about the station (such as location, capacity, and equipment status), operational metrics (such as failure rate and utilization rate), etc. Battery swap vehicle and driver data includes vehicle information (such as vehicle model and battery type), driver information (such as driver ID and driving record), etc. Battery swap battery data includes basic battery information (such as battery ID, capacity, and health status), usage records (such as the number of charges and discharges), etc. Battery swap transaction order data includes order information (such as order ID, battery swap station ID, and vehicle ID), and transaction records (such as battery swap time and cost). Storing different types of data in different underlying databases improves the efficiency, security, and scalability of data management.
[0049] In this way, pre-set data can be processed by domain based on pre-set data types, such as battery swap station operation data, battery swap vehicle and driver data, etc. Specifically, a separate underlying database can be assigned to each data type. For example: battery swap station operation data can be stored in MySQL database A; battery swap vehicle and driver data can be stored in MongoDB database B; battery swap battery data can be stored in PostgreSQL database C; and battery swap transaction order data can be stored in Elasticsearch database D.
[0050] Optionally, select a database from the underlying database that matches the data type of the query statement. For example, if the query statement data type is "battery swap station operation data," select MySQL database A, which stores battery swap station operation data. Optionally, based on the matching results, obtain the target database's connection information (e.g., IP address, port, username, password).
[0051] In this way, the target database is selected according to the data type of the query statement, cross-database queries are avoided, query efficiency is improved, multiple data types and underlying databases can be supported, and subsequent expansion of new data types or databases is facilitated.
[0052] In one embodiment, verifying the query statement includes: Detecting the query statement to determine whether it contains the preset query question; and / or, According to the preset query permissions for the underlying database, the query statements are restricted by permissions.
[0053] Optionally, when checking the query statement, at least one of the following items may be included: checking whether the query statement complies with the grammatical rules of the database, such as whether the SQL grammar is correct. Checking whether the query statement is logically reasonable, such as whether there are invalid query conditions or conflicting query logic. Checking whether the query statement may cause performance problems, such as whether a full table scan or unoptimized query conditions is used. Checking whether the query statement may return inconsistent or erroneous data, such as whether necessary associated tables or conditions are omitted. Optionally, if the above problems are detected, it is necessary to promptly feedback the error information and prompt the user to make corrections to ensure that the generated query statement is correct and valid, or it can be corrected by itself based on the detected problem. In this way, the accuracy of the query statement is improved, and at the same time, the query time of the database can be reduced, thereby improving the query efficiency.
[0054] Optionally, in the field of battery swapping, different users may have different access rights to the data in the database. Therefore, after generating a query statement, it is necessary to constrain the query statement according to the user's data permissions. Specifically, it includes: data range restrictions, field permission restrictions, and operation permission restrictions. Among them, data range restrictions include adding corresponding conditions to the query statement based on the user's permissions to restrict users to access only data within their permission range. For example, if a user can only query data in a specific area or time period, the corresponding area or time range restrictions will be automatically added to the query statement. Field permission restrictions include that some users may only be able to access some fields in the database, so it is necessary to exclude fields that users do not have access to in the query statement to ensure that users can only query data within their permission range. Operation permission restrictions include that some users may only have read permissions but not write or delete permissions, so it is necessary to ensure that the generated query statement does not perform operations that exceed the user's permissions.
[0055] Optionally, to simplify user operations, permission constraints can be automatically added to query statements, eliminating the need for manual additions. For example, corresponding filtering conditions or field restrictions can be automatically added to query statements based on the user's role or permission group. This ensures that generated queries comply with both grammatical and logical requirements and the user's data permissions by checking and constraining query statements. This not only prevents incorrect query execution but also effectively protects database data security and prevents users from unauthorized access to sensitive information.
[0056] Step S104: according to the verified query statement, obtain target data information corresponding to the target language in the target database.
[0057] Alternatively, you can connect directly to the target database through a database connection pool or submit the validated query to the database engine for execution. The database engine will parse the query and, based on the conditions, fields, and table relationships in the query, retrieve the data that meets the conditions from the target database and determine it as the target data corresponding to the target language.
[0058] In one embodiment, obtaining target data information corresponding to the target language from the target database according to the verified query statement includes: Determining the definition of a proper noun or data scalar corresponding to the target proper noun according to a preset recall method, and determining the definition of the proper noun or data scalar as interpretation information of the target proper noun; According to the interpretation information and the query statement, the target data information corresponding to the target language is obtained in the target database.
[0059] Optionally, in the query statement entered by the user, proper nouns or data scalars related to the battery swapping field are first identified. For example, the user query statement may contain proper nouns or data indicators such as "battery swap station A," "battery capacity," and "charging power." Optionally, the definitions of these proper nouns or data scalars can be recalled using the following preset recall methods: keyword matching and semantic similarity matching. Here, for keyword matching, the keywords in the user query can be directly matched based on a predefined dictionary of proper nouns or data scalar tables. For example, if the user mentions "battery swap station A," the definition of "battery swap station A" can be recalled based on the dictionary. For semantic similarity matching, if the vocabulary used by the user does not completely match the predefined proper nouns, the closest proper noun or data scalar can be recalled using a semantic similarity algorithm (such as similarity calculation based on word vectors). For example, if the user mentions "charging station power," the data scalar "charging power" can be recalled.
[0060] Optionally, by using a preset recall method, the definition of the target proper noun or data scalar can be found. Here, these definitions are used as the explanation information of the target proper noun for subsequent query processing and understanding of the large model.
[0061] Optionally, the recalled explanation information can be provided as context to a large model (such as GPT) or query engine to help it better understand the semantics of the user's query. This context can align the nouns in the user's question (such as "battery swap station A" and "charging power") with data indicators in the battery swap station field, ensuring accurate semantic understanding.
[0062] Optionally, recall methods such as keyword matching and semantic similarity matching can accurately identify proper nouns and data scalars in user queries and retrieve their definitions as explanatory information. This recalled explanatory information is combined with the query statement to retrieve the target data from the target database and convert it into the format required by the user. This process not only improves the semantic understanding of user questions but also ensures the accuracy and interpretability of query results, thereby enhancing the user experience.
[0063] In one embodiment, after obtaining target data information corresponding to the target language from the target database according to the verified query statement, the following steps are included: Performing computational processing on the acquired target data information according to the target language to obtain a final processing result; and / or, The target display type is determined according to the preset display rules, and the obtained target data information or the processing result is output based on the target display type.
[0064] Optionally, the target language is not only used to clarify the user's intent, but may also contain specific calculation rules or indicator definitions. For example, when a user queries "failure rate (ppm) of battery swap stations", the target language specifies how to calculate the failure rate. Optionally, the target data is extracted from a database or other data source. For example, the "number of automatically processed orders" and the "total number of battery swap orders" are obtained. Optionally, calculations are performed according to the rules defined in the target language. For example, the calculation formula for the failure rate (ppm) of a battery swap station is: Failure rate (ppm) = (number of automatically processed orders / total number of battery swap orders) × 10,000. Optionally, the calculation result is used as the final processing result. For example, the calculated failure rate is 50 ppm.
[0065] Optionally, you can preset display rules based on business needs or user preferences. For example, if the number of data items exceeds 100, use a line chart; if the number of data items is less than 100, use a bar chart. Alternatively, you can select a chart based on the data type, such as using a line chart for time series data and a pie chart for categorical data.
[0066] Optionally, you can also set interactive features such as zooming, filtering, and hover prompts for the chart.
[0067] Determining the target display type can involve data analysis and rule matching. Data analysis involves analyzing the target data to determine its data type (e.g., numerical, time series, categorical, etc.) and volume. Rule matching involves matching the most appropriate display type based on pre-set display rules. For example, for time series data, a line chart might be selected, while for categorical data, a pie chart might be selected.
[0068] Optionally, use large models (such as GPT or other AI models) to automatically generate visualization code based on data type and volume. For example, generate Matplotlib or ECharts code based on Python. Optionally, add rules and constraints when generating visualization code to ensure interactive experience. For example: number of data items: When the amount of data is too large, automatically perform aggregation or paging. In this way, generating visualization code from a large model improves the efficiency and aesthetics of data presentation. At the same time, clear and intuitive visualization helps users better understand the data, efficiently complete data calculation and presentation tasks, and meet users' needs for data indicator query and visualization.
[0069] In summary, the information acquisition method provided by the above embodiment determines the corresponding target database according to the query statement, and queries the target data information based on the target database, which can help determine the target database for data acquisition and improve the efficiency of acquiring data information.
[0070] Based on the same inventive concept as the above embodiments, the information acquisition method provided by this application is described in detail below through a specific example. Specifically, the information acquisition method is applied to a large model, aiming to help realize the needs of automatic data acquisition, query, and score data in the business operation and management of the battery swap station. Figure 2 As shown, the platform uses advanced natural language processing technology and can convert user questions into programming language through the semantic understanding of large models, thereby realizing automatic understanding of intentions, data acquisition and data analysis.
[0071] Large Language Models (LLMs) are AI-based models capable of understanding and generating natural language text. They are trained on large amounts of data to learn the structure, grammar, semantics, and context of language, enabling them to perform tasks such as answering questions, writing articles, and translating between languages. Common large models include OpenAI's GPT series (such as GPT-3 and GPT-4) and other similar models.
[0072] In one embodiment, advanced large-scale modeling technology is used to deeply analyze user input. By understanding the language, it is possible to identify the user's intentions and specific needs, thereby accurately grasping the user's query direction, including: A. First, obtain the user's question information and convert it into the target language. Then, perform technical word segmentation on the target language, remove some pause words, and retain at least one keyword in the target language.
[0073] B. Based on the word segmentation results, perform entity alignment and entity replacement with the proper nouns for battery swap stations. Specifically, alignment is performed using keyword matching combined with contextual semantic similarity. A threshold is controlled to select appropriate alignment entities. Entities with low thresholds or no matches are defaulted to invalid entities, recorded and analyzed to facilitate the next entity library update.
[0074] C. Recall the definitions of the proper nouns or data scalars of these battery swap stations through keyword matching, semantic similarity matching, and determine them as explanatory information.
[0075] D. Using the explanation information obtained from the recall as context allows the large model to understand the meaning of the term "swap station". This also facilitates further alignment of the term in the user's question with data indicators in the swap station field, improving the ultimate semantic understanding of the user's question. In one embodiment, based on the analysis results of the target language, corresponding database query statements are generated and executed. Specifically, the following steps are performed: A. To improve the effectiveness of the final query, the data in the battery swap station field is divided into different domains, including: battery swap station operation data, battery swap vehicle and driver data, battery swap battery data, and battery swap transaction order data. This improves the accuracy of information query and facilitates user permission isolation.
[0076] B. When generating database query statements using a large model, first identify the data domain, locate the correct target database, and then accurately align the database name.
[0077] C. After generating the database query statement, verify the query statement. On the one hand, it can eliminate incorrect database query statements. On the other hand, it can add some permission processing and data range constraints to the query statement based on the different data permissions of users in the battery swap field.
[0078] D. Finally, the processed data is submitted to the big data real-time query platform for data acquisition.
[0079] In one embodiment, the query results are further processed to generate an easy-to-understand visual report that displays the data in charts and graphs, allowing users to intuitively understand the information and trends behind the data. Specifically, the report includes: A. Because battery swap station indicators have certain specific requirements, such as the failure rate (ppm) of battery swap stations, which is calculated by dividing automatically processed orders by all battery swap orders and multiplying the result by 10,000, the display of these specific indicators requires final calculation of the acquired target data.
[0080] B. The target data information obtained from the target database needs to be visualized and displayed in conjunction with the big model. The big model generates visualization code based on the data type and volume. To ensure a satisfactory interactive experience, certain rules and constraints are added, including the number of data items, the type of icon generated, and the way the icon is displayed.
[0081] C. Return the processed results and target data information to the caller to complete the data display.
[0082] In one embodiment, the natural language processing model can be continuously optimized based on user feedback to ensure that the system can continuously improve its accuracy and response speed as usage deepens, ultimately achieving a better user experience and higher work efficiency. Specifically, the following steps are included: A. To meet the needs of users when their intentions are unclear, when users are not very clear about the data indicators, multiple rounds of language interaction with users can be used to clarify their intentions.
[0083] B. Through the similarity scheme between the proper nouns in the user's question and the indicators in the database, we recall the high similarity indicators above the threshold, ask the user a second question to clarify, correct the user's intention, and obtain the user's true expression.
[0084] In practice, managers can use the intelligent inquiry system to enter natural language requests such as "Please provide me with last month's battery swap station operating data." The system will parse the request, generate the corresponding SQL (database programming language) query, and extract the required data from the database. The system then processes the data, generates a visual report, and displays it to the user.
[0085] In this way, managers can quickly obtain the required data for analysis and decision-making without relying on professional technicians. This not only improves work efficiency but also promotes the implementation of a data-driven decision-making culture in the enterprise.
[0086] In summary, the above embodiments provide an information acquisition method, computing device, and computer-readable storage medium, which determine the corresponding target database according to the query statement and query the target data information based on the target database, thereby helping to determine the target database for data acquisition and improving the efficiency of obtaining data information.
[0087] Based on the same inventive concept as the above embodiments, an embodiment of the present invention provides a computing device, such as Figure 3 As shown, the computing device includes: a processor 210 and a memory 211 storing a computer program; wherein, Figure 3 The processor 210 shown in the figure is not used to indicate that the number of processors 210 is one, but is only used to indicate the positional relationship of the processor 210 relative to other devices. In actual applications, the number of processors 210 may be one or more; similarly, Figure 3 The memory 211 shown in the figure has the same meaning, that is, it is only used to refer to the position relationship of the memory 211 relative to other devices. In actual applications, the number of memories 411 can be one or more. When the processor 210 runs the computer program, the above information acquisition method is implemented.
[0088] The computing device may also include: at least one network interface 212. The various components in the computing device are coupled together via a bus system 213. It is understood that the bus system 213 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 213 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 3 Various buses are labeled as bus system 213.
[0089] Memory 211 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disk, or compact disc read-only memory (CD-ROM); magnetic surface memory may include magnetic disk memory or magnetic tape memory. Volatile memory may include random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM).The memory 211 described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0090] The memory 211 in the embodiment of the present invention is used to store various types of data to support the operation of the computing device. Examples of such data include: any computer program used to operate on the computing device, such as an operating system and application programs; contact data; phone book data; messages; images; videos, etc. Among them, the operating system includes various system programs, such as the framework layer, core library layer, and driver layer, which are used to implement various basic services and handle hardware-based tasks. The application program can include various application programs, such as media players and browsers, which are used to implement various application services. Here, the program that implements the method of the embodiment of the present invention can be included in the application program.
[0091] Based on the same inventive concept as the above-mentioned embodiment, this embodiment further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. The computer-readable storage medium may be a magnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); or various devices including one or any combination of the above-mentioned memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc. When the computer program stored in the computer-readable storage medium is executed by a processor, the information acquisition method applied to the above-mentioned computing device is implemented. For the specific steps implemented when the computer program is executed by the processor, please refer to Figure 1 The description of the illustrated embodiment will not be repeated here.
[0092] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned 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.
[0093] As used herein, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion of elements other than the listed elements and may also include additional elements not specifically listed.
[0094] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. An information acquisition method, characterized in that: include: receiving target language for task instructions; Processing the target language and generating a corresponding query statement; Verifying the query statement, and determining a target database to be queried based on the verified query statement; According to the verified query statement, target data information corresponding to the target language is obtained in the target database.
2. The method according to claim 1, characterized in that The processing of the target language further includes: Determine whether the information indicated in the target language is clear; If it is determined that the information indicated by the target language is unclear, obtaining indication information through multiple rounds of language interaction, updating the target language based on the indication information, and processing the updated target language; and / or, According to the processing result of the target language, the target language is updated and the updated target language is outputted to confirm the task content of the updated target language. After receiving the confirmation information, the updated target language is processed.
3. The method according to claim 1, characterized in that After obtaining target data information corresponding to the target language in the target database according to the verified query statement, the method includes: Performing computational processing on the acquired target data information according to the target language to obtain a final processing result; and / or, The target display type is determined according to a preset display rule, and the obtained target data information or the processing result is output based on the target display type.
4. The method according to claim 1, wherein The processing of the target language and the corresponding generation of query statements include: Perform word segmentation on the target language to obtain at least one keyword; Matching the at least one keyword with a preset proper noun to determine a target proper noun corresponding to the at least one keyword; A query statement in the target language is generated according to the target proper noun.
5. The method according to claim 4, characterized in that The matching of the at least one keyword with a preset proper noun to determine a target proper noun corresponding to the at least one keyword includes: Performing similarity matching calculation on the at least one keyword and a preset proper noun; If the calculated similarity is greater than or equal to a preset similarity threshold, the corresponding proper noun is determined as the target proper noun; If the similarity is less than a preset similarity threshold, the target proper noun of the keyword is not obtained.
6. The method according to claim 4, characterized in that The acquiring, in the target database, target data information corresponding to the target language according to the verified query statement includes: Determining, according to a preset recall method, a definition of a proper noun or a data scalar corresponding to the target proper noun, and determining the definition of the proper noun or the data scalar as interpretation information of the target proper noun; According to the explanation information and the query statement, target data information corresponding to the target language is acquired in the target database.
7. The method according to claim 1, characterized in that The step of verifying the query statement and determining the target database to be queried based on the verified query statement includes: Performing domain processing on the preset data according to the preset data type to determine at least one underlying database; the preset data type includes at least one of battery swap station operation data, battery swap vehicle and driver data, battery swap battery data, and battery swap transaction order data; Determine the data type of the query statement; In the at least one underlying database, a target database having a type consistent with the data type of the query statement is determined.
8. The method according to claim 7, characterized in that The verifying the query statement includes: Detecting the query statement to determine whether there is a preset query question; and / or, According to the preset query authority for the underlying database, authority constraints are imposed on the query statement.
9. A computing device, characterized in that include: A processor and a memory for storing executable instructions; wherein the processor is configured to execute the instructions to implement the information acquisition method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that When the instructions in the computer-readable storage medium are executed by a processor, the information acquisition method according to any one of claims 1 to 8 is implemented.