Information processing system
Patent Information
- Application Number
- CN202610237748.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2025-03-19
- Filing Date
- 2026-02-28
- Publication Date
- 2026-09-22
AI Technical Summary
然而,数据存储装置内部的表结构往往复杂多样,不同表之间存在多种主外键关系和业务逻辑关系,普通业务用户难以及时、准确地理解这些表结构及其字段含义
服务器在一实施形态中将每次自然语言信息请求、生成的查询语言、执行结果以及用户后续反馈记录为历史数据。服务器周期性地利用这些历史数据更新生成式人工智能模型的参数。服务器可以采用增量学习或微调策略,通过重新最小化历史样本上的损失函数来校正模型偏差。
Smart Images

Figure CN122795901A_ABST
Abstract
Description
Technical Field
[0001] The technology disclosed herein relates to an information processing system. Background Technology
[0002] Japanese Patent Application Publication No. 2022-180282 discloses a method for controlling a role-based chatbot executed by at least one processor. The method includes the following steps: receiving a user's speech; adding the user's speech to a prompt word, the prompt word containing instruction statements associated with an explanation of the chatbot's role; encoding the prompt word; and inputting the encoded prompt word into a language model to generate a chatbot response to the user's speech.
[0003] In existing technologies, when users want to retrieve the information they need from data storage devices (such as data warehouses, database systems, etc.), they typically need to manually write structured query languages (such as SQL). However, the table structures within data storage devices are often complex and diverse, with various primary and foreign key relationships and business logic relationships between different tables. Ordinary business users find it difficult to understand these table structures and the meaning of their fields in a timely and accurate manner. Therefore, users must rely on professional data engineers or database administrators to manually analyze the table structures and write query statements according to business needs. This not only increases communication and time costs but also easily leads to query errors, maintenance difficulties, and a high degree of dependence on personnel skills.
[0004] Furthermore, with the development of generative artificial intelligence models, although query statements can be automatically generated to a certain extent by the models, there is still a lack of unified, automated, and scalable technical solutions for effectively combining the specific table structure information of the data storage device with the information requests expressed by users in natural language or specific formats, and guiding the generative artificial intelligence model to generate query language that meets specific data environments and business semantics through appropriate prompt text.
[0005] In summary, the problem to be solved by this invention is to provide a system and method that can automatically parse and learn the table structure of a data storage device, automatically generate a query language suitable for the corresponding data environment based on the user's natural language or specific format information request, thereby reducing the requirements for the user's professional technical capabilities, improving the efficiency and accuracy of information acquisition, and making full use of the capabilities of generative artificial intelligence models. Summary of the Invention
[0006] To address the aforementioned issues, this invention proposes an information processing system comprising a processor configured to perform the following processing steps: First, the processor parses and learns the table structure of the data storage device. Specifically, the processor establishes a connection with the data storage device and automatically obtains the relevant table names, field names, field types, primary and foreign key relationships, and other constraint information from system information tables, metadata management modules, or equivalent structural description information. Based on this information, the processor constructs a table structure model and a table relationship model, and associates each field with its corresponding business meaning or semantic tag, so that in the subsequent query language generation process, it can automatically select appropriate tables and fields based on the table structure model and semantic mapping.
[0007] Secondly, the processor receives information requests from users, expressed in natural language or a specific format. The user can input a question description via a terminal device, including natural language sentences, semi-structured text, or a specific format (e.g., parameterized forms, fixed grammar templates, etc.). The processor parses the received information request, identifying the included query intent, target metrics, filtering conditions, grouping conditions, sorting conditions, and business elements such as time range and entity names. Based on the parsed business elements, the processor generates prompt text for generating query language using a generative artificial intelligence model. This prompt text includes at least: table structure information, semantic descriptions of business elements, and query task instructions. The prompt text is constructed in a form that can be understood and utilized by the generative artificial intelligence model, enabling the model to output corresponding query language candidates while fully considering the current data storage device table structure and business context.
[0008] Then, based on the parsed prompt text, the processor invokes a generative artificial intelligence model to automatically generate a query language. The processor can provide the prompt text as input to the generative AI model, and after obtaining the query language output by the model, it performs syntax validity checks, table structure consistency checks, and basic security checks. If necessary, the processor can also modify or complete the generated query language according to rules to ensure that the query statement can be correctly executed in the current data environment. Through the above processing, the processor ultimately determines the target query language used to access the data storage device.
[0009] Furthermore, the processor uses the automatically generated query language to execute a query in the data storage device, retrieves information corresponding to the user's information request from the data storage device, and returns the query results to the terminal for the user to view. Through the above steps, the system of the present invention can automatically complete a whole process from table structure parsing and learning, user request understanding, prompt text generation to automatic generation and execution of query language, thereby significantly reducing the technical threshold for users to obtain data, improving query efficiency and accuracy, and effectively combining the capabilities of generative artificial intelligence models in natural language understanding and code generation.
[0010] "System" refers to an integrated device including at least one processor and optional storage devices, communication interfaces and other hardware or software components, used to execute a predetermined program to realize the overall technical solution of parsing and learning the table structure of the data storage device, and automatically generating query language and obtaining information based on user information requests.
[0011] A processor is a computing unit that can execute program instructions to perform data processing, logical operations, and flow control. It can be a single physical processor, a combination of multiple processors, a central processing unit (CPU), a graphics processing unit (GPU), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or any combination thereof.
[0012] "Data storage device" refers to hardware and / or software systems used to store structured or semi-structured data, including but not limited to relational databases, data warehouses, cloud databases, distributed database systems, and their associated metadata management components.
[0013] "Table structure" refers to the collection of structural information in a data storage device used to describe one or more data tables, including table name, field name, field data type, primary key, foreign key, index, constraints, and relationships between tables.
[0014] "Parsing" refers to the process by which a processor reads, identifies, disassembles, and structures metadata or structural description information related to table structure in a data storage device in order to obtain a clear description of the table, fields, and their relationships.
[0015] "Learning" refers to the process by which the processor models, summarizes, and stores the parsed table structure information, including establishing table structure models, relational models, and semantic mappings, so that the processor can use this structural information for reasoning and selection in the subsequent query language generation process.
[0016] "User" refers to an entity that sends a request for information to the system through a terminal device, including human operators, and may also include other computer systems or applications that submit requests on behalf of human operators.
[0017] "Information request" refers to the request content submitted by a user to the system, which describes what kind of information they want to obtain from the data storage device. It may include business elements such as query target, indicators, conditions, time range, entity name, etc.
[0018] "Natural language" refers to the language forms used by humans in daily life, including but not limited to Chinese and English. Its expression does not rely on fixed structured query syntax, but describes information needs in a free text manner.
[0019] "Specific format" refers to an information request representation that is distinct from natural language and has a predefined structure or grammatical rules, including but not limited to parameterized forms, fixed template statements, semi-structured text, and tokenized instructions.
[0020] "Generative AI models" refer to AI models that can automatically generate text content based on input text or other forms of prompts, including but not limited to large language models, code generation models and their variants, used to output query language based on prompt text.
[0021] "Prompt text" refers to the text content generated by the processor and provided to the generative artificial intelligence model. It describes the relevant structural information of the data storage device, the user's information request elements, and the expected query task, thereby guiding the generative artificial intelligence model to generate data query language that meets the expectations.
[0022] "Query language" refers to a structured language used to make data access requests to a data storage device, including but not limited to Structured Query Language (SQL), Multidimensional Expressions (MDX), Graph Query Language (such as Cypher), and other query scripts or statements that can be executed in a data storage device.
[0023] "Automatic generation" refers to the process by which a processor generates query language based on parsed table structures, user information requests, and the output of generative artificial intelligence models, without any direct human input of specific query statements.
[0024] "Information acquisition" refers to the process by which the processor uses an automatically generated query language to perform a query operation in the data storage device, thereby obtaining query result data corresponding to the user's information request, and providing the result to the terminal or subsequent processing module. Attached Figure Description
[0025] Figure 1 This is a conceptual diagram illustrating an example of the configuration of the data processing system according to the first embodiment.
[0026] Figure 2 This is a conceptual diagram illustrating an example of the main functions of the data processing apparatus and smart device according to the first embodiment.
[0027] Figure 3 This is a conceptual diagram illustrating an example of the configuration of the data processing system according to the second embodiment.
[0028] Figure 4 This is a conceptual diagram illustrating an example of the main functions of the data processing device and smart glasses according to the second embodiment.
[0029] Figure 5This is a conceptual diagram illustrating an example of the configuration of the data processing system according to the third embodiment.
[0030] Figure 6 This is a conceptual diagram illustrating an example of the main functions of the data processing apparatus and head-mounted terminal according to the third embodiment.
[0031] Figure 7 This is a conceptual diagram illustrating an example of the configuration of the data processing system according to the fourth embodiment.
[0032] Figure 8 This is a conceptual diagram illustrating an example of the main functions of the data processing device and robot according to the fourth embodiment.
[0033] Figure 9 This represents an emotion map that maps multiple emotions.
[0034] Figure 10 This represents an emotion map that maps multiple emotions.
[0035] Figure 11 This is a sequence diagram illustrating the processing flow of the data processing system of the first embodiment.
[0036] Figure 12 This is a sequence diagram illustrating the processing flow of the data processing system in Application Example 1.
[0037] Figure 13 This is a sequence diagram illustrating the processing flow of the data processing system of the second embodiment.
[0038] Figure 14 This is a sequence diagram illustrating the processing flow of the data processing system in Application Example 2. Detailed Implementation
[0039] Hereinafter, an example of an implementation of the system according to the present disclosure will be described with reference to the accompanying drawings.
[0040] First, let me explain the terminology used in the following instructions.
[0041] In the following embodiments, the processor (hereinafter referred to as "processor") with reference numerals may be a single computing device or a combination of multiple computing devices. Furthermore, the processor may be a single computing device or a combination of multiple computing devices. Examples of computing devices include CPU (Central Processing Unit), GPU (Graphics Processing Unit), GPGPU (General-Purpose computing on Graphics Processing Units), APU (Accelerated Processing Unit), etc.
[0042] In the following embodiments, RAM (Random Access Memory), as indicated in the figures, is a memory that temporarily stores information and is used as working memory by the processor.
[0043] In the following embodiments, the memory, as indicated by the reference numerals, is one or more non-volatile storage devices that store various programs and parameters. Examples of non-volatile storage devices include flash memory (SSD (Solid State Drive)), disks (e.g., hard disks), or magnetic tapes.
[0044] In the following embodiments, the communication I / F (Interface) with reference numerals is an interface that includes a communication processor and an antenna, etc. The communication I / F is responsible for communication between multiple computers. As an example of a communication specification applicable to the communication I / F, wireless communication specifications such as 5G (5th Generation Mobile Communication System), Wi-Fi (wireless fidelity) (registered trademark), or Bluetooth (registered trademark) can be listed.
[0045] In the following embodiments, "A and / or B" is synonymous with "at least one of A and B". That is, "A and / or B" means that it can be only A, only B, or a combination of A and B. Furthermore, in this specification, when "and / or" connects to express more than three items, the same interpretation as "A and / or B" applies.
[0046] First Implementation Method Figure 1 An example of the configuration of the data processing system 10 according to the first embodiment is shown.
[0047] like Figure 1 As shown, the data processing system 10 includes a data processing device 12 and an intelligent device 14. A server can be cited as an example of the data processing device 12.
[0048] The data processing apparatus 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" as understood in this disclosure. The computer 22 includes a processor 28, RAM 30, and memory 32. The processor 28, RAM 30, and memory 32 are connected to a bus 34. Furthermore, the database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[0049] The smart device 14 includes a computer 36, a receiving device 38, an output device 40, a camera 42, and a communication I / F 44. The computer 36 includes a processor 46, RAM 48, and memory 50. The processor 46, RAM 48, and memory 50 are connected to a bus 52. In addition, the receiving device 38, output device 40, camera 42, and communication I / F 44 are also connected to the bus 52.
[0050] The receiving device 38 includes a touchscreen 38A and a microphone 38B, and receives user input. The touchscreen 38A receives user input via touch by detecting contact with an indicator (e.g., a pen or finger). The microphone 38B receives user input via sound by detecting the user's voice. The control unit 46A in the processor 46 sends data representing the user input received by the touchscreen 38A and microphone 38B to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the data representing the user input.
[0051] The output device 40 includes a display 40A and a speaker 40B, and presents data to the user 20 by outputting data in a form perceptible to the user 20 (e.g., sound and / or text). The display 40A displays visual information such as text and images according to instructions from the processor 46. The speaker 40B outputs sound according to instructions from the processor 46. The camera 42 is a small digital camera equipped with an optical system such as a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor.
[0052] Communication I / F44 is connected to network 54. Communication I / F44 and 26 are responsible for sending and receiving various information between processor 46 and processor 28 via network 54.
[0053] Figure 2 The diagram shows an example of the main functions of the data processing device 12 and the smart device 14.
[0054] like Figure 2 As shown, in the data processing apparatus 12, specific processing is performed by the processor 28. A specific processing program 56 is stored in the memory 32. The specific processing program 56 is an example of a "program" as understood in this disclosure. The processor 28 reads the specific processing program 56 from the memory 32 and executes the read specific processing program 56 on the RAM 30. Specific processing is implemented by the processor 28 operating as a specific processing unit 290 according to the specific processing program 56 executed on the RAM 30.
[0055] The memory 32 stores a data generation model 58 and an emotion-specific model 59. The data generation model 58 and the emotion-specific model 59 are used by the specific processing unit 290. The specific processing unit 290 can use the emotion-specific model 59 to infer the user's emotions and perform specific processing based on the user's emotions. In the emotion inference function (emotion-specific function) using the emotion-specific model 59, various inferences and predictions related to the user's emotions are performed, including inferences and predictions of the user's emotions, but this is not limited to this example. Furthermore, emotion inference and prediction may also include, for example, emotion analysis (parsing).
[0056] In the smart device 14, the processor 46 performs the acceptance output processing. The memory 50 stores the acceptance output program 60. The acceptance output program 60 is used in conjunction with the data processing system 10 and the specific processing program 56. The processor 46 reads the acceptance output program 60 from the memory 50 and executes the read acceptance output program 60 on the RAM 48. The acceptance output processing is implemented by the processor 46 acting as the control unit 46A according to the acceptance output program 60 executed on the RAM 48. Furthermore, the smart device 14 has the same data generation model and emotion-specific model as the data generation model 58 and the emotion-specific model 59, and these models can also be used to perform the same processing as the specific processing unit 290. The acceptance output processing is implemented by the processor 46 acting as the control unit 46A according to the acceptance output program 60 executed on the RAM 48.
[0057] Alternatively, other devices besides the data processing device 12 may also have the data generation model 58. For example, a server device (e.g., a generation server) may have the data generation model 58. In this case, the data processing device 12 obtains the processing results (prediction results, etc.) using the data generation model 58 by communicating with the server device that has the data generation model 58. Furthermore, the data processing device 12 may be a server device or a user-held terminal device (e.g., a mobile phone, robot, home appliance, etc.). Next, an example of the processing of the data processing system 10 of the first embodiment will be described.
[0058] Example 1 The flow of a specific process in Example 1 will be described. Each part of the system described below is implemented by the data processing device 12 and the smart device 14. Furthermore, the data processing device 12 is referred to as the "server," and the smart device 14 is referred to as the "terminal."
[0059] In existing information retrieval technologies based on data storage devices, computer systems typically only provide fixed query interfaces or graphical filtering interfaces. Users still need to directly write query language statements to perform flexible queries and analyses. This requires users to possess professional knowledge of database structures, field meanings, and query language syntax, making it difficult for non-professional users to efficiently utilize large-scale data resources. Furthermore, even professionals, when faced with complex data structures and multi-table joins, need to repeatedly consult schema information and interface documentation, manually constructing and debugging query statements—a time-consuming and error-prone process that reduces the overall efficiency of the computer system in data processing.
[0060] Meanwhile, with the development of generative artificial intelligence models, existing technologies have attempted to use these models to convert natural language into query language, but several technical problems remain: for example, the models often lack precise constraints on specific data structures, and the generated query statements may reference non-existent fields or illegal storage areas; there is a lack of security verification and automatic correction mechanisms for the generated results, which can easily lead to destructive operations or inefficient queries; and there is a lack of unified management and utilization of multi-turn dialogue history, making it impossible to maintain context during continuous information acquisition, thus limiting the system's usability and accuracy in complex interaction scenarios. These problems essentially stem from the fact that computer systems have failed to integrate data structure parsing, generative artificial intelligence model control, query language security management, and dialogue context utilization at the architecture and program flow levels, resulting in a lack of reliable computer implementation mechanisms for the natural language to query language conversion process.
[0061] Furthermore, when existing systems collaborate with front-end terminals, they often simply return raw query results data without a unified mechanism to process the results into structured output, associate the output data with the corresponding query language. This makes subsequent visualization, audit trails, and query reuse dependent on additional manual operations or independent system support, increasing system complexity and hindering the formation of a closed-loop data processing flow within the computer.
[0062] Therefore, it is necessary to provide a new system architecture and program control scheme that enables computers to: automatically parse and learn data structures, transforming them into pattern information usable by generative artificial intelligence models; precisely control the behavior of generative artificial intelligence models through prompts; perform security and validity checks and dynamically correct them before and after query language generation; manage multi-turn dialogue history and embed it into prompts to achieve contextual association; and simultaneously convert query results into structured data adapted for terminal display and establish a connection with the query language. Through the above technical solutions, the automation, security, accuracy, and auditability of natural language query processing can be improved from the perspectives of computer architecture and program logic, thereby enhancing the overall technical performance of computers in data access and interactive analysis.
[0063] The specific processing performed by the specific processing unit 290 of the data processing apparatus 12 in Embodiment 1 is achieved by the following means.
[0064] In this invention, the server includes: a device for acquiring a data structure and parsing all or part of the data structure based on the storage area identifiers and attribute information contained in the data structure, and recording the parsing results as pattern information; a device for parsing information retrieval requests received from a user terminal in natural language or a predetermined format, and constructing prompt statements for instructing a generative artificial intelligence model to generate query language based on the pattern information and the information retrieval requests; a device for inputting the prompt statements into the generative artificial intelligence model, acquiring the output query language from the generative artificial intelligence model, performing retrieval processing on a data storage device based on the storage areas and operational conditions contained in the query language, converting the retrieval results acquired from the data storage device into output data; a device for sending the output data to the user terminal; a device for checking the query language for the existence of prohibited statements, the validity of referenced objects, and syntactic consistency, and dynamically correcting the prompt statements based on the check results and re-inputting them into the generative artificial intelligence model; and a device for associating and recording the dialogue history of multiple information retrieval requests with identification information, and providing context to the generative artificial intelligence model to generate query language by including the dialogue history in the prompt statements. This enables the implementation of a complete technical process within the computer, from automatic data structure parsing, precise construction of prompt statements, controlled invocation of generative artificial intelligence models, security verification and dynamic correction of query language, to multi-turn dialogue context management and structured result output. This improves the accuracy and security of query language generation, enhances the retrieval efficiency of data storage devices, and strengthens the usability and auditability of the system in interactive data analysis scenarios, all without requiring users to master professional query language skills. This achieves a comprehensive improvement in computer data processing capabilities and human-computer interaction performance.
[0065] "Data structure" refers to the logical structure information used to organize and represent data in a data storage device, including metadata such as tables, fields, indexes, constraints, and their interrelationships.
[0066] "Storage area identifier" refers to the identification information used to uniquely distinguish each data unit or data set within a data storage device, including but not limited to table name, field name, view name, schema name, etc.
[0067] "Attribute information" refers to descriptive metadata associated with a storage area, including data type, length, whether nullables are allowed, primary key or foreign key attributes, default values, and constraints.
[0068] "Schema information" refers to an abstract set of information obtained from data structure parsing, used to describe the data organization and field meanings in a data storage device. It can be stored and used in the form of text, metadata records, or structured descriptions.
[0069] "User terminal" refers to a computing device operated by a user and interacting with a server through a communication network, including but not limited to personal computers, mobile terminals, tablet devices, or other devices with display and input functions.
[0070] "Information retrieval request" refers to the instruction issued by a user to obtain target information from a data storage device. This instruction can be expressed in natural language or a predetermined format and includes information requirements such as data range, filtering conditions, and statistical methods.
[0071] "Generative artificial intelligence model" refers to an artificial intelligence model that is based on machine learning or deep learning technology and can automatically generate text, code or other data based on input content by learning from training data. In this invention, it is used to generate query language based on prompt statements.
[0072] "Prompt statements" refer to the set of control text or structured information input into a generative artificial intelligence model to limit the model's role, task, available data structure, and output requirements. These include system-level descriptions, rule constraints, and expressions of user requests.
[0073] "Query language" refers to a formal language used to issue operation instructions such as data retrieval, filtering, aggregation or updating to a data storage device. In the embodiments, it is usually a structured query language or a variant thereof.
[0074] "Data storage device" refers to a device or system used for persistent storage of structured or semi-structured data and providing a data read / write interface, including database systems, data warehouse systems, or storage systems with query functions.
[0075] "Retrieval processing" refers to the access operations performed in a data storage device according to a query language, including the selection, filtering, grouping, aggregation, and sorting of data records, in order to obtain data results that satisfy the information retrieval request.
[0076] "Output data" refers to the result data generated by the server after receiving the search results, which is displayed to the user terminal or processed subsequently, including structured data that has been formatted, reorganized, or processed by calculation.
[0077] "Forbidden statements" refer to statements or keywords in the query language that are pre-set by the system to be prohibited or require restricted use, including operation instructions that may cause data corruption, exceed permission limits, or affect system stability.
[0078] "Reference object validity" refers to the attribute that the storage area, field, or other data object referenced in the query language exists in the data storage device and is consistent with the schema information.
[0079] "Syntactic consistency" refers to whether the query language conforms to the predetermined grammatical rules, whether the statement structure is correct, and whether the various grammatical elements meet the language specification requirements.
[0080] "Dialogue history" refers to a collection of interaction records associated with the same user or the same session, formed between multiple information retrieval requests. This includes user requests, system response results, and query language generated in between.
[0081] "Identification information" refers to identifying data used to distinguish different users, different sessions, or different interaction links, including user identifiers, session identifiers, or other tags that can uniquely identify the context of a conversation.
[0082] "Context" refers to the semantic environment composed of dialogue history, current information retrieval request, and related pattern information, which helps generative artificial intelligence models understand user intent and generate query language consistent with previous and subsequent requests.
[0083] "Structured data" refers to data that is organized according to a predetermined data model, has clearly defined fields and data types, and is easy to display and process on user terminals in the form of tables, graphs or other standardized methods.
[0084] The embodiments of this invention will be described in conjunction with the specific composition of the hardware structure, software modules, data structure, and generative artificial intelligence model. The following embodiments are merely illustrative examples, and those skilled in the art can make various modifications and substitutions without departing from the spirit of this invention.
[0085] I. System Overall Structure In this invention, the server serves as the core computing device, connecting to terminals and data storage devices via a communication network. The server can employ a general-purpose computing platform, such as a rack-mounted or cloud-based computing node with a multi-core general-purpose processor, at least 16GB of memory, and solid-state storage. The operating system can be a Unix-like operating system. The server runs a web service framework, middleware, database access drivers, and a generative artificial intelligence model inference environment on its software.
[0086] The terminal, as a user interaction device, can be any computing device with a display screen and input device, such as a smartphone, tablet computer, personal computing device, or embedded display terminal. The terminal communicates with the server through a browser or dedicated application. In this invention, the terminal primarily handles user input collection, result display, and data transmission with the server; it does not execute complex query generation logic.
[0087] Users input information in natural language through a terminal to request information and view the structured query results returned by the server. Users do not need to have knowledge of query language syntax; they only need to describe their information needs in natural language.
[0088] Data storage devices can be centralized database systems, distributed data warehouses, or cloud storage clusters. Internally, the data storage device manages data using a table structure, typically including sales data tables and customer data tables, each containing multiple columns and fields. The data storage device provides a standard query language interface, through which the server sends query statements and receives results via the database driver.
[0089] II. Server Software Modules and Program Structure In one embodiment of the present invention, the server includes the following main software modules (each module may be implemented as a process, thread, or function library): 1. Pattern parsing and management module In the schema resolution and management module, the server uses the metadata interface provided by the database management system to obtain the names, column names, data types, constraint information, and relationships between tables. The server then organizes this information into a unified "schema information" data structure in memory.
[0090] The server constructs record entries for each table in the schema information. These record entries include: - Table identifier (e.g., logical name, physical name); - Column identifier list (field name, data type, whether it is a key field, whether it is nullable); - Relationship information (such as primary keys, foreign keys, and related table information).
[0091] The server stores schema information in persistent storage or an in-memory database for easy and fast subsequent retrieval. The server can periodically retrieve metadata from the data storage device to respond to changes in the data structure.
[0092] Through this centralized information management model, when the server invokes the generative artificial intelligence model, it can accurately encode the currently available data structures, field names, and constraints into the prompt statement, thereby reducing the occurrence of non-existent fields referenced in the generated results and improving the accuracy of the query language.
[0093] 2. Prompt Statement Module After receiving a natural language information request from the terminal, the server combines the pattern information with the current user request into a text description in the prompt statement composition module. This description is used as the input control content for the generative artificial intelligence model.
[0094] In one specific implementation, the server divides the prompt statement into two parts: a system description section and a user request section. The system description section includes the following: - Model role description: For example, "You are an assistant who is specifically responsible for converting Chinese natural language into query language"; - Data structure description: Names of each table and descriptions of its main fields; - Generation rules: For example, "only output the query language itself, not the explanation", "prohibit the generation of statements that update or delete data"; - Default conditions: For example, "When the user does not specify a year, the current year will be used by default".
[0095] The user request section directly includes the user's natural language input, for example: "User request: I want to view the sales figures for each month of 2023, broken down by product category." During the creation of the query prompt, the server dynamically supplements contextual information based on the dialogue history, such as the tables used in the previous query, filtering conditions, and the analysis scope previously confirmed by the user. The server inserts this contextual content into the system description or supplementary descriptions, enabling the generative AI model to consider the consistency of multi-turn dialogues when generating new query language.
[0096] The following is an example of a prompt statement from the server in one embodiment (in text form): You are an assistant specifically responsible for converting Chinese natural language into query language.
[0097] The current database is a sales database, containing the following table structure: Table "Sales Report": - Product Category (Text Type) - Month (integer type) - Year (integer type) - Sales Revenue (Numerical Type) Your task is to generate a standard query language statement based on the user's Chinese request.
[0098] Require: 1. Output only the query language statement itself, without any explanation.
[0099] 2. Do not generate statements that modify or delete data.
[0100] 3. If a user requests data for 2023, please add "year = 2023" to the conditions.
[0101] User request: I want to view the sales figures for each month of 2023, broken down by product category.
[0102] Through the aforementioned prompts, the server constrains the behavior of the generative artificial intelligence model, ensuring that the query language it generates strictly matches the actual data structure and avoiding dangerous operations. This creates a more secure and controllable control mechanism within the computer than traditional natural language interfaces.
[0103] 3. Generative Artificial Intelligence Model Module In one embodiment of the present invention, the server uses a generative artificial intelligence model based on deep learning. This model can employ a sequence-to-sequence network structure based on a self-attention mechanism, such as a transformer network containing multiple layers of encoders and decoders. In the model module, the server loads pre-trained network parameters that have been fine-tuned for a natural language to query language task.
[0104] The server can be configured in the following way in terms of model structure: - Word embedding layer: Maps the tokens in the input text to fixed-dimensional vectors; - Multi-head self-attention layer: used to capture long-distance dependencies within a sentence; - Feedforward neural network layer: performs non-linear transformation on the attention output; - Residual connections and layer normalization: used to accelerate training and stabilize the network; - Decoder section: Generates query language tag sequences autoregressively.
[0105] During the training phase, the server uses pairs of natural language requests and corresponding query languages as training samples, employs cross-entropy as the loss function, and updates the network weights using gradient descent. The server can apply strategies such as learning rate decay, gradient clipping, and regularization during training to improve the model's generalization ability.
[0106] During the inference phase, the server encodes the prompt statement as input text into a token sequence. After word embedding and encoder processing, the decoder progressively generates the query language based on the generated tokens and attention context. The server can set inference parameters such as maximum output length, temperature coefficient, and beam search width to balance diversity and accuracy.
[0107] Unlike traditional natural language interfaces based on template matching or simple rules, this invention uses a deep neural network to vectorize the structure and semantic relationships of natural language, enabling it to handle complex sentence structures and multi-condition expressions. Furthermore, by explicitly injecting pattern information and rule constraints into the prompt statements, the server forms a composite mechanism of "neural network generation + explicit control," which enhances the controllability and interpretability of the natural language to query language conversion process at the computer level.
[0108] 4. Query Language Security Verification and Dynamic Correction Module After obtaining the query language output by the generative artificial intelligence model, the server performs multi-level checks on the query language in the query language security verification and dynamic correction module, including: - Prohibited Statement Detection: The server pre-registers prohibited keywords or operations in a list, such as deleting a table, updating data, creating a structure, etc. The server checks whether the query language contains these keywords through lexical analysis; - Reference object validity check: The server parses the query language into an abstract syntax structure, extracts the table name and column name from it, and compares them with the records in the schema information. When an unknown table or unknown field is found, the server determines it to be an invalid reference. - Syntax consistency check: The server can call the database's syntax analysis interface or use a local syntax parser to perform syntax analysis on the query language and detect problems such as missing keywords or mismatched parentheses.
[0109] When the server finds an error during its check, it does not immediately terminate with an error message. Instead, it sends the error information as text in a new message. For example, when a field name is incorrect, the server can construct the following message: System Information: An error occurred during the execution of the previously generated query language. The error message is as follows: "Field 'Sales_Total' does not exist. Please check the field name." Please regenerate the query language based on the correct field name "Sales".
[0110] User request: I want to view the sales figures for each month of 2023, broken down by product category.
[0111] The server re-inputs the prompt into the generative AI model, guiding the model to correct the erroneous field. This iterative correction mechanism allows the computer system to automatically converge to a query language with correct structure and syntax without human intervention, improving the overall robustness and automation of the system.
[0112] 5. Query execution and result data construction module After passing security verification, the server sends the query language to the data storage device. The server establishes a connection with the data storage device using the database driver and submits the query language. The data storage device internally performs data operations such as index retrieval, filtering condition calculation, grouping and aggregation, and returns the result set.
[0113] In the result data construction module, the server performs the following data processing on the result set: - Field standardization: The server maps field names to uniform display names; - Sorting and pagination: The server sorts the results by time, category, and other dimensions, and performs pagination when necessary; - Derivative indicator calculation: The server calculates derived indicators such as ratio values and year-on-year growth as needed.
[0114] The server organizes the processed results into a structured format for easy display on the terminal. For example, the server can construct an internal structure containing a list of column names and a list of row records, and record the query language content corresponding to the result. The server can return the query language along with the result data, allowing the terminal or subsequent systems to audit and reuse it.
[0115] By centralizing data processing on the server side, the server can reduce the processing burden on the terminal and decrease the complexity of intermediate results transmitted over the network, which is beneficial for maintaining low communication load and high response speed in high-concurrency scenarios.
[0116] III. Terminal Implementation Forms In one embodiment of the invention, the terminal runs a general-purpose browser or a dedicated application. During the user input phase, the terminal provides a text input area through a graphical interface, where the user inputs a natural language information retrieval request. When receiving data returned by the server, the terminal renders the structured result data as a table or graphical view.
[0117] The terminal can use a native scripting language for simple data caching and interface switching, but it does not participate in complex pattern parsing and query generation logic. When needed, the terminal can provide a query language viewing function, allowing advanced users to directly see the query language content corresponding to the current result for verification or reuse.
[0118] IV. Technical Effects and Improvements in Computer Technology Through the modular design described above, the server achieves the following technical improvements within the computer system: 1. Improved query generation accuracy and reduced error rate The server utilizes a pattern parsing module to extract precise data structure information and explicitly injects this information into the generative artificial intelligence model via prompts, thereby forming a composite feature representation of "natural language semantic vectors + explicit structural constraints" within the model. Compared to traditional generation methods that rely solely on corpus distribution, this invention reduces erroneous references to non-existent fields by the model, significantly lowering the field error rate of the query language.
[0119] 2. Improved processing speed and computational efficiency Before queries are executed, the server performs local syntax and structure checks to prevent a large number of erroneous queries from being directly submitted to the data storage device, thereby reducing unnecessary load on the database engine. The server employs an in-memory database or high-speed cache structure for schema information caching and dialogue context management, significantly reducing the time overhead of schema queries and context retrieval. In high-concurrency request scenarios, this local preprocessing and caching mechanism significantly improves overall processing throughput.
[0120] 3. Improvement of Data Management and Auditability When constructing output data, the server associates and stores the query language with the result data, forming a traceable query record. This record can be used for subsequent analysis and security auditing, facilitating the tracing of the specific query language and its generation process from which a result set originates. This association mechanism is often missing in traditional natural language interfaces. This invention introduces a unified management module into the server, making the data management structure within the computer system more complete and traceable.
[0121] 4. Reduced communication load and terminal computing burden The server performs aggregation and filtering operations on the data storage device side, sending the pre-organized structured results to the terminal, avoiding the transmission of large amounts of raw, detailed data. The terminal only needs to render and display the data, resulting in a smaller processing load, making it suitable for use in mobile network environments. This reduces communication load and improves the user experience.
[0122] 5. The fundamental difference from human manual operation In this invention, the server does not simply automate the process of manually writing query language. Instead, it constructs a technical system within the computer, centered on a generative artificial intelligence model, using pattern information and prompts as control mechanisms, and employing security verification and dynamic correction as a closed loop. At the algorithmic level, this system utilizes deep neural network parameter learning and vectorized semantic modeling; at the system level, it employs pattern caching, dialogue context management, and security filtering to achieve efficient and controllable query generation under conditions of large-scale data structures and complex natural language input. This structure is based on a comprehensive improvement of computer architecture and algorithm design, rather than a simple automatic mapping of human rules.
[0123] V. Other Implementation Variations In different implementations, the server can replace the specific network structure of the generative artificial intelligence model. For example, it can use transformer networks with different numbers of layers, different hidden dimensions, or different numbers of attention heads. It can also use a pre-trained language model and continue to fine-tune it on local data. During training, the server can use different combinations of loss functions, such as adding length regularization terms or grammatical constraint terms to the cross-entropy loss to improve the executability of the generated results.
[0124] For storing schema information, the server can choose a file system, relational database, or key-value store, as long as it can quickly retrieve data by table name and field name. The server's security verification module can incorporate a rule-based policy system to configure different prohibited statements and resource access whitelists for different business scenarios.
[0125] Terminals can adopt different display methods depending on the application scenario. For example, in industrial monitoring scenarios, query results can be converted into dashboards or alarm graphs, while in data analysis scenarios, multi-dimensional interactive charts can be used. User natural language requests can also be extended to control-related operations, such as requesting the generation of periodic report configurations. After parsing, the server can integrate the generated query language with the scheduling system to achieve automated task configuration.
[0126] Through the various implementations and variations described above, this invention provides a universal and scalable technical solution for different types of data storage devices and application environments while ensuring the accuracy, security, and efficiency of query language generation. This achieves structural improvements and performance enhancements to the natural language query interface at the computer technology level.
[0127] use Figure 11 The processing procedure is explained.
[0128] Step 1: The user enters information on the terminal to retrieve a request. Users open the query function page in the terminal interface and enter information in natural language in the text input box to obtain the request. An example input is: "I want to view the sales figures for each month of 2023 by product category." The terminal takes the string entered by the user as input data, uses a local script to obtain the content of the string, removes leading and trailing spaces, and encapsulates the string with the user identifier and session identifier into a request record.
[0129] The terminal records the request as output and sends it to the server via a network protocol.
[0130] Step 2: The server receives and parses the request from the terminal. The server takes the request record sent by the terminal as input, parses the communication message through the network service module, and extracts the natural language text "I want to view the sales figures for each month of 2023 by product category" as well as metadata such as user identifier and session identifier.
[0131] The server processes the input data: it decodes the text into an internal string according to the encoding format, matches the user identifier against the current session context table to determine if there is any existing dialogue history. The server records the timestamp, user identifier, and original text of the request in the log system.
[0132] The server outputs the parsed natural language request and session context pointer to the subsequent prompt statement building module.
[0133] Step 3: The server retrieves and organizes schema information of the data structure. The server takes the information returned by the metadata interface of the data storage device as input and reads the table name, column name, data type and constraint information from it.
[0134] The server processes the input in a structured manner: it constructs an internal data structure for each table, containing table identifiers, column lists, primary key and foreign key information, and then aggregates these data structures into a schema information set. The server can standardize field names, such as by unifying naming styles and adding Chinese explanations.
[0135] The server outputs the processed pattern information, stores it in a cache or in-memory database, and provides it to the prompt statement composition module.
[0136] Step 4: Prompt statements for servers to form generative artificial intelligence models The server takes the natural language request obtained in step 2 and the pattern information obtained in step 3 as input, and the historical query summary saved in the session context as auxiliary input.
[0137] The server performs data combination operations in the string processing module: based on a preset template, it concatenates model role descriptions, table structure descriptions, generation rules, and default conditions into system description text, and then appends the user's natural language request as the user request text. As needed, the server embeds key information from historical queries into the description text in the form of "dialogue history."
[0138] The server outputs a complete prompt text that explicitly includes data structure information, constraint rules, and the current user request, for use by the generative artificial intelligence model.
[0139] Step 5: The server invokes a generative artificial intelligence model to generate the query language. The server takes the prompt from step 4 as input and sends it to the inference interface of the generative artificial intelligence model.
[0140] During model inference, the server encodes the input using tokenization, splitting the text into a sequence of tokens, and then converts it into a vector representation through an embedding layer and an encoder. The generative AI model, based on a transformer structure, performs self-attention computation and feedforward transformation on these vectors, progressively outputting a sequence of tokens representing the query language. The server then performs de-tokenization on the model output, restoring the token sequence to the query language string.
[0141] The server outputs the generated query language statement, for example: The query "SELECT Product Category, Month, SUM(Sales Amount) AS Monthly Sales Amount FROM Sales Table WHERE Year = 2023 GROUP BY Product Category, Month;" is then passed to the security verification module.
[0142] Step 6: The server performs security and validity checks on the generated query language. The server takes the query language string output from step 5 as input, first splits the string into a token sequence using a lexical analyzer, and then scans the token sequence to detect whether it contains preset prohibited keywords, such as deletion, update, or structural modification instructions.
[0143] The server then processes the query language using the schema information: parsing out the table names and column names, and matching them with the schema information set. If an unknown table or column is found, the server records it as an invalid reference. The server can also call a syntax parser to build a syntax tree for the query language to determine whether the syntax structure is complete and consistent.
[0144] The server generates a validation result record as output based on the analysis results. This record indicates whether the query language is safe and valid; for invalid cases, it also includes a description of the error reason. The server forwards safe and valid query languages to the query execution module and invalid cases to the prompt statement correction module.
[0145] Step 7: The server corrects and regenerates error messages for queries containing incorrect language. The server takes the verification result from step 6 and the original query language as input. When the verification result shows that there are prohibited statements, unknown fields, or syntax errors, the server constructs a new prompt statement in the string processing module.
[0146] The server embeds the error reason as text into the new system description, for example, adding "System Information: The previously generated query language encountered an error during execution, the error content is...", and keeps the original user request unchanged, recombining it into the corrected prompt statement.
[0147] The server outputs the corrected prompt and inputs it into the generative artificial intelligence model again, repeating steps 5 and 6 until a valid query is generated.
[0148] Step 8: The server executes queries and retrieves search results from the data storage device. The server takes the validated query language string as input, establishes a connection with the data storage device through the database driver, and submits the query language to the data storage device.
[0149] The data storage device internally performs data operations based on the query language: it reads records that meet the specified conditions from the specified table and performs grouping and aggregation operations on the specified columns. The server receives the result set returned by the data storage device at the client interface and decodes the result set into an internal structure, such as a list of multiple records, each containing fields such as "product category", "month", and "monthly sales".
[0150] The server outputs the result set to the result processing module, and can also attach metadata such as execution time and number of returned rows.
[0151] Step 9: The server builds output data and associates it with query languages. The server takes the result set obtained in step 8 and the validated query language as input, and performs data processing on the result set in the result processing module: arranges the records according to the specified field order, performs formatting processing on the numerical fields as needed (e.g., retaining decimal places), and calculates derived data (such as sum, percentage) when necessary.
[0152] The server constructs a structured output data structure, combining a list of column names, a list of records, and the corresponding query language into a unified object. The server can also assign a unique identifier to this object for subsequent auditing and reuse.
[0153] The server uses the structured output as data and hands it over to the communication module, ready to send it to the terminal.
[0154] Step 10: The server sends the output data to the terminal. The server takes the structured output from step 9 as input, serializes it into a transmission-formatted text (e.g., a JSON string), and encapsulates it into a response message via the network interface. The server adds a status code and necessary metadata information to the response header.
[0155] The server sends the encapsulated response message to the network address specified by the terminal, completing the server-side processing of this request.
[0156] The server will record the success status, data size, and response time in the log output for subsequent performance analysis and troubleshooting.
[0157] Step 11: The terminal receives and displays the results returned by the server. The terminal takes the server's response message as input, parses the message through the local communication module, and extracts structured output data, including column names, record lists, and associated query language text.
[0158] The terminal processes and displays the data in its interface rendering module: it generates table headers based on column names and plots the record list row by row into a data table; or it maps the "Month" and "Monthly Sales" fields to graphical components to generate line charts or bar charts. In advanced mode, the terminal can also display associated query languages in a separate area for user viewing.
[0159] The terminal displays the graphical interface as output on the display device, allowing users to visually view the query results on the terminal screen. Users can then input new natural language requests based on the current results to proceed to the next processing step.
[0160] Application Example 1 The process flow corresponding to the specific processing in Use Case 1 will be described below. The various parts of the system described below are implemented by the data processing device 12 and the intelligent device 14. Furthermore, the data processing device 12 is referred to as the "server" and the intelligent device 14 is referred to as the "terminal".
[0161] In existing computer data processing technologies, end users typically rely on specialized query languages, complex data table structures, and specialized data analysis tools to retrieve information from large-scale data storage devices. For non-professional users lacking knowledge of database syntax and schema structures, directly issuing information requests via natural language and automatically obtaining accurate data queries and graphical analysis results remains quite difficult. Even when some systems introduce natural language interfaces, they usually only perform keyword matching or template replacement internally, failing to accurately understand the user's semantic intent or automatically construct high-quality query statements based on the underlying data structure. This results in inaccurate query results, insufficient visualization, and requires users to manually adjust parameters and statements multiple times, leading to low interaction efficiency.
[0162] Furthermore, traditional systems often rely on fixed rules or scripts to generate query language, making it impossible to adaptively optimize the system based on historical query behavior and results. They also cannot automatically improve query generation strategies and visualization content selection strategies through generative artificial intelligence models. As a result, even with longer system runtime, they still cannot significantly reduce error rates or improve response quality.
[0163] Furthermore, existing data analysis systems often only provide static mappings from queries to charts, lacking the ability to perform in-depth preprocessing of user natural language requests (such as string normalization, segmentation, and format validation) and automatic generation of prompts. This makes generative artificial intelligence models susceptible to interference from noisy inputs, ambiguous expressions, or incomplete sentences, resulting in problems such as unstable generated query statements and mismatch between visualization results and user intent.
[0164] Therefore, a system is needed that can improve the end-to-end processing flow from natural language to query language to visualization results within the computer. This system should significantly improve the accuracy and robustness of automatically generated query language on the server side through machine learning of data structures, semantic parsing of natural language requests, automatic construction and dynamic correction of prompts from generative artificial intelligence models, and continuous learning from historical interaction data. At the same time, it should reduce the number of trial and error attempts users make to obtain the correct results, thereby substantially improving the processing performance and interactive experience of computers in data access and analysis tasks.
[0165] The specific processing performed by the specific processing unit 290 of the data processing apparatus 12 in Application Example 1 is achieved by the following means.
[0166] In this invention, the server includes means for parsing the data structure of a data storage device and learning all or part of the structural and attribute information of the data structure using machine learning methods; means for receiving natural language information requests from a user terminal and semantically parsing the information requests based on the learned data structure information to generate a structured data request containing a set of data to be acquired, conditional items, summary items, and visualization categories; means for generating an intermediate representation corresponding to the query language syntax and the data structure of the data storage device based on the structured data request and automatically generating a query language accordingly; and means for sending the automatically generated query language to the data storage device and obtaining information from it that corresponds to the data request. The system includes: means for processing information, means for statistically processing and transforming the acquired information to generate visualized data including graphics or charts, means for generating natural language explanatory text based on the visualized data and the acquired information using a generative artificial intelligence model, and means for converting the explanatory text and the visualized data into a form that can be output to the user's operating terminal; and means for performing string normalization, segmentation, and format validation on prompt statements input to the generative artificial intelligence model, and automatically generating, correcting, or completing the prompt statements based on the processing results to control the query language generation process, and for learning or adjusting the parameters of the generative artificial intelligence model based on historical natural language information requests and historical query results. This allows for the formation of a closed-loop processing pipeline within the server, from natural language information requests to structured data requests, intermediate representation, query language generation, data acquisition, and visualization and automatic explanatory generation. This enables the computer system to stably and efficiently automatically construct high-quality query languages, reduce query errors, improve the consistency between visualization results and user semantic intent without requiring users to possess database expertise. Furthermore, it allows for adaptive improvement of query generation and visualization strategies through continuous learning of historical interaction data, thereby substantially improving the computer's processing power and resource utilization efficiency in data access and analysis tasks.
[0167] A "system" refers to a computer-based device consisting of at least one server, at least one data storage device, and at least one user terminal interconnected through a communication network to collaboratively perform data processing and information provision functions.
[0168] A "server" is a computer device that includes a processor, memory, and communication interface, used to execute program instructions to perform functions such as data structure parsing, semantic parsing, query language generation, data acquisition, visualization generation, and explanatory text generation.
[0169] "User terminal" refers to an electronic device that allows users to input and view output, including but not limited to smartphones, tablets, personal computers, etc., which can send natural language information requests to the server and receive the server's returned results through a graphical user interface or other human-computer interaction methods.
[0170] "Data storage device" refers to a storage device used to store data in a structured or semi-structured form for a long period of time and to support read and write access based on a query language, including database servers, distributed storage systems or other data persistence devices.
[0171] "Data structure" refers to the logical and physical structure information used to organize and represent data in a data storage device, including tables, fields, indexes, constraints, relationships, and their metadata.
[0172] "Structure information" refers to metadata information that describes the hierarchical relationships, associations, field types, primary keys, and foreign keys among data units or data sets in a data storage device.
[0173] "Attribute information" refers to the characteristic information associated with each field or data object in a data structure, including data type, value range, statistical characteristics, business meaning, naming rules, and other attribute data used to assist in understanding and processing the data.
[0174] "Machine learning methods" refer to a class of algorithms and techniques that use training data to automatically adjust model parameters so that the model can learn patterns from the data and make predictions or inferences in subsequent processing. These methods include supervised learning, unsupervised learning, and reinforcement learning.
[0175] "Natural Language Information Request" refers to text information entered by a user in the form of human natural language (such as Chinese, English, etc.) to express the data content, conditions and restrictions, and display methods they wish to obtain.
[0176] Semantic parsing refers to the process of analyzing natural language information requests to identify semantic elements such as query objectives, conditions, metrics, grouping methods, and visualization requirements, and then converting them into a structured representation.
[0177] "Structured data request" refers to data access requirements expressed in a predefined data structure form based on semantic parsing, which includes information such as the data set to be accessed, filtering conditions, aggregation methods, sorting methods, and visualization categories.
[0178] A “data set” refers to a logical collection of data records or data objects that meet specific conditions and are selected from a data storage device based on a structured data request.
[0179] "Condition items" refer to one or more constraints used to limit the scope of a data set, including field value constraints, time interval constraints, classification restrictions, etc.
[0180] "Summary items" refer to the target items corresponding to statistical operations performed on the numerical fields in a dataset, including statistical measures such as summation, count, average, maximum, and minimum.
[0181] "Visualization category" refers to the category information used to specify how the data results are displayed graphically, including chart types such as bar charts, line charts, pie charts, and scatter plots.
[0182] "Intermediate representation" refers to an abstract representation that lies between natural language information requests and specific query languages, and is associated with data structures and query syntax. It is used to clarify the logical structure of query targets, conditions, aggregations, and groupings.
[0183] "Query language" refers to a formal language used to issue data access and operation requests to data storage devices, including Structured Query Language and its dialects or other equivalent query expression languages.
[0184] "Automatic query language generation" refers to the process by which the system constructs a query language programmatically based on structured data requests and data structure information without requiring manual writing of specific query statements.
[0185] "Statistical processing" refers to the process of performing mathematical and statistical operations on data obtained from data storage devices, including summation, counting, averaging, variance calculation, grouping and aggregation, etc.
[0186] "Conversion processing" refers to the processing of raw data, including format conversion, unit conversion, dimension transformation, sorting, or other methods to adapt it for visualization or subsequent analysis.
[0187] "Visualized data" refers to data representation results that have undergone statistical processing and transformation, and are presented in the form of graphics or charts to intuitively display data characteristics and relationships.
[0188] "Graphics or charts" refers to a graphical representation used to present the distribution, trends, comparisons, or structural relationships of data, including bar charts, line charts, pie charts, scatter plots, and other data visualization charts.
[0189] "Generative AI models" refer to AI models that can automatically generate text, structured data, or other outputs based on input content, including deep learning-based sequence generation models, transformer models, etc.
[0190] "Explanatory text" refers to natural language text generated based on visualized data and acquired information, used to explain and describe data content, statistical results, or analytical conclusions.
[0191] "Output format" refers to the specific data format and transmission method by which the server encodes and encapsulates visual data and explanatory text into a format that can be correctly received and presented by the user's terminal, including the encapsulation structure of image data, text data, and combinations thereof.
[0192] "Prompt statements" refer to one or more pieces of text that are input to a generative artificial intelligence model and are used to instruct or guide the model to perform specific tasks such as query language generation, summary generation, or explanatory text generation.
[0193] "String normalization" refers to the process of standardizing natural language information requests or prompts, including case conversion, whitespace standardization, special character handling, encoding standardization, and redundant character elimination.
[0194] "Segmentation processing" refers to the process of breaking down natural language information requests or prompts into basic units such as words, phrases, or clauses according to semantic or grammatical rules, for use in subsequent semantic parsing or model input.
[0195] "Format validation processing" refers to the process of checking the structure, length, character set, and whether key fields of natural language information request or prompt statements are complete in order to determine whether they conform to the predetermined input specifications.
[0196] "Dynamic correction or completion" refers to the process of automatically modifying, expanding, or completing the content of prompt statements based on the results of string normalization, segmentation, and format validation, in order to improve the input quality of generative artificial intelligence models.
[0197] "Historical data" refers to information related to data query and interaction that is accumulated and stored during the operation of the system, including historical natural language information requests, corresponding query languages, query results, and user feedback.
[0198] "Learning or parameter tuning" refers to a series of processes that train, fine-tune, or update the parameters of a generative artificial intelligence model based on historical data in order to improve the quality and adaptability of the model's output.
[0199] "Automatic query language generation accuracy" refers to the degree of semantic and execution result consistency between the query language automatically generated by the system based on natural language information requests and the ideal query statement. It is used to measure the correctness and reliability of the automatic generation process.
[0200] "Visualized data generation content" refers to the specific combination and presentation method of data dimensions, metrics, chart types, and layout styles selected by the system when generating visualized data.
[0201] In each implementation, the server, terminal, and user each assume different functional roles, working together to achieve a complete technical process from natural language information request to query language generation, data acquisition, and visualization. The following, using representative implementations, provides a detailed description of the system structure, program modules, data structure, artificial neural network model, and technical effects of this invention.
[0202] I. Overall System Composition In one embodiment, the server is configured as one or more general-purpose computer devices, including a processor, main memory, non-volatile memory, and a network interface. At the hardware level, the server may employ computing nodes with multi-core central processing units and may optionally be equipped with graphics processing units to accelerate deep learning computations.
[0203] In one embodiment, the terminal includes a smartphone, tablet computer, or personal computer. The terminal runs a mobile operating system or a desktop operating system and communicates with the server through a browser application or a dedicated client application. The terminal has a display device, an input device, and a network communication module for sending natural language text to the server and displaying the graphical and textual results returned by the server.
[0204] In one implementation, users input prompts in natural language to the server through the terminal's graphical user interface, and then understand and analyze the results based on the visualizations displayed on the terminal.
[0205] In one embodiment, the data storage device is configured as a relational database system or an equivalent data management system. The data storage device internally stores multiple data tables, each of which has predefined fields, primary keys, foreign keys, and index structures.
[0206] II. Server Program Modules and Software Composition In one implementation, the server uses a general-purpose programming language to implement the main program logic, and the server deploys the following functional modules on the operating system: 1. Data Structure Analysis and Learning Module; 2. Natural Language Preprocessing and Semantic Parsing Module; 3. Intermediate representation construction and query language generation module; 4. Data access and result shaping module; 5. Data statistics and visualization generation module; 6. Description text generation module; 7. Module for generating and dynamically correcting prompt statements; 8. Historical data management and model update module.
[0207] In one implementation, the server implements a generative artificial intelligence model using a deep learning framework. During the model inference phase, the server performs tensor operations using a graphics processing unit or a central processing unit. The server communicates with the data storage device through a database access library and generates visual graphics through a graphics rendering library.
[0208] III. Data Structure Analysis and Learning In one implementation, the server periodically or during system initialization reads metadata from the data storage device, including table names, field names, field types, primary key information, foreign key relationships, and index information for each data table. The server parses this metadata and constructs a graph structure representation, where nodes represent data tables or fields, and edges represent foreign key relationships or logical associations.
[0209] In one implementation, the server learns the graph structure described above using machine learning methods. Specifically, the server encodes each field and table as a vector representation. The server constructs features based on foreign key join frequency, frequency of union queries, field value distribution statistics, etc. The server performs embedding learning on these features to obtain a vector space representation that reflects the semantics of the data structure.
[0210] In another implementation, the server inputs the textual information of field names and table names along with the statistical features of the fields into the neural network. The server uses an attention mechanism to fuse the semantic and structural features of the names, so that the generative artificial intelligence model can more accurately align to the underlying data fields when parsing the user's natural language in the future.
[0211] IV. Natural Language Preprocessing and Semantic Parsing In one embodiment, the terminal receives prompts input by the user through the interface and sends them to the server in text form. For example, the user can input the following prompts: Please use a bar chart to show the comparison of monthly sales of electronic devices in different regions. or: "Help me analyze the trend of total sales for each month this year." In one implementation, the server first performs string normalization processing on the received natural language text, including standardizing character encoding, removing extra spaces, standardizing number and date expressions, and converting full-width and half-width symbols. The server then performs segmentation processing, dividing the sentence into word or sub-word sequences, while recording part-of-speech information and positional encoding. The server further performs format validation processing to check for text length, illegal characters, and whether key semantic slots are missing.
[0212] In one implementation, the server constructs the input sequence of the generative artificial intelligence model based on the normalization and segmentation results, and splices or embeds special tags representing data table names and field names based on the learning results of the current data structure, so that natural language information requests and underlying data structures are processed together in the same vector space.
[0213] In one implementation, the server employs a multi-layer transformer architecture as the foundation for a generative artificial intelligence model. This model includes a multi-layer self-attention encoder and a multi-layer self-attention and cross-attention decoder. The model input is a sequence of user prompts after word segmentation and encoding, and the model output is a serialized representation of a structured data request or a sequence of intermediate semantic tags.
[0214] In one implementation, the server predicts a label for each output location. This label can represent semantic units such as target data tables, fields, filtering conditions, aggregation operations, grouping fields, and visualization categories. During the training phase, the server updates model parameters by minimizing cross-entropy loss. The server iteratively updates the weights, biases, and attention parameters for each layer through backpropagation and gradient descent. The server can employ a learning approach that combines pre-training and fine-tuning to improve its adaptability to general language patterns and specific data structures.
[0215] In another implementation, the server models the semantic parsing problem as a structured prediction task. The server outputs a structured object containing a set of target tables, a set of fields, a set of conditions, and visualization requirements. The server improves the accuracy of semantic parsing by imposing constraints during the decoding phase (e.g., fields must belong to a specified table, and date conditions must fall within a valid range).
[0216] V. Intermediate Representation Construction and Query Language Generation In one implementation, the server constructs an intermediate representation based on the semantic parsing results. This intermediate representation includes: 1. The target set of data tables; 2. The mapping relationship between fields and tables; 3. The logic tree structure of conditional expressions; 4. Configuration of aggregate functions and grouping fields; 5. Sorting and restriction strategies; 6. Visualize the mapping between categories and corresponding data columns.
[0217] In one implementation, the server treats the intermediate representation as an undirected or directed graph structure, where nodes are fields and table objects, and edges are connections or conditional relationships. Before generating the query language, the server performs a consistency check on this graph to ensure that all fields have a unique data source and that all connections conform to foreign key constraints. This proactively eliminates logical errors within the computer, reducing the probability of query execution failure.
[0218] In one implementation, the server automatically generates the query language based on an intermediate representation. The server first selects an appropriate main table and join order, then generates filter clauses based on the conditional logic tree, and finally generates aggregation and grouping clauses based on aggregation requirements. During the generation process, the server considers index information and field cardinality statistics, prioritizing the order with lower join costs, thereby indirectly reducing the time complexity of database execution.
[0219] In another implementation, the server generates query statements conforming to the corresponding dialect for different types of data storage devices (such as relational databases or distributed query engines). Through an abstract intermediate representation, the server can adapt to different query languages, enabling cross-system data access without requiring users to modify their natural language requests.
[0220] VI. Data Access, Statistics, and Visualization Generation In one implementation, the server sends the generated query language to the data storage device and receives the returned record set. The server performs statistical and transformation processing on this record set, such as aggregation calculations, time granularity conversions, unit conversions, and derived index calculations. During this process, the server uses vectorized operations and columnar processing to improve memory access efficiency and computational throughput.
[0221] In one implementation, the server generates visualized data based on statistically processed data. The server selects the appropriate chart type, such as a bar chart, line chart, or pie chart, according to the visualization category specified in the intermediate representation. When drawing the chart, the server automatically adjusts the axis scales, label format, and color scheme to ensure readability and differentiation on the terminal.
[0222] In one implementation, the server converts the generated charts into an image format or encodes the chart structure into descriptive data that can be rendered by the terminal. The server then encapsulates the visualization results along with a partial data overview into a response message and returns it to the terminal, achieving end-to-end technical processing from natural language to graphical results.
[0223] VII. Explanatory Text Generation and Prompt Statement Control In one implementation, after obtaining visualized data and statistical results, the server again invokes a generative artificial intelligence model to generate natural language explanatory text for the data. The server inputs key statistics, outliers, and trend information as structured features into the model, and the model generates explanatory text according to a predetermined template or strategy during the decoding phase. This explanatory text may include the category of the maximum value, the month-on-month change, and a description of the overall trend.
[0224] In one implementation, the server does not directly feed the user prompts into the generative AI model for query language generation. Instead, it first generates prompts to guide the model's behavior. Based on the natural language preprocessing results and data structure characteristics, the server constructs prompts with instructional content, such as explicitly annotating subtasks like "generate query conditions," "select aggregation fields," and "specify visualization type" in the internal text.
[0225] In one implementation, the server dynamically corrects or completes the prompt statement, supplementing missing information based on string normalization and format validation results. For example, it specifies "previous month" as start and end dates, maps "sales amount" to specific field names, and maps "region" to a region field. In this way, the server provides the generative artificial intelligence model with more precise and structured instructions than the user's original input, thereby significantly reducing the ambiguity and errors in the model's output query language.
[0226] VIII. Historical Data-Driven Model Updates and Technological Effects In one implementation, the server records each natural language information request, the generated query language, the execution result, and subsequent user feedback as historical data. The server periodically uses this historical data to update the parameters of the generative artificial intelligence model. The server can employ incremental learning or fine-tuning strategies to correct model biases by re-minimizing the loss function on historical samples.
[0227] In one implementation, the server uses historical query records to identify patterns in which the statistical model frequently makes mistakes, such as frequently misidentified field aliases or ambiguous expressions. The server introduces specific constraints or penalty mechanisms to address these patterns, preventing the model from easily selecting structures associated with historical errors in its output.
[0228] Through the aforementioned structure and processing, the server implements a technical approach that differs from traditional manual rules or fixed models after a single training iteration. Internally, the server adaptively adjusts the semantic parsing and query generation modules, resulting in higher accuracy in automatically generated query language, lower query execution failure rates, and a higher degree of alignment between the visualized results and the user's true intent over longer runtime.
[0229] IX. Explanation of Technological Improvements and Causal Relationships In one implementation, the server learns through intermediate representations and data structure vectorization. When constructing the query language, it can pre-exclude a large number of invalid field combinations, thereby reducing the overhead caused by database optimizer rollback and reordering during query execution and improving the overall response speed.
[0230] In one implementation, the server performs strict string normalization and format validation on natural language requests, effectively reducing parsing failures caused by inconsistent encoding, illegal characters, or incomplete sentence structure, thereby lowering the system error rate.
[0231] In one implementation, the server uses an automatic generation and dynamic correction mechanism for prompt statements, giving the input received by the generative AI model clearer task boundaries and contextual constraints. Because the model does not need to infer all structural information from highly noisy raw text, the uncertainty in the reasoning process is significantly reduced, resulting in more stable query language output and a significantly lower error rate.
[0232] In one implementation, the server inputs field statistical features and structural information as additional features into the neural network, enabling the model to refer to field distribution and business importance when predicting aggregation and grouping fields, thereby improving the executability and performance of query statements at the technical level.
[0233] In one implementation, the server uses historical data-driven model updates to ensure the system remains adaptable to new data structure changes or query pattern shifts. This adaptive process is achieved internally through retraining and parameter updates, rather than simply mechanically replicating human operations, thus demonstrating a substantial improvement in the computer's internal information processing and resource scheduling methods.
[0234] 10. Alternative Methods and Modified Implementation Forms In one implementation, the server employs a multi-layer transformer as a generative artificial intelligence model. In another implementation, it can use a structure combining recurrent neural networks and convolutional networks, or other variations of the encoder-decoder framework, as long as the model can output structured data requests or query languages based on prompts and data structure features.
[0235] In one implementation, the server targets a relational data storage device; in another, the data storage device can be replaced with a time-series database, a columnar data warehouse, or a search engine indexing system. In this case, the intermediate representation still clarifies the query objective at the logical layer, and the query language generation module constructs the corresponding language based on the syntax of different backend systems.
[0236] In one implementation, the terminal receives visualized data as images; in another, it receives structured chart descriptions and renders them locally. Both methods utilize pre-processed statistical data and transformations performed by the server to reduce the terminal's computational load and communication frequency.
[0237] In one embodiment, the user inputs prompts via text; in another embodiment, the user inputs via voice, which is then processed into text on the terminal before being sent to the server. The core of this invention lies in the server's semantic parsing and query generation of text-based prompts, without imposing any entity restrictions on the input method.
[0238] Through the aforementioned implementations, the server, terminal, and user collaborate at the hardware and software levels, enabling the conversion process from natural language to query language and then to data visualization to be executed internally within the computer in a structured, learnable, and optimizable manner. This invention not only reduces the burden on users in constructing query languages but also provides technical improvements in multiple internal computer processing stages, such as data structure learning, neural network computation, query generation optimization, and visualization mapping, thereby achieving substantial improvements in processing speed, generation accuracy, and system stability.
[0239] use Figure 12 The processing procedure is explained.
[0240] Step 1: The user enters a natural language prompt on the terminal and initiates a request.
[0241] Users can type their information requests in natural language into the input interface provided on the terminal, such as: "Please use a bar chart to show the comparison of sales of electronic devices in different regions this month." or "Help me analyze the trend of total sales changes each month this year."
[0242] Input: Natural language text (prompt statements) entered by the user in the terminal interface.
[0243] Output: The original prompt text cached internally by the terminal.
[0244] Based on the user's specific action of clicking the "Query" or "Analyze" button, the terminal reads the prompt statement in the current input box and prepares to package it into request data to be sent to the server.
[0245] Step 2: The terminal sends a request containing a prompt statement to the server.
[0246] The terminal converts the cached natural language prompts into a network transmission format, encapsulates them as request parameters in the message body, and sends the request to the server through the communication module. In its implementation, the terminal sets the request path, request method, and necessary authentication information.
[0247] Input: The original prompt text cached in the terminal.
[0248] Output: The request message sent to the server over the network.
[0249] Before sending, the terminal encodes the text into a unified character set and includes length and format information in the message header to ensure that the server can parse it correctly.
[0250] Step 3: The server receives the request and performs string normalization processing.
[0251] The server receives request messages from terminals via the network interface and parses them to extract the user's natural language prompts. The server then performs string-level normalization on these prompts, including removing extra spaces, standardizing punctuation, and regulating the representation of numbers and dates.
[0252] Input: The original prompt text received from the terminal.
[0253] Output: The normalized prompt text.
[0254] The server scans the character sequence one by one, identifies and replaces symbols that do not conform to the preset rules, and deletes redundant characters to reduce noise during subsequent word segmentation and semantic parsing.
[0255] Step 4: The server performs segmentation and format validation on the prompt statement.
[0256] The server performs word segmentation or sub-word splitting on the normalized prompt statement, generating an ordered word sequence, and assigning a position index and possible part-of-speech information to each word. The server then checks whether the prompt statement contains the necessary time, object, and indicator components, and checks whether the length is within the preset range.
[0257] Input: The normalized prompt text.
[0258] Output: The segmented sequence and format verification results.
[0259] The server uses a word segmentation algorithm to divide the sentence, converting the continuous character stream into a list of word units. At the same time, it determines whether key semantic slots are missing according to preset rules. If they are missing, it triggers completion processing in subsequent steps.
[0260] Step 5: The server generates or modifies prompts for generative artificial intelligence models.
[0261] Based on the word segmentation and format validation results, the server constructs a structured prompt statement, explicitly specifying the query language, data range, aggregation method, and visualization category to be generated. If the original request is found to be missing a specific time range or field name, the server automatically completes this information based on default rules or data structure learning results.
[0262] Input: The segmented sequence and the format verification result.
[0263] Output: Standardized prompts for generative artificial intelligence models.
[0264] The server concatenates multiple text fragments (instruction part, context part, data structure hint part) into a new prompt statement, giving the generative artificial intelligence model a clearer task description and constraints when receiving input.
[0265] Step 6: The server converts the prompt statements into model input features.
[0266] The server encodes standardized prompts, mapping word or subword sequences to integer index sequences, and further mapping them to high-dimensional vector representations. Simultaneously, the server incorporates vector embeddings of table names and field names from the data structure into the input features, enabling the model to perceive both natural language and data structure information within the same feature space.
[0267] Input: Vector representation of standardized prompt statements and data structures.
[0268] Output: Input tensors for use by generative artificial intelligence models.
[0269] The server maps each word to its embedding vector through a lookup table operation, constructs a three-dimensional or two-dimensional tensor (batch, sequence length, embedding dimension), and then adds a position encoding vector to represent the relative order of each position in the sequence.
[0270] Step 7: The server uses a generative artificial intelligence model to perform semantic parsing and generate intermediate semantic representations.
[0271] The server feeds the input tensor into a generative AI model based on a transformer structure. The model computes the sequence through a multi-layered self-attention mechanism and a feedforward network, outputting a semantic representation for each position. At the decoding end, the server predicts semantic labels such as target table, field, condition, aggregation, and visualization categories based on attention weights and output probability distribution.
[0272] Input: The input tensor of the generative artificial intelligence model.
[0273] Output: An intermediate semantic representation containing the target table, fields, conditions, aggregations, and visualization requirements.
[0274] During the forward propagation of the model, the server performs matrix multiplication and addition, nonlinear activation, normalization and other operations on the input tensor to obtain the probability distribution for each semantic unit. The server selects the label or structure sequence with the highest probability and combines them into a structured semantic object.
[0275] Step 8: The server converts the intermediate semantic representation into an intermediate representation structure.
[0276] The server constructs a logically complete intermediate representation based on the intermediate semantic tags, including the target data table set, field set, conditional expression tree, aggregate function configuration, grouping fields, and visualization categories.
[0277] Input: Intermediate semantic representation.
[0278] Output: Intermediate representation structure (logical query plan).
[0279] The server matches tables and fields based on semantic tags, establishes a mapping from fields to tables, and combines multiple conditions into a tree structure according to logical operators (AND, OR, NOT). It also records aggregation types and visualization types, providing a clear structural framework for subsequent query language generation and visualization generation.
[0280] Step 9: The server generates the query language based on the intermediate representation.
[0281] The server reads the target table, join relationships, and conditional logic specified in the intermediate representation, and constructs the select clause, source clause, join clause, condition clause, grouping clause, and sorting clause of the query language statement. During the construction process, the server generates query statements that conform to the dialect of the data storage device according to its syntax rules.
[0282] Input: The middle part represents the structure.
[0283] Output: The specific query language statement.
[0284] The server concatenates the various parts of the query language in a predetermined order, generates the correct list of identifiers using field names and table names, and fills in comparison operators and literal values in the conditional clauses, thereby transforming the abstract logical structure into text-based instructions that can be executed by the data storage device.
[0285] Step 10: The server sends a query to the data storage device and retrieves the result data.
[0286] The server sends the generated query language to the data storage device via the database interface, triggering query execution within the data storage device. The data storage device accesses the data tables based on indexes and optimization strategies, calculating the set of records that meet the conditions. The server receives the query results and converts them into data structures for internal use.
[0287] Input: Query language statement.
[0288] Output: The raw result data set returned from the data storage device.
[0289] The server reads the results row by row from the database connection, maps each row to a field name-to-value mapping, or converts it into a two-dimensional table structure for subsequent statistical and transformation operations in memory.
[0290] Step 11: The server performs statistical processing and transformation on the resulting data.
[0291] The server groups the result data by specified fields according to the aggregation requirements specified in the intermediate representation, and performs summation, counting, averaging, or other statistical operations within each group. The server can also perform granular transformation on time fields, unit conversion on numerical fields, or generate new derived indicators.
[0292] Input: The original result data set and the statistical configuration specified in the intermediate representation.
[0293] Output: Structured statistical data after aggregation and transformation.
[0294] The server aggregates data under the same grouping key by traversing data records or using vectorized operations, calculates corresponding statistical indicators, and organizes the results into a data table structure suitable for visualization, which includes category dimension columns and measure columns.
[0295] Step 12: The server generates visualized data.
[0296] The server maps statistical data to a graphical coordinate system based on the visualization categories in the intermediate representation. For example, in the case of a bar chart, the server uses the category field as the x-axis and the measure field as the y-axis, and calculates the appropriate scale and bar width. The server generates the graphical object or chart description structure.
[0297] Input: Structured statistical data and visualized category information.
[0298] Output: Visualized data (graphical objects or chart descriptions).
[0299] The server sets the minimum and maximum values of the coordinate axes based on the data range, automatically selects the color scheme and label format, and maps each data point to one or more graphic elements (such as bars, line nodes, or sectors) to form a complete visualization chart.
[0300] Step 13: The server generates natural language explanatory text.
[0301] The server takes statistical data and a summary of the visualization configuration as input features, constructs prompts for generating explanations, and inputs them into the generative artificial intelligence model. During decoding, the model generates natural language text describing the content of the charts based on the input features, for example, stating that "the region with the highest sales of electronic devices this month is East China, totaling 100,000 yuan."
[0302] Input: Structured statistical data, visual configuration information, and explanatory prompts.
[0303] Output: Natural language description text.
[0304] When generating prompts, the server explicitly instructs the model to summarize key points such as maximum value, minimum value, and overall trend. During forward propagation, the model generates a coherent descriptive text based on these features and instructions. The server then converts the generated text from its internal encoding into a standard character sequence.
[0305] Step 14: The server encapsulates visual data and explanatory text and returns it to the terminal.
[0306] The server combines the visual chart data and explanatory text into a response message, performs necessary serialization and encoding to ensure it meets the format requirements for network transmission and terminal parsing. The server then sends this response to the terminal via the network interface.
[0307] Input: Visualized data and natural language explanatory text.
[0308] Output: The response message sent to the terminal.
[0309] During the encapsulation process, the server may compress image data, use uniform encoding for text, and indicate the data type and length in the response header so that the terminal can correctly parse and display it.
[0310] Step 15: The terminal receives the response and displays the result to the user.
[0311] The terminal receives a response message from the server and parses the visual data and explanatory text within it. The terminal renders the chart on the display device and displays the explanatory text in text form near the chart, enabling users to intuitively understand and analyze the data.
[0312] Input: The response message received from the server.
[0313] Output: Charts and explanatory text displayed on the terminal screen.
[0314] The terminal calls the local graphics rendering function or built-in components to display graphics, places the parsed text in a predetermined area of the interface, and adjusts the layout and font size according to the screen size to ensure that users can clearly view the analysis results.
[0315] Step 16: Users can perform further actions or issue new prompts based on the displayed results.
[0316] Users observe the charts and explanatory text displayed on the terminal and make judgments and decisions based on business needs. When users require more detailed analysis or different perspectives, they can enter new natural language prompts on the terminal, such as: "Please only display regions with sales exceeding 50,000 yuan," thereby initiating a new round of processing.
[0317] Input: The charts and explanatory text displayed on the terminal screen.
[0318] Output: The prompt or operation command newly entered by the user.
[0319] Users determine their next query direction by reading and understanding visual and textual information, and express their new analysis needs by typing in new natural language text or selecting controls on the interface, so that the system can continuously provide them with technically processed data analysis results.
[0320] Alternatively, an emotion engine for inferring user emotions can be combined. That is, the specific processing unit 290 can also use the emotion-specific model 59 to infer user emotions and perform specific processing using user emotions.
[0321] Example 2 The flow of a specific process in Example 2 will be described. Each part of the system described below is implemented by the data processing device 12 and the smart device 14. The data processing device 12 will be referred to as the "server," and the smart device 14 as the "terminal."
[0322] In existing technologies, when users want to retrieve information from data storage devices, they typically need to manually write structured query languages, such as structured query statements. This often requires developers or data analysts to possess database schema understanding and query language writing skills, making it difficult for ordinary users to directly retrieve data using natural language. Furthermore, existing natural language query systems often only roughly map natural language to fixed templates, failing to fully utilize the underlying data table structure information for dynamic optimization. This results in insufficient flexibility in query generation and poor adaptability to different data structures.
[0323] Furthermore, in existing solutions, the server-side processing of user requests often involves simply transcribing natural language into query statements and executing them directly. This lacks a joint modeling and learning mechanism based on the data storage structure and the user's semantic intent, making it difficult to stably generate correct and efficient query statements under various time expressions, target object expressions, and complex aggregation conditions. When processing fuzzy or diverse natural language expressions such as "the first quarter of last year" or "the total amount of a certain type of object," the system is prone to inaccurate parsing and incorrect query condition generation.
[0324] Furthermore, many systems, after obtaining query results, only return them in the form of raw numerical values or tables. They lack the ability to further process the underlying numerical data into natural language descriptions that are easy for users to understand. They do not make full use of the computing resources on the server side to aggregate, convert units, and semantically represent the results, thereby increasing the burden on users to interpret the results themselves.
[0325] Therefore, how can the server, through improved data processing flow and model invocation mechanism, enable the server to: (1) Actively analyze and learn the information structure in the data storage department to form structured knowledge that can be used for query generation; (2) Based on this information structure and the user's natural language request, construct high-quality prompt statements to drive the generative artificial intelligence model to automatically generate query language that conforms to the underlying data structure; (3) Perform aggregation, unit conversion and natural language generation on the query results to output them in a human-readable manner; This has become a necessary computer technology problem to solve. The essence of the problem lies in improving the internal algorithmic flow and data representation of the server in the query generation and result expression path, so that the computer system can automatically, accurately, and efficiently complete the round-trip conversion from natural language to query language and then to natural language results without the need for manual writing of query language, thereby improving the overall performance and availability of the computer in data access and human-computer interaction.
[0326] The specific processing performed by the specific processing unit 290 of the data processing apparatus 12 in Embodiment 2 is achieved by the following means.
[0327] In this invention, the server includes means for parsing and learning the information structure stored in the data storage unit; means for receiving information requests in natural language or a predetermined format from a user terminal and constructing prompt statements based on the information structure and information requests to instruct a generative artificial intelligence model to generate query language; means for inputting the prompt statements into the generative artificial intelligence model and obtaining the query language generated by the generative artificial intelligence model; means for performing information acquisition processing on the data storage unit using the query language and generating user-oriented output information including aggregation results and unit conversion results based on the acquired information; and means for converting the output information into natural language or a predetermined format for display and sending it to the user terminal. Thus, an end-to-end processing flow can be implemented within the server using a unified program flow, from data structure learning, natural language semantic parsing, prompt statement construction, automatic generation of query language driven by the generative artificial intelligence model, to automatic aggregation of result data and natural language expression. This reduces reliance on manually written query statements and manual interpretation of results, improving the technical effects of the computer system in terms of data retrieval accuracy, query generation efficiency, and human-computer interaction friendliness, achieving a substantial improvement in computer data processing capabilities and usability.
[0328] "Data storage department" refers to storage devices or storage resources used to store and manage data in a predetermined structure, including but not limited to relational databases, non-relational databases, distributed storage systems and one or more data tables or data sets set thereon.
[0329] "Information structure" refers to the way data is organized in the data storage department and its metadata description, including structured information that reflects the logical and physical structure of the data, such as table names, field names, field types, relationships between fields, constraints, and indexes.
[0330] "Information retrieval condition candidates" refers to one or more sets of conditions that are pre-extracted or learned based on the information structure and can be used to limit the scope of data retrieval or aggregation methods. These include condition elements related to time, object, field filtering, grouping, and aggregation methods.
[0331] "User terminal" refers to a computing device that enables users to interact with the system, including but not limited to computer equipment, mobile communication equipment, wearable devices, and the applications or browsers running on them.
[0332] "Information request" refers to a request content entered by a user through a user terminal and expressed in natural language or a predetermined format, used to instruct the system to retrieve target information from the data storage department.
[0333] "Natural language" refers to the forms of language expression used by humans in daily communication, which do not depend on specific programming syntax or query syntax, including spoken language, written language, and textual expressions containing vague time or object descriptions.
[0334] "Predefined format" refers to a structured or semi-structured representation of an information request that is pre-defined by the system, other than natural language. This includes, but is not limited to, set of form fields, parameterized requests, templated sentences, and tagged text.
[0335] "Generative artificial intelligence models" refer to models trained using machine learning and deep learning techniques that can automatically generate text output based on input prompts, including but not limited to language models, dialogue models, and code generation models based on neural networks.
[0336] "Prompt statements" refer to the input text constructed by the server and provided to the generative artificial intelligence model. They are used to instruct the generative artificial intelligence model on the generation goals, constraints, and output formats, so as to guide it to generate query language or explanatory text that is compatible with the data storage department.
[0337] "Query language" refers to a formalized language expression used to issue retrieval, filtering, aggregation, or update instructions to the data storage department, including but not limited to structured query statements, object-oriented query statements, and other sets of commands that can be parsed and executed by the data storage system.
[0338] "Information acquisition and processing" refers to the operation process performed by the server on the data storage unit using query language, including parsing queries, accessing stored data, and performing operations such as filtering, sorting, grouping, and aggregation to obtain data that meets the information acquisition conditions.
[0339] "Output information" refers to the set of result data generated for user display or further processing after the data is obtained from information acquisition and processing, and after necessary aggregation, unit conversion and formatting processing by the server.
[0340] "Display data" refers to the form of output information converted by the server and used to present on the user terminal interface, including but not limited to text, tables, graphics, charts and combinations thereof.
[0341] "Time-related expressions" refer to natural language fragments or pre-formatted content used in information requests to indicate time ranges or points in time, including expressions such as "last year," "this month," and "first quarter" that can be mapped to specific time intervals or time markers.
[0342] "Expressions related to the target project" refer to natural language fragments or pre-formatted content used in information requests to indicate the query object or analysis object, including expressions such as product name, category name, user group, and region name that can be mapped to field values or sets of fields in the information structure.
[0343] "Search criteria" refers to the conditional expressions used in query languages to limit the selection range of data records, including field value matching criteria, range criteria, logical combination criteria, and filtering criteria based on time or object.
[0344] "Summary conditions" refer to the condition settings used in query languages to perform aggregation operations on data records, including grouping fields, aggregation function types, and corresponding grouping methods and aggregation ranges.
[0345] "Aggregation processing" refers to the process by which a server performs statistical operations on multiple data records obtained from the data storage department, including operations such as summation, counting, averaging, finding the maximum and minimum values, and grouping statistics by dimension.
[0346] "Unit conversion processing" refers to the server's processing of numerical data by changing the units of measurement to make it easier for users to understand or conform to business semantics, including conversions of monetary units, time units, quantity units, etc.
[0347] "Explanatory text" refers to text content used to explain, summarize, or describe query results in natural language. It is generated at least in part based on the results of aggregation and unit conversion processing, and is used to improve users' understanding of the meaning of the results.
[0348] In this embodiment of the invention, the server, terminal, and user each assume different functional roles, working collaboratively to achieve efficient and accurate access to data in the data storage unit. Furthermore, using a generative artificial intelligence model and prompts, natural language information requests are automatically converted into query language, and the query results are then converted into natural language descriptions. The following provides a detailed description of this embodiment, combining hardware and software configuration, data processing flow, generative artificial intelligence model structure and training methods, as well as technical effects and variations.
[0349] I. Overall System Composition A server includes at least one processor, memory, a network interface, and persistent storage. The server processor can be a general-purpose central processing unit or a graphics processing unit, the memory can be random access memory, and the persistent storage can be a disk array or solid-state storage. The server runs server-side applications on an operating system. These applications can be implemented based on general-purpose server software and development frameworks, such as a combination of a web server software and a backend application framework.
[0350] A terminal includes a user-operated computing device, such as a mobile terminal or a desktop computing device. The terminal processor runs an operating system and a front-end application or browser, which can be implemented based on a cross-platform framework or a native development environment. The terminal communicates with the server over a network, using Transmission Control Protocol (TCP) and Secure Sockets Layer (SSL) protocols to achieve encrypted data transmission.
[0351] Users can input information requests in natural language or a predefined format through the terminal and view the natural language results, tables, or charts returned by the server through the terminal interface.
[0352] The server has a data storage unit within the storage device. This data storage unit can consist of a relational data management system, a columnar data warehouse system, or a distributed data storage system. The data storage unit stores multiple data tables, each with a structured information structure including table name, field names, field types, constraints, and indexes.
[0353] II. Server-side program modules and data flow The server loads multiple functional modules into memory, which are implemented by the processor executing corresponding program instructions. The server mainly includes the following modules: information structure parsing and learning module, request receiving and preprocessing module, prompt statement construction module, generative artificial intelligence model interface module, query execution module, result processing and natural language generation module, and response generation module.
[0354] 1. Information Structure Analysis and Learning Module During system initialization or periodic tasks, the server parses the metadata of the data tables in the data storage department. The server accesses the system directory or information schema of the data storage department to obtain table names, field names, field types, primary keys, foreign keys, indexes, and statistical information. The server then transforms these information structures into an internally unified representation, such as a graph structure or an embedded vector set.
[0355] The server uses a processor to execute feature extraction algorithms, converting the type, value distribution, and relationships of each field into numerical features, such as field type encoding, field cardinality, and inter-field correlation. The server further utilizes unsupervised clustering or embedding learning methods to cluster or reduce the dimensionality of the fields, learning patterns that can be used to construct candidate information retrieval conditions. For example, the server clusters time-type fields into a time dimension, numerical fields into a measurement dimension, and text fields into a description dimension.
[0356] The server stores the learned information structure and its features in memory cache and persistent storage for subsequent prompt statement construction and query language generation. In this way, the server internally establishes a mapping from the database schema to the semantic dimension, thereby improving its ability to understand the data structure during query generation.
[0357] 2. Request Reception and Preprocessing Module The server receives information requests from terminals via a network interface. Within the backend application framework, the server parses the request message, extracting the user identifier, the information request text, and optional language tags or contextual session identifiers. The server performs preprocessing operations on the information request text, including removing redundant whitespace, standardizing date formats, and recognizing numbers and currency units. The server can use a Chinese word segmentation library or a natural language processing tool to segment and tag the text for subsequent prompts and entity extraction.
[0358] The server reads the previous query context from the session storage based on the user identifier and historical session records, such as the time range of the most recent query and the target object category, to support semantic completion of queries across rounds.
[0359] 3. Prompt Statement Construction Module Based on the preprocessed information request text and the structured knowledge provided by the information structure parsing and learning module, the server constructs prompt statements to drive the generative artificial intelligence model. The server stores multiple prompt templates in its memory, each template targeting a different task, such as query language generation, time expression parsing, and explanatory text generation.
[0360] When constructing the prompt statement for query language generation, the server embeds a summary of the information structure and the user's request content into the same text sequence. For example, the server might generate the following prompt statement: "You are a database query generation assistant."
[0361] There is now a data storage department containing a data table called sales_data.
[0362] The main fields of this data table include: - product: Indicates the object identifier; - sales: indicates a numerical metric; - date: Represents date and time, in YYYY-MM-DD format.
[0363] Please read the following user information request. 1. Identify the objects that need to be statistically analyzed; 2. Identify the time range; 3. Generate a query language statement that uses an aggregate function on the sales field to calculate the total amount and names the result field total_value.
[0364] User information request: 'I would like to know the sales figures for Product A in the first quarter of last year.' Please only output the query language statement; do not output any other descriptions. When constructing the prompt statement, the server automatically lists the relevant data table names and field names using the information structure parsing results. It also pre-inserts time-related expressions such as "first quarter of last year" and "product A," as well as expressions related to the target item, extracted from the information request. This allows the generative AI model to fully utilize the underlying structural information when generating query language. Through this structured embedding, the server achieves joint encoding of data pattern features and natural language semantics, thereby improving the model's accuracy in parsing query intent and field correspondences.
[0365] III. Structure and Interface of Generative Artificial Intelligence Models The server encapsulates calls to generative AI models within its generative AI model interface module. These models can be deployed on the same physical machine as the server, or on a separate compute node or in a cloud-based inference service. The core model is a neural network language model based on a multi-layered Transformer architecture.
[0366] 1. Model Architecture The generative AI model comprises an embedding layer, a multi-layer self-attention encoder, a multi-layer self-attention decoder, and an output layer. The model input is a sequence of tokenized prompts mapped to vectors. The embedding layer maps tokens to fixed-dimensional vectors and overlays positional encodings. The encoder utilizes a multi-head self-attention mechanism to compute dependencies between tokens, generating context-sensitive hidden representations. The decoder, through masked self-attention and cross-attention, progressively generates the query language text based on the encoder output and the generated output sequence.
[0367] During model training, the server uses a dataset containing pairs of natural language questions and corresponding query languages to supervise model learning. The server calculates the difference between the model's generated output and the target query language using a loss function, such as cross-entropy loss. The server iteratively updates the model weights using optimization algorithms (e.g., adaptive moment estimation or stochastic gradient descent). During training, the server can also employ data augmentation methods, such as diversifying time representations and replacing target object names with similar ones, to improve the model's robustness to different natural language expressions.
[0368] 2. Model Invocation and Parameter Control During the inference phase, the server inputs the constructed prompt statement into the model interface module. The server specifies the model identifier, maximum generation length, temperature parameters, and decoding strategy in the request. The server can employ greedy search or bundle search strategies to generate the query language, reducing randomness and increasing the proportion of deterministic output. The server can also set constraint rules to prohibit the generation of certain unsafe keywords, preventing the output of dangerous statements related to data storage control operations.
[0369] After receiving the model output, the server performs syntax and semantic checks on the output text. The server uses string parsing and regular expression validation to check if the query language contains correct table and field names and if it only contains allowed query keywords. The server can correct the output or call the model again to generate additional data if necessary.
[0370] By employing this generative AI model invocation method based on prompts and structure awareness, the server internally implements an unconventional query generation algorithm, rather than simple rule replacement or fixed template filling. This process leverages the reasoning capabilities of deep neural networks in high-dimensional semantic spaces, combined with the explicit provision of information structures, enabling the query generation process to automatically adapt to different data patterns and improving the accuracy and coverage of query language generation.
[0371] IV. Query Execution and Result Processing In the query execution module, the server accesses the data storage unit using a validated query language. The server establishes a connection with the data management system through a database driver or client library, sending the constructed query language over the connection. The data management system parses and optimizes the query language, performs retrieval and aggregation operations on the storage medium, and returns the result set to the server.
[0372] In the result processing and natural language generation module, the server performs aggregation and unit conversion on the acquired numerical data. Based on the aggregation function type and grouping fields in the query language, the server summarizes the original records by time or object dimension. For example, the server aggregates daily sales records into a quarterly total and converts the unit from basic currency to a ten-thousand-yuan level for easier user understanding.
[0373] The server further constructs prompts for the results, converting the query results into natural language descriptions. The server can generate prompts such as: "Below are the user's question and the database query results. Please answer the user in concise Chinese."
[0374] User question: 'I would like to know the sales figures for Product A in the first quarter of last year.' Query result: total_value = 5000000 (Japanese Yen) Please convert the results into amounts in ten thousand yuan and provide a natural language response. The server inputs the prompt statement along with the structured results into a generative AI model to generate explanatory text such as, "According to the query results, the sales volume of product A in the first quarter of last year was 5 million yuan." The server can impose length limits and filter sensitive information on the explanatory text as needed.
[0375] V. Terminal-side display and interaction After receiving the response from the server, the terminal parses and renders the natural language answer and numerical results. The terminal uses a graphical interface rendering engine to display explanatory text in the dialog window or results area, and can utilize a chart library to plot aggregated results by time or object dimension as bar charts, line charts, or pie charts. The terminal can also display the generated query language for professional users to view, thus achieving transparency and verifiability.
[0376] Users read the natural language descriptions and charts generated by the system on the terminal interface, and understand and analyze the results. Users can then issue further natural language information requests, such as "What was the situation in the second quarter of last year?" The terminal sends the new information request to the server, forming a continuous interactive process.
[0377] VI. Technical Effects and Causal Relationships The server replaces the traditional "manually written query" by parsing structured information, constructing prompt statements, and generating queries driven by a generative artificial intelligence model. However, its technological contribution is not limited to simple automation, but rather improves the way computers process data internally. 1. The server maps the data table schema to a semantic dimension space by parsing and learning the information structure. This allows the server to explicitly provide the semantics of table fields when constructing prompts, enabling the generative AI model to align natural language expressions with structured fields in a high-dimensional feature space. This joint encoding mechanism reduces the model's reliance on implicit schema memory, improves its transferability to new data schemas, and thus enhances query generation accuracy.
[0378] 2. The server embeds time-related and target-item-related expressions into the query prompts, explicitly mapping them to specific fields and conditions. This makes the query language generated by the model more accurate in its condition combinations. This approach reduces the need for multiple rounds of parsing and correction, thereby shortening the overall processing chain and improving query response speed.
[0379] 3. The server performs aggregation and unit conversion in the result processing module. Local numerical calculations reduce the need for terminal-side computation and repeated queries, reduce network communication load, and improve the overall computational efficiency of the system.
[0380] 4. The server utilizes a generative AI model based on the Transformer architecture, employing multi-head self-attention and contextual modeling mechanisms internally to parse complex natural language expressions. This avoids the high cost and low scalability of traditional rule engines when maintaining complex rule bases. By minimizing the loss function and optimizing parameters during training, the server essentially optimizes the computational path through searching the model parameter space, thereby improving the accuracy and robustness of judgments in complex semantic combination scenarios.
[0381] 5. When the server invokes the generative AI model, it employs decoding strategies such as beam search, combined with output checks and constraint rules, forming a multi-stage "generation-verification-correction" pipeline. This non-single-step generation pipeline structure reduces the probability of invalid query language entering the query execution module at the algorithm level, thereby reducing resource waste and abnormal interruptions caused by erroneous queries and improving system stability.
[0382] Through the aforementioned causal chain, this invention achieves improvements at the level of server internal structure and program logic, enabling the computer system to improve accuracy, increase processing speed, reduce error rate, and optimize resource utilization during the round-trip conversion process from natural language to query language and from query results to natural language descriptions.
[0383] VII. Optional Implementation Forms and Variations In different implementations, servers can employ different data storage types. For example, a server can use a columnar data warehouse system to improve the performance of large-scale aggregate queries, or a row-based relational database to improve the performance of single-row queries and frequent updates. The server can unify the abstract information structure across different data storage types, allowing the prompt statement construction module to be unaware of the underlying implementation differences.
[0384] In selecting generative AI models, servers can employ models of varying sizes and parameter configurations. In resource-constrained scenarios, servers can use models with smaller parameters, supplemented by local rules for further parsing; in high-performance scenarios, servers can use deep models with larger parameters to achieve higher semantic parsing accuracy. Servers can also decompose models into multiple sub-models, such as a sub-model specifically for handling temporal representation parsing, a sub-model specifically for handling field mapping, and a main model specifically for generating query language, and connect these sub-models through an internal pipeline.
[0385] The server can also adjust the way it constructs prompt statements according to the business scenario. For example, in a multi-table join query scenario, the server can explicitly list multiple related tables and their associated fields in the prompt statement; in a simple statistical scenario involving only a single table, the server can use a more concise prompt statement to reduce model inference time.
[0386] The terminal can be implemented as a mobile terminal, desktop terminal, or embedded terminal. In terms of display methods, the terminal can support various formats such as charts, dashboards, and geographic information visualizations to adapt to data analysis, monitoring, or control scenarios. The terminal can also bind server-generated natural language descriptions to interactive charts, allowing users to trigger new natural language information requests by clicking on chart areas, thus forming a human-computer interaction mode that links natural language and visualization.
[0387] Through the above-described various implementations and variations, this invention provides an scalable natural language interface system for structured data querying, achieving a comprehensive improvement in the computer's internal data processing and human-computer interaction capabilities.
[0388] use Figure 13 The processing procedure is explained.
[0389] Step 1: User inputs information request in the terminal Users can use applications or browsers on their devices to enter information requests in natural language into input boxes, such as "I want to know the sales figures for product A in the first quarter of last year".
[0390] The user clicks the "Query" button on the terminal.
[0391] The terminal writes the text entered by the user into its local memory and uses the input method interface provided by the operating system to complete the text acquisition.
[0392] The terminal performs basic validation on the input (such as checking if it is empty), and then assembles fields such as information request, user identifier, and language type into a request data structure.
[0393] The terminal takes the request data structure as input, encodes it into a request message through the network communication module, and outputs it to the network interface, ready to send it to the server.
[0394] Step 2: The terminal sends an information request to the server. The terminal takes the request data structure from step 1 as input, encapsulates it into a network data packet through the network protocol stack, and sends it to the interface address specified by the server through a secure transmission channel.
[0395] Before sending, the terminal serializes the request data, converting the internal data structure into string-based transmission data and adding necessary header fields.
[0396] The terminal outputs the result of the sending operation (such as a success or failure status) and stores it in its local state so that it can retry or provide error messages when necessary.
[0397] Step 3: The server receives and parses the information request. The server takes the network request message sent by the terminal as input, receives the message through the network interface, and then hands it over to the backend application for processing.
[0398] The server uses the request parsing function provided by the backend framework to parse fields such as information request text, user identifier, and language type from the message and convert them into an internal data structure representation.
[0399] The server performs basic preprocessing operations on the parsed text, including removing leading and trailing whitespace, standardizing the encoding format, and checking the length for validity. The preprocessed text and related metadata are then provided as output to subsequent modules.
[0400] Step 4: The server parses the information structure of the data storage department. The server takes metadata (including table name, field name, field type, constraint relationship, etc.) from the data storage department as input and obtains this structural information through the metadata query interface of the data management system.
[0401] The server performs data processing operations on the obtained metadata: The server converts identifiers such as table names and field names into a unified format, maps field types to category codes, and calculates the statistical attributes of fields (such as field value range and non-null ratio).
[0402] The server transforms the processed information structure into structural description data, including a list of table structures and a list of field features, and then passes this structural description data as output to the prompt statement construction module.
[0403] Step 5: The server performs semantic pre-analysis on the information request. The server takes the preprocessed text from step 3 as input and calls the natural language processing component to perform word segmentation and key phrase extraction on the text.
[0404] The server extracts time-related expressions (e.g., "first quarter of last year") and target item-related expressions (e.g., "product A") from the text and maps these expressions to intermediate semantic representations, such as time slots and value slots.
[0405] The server constructs a semantic tag data structure (including time tags, object tags, operation type tags, etc.) based on the extraction results, and uses this semantic tag data structure as output for the prompt statement construction module and the generative artificial intelligence model.
[0406] Step 6: The server constructs prompts for query language generation. The server takes the structural description data from step 4 and the semantic tag data structure from step 5 as input, and selects a suitable prompt template from the prompt template library.
[0407] The server inserts the table names and key field names from the structure description data into the structure description section of the template, and embeds the time representation and target item representation from the semantic tag data structure into the task description section of the template.
[0408] The server generates a complete prompt text through data processing operations such as string concatenation and placeholder replacement, for example: "You are a database query generation assistant."
[0409] There is now a data storage department containing a data table called sales_data.
[0410] The main fields of this data table include: - product: Indicates the object identifier; - sales: indicates a numerical metric; - date: Represents date and time, in YYYY-MM-DD format.
[0411] Please read the following user information request. 1. Identify the objects that need to be statistically analyzed; 2. Identify the time range; 3. Generate a query language statement that uses an aggregate function on the sales field to calculate the total amount and names the result field total_value.
[0412] User information request: 'I would like to know the sales figures for Product A in the first quarter of last year.' Please only output the query language statement; do not output any other descriptions. The server outputs the prompt text to the generative artificial intelligence model interface module.
[0413] Step 7: The server invokes a generative artificial intelligence model to generate the query language. The server takes the prompt generated in step 6 as input and sends an inference request to the generative artificial intelligence model through the generative artificial intelligence model interface.
[0414] The server performs word segmentation and vectorization on the input prompts, converting each word into an embedding vector and adding positional encoding information to form the model input tensor.
[0415] Generative AI models internally utilize multi-layered self-attention networks to compute input tensors: The model applies attention weights to the relationships between time expressions, target item expressions, and field names in the prompt statements, and calculates the contextual representation of each word. During the decoding phase, the model calculates the probability distribution of the output sequence step by step based on the previously generated output and encoding results, and selects the word with the highest probability as the current output.
[0416] The server receives the generated query language text sequence, such as a query statement, from the model interface.
[0417] The server outputs the query language text and proceeds to the subsequent validation stage.
[0418] Step 8: The server validates and adjusts the planned query language. The server takes the query language text generated in step 7 as input and performs syntax and semantic checks on it.
[0419] The server parses the query language, extracts the table names and field names involved, and compares them with the structure description data in step 4 to confirm that the referenced tables and fields actually exist in the data storage department.
[0420] The server checks whether the query language contains only allowed operations (e.g., only read and aggregate are allowed, but modification or deletion of data is not allowed) and detects whether it contains unsafe keywords.
[0421] When the server detects incorrect or mismatched field names, it can correct the query language based on the similarity of fields in the information structure or alias mapping.
[0422] The server will ultimately provide the query execution module with the validated or corrected query language as output.
[0423] Step 9: The server executes queries and retrieves results in the data storage department. The server takes the query language that passed the validation in step 8 as input and sends a query request to the data storage department through the database connection interface.
[0424] The data storage department parses and optimizes the query language, performs retrieval, filtering, and aggregation operations on the underlying storage medium, and statistically analyzes data records that meet the criteria.
[0425] The server reads the results from the dataset returned by the database, which typically includes one or more numeric fields (such as the aggregated total) and optional grouping dimension fields.
[0426] The server outputs the raw query results to the result processing and natural language generation module.
[0427] Step 10: The server performs aggregation and unit conversion on the query results. The server takes the original query result data obtained in step 9 as input and performs secondary aggregation or reorganization on the results according to the aggregation requirements in the query language and the predefined display rules.
[0428] The server performs unit conversion processing on numeric fields, such as converting the basic currency unit to ten thousand yuan, and summarizing the time granularity from daily to quarterly.
[0429] The server binds the processed numerical results to the corresponding time or object dimensions to form structured result data, such as a collection of records containing fields like "time period", "object identifier", and "converted value".
[0430] The server uses this structured result data as output, providing input for the generation of natural language descriptions.
[0431] Step 11: The server generates user-oriented natural language instructions. The server takes the structured result data from step 10 and the original information request text as input and constructs a prompt statement for explaining the results.
[0432] The server embeds the user's question and key numerical results in the prompt statement, for example: "Below are the user's question and the database query results. Please answer the user in concise Chinese."
[0433] User question: 'I would like to know the sales figures for Product A in the first quarter of last year.' Query result: total_value = 5000000 (Japanese Yen) Please convert the results into amounts in ten thousand yuan and provide a natural language response. The server inputs the prompt into a generative artificial intelligence model, which then obtains a natural language response text through a vectorization and attention computation process similar to step 7.
[0434] After the server performs length control and sensitive word checks on the response text, it outputs the final natural language description along with the structured result data to the response generation module.
[0435] Step 12: The server generates a response and sends it to the terminal. The server takes the natural language description and structured result data from step 11 as input and constructs a response data structure, which includes the original information request, the generated query language, the numerical results, and the natural language answer.
[0436] The server performs serialization processing on the response data structure, converting it into a format suitable for network transmission, and sets the necessary response header fields.
[0437] The server sends the serialized response data to the terminal address via the network interface and records the sending status as internal output in the log for performance monitoring and error tracing.
[0438] Step 13: The terminal receives the response and displays the result. The terminal takes the response data sent by the server as input, receives the data through the network module, and then hands it over to the front-end application for processing.
[0439] The terminal deserializes the response data, parsing out the natural language response text and numerical result fields.
[0440] The terminal displays the natural language response in the results area of the user interface and can draw charts or tables based on the numerical results.
[0441] The terminal presents the rendered interface content to the user as output. The user obtains the information they need by reading the text and observing the charts, and can initiate the next round of natural language information requests based on the displayed results.
[0442] Application Example 2 The process flow corresponding to the specific processing in Use Case 2 will be described below. The various parts of the system described below are implemented by the data processing device 12 and the intelligent device 14. In addition, the data processing device 12 is referred to as the "server" and the intelligent device 14 is referred to as the "terminal".
[0443] In existing computer technologies, information retrieval from data storage devices (such as relational databases and data warehouses) typically requires users to directly write formal query statements using structured query languages or rely on fixed templates to generate query statements. This type of technology has the following problems: (1) The system only performs static configuration or simple mapping of the data table structure, and fails to actively learn the relationship between the data tables and the semantics of the fields inside the computer. As a result, the automatically generated query statement is difficult to adapt to changes in the data structure in a timely manner in complex scenarios, which affects the accuracy of retrieval and the maintainability of the system.
[0444] (2) Existing natural language query systems mostly convert natural language into query language, lacking a dedicated prompt statement construction and constraint mechanism for "generative artificial intelligence models". They cannot finely control the output behavior of generative artificial intelligence models inside the computer, which easily generates query statements with mismatched structure or security risks, increasing the protection and auditing burden of the database execution layer.
[0445] (3) When providing information retrieval to users, existing technologies rarely take the user's emotional state as an input dimension for the internal scheduling and output control of the computer. The operating system and application usually process requests according to fixed priorities and cannot dynamically adjust task priorities and query granularity based on emotional information, resulting in insufficient intelligent allocation of computing resources and a lack of optimized balance between user experience and overall system throughput.
[0446] (4) In most systems, the server only performs intent analysis on natural language, without forming a unified “structured data representation” (such as time information, object information, processing content information, etc.) within the program, and does not use this structured data together with data table structure information and sentiment information as input context for generative artificial intelligence models. This makes it difficult for the query language generation process to take into account multiple technical goals such as semantic accuracy, execution performance and security.
[0447] (5) Due to the lack of an automatic verification and correction mechanism for the query language output by generative artificial intelligence models, servers often need to be manually reviewed or filtered through coarse-grained blacklists. The generated results cannot be finely corrected at the program level based on the learned data structures and security policies, thus limiting the reliable application of generative artificial intelligence models in production-level database environments.
[0448] Therefore, it is necessary to propose a new computer implementation method that enables the server to: (a) Actively parse and learn the table structure of data storage devices at the machine level; (b) Integrate natural language information requests, structured data, and sentiment information into prompts for generative artificial intelligence models; (c) Automatically validate and correct the query language output by the generative artificial intelligence model; (d) Dynamically adjust the priority, data range, and displayed content of query processing based on sentiment information; This improves query accuracy and security while enhancing computing resource scheduling and human-computer interaction, thereby improving computer technology itself.
[0449] The specific processing performed by the specific processing unit 290 of the data processing apparatus 12 in Application Example 2 is achieved by the following means.
[0450] In this invention, the server includes a module for acquiring and learning the table structure relationships of a data storage device, a module for generating prompt statements for a generative artificial intelligence model, a module for calling the generative artificial intelligence model based on the prompt statements and verifying and correcting the generated query language, a module for adjusting query execution and result presentation by incorporating sentiment information, and a module for outputting result information to the terminal. This enables an end-to-end automated query generation and execution process within the computer: the server first parses the table structure from the data storage device and forms a structural information model; then, based on natural language information requests and sentiment information from the information input device, it generates prompt statements containing structural information, intent information, and constraint rules; it uses the generative artificial intelligence model to generate query language and automatically verifies and corrects the query language using structural information and security policies; further, it dynamically adjusts the query processing priority and data granularity based on sentiment information; and finally, it controls the summary and display items of the results and returns them to the terminal. This improves query accuracy and security while enhancing computing resource utilization efficiency and interactive experience, achieving a comprehensive improvement in natural language query systems and database access technologies.
[0451] A "system" refers to a collection of devices consisting of at least one computing device, at least one data storage device, and at least one information input device, which work together through hardware and software to perform data processing and information provision functions.
[0452] "Computational processing unit" refers to a computing unit used to execute program instructions to implement data parsing, learning, generation, verification, querying and control processes, including but not limited to central processing unit, graphics processing unit or other programmable logic devices.
[0453] "Data storage device" refers to a storage system used to store data tables, metadata and related information in a structured or semi-structured form, and to support data read, write and query operations, including but not limited to database systems, data warehouses or other persistent storage media.
[0454] "Table structure" refers to the logical structure definition used to organize data in a data storage device. It usually includes information such as table name, column name, column type, primary key, foreign key, and relationships between tables.
[0455] "Structure information" refers to descriptive data obtained from data storage devices that represents the table structure, its field relationships, constraints, and metadata, and is used to guide the generation, validation, and execution of query languages.
[0456] A “data set” refers to a group of records or tuples stored in a data storage device according to the same structural definition, usually corresponding to all or part of the rows in a table.
[0457] "Attributes" refer to fields or columns used to describe the characteristics of each record in a data set, such as data items like identifier, name, time, value, or category.
[0458] "Information input device" refers to an input interface and related hardware used to receive information requests, emotion-related data or other interactive instructions from users, including but not limited to display interfaces, keyboards, touch screens, microphones or cameras on terminal devices.
[0459] "Information request" refers to the request made by a user through an information input device in natural language or a specific format to obtain, statistically analyze, or perform analysis on target data in a data storage device.
[0460] "Natural language" refers to the language forms used by humans in daily communication. It is not limited to fixed grammatical structures or sets of keywords, and includes spoken language, written language and their variations.
[0461] "Emotional information" refers to data used to represent a user's psychological or emotional state when making a request for information, including emotion category, emotion intensity, or other emotional characteristics.
[0462] "Emotional state" refers to the category of a user's current subjective experience determined based on emotional information, such as joy, anger, dissatisfaction, sadness, or neutrality.
[0463] "Generative artificial intelligence models" refer to artificial intelligence models trained using machine learning or deep learning methods that can automatically generate output text (including query language) based on input text or other data.
[0464] "Prompt statements" refer to text instructions or contextual content input into a generative artificial intelligence model, used to describe task objectives, constraints, and background information, in order to guide the generative artificial intelligence model to output query language that meets the requirements.
[0465] "Query language" refers to a formal language used to issue retrieval, filtering, summarizing or modification instructions to data storage devices, including but not limited to Structured Query Language and its extended forms.
[0466] "Security conditions" refer to pre-set constraints to prevent unauthorized access or damage to data storage devices, including prohibited objects, prohibited statement types, and other security policies.
[0467] "Verification" refers to the process of comparing the generated query language with the structural information and security conditions before the query language is executed, in order to check its syntactic correctness, structural matching and security compliance.
[0468] "Correction" refers to the automatic modification or constraint of the query language when it is found during the verification process that it does not conform to the structural information or security conditions, so as to make it meet the predetermined rules.
[0469] "Processing priority" refers to the control parameters used to distinguish the order of requests and the weight of resource allocation when the system schedules and executes multiple information requests.
[0470] "Scope of target data acquisition" refers to the extent to which the data set to be extracted from the data storage device is covered when the query language is executed, including limitations such as time interval, number of objects, or number of records.
[0471] "The level of detail in the target data" refers to the level of refinement of the query results in terms of the number of fields, granularity, and aggregation level, such as returning only summary results or returning detailed records.
[0472] "Query processing" refers to the overall process by which the system performs operations such as retrieval, filtering, aggregation, and sorting in the data storage device based on query language to obtain data results that meet the information request.
[0473] "Summary content" refers to a concise representation extracted from the search results to briefly explain or summarize key information before the results are provided to users.
[0474] "Display items" refers to the set of result elements that are actually presented to the user on an information input device or terminal, including text fields, numeric fields, graphic elements, or other visual components.
[0475] "Structured data" refers to a data structure that formally represents elements such as time information, object information, and processing content information contained in natural language information requests according to a predetermined data model, which facilitates logical reasoning and query language generation by programs.
[0476] "Time information" refers to time-related elements extracted and represented from information requests, such as year, month, quarter, date, or time period.
[0477] "Object information" refers to the elements extracted from the information request and represented that are related to the target entity, such as goods, users, regions, or categories.
[0478] "Processing content information" refers to extracting elements from information requests and representing the types of operations that need to be performed on data storage devices, such as querying, statistics, sorting, comparison, or recommendation.
[0479] "Output constraints" refer to a set of rules pre-set to limit the format, content range, or complexity of the output results when a generative artificial intelligence model is invoked to generate query language.
[0480] In the following description, "server" generally refers to a computing device having at least one processing unit and memory, "terminal" refers to a user-side device having input / output interfaces, and "user" refers to the entity that operates the terminal and issues information requests.
[0481] In one embodiment, the server is implemented using general-purpose computer hardware, such as a rack-mounted computing device equipped with a multi-core central processing unit, main memory, and non-volatile memory. The server pre-installs an operating system and application runtime environment, such as a UNIX-like operating system and a Python runtime environment, in its memory. The server stores the various functional module programs involved in this invention in its memory, including: a table structure parsing and learning module, a natural language parsing module, a prompt statement generation module, a generative artificial intelligence model interface module, a query language verification and correction module, a sentiment information processing module, a query execution module, and a result generation and output control module. The server communicates bidirectionally with one or more data storage devices via a network interface. In one embodiment, the data storage device is a relational database management system, such as data management software based on structured query language, running on the same physical device or a separate storage server.
[0482] In one implementation, the server uses an object-relational mapping (ORM) software library as a table structure parsing tool, such as a metadata access library that supports multiple databases. The server establishes a connection with the data storage device based on a database connection driver and calls the metadata interface to obtain the names, field names, field types, key constraints, and inter-table relationships of all data tables. The server stores this information as an internal structural information model, for example, in memory as key-value pairs or a graph structure. The server further infers the semantic relevance between fields by performing word segmentation, similarity calculation, and statistical co-occurrence analysis on the field names. For example, it classifies "product_id" and "product_name" as belonging to the same entity and marks "year," "month," and "quarter" as time-dimensional fields. Through this table structure learning process, the server internally forms structural information that can be directly referenced by subsequent modules, thus avoiding the reliance on manual maintenance of mapping rules in traditional systems, reducing human configuration errors, and improving the adaptability to changes in table structure.
[0483] In one embodiment, the terminal is a smartphone, tablet, or personal computing device. The terminal runs an application or browser script with a graphical user interface to display input boxes, voice buttons, and query results areas to the user. The terminal has a built-in microphone and camera, and installs a speech recognition software development kit (SDK) and an emotion recognition software development kit (EDK). The terminal converts the user's voice signal into audio frames and calls a speech recognition service to obtain the corresponding text string. The terminal uses the camera to capture images or videos of the user's face, or uses voice features to send feature data to the emotion recognition service to obtain emotion tags and confidence levels. The terminal encapsulates the natural language text, emotion information, and device context (such as the current store sign) into a request message and sends it to the server via the network.
[0484] In typical applications, users submit queries in natural language via the terminal. For example, in a sales analysis scenario, a user might enter "What was the best-selling product in the first quarter of last year?", or in an inventory query scenario, they might say, "Is this product still in stock? It was out of stock last time." The user's emotional state when making the request, such as obvious dissatisfaction or happiness, is calculated by the terminal using an emotion recognition algorithm and sent to the server along with the text. Users do not need to understand the database table structure or the syntax of Structured Query Language; the server internally handles the conversion from natural language to query language.
[0485] In one implementation, the server uses a natural language processing (NLP) library to parse the received natural language text. The server first performs language detection and word segmentation, then uses part-of-speech tagging and dependency parsing to identify time expressions, target objects, and operational intentions. The server further maps sentences to several predefined intent categories using a combination of rule templates and machine learning classifiers, such as "query the best-selling product," "query the inventory availability of a certain product," and "statistics sales by month." The server performs similarity matching between lexical vector representations and field and table names in the structural information model, mapping phrases such as "last year," "first quarter," "sales," and "product A" in the natural language to specific fields and constant values, forming structured data containing time information, object information, and processing content information. For example, the server parses "sales of product A in the first quarter of last year" as: year = the value of the previous calendar year, quarter = 'Q1', product_name = 'product A', metric = 'sales'.
[0486] The server generates prompt statements based on structured data, structural information, and sentiment information. In one implementation, the server constructs multi-segment text for the generative AI model, including: a database structure summary segment, a task description segment, an input question segment, a sentiment constraint segment, and an output format constraint segment. The database structure summary segment briefly lists relevant tables and fields, such as "sales(product_id, product_name, year, quarter, month, sales)". The task description segment specifies the type of query language to be generated, such as "Generate a structured query for the highest-selling product". The input question segment directly contains the user's original question text to maintain semantic integrity. The sentiment constraint segment fills in different rules based on sentiment information; for example, when the sentiment label is "dissatisfaction", the prompt statement includes "Please generate a query that is as simple and fast as possible, returning only the core fields", and when the sentiment label is "joy", the prompt statement includes "Please also generate a query recommending related products". The output format constraint segment requires the generative AI model to output only query language text starting with "SELECT", without natural language interpretation.
[0487] In a specific example, the prompt message generated by the server could be: "You are an SQL generation assistant."
[0488] Database structure: - sales(product_id, product_name, year, quarter, month, sales) User question: 'Please tell me the top-selling product in the first quarter of last year.'
[0489] Requirements: Generate a SQL query to find the names of the best-selling products in the first quarter of last year. Output only the SQL query; do not provide explanations. In another example, when the user's emotion is dissatisfaction, the server can generate the following prompt: "You are an intelligent SQL generator."
[0490] Database structure: inventory(store_id, product_id, stock_quantity), products(product_id, product_name).
[0491] User question: 'Is this product in stock?'
[0492] User sentiment: Frustration.
[0493] rule: - When a user is dissatisfied, only check if the product is in stock at the current store, and simplify the query as much as possible.
[0494] - The current store ID is 101, and the product name is 'Product X'.
[0495] Please generate a SQL query to determine the current inventory quantity of this product in the store. Output only the SQL query. In one implementation, the server invokes an external generative AI model service via a network interface. This generative AI model can employ a multi-layered self-attention neural network based on the Transformer architecture, including an embedding layer, multiple encoder-decoder layers, self-attention sublayers, feedforward sublayers, and an output layer. During training, the model uses natural language questions and corresponding structured query language pairs as supervised samples, optimizes using a cross-entropy loss function and an autoregressive language modeling objective, and updates network weights using gradient descent and its variants. The training data contains various table structures and question types, enabling the model to learn to generate logically correct query language in different structural environments. Data augmentation techniques can be used during training, such as replacing time expressions and entity names, to enhance the model's generalization ability to analogous scenarios.
[0496] During the inference phase, the server inputs the constructed prompts as a text sequence into the generative AI model interface module. This module encodes the prompts into vector representations, which are then transformed layer by layer through multi-head self-attention layers and feedforward network layers, outputting a probability distribution sequence at the character or sub-word level. The model progressively decodes and generates the query language text according to the principle of maximizing probability until it encounters an end marker. The server extracts query language fragments from the output, removing any unexpected text, such as interpretable natural language, through grammar checking and keyword filtering. Because the prompts already embed table structure and sentiment constraints, the model's internal attention mechanism can align temporal and object information with corresponding fields, thereby reducing the error rate of traditional rule-based transformation schemes under complex semantics.
[0497] After obtaining the generated query language, the server uses a structural information model (SIM) for verification and correction. The server first parses the abstract syntax tree of the query language, checking that all table and field names are in the SIM's whitelist. For mismatched names, the server attempts to replace them using fuzzy matching or an alias table. The server further checks for update statements, delete statements, or other prohibited operation types; if found, it refuses execution or removes them. In one implementation, the server can automatically remove dangerous clauses, such as unrestricted Cartesian product joins, based on predefined security policies. The server also modifies result constraint clauses in the query language based on sentiment information and system load. For example, when the system is busy and user sentiment is negative, the number of result rows is limited to a smaller value to shorten response time.
[0498] In one implementation, the server executes a modified query language via a database driver to retrieve record sets from the data storage device. The data storage device employs a row-oriented or column-oriented storage structure, internally accelerating filtering and aggregation operations through indexing and caching mechanisms. After retrieving the results, the server performs post-processing, including sorting by time fields, summing or averaging numerical fields, and grouping and statistically analyzing categorical fields. The server then determines the granularity of the result summary based on sentiment information. When the sentiment is negative, only a few key fields and aggregated results are retained, such as total sales or inventory quantity. Conversely, when the sentiment is positive, more dimensional information can be added, such as category-specific statistics, growth rates, and lists of related recommended products.
[0499] In one implementation, the terminal receives structured results and summary text returned by the server and visualizes the data using graphical components. The terminal can use a graphics library to plot time-series data as line charts, category summary data as bar charts, or present it as an augmented reality overlay on top of actual products in smart glasses. The terminal selects different display styles based on emotional tags; for example, reducing animation effects and highlighting key numbers when the user is in a bad mood, and increasing interactive elements and detailed views when the user is in a good mood. By controlling the presentation layer on the client side, the system further reduces the cognitive burden required for users to find key information, achieving technical optimization at the human-computer interface level.
[0500] The server achieves several technical benefits through its modular design. Because the server explicitly learns and caches table structures and field relationships internally, rather than simply relying on configuration files, it can automatically adapt prompts and validation rules to changes in table structure, thereby reducing manual maintenance costs and lowering the probability of query errors. By combining natural language parsing results with structural and sentiment information, the server provides the generative AI model with a more accurate and well-defined context when constructing prompts. The query language generated by the model significantly outperforms general text generation that relies solely on natural language input in terms of semantic consistency and execution efficiency. In terms of security, the server uses syntax tree checking and whitelist verification mechanisms to finely filter and automatically correct the generated query language, thereby significantly reducing potential security risks caused by the generative model's output without increasing the burden on the database layer.
[0501] Furthermore, the server utilizes emotional information to dynamically adjust processing priorities and data granularity, achieving intelligent scheduling of computing resources: when it detects user impatience or dissatisfaction, the server prioritizes related requests and simplifies queries to reduce response latency; when it detects a user in an exploratory or active state, the server can appropriately increase query complexity to provide more in-depth data analysis. This emotion-based control logic is not a simple automation of manual operations, but rather an improvement to the computer system's operating mechanism by introducing new control parameters at the task scheduling and query generation levels, enabling the computer system to adaptively optimize resource utilization and output content based on human states.
[0502] In another implementation, the server can deploy a pre-trained generative neural network model locally instead of using external generative AI services. This model can employ a dual-tower encoder-decoder structure, where the encoder encodes the natural language question and structured data, and the decoder generates the query language under constraints. During local training, the server selects corpora containing various database structures, minimizing the cross-entropy loss between the predicted query language and the manually annotated query language, while introducing a structure mismatch penalty term, treating fields not present in the structured information model as additional losses. Through this joint loss function design, the model automatically learns the ability to generate structure-compatible query language while maintaining correctness during training, thereby reducing the burden on subsequent verification and correction modules during the inference phase.
[0503] In another implementation, the server can extend the prompt generation rules by introducing multi-turn contextual information. This allows the generative AI model to generate incremental queries based on previous queries. For example, after a user receives a value for "sales of product A in the first quarter of last year," they might ask, "What about the first quarter of this year?" The server can then add structured information and a summary of the previous query to the prompt, enabling the model to generate a query that only modifies the time condition. Through this dialogue context modeling, the server reduces repetitive parsing processes and redundant field specification, thereby further improving query generation efficiency.
[0504] Through the above implementation methods, the server combines multi-core processors and database index structures at the hardware level, and natural language processing algorithms, generative artificial intelligence models and structured verification mechanisms at the software level. This makes the conversion process from natural language to query language superior to traditional manual rules or single model solutions in terms of computational accuracy, execution speed, security and resource utilization. This achieves a substantial improvement in computer technology itself, rather than just automating business processes.
[0505] use Figure 14 The processing procedure is explained.
[0506] Step 1: Users input information requests on the terminal and generate emotion-related data.
[0507] Users input queries expressed in natural language into the terminal, such as typing "What was the best-selling product in the first quarter of last year?" into a text box or speaking "Is this product still in stock?". The input is natural language speech or text data. The terminal converts the speech signal into a digital audio sample and caches the text input locally. The output is a natural language text string, which serves as the basis for subsequent query processing.
[0508] Step 2: The terminal uses speech recognition and emotion recognition software to generate text and emotional information.
[0509] The terminal sends the collected voice signal to the speech recognition component, with audio data as input and corresponding text content as output. Simultaneously, the terminal captures the user's facial image and voice features through its camera and microphone, inputting this data into an emotion recognition algorithm. The algorithm extracts and classifies features such as facial expressions, tone, and speech rate, outputting emotion labels (e.g., "joy," "dissatisfaction," "neutral") and confidence scores. The terminal combines the natural language text, emotion labels, emotion confidence scores, and device context information into structured request data, which is then sent to the server as the next data output.
[0510] Step 3: The terminal sends a request message to the server containing information requests and emotional information.
[0511] The terminal encapsulates the user ID, terminal information, natural language text, and sentiment information in a structured format, with the input being a locally generated request object. The terminal encodes this object into a network message using a network protocol and sends it to the server's predefined interface address. The terminal updates its local state to "waiting for a response." The output is a complete request message transmitted over the network to the server.
[0512] Step 4: The server receives the request and performs basic verification and logging.
[0513] The server receives request messages from terminals via the network interface. The input is structured data containing natural language text, sentiment information, and contextual information. The server parses the message structure, verifying the completeness and correctness of fields, such as checking if `query_text` is a non-empty string and if `emotion_label` is in the allowed list. The server writes valid requests to a log storage, including timestamps, user identification information, request content, and sentiment tags. The output is the verified and logged request object for use by subsequent processing modules.
[0514] Step 5: The server parses the table structure of the data storage device and generates structure information.
[0515] The server connects to the data storage device using a database connection driver, with database connection parameters as input. The server calls the metadata interface to read the names, fields, field types, key constraints, and inter-table relationships of all tables, and builds a structural information model based on this raw metadata, such as storing the relationships between table names and field sets as mappings or graph structures. The server performs word segmentation and similarity calculations on field names, marking time-related fields as time dimensions and primary / foreign key pairs as entity associations. The output is a structural information object representing the current database table structure and field relationships, used for subsequent natural language parsing and prompt generation.
[0516] Step 6: The server parses natural language information requests and generates structured data.
[0517] The server takes the query_text received from the terminal as input and performs word segmentation, part-of-speech tagging, and dependency parsing using a pre-loaded natural language processing model. Based on grammatical structure, the server identifies time expressions (e.g., "last year," "first quarter"), target objects (e.g., "product A," "this product"), and operation types (e.g., "query sales," "is there stock"). The server further uses word vectors or similarity matching to map these phrases to specific fields in the structural information (e.g., year, quarter, product_name, sales, etc.). The data processing includes converting text fragments into standardized time values, mapping noun phrases to field values, and mapping verb phrases to query intent. The output is a structured data object containing time information, object information, and processed content information.
[0518] Step 7: The server determines the query intent and target table based on the structural information and structured data.
[0519] The server takes structured data and a structured information model as input, and uses a rule engine or classification model to determine the appropriate set of data tables and operation mode. For example, when processing "highest selling products" and a time dimension exists, the server determines to query the `sales` table and possibly join it with the `products` table; when processing "inventory availability," the server determines to use the `inventory` and `products` tables. The server constructs a preliminary query plan based on field requirements, including a list of selection fields, filter conditions, grouping dimensions, and sorting rules. The output is a query intent description object, containing the target set of tables and the logical query plan, providing the foundation for generating suggestion statements.
[0520] Step 8: The server combines structural information, structured data, and emotional information to generate prompts.
[0521] The server takes a structure information summary, query intent description, raw natural language text, and sentiment information as input, and performs template filling and string concatenation operations. The server inserts relevant table structure descriptions, field names, and user question text into the prompt statements, and adds constraint rules based on sentiment tags, such as "When the user is dissatisfied, please generate a query that is as simple and fast as possible, returning only the core fields" or "When the user is happy, please also generate a query recommending relevant data." The server standardizes the format of the prompt statements to ensure that the generative AI model can correctly parse the task description and output requirements. The output is a complete prompt statement text, which serves as the input to the generative AI model.
[0522] Step 9: The server invokes a generative artificial intelligence model to generate query language based on the prompts.
[0523] The server sends the prompt as input to the generative AI model interface module. Internally, the generative AI model, based on a Transformer neural network, embeds and performs self-attention calculations on the input text to generate a probability distribution sequence of output tokens. In the interface module, the server uses an autoregressive decoding algorithm (such as greedy search or bundle search) to sequentially select the tokens with the highest probabilities and concatenate them into a query language string. This process involves data computation including matrix multiplication, self-attention weight calculation, and nonlinear activation, among other neural network operations. The output is a query language text generated by the generative AI model, typically a structured query statement beginning with "SELECT".
[0524] Step 10: The server performs syntax parsing and security verification on the generated query language.
[0525] The server takes the generated query language text as input and constructs an abstract syntax tree (AST) using a query parser. The server traverses the AST nodes, comparing each table name and field name with the structural information model to check if all belong to the whitelisted tables and fields. Simultaneously, the server scans operation types, detecting any disallowed statements (such as DELETE, UPDATE, and DROP), and rejects or prunes these parts according to predefined security policies. Data processing in this step involves filtering, replacing, and pruning the AST structure, outputting a validated and security-filtered version of the query language.
[0526] Step 11: The server adjusts the query language based on sentiment information and system status.
[0527] The server takes validated query language, sentiment labels, and current system load information as input and performs secondary adjustments to the LIMIT, ORDER BY, and select field list in the query statement. For example, when `emotion_label` is "dissatisfied" and the system load is high, the server sets the LIMIT value to a smaller number and retains only necessary fields to reduce data scanning and network response volume; when `emotion_label` is "joyful" and the system is idle, the server can add additional fields or append subqueries to generate recommendation results. The output is the final query language text to be executed, balancing performance and sentiment response requirements while ensuring semantic accuracy.
[0528] Step 12: The server executes query language and retrieves results from the data storage device.
[0529] The server takes the final query language as input, communicates with the data storage device through the database driver, and executes the query operation. The data storage device scans and calculates its internal indexes and data pages based on the filtering conditions, grouping, and sorting requirements in the query statement, returning a set of records that meet the conditions. The server receives the result set, performs format standardization processing on the original records, such as converting each row into a key-value pair structure. The output is a structured collection of query result data for subsequent summarization and presentation control.
[0530] Step 13: The server generates a summary of the results and controls the content displayed based on sentiment information.
[0531] The server takes query results and sentiment information as input, calculates statistical summaries, such as sums, averages, maximum values, or top-ranked items. When the sentiment is "dissatisfied," the server generates only a brief summary and a few key fields, such as "Product A sales volume in the first quarter of last year was 25,430 units" or "Current store inventory is 12." When the sentiment is "happy," the server can generate multi-level summaries, such as sales distribution by category, growth rate, and recommended lists. Data processing includes aggregation calculations, sorting, and filtering, with the output being summary text and the corresponding display data structure.
[0532] Step 14: The server packages the results and summary and sends them to the terminal.
[0533] The server takes a summary text, detailed data, and structured data for visualization as input to construct a response object, which includes a status code, message text, and data fields. The server serializes the response object and sends it back to the terminal over the network. The output is a complete response message, transmitted over the network to the terminal, awaiting parsing and display.
[0534] Step 15: The terminal parses the response and displays the results in an emotionally appropriate manner.
[0535] The terminal receives a response message from the server, with the input being a structured response containing a summary and data. The terminal parses the fields, extracts the summary text and chart data, and selects a display mode based on sentiment tags: under a negative sentiment, the terminal displays only key conclusions in large font and hides some secondary information; under a positive sentiment, the terminal displays charts, recommendation lists, and detailed tables. The terminal may use a graphics library to plot time-series data as line graphs, categorical data as bar charts, or display key information in an augmented reality overlay on a wearable device. The output is a visualization presented on a screen or display device for user viewing and further interaction.
[0536] Step 16: Users can make further queries or decisions based on the displayed results.
[0537] Users observe the summary and detailed information displayed on the terminal and input visual query results. Users may then ask follow-up questions, such as "What about the first quarter of this year?" or "Help me compare these two quarters," inputting new natural language requests again through the terminal. At this point, the aforementioned steps are repeated from step 1, forming a multi-round interactive process. Users can also make decisions directly based on the results in real-world scenarios, such as restocking a product or adjusting promotional strategies, achieving linkage between data processing and real-world operations.
[0538] The specific processing unit 290 sends the result of the specific processing to the smart device 14. In the smart device 14, the control unit 46A causes the output device 40 to output the result of the specific processing. The microphone 38B acquires sound representing user input regarding the result of the specific processing. The control unit 46A sends the sound data representing user input acquired by the microphone 38B to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the sound data.
[0539] Data generation model 58 is a so-called generative AI (Artificial Intelligence). Examples of data generation models 58 include ChatGPT (registered trademark) (accessible via the internet (URL: https: / / openai.com / blog / chatgpt)). Data generation model 58 is obtained through deep learning on a neural network. Input to data generation model 58 are prompt words containing instructions, and inference data such as sound data representing sound, text data representing text, and image data representing images (e.g., still image data or animation data). Data generation model 58 infers from the input inference data based on the instructions represented by the prompt words and outputs the inference result in one or more data forms, such as sound data, text data, and image data. Data generation model 58 includes, for example, text generation AI, image generation AI, and multimodal generation AI. Here, inference refers to, for example, analysis, classification, prediction, and / or induction. The specific processing unit 290 performs the aforementioned specific processing while using data generation model 58. The data generation model 58 can also be a model finely tuned to output inference results from prompts that do not contain instructions. In this case, the data generation model 58 can output inference results based on prompts that do not contain instructions. The data processing apparatus 12, etc., includes various data generation models 58, including AI other than the generation AI. AI other than the generation AI can be, for example, linear regression, logistic regression, decision trees, random forests, support vector machines (SVM), k-means clustering, convolutional neural networks (CNN), recurrent neural networks (RNN), generative adversarial networks (GAN), or Naive Bayes, and can perform various processes, but is not limited to this example. Furthermore, the AI can also be an AI agent. Furthermore, when the processing of the above-mentioned parts is performed by AI, the processing can be performed partially or entirely by AI, but is not limited to this example. Furthermore, the processing performed by the AI including the generation AI can be replaced by processing in the rule base, and the processing in the rule base can also be replaced by processing performed by the AI including the generation AI.
[0540] Furthermore, the processing of the aforementioned data processing system 10 is performed by the specific processing unit 290 of the data processing device 12 or the control unit 46A of the smart device 14, but it can also be performed by both the specific processing unit 290 of the data processing device 12 and the control unit 46A of the smart device 14. Additionally, the specific processing unit 290 of the data processing device 12 acquires or collects information required for processing from the smart device 14 or external devices, and the smart device 14 acquires or collects information required for processing from the data processing device 12 or external devices.
[0541] For example, the collection unit is implemented by the control unit 46A of the smart device 14 or the specific processing unit 290 of the data processing device 12. For example, the acquisition unit uses the camera 42 or communication I / F 44 of the smart device 14 to acquire step data, which is then processed by the specific processing unit 290 of the data processing device 12. For example, the analysis unit is implemented by the specific processing unit 290 of the data processing device 12, which analyzes the data from the collection unit and the acquisition unit. For example, the generation unit is implemented by the specific processing unit 290 of the data processing device 12, which uses a generation AI to generate a menu. For example, the serving unit is implemented by the output device 40 of the smart device 14 or the specific processing unit 290 of the data processing device 12, which provides the generated menu to the user. The correspondence between each unit and the device or control unit is not limited to the above examples and various changes can be made.
[0542] In the above embodiments, examples of specific processing by the data processing device 12 are given, but the technology disclosed herein is not limited to this, and specific processing may also be performed by the smart device 14.
[0543] Second Implementation Method Figure 3 An example of the configuration of the data processing system 210 according to the second embodiment is shown.
[0544] like Figure 3 As shown, the data processing system 210 includes a data processing device 12 and smart glasses 214. A server can be cited as an example of the data processing device 12.
[0545] The data processing apparatus 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" as understood in this disclosure. The computer 22 includes a processor 28, RAM 30, and memory 32. The processor 28, RAM 30, and memory 32 are connected to a bus 34. Furthermore, the database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[0546] The smart glasses 214 include a computer 36, a microphone 238, a speaker 240, a camera 42, and a communication I / F 44. The computer 36 includes a processor 46, RAM 48, and memory 50. The processor 46, RAM 48, and memory 50 are connected to a bus 52. Furthermore, the microphone 238, speaker 240, camera 42, and communication I / F 44 are also connected to the bus 52.
[0547] Microphone 238 receives instructions from user 20 by receiving sounds emitted by user 20. Microphone 238 captures sounds emitted by user 20 and converts the captured sounds into sound data, which is then output to processor 46. Speaker 240 outputs sound according to instructions from processor 46.
[0548] Camera 42 is a small digital camera equipped with an optical system such as a lens, aperture and shutter, and imaging elements such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, which captures images of the user 20's surroundings (e.g., the field of view defined by an angle equivalent to the field of vision of an average healthy person).
[0549] Communication I / F44 is connected to network 54. Communication I / F44 and 26 are responsible for the transmission and reception of various information between processor 46 and processor 28 via network 54. The transmission and reception of various information between processor 46 and processor 28 using communication I / F44 and 26 is performed in a secure state.
[0550] Figure 4 This illustrates an example of the main functions of the data processing device 12 and the smart glasses 214. For example... Figure 4 As shown, in the data processing device 12, specific processing is performed by the processor 28. The specific processing program 56 is stored in the memory 32.
[0551] The specific processing program 56 is an example of a "program" involved in the technology of this disclosure. The processor 28 reads the specific processing program 56 from the memory 32 and executes the read specific processing program 56 on the RAM 30. Specific processing is implemented by the processor 28 operating as a specific processing unit 290 according to the specific processing program 56 executed on the RAM 30.
[0552] The memory 32 stores a data generation model 58 and an emotion-specific model 59. The data generation model 58 and the emotion-specific model 59 are used by the specific processing unit 290. The specific processing unit 290 can use the emotion-specific model 59 to infer the user's emotions and perform specific processing based on the user's emotions. In the emotion inference function (emotion-specific function) using the emotion-specific model 59, various inferences and predictions related to the user's emotions are performed, including inferences and predictions of the user's emotions, but this is not limited to this example. Furthermore, emotion inference and prediction may also include, for example, emotion analysis (parsing).
[0553] In the smart glasses 214, the processor 46 performs reception and output processing. The memory 50 stores the reception and output program 60. The processor 46 reads the reception and output program 60 from the memory 50 and executes the read reception and output program 60 on the RAM 48. The reception and output processing is implemented by the processor 46 operating as a control unit 46A according to the reception and output program 60 executed on the RAM 48. Furthermore, the smart glasses 214 has the same data generation model and emotion-specific model as the data generation model 58 and the emotion-specific model 59, and these models can also be used to perform the same processing as the specific processing unit 290.
[0554] Next, the specific processing of the specific processing unit 290 of the data processing device 12 will be described. Each part of the system described below is implemented by the data processing device 12 and the smart glasses 214. In the following description, the data processing device 12 will be referred to as the "server" and the smart glasses 214 will be referred to as the "terminal".
[0555] Example 1 The process is the same as that of the specific process described in Embodiment 1 in the first embodiment above, so the description is omitted.
[0556] Application Example 1 The process is the same as that in the specific processing described in Application Example 1 of the first embodiment above, so the description is omitted.
[0557] Example 2 The process is the same as that of the specific process in Embodiment 2 described in the first embodiment above, so the description is omitted.
[0558] Application Example 2 The process is the same as that in the specific processing described in Application Example 2 of the first embodiment above, so the description is omitted.
[0559] The specific processing unit 290 sends the result of the specific processing to the smart glasses 214. In the smart glasses 214, the control unit 46A outputs the result of the specific processing to the speaker 240. The microphone 238 acquires sound input representing the user's input regarding the result of the specific processing. The control unit 46A sends the sound data representing the user's input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the sound data.
[0560] Data generation model 58 is a so-called generative AI (Artificial Intelligence). Examples of data generation models 58 include ChatGPT (registered trademark) (accessible via the internet (URL: https: / / openai.com / blog / chatgpt)). Data generation model 58 is obtained through deep learning on a neural network. Input to data generation model 58 are prompt words containing instructions, and inference data such as sound data representing sound, text data representing text, and image data representing images (e.g., still image data or animation data). Data generation model 58 infers from the input inference data based on the instructions represented by the prompt words and outputs the inference result in one or more data forms, such as sound data, text data, and image data. Data generation model 58 includes, for example, text generation AI, image generation AI, and multimodal generation AI. Here, inference refers to, for example, analysis, classification, prediction, and / or induction. The specific processing unit 290 performs the aforementioned specific processing while using data generation model 58. The data generation model 58 can also be a model finely tuned to output inference results from prompts that do not contain instructions. In this case, the data generation model 58 can output inference results based on prompts that do not contain instructions. The data processing apparatus 12, etc., includes various data generation models 58, including AI other than the generation AI. AI other than the generation AI can be, for example, linear regression, logistic regression, decision trees, random forests, support vector machines (SVM), k-means clustering, convolutional neural networks (CNN), recurrent neural networks (RNN), generative adversarial networks (GAN), or Naive Bayes, and can perform various processes, but is not limited to this example. Furthermore, the AI can also be an AI agent. Furthermore, when the processing of the above-mentioned parts is performed by AI, the processing can be performed partially or entirely by AI, but is not limited to this example. Furthermore, the processing performed by the AI including the generation AI can be replaced by processing in the rule base, and the processing in the rule base can also be replaced by processing performed by the AI including the generation AI.
[0561] Furthermore, the processing of the aforementioned data processing system 10 is performed by the specific processing unit 290 of the data processing device 12 or the control unit 46A of the smart glasses 214, but it can also be performed by both the specific processing unit 290 of the data processing device 12 and the control unit 46A of the smart glasses 214. Additionally, the specific processing unit 290 of the data processing device 12 acquires or collects information required for processing from the smart glasses 214 or external devices, and the smart glasses 214 acquires or collects information required for processing from the data processing device 12 or external devices.
[0562] For example, the collection unit is implemented by the control unit 46A of the smart glasses 214 or the specific processing unit 290 of the data processing device 12. For example, the acquisition unit uses the camera 42 or communication I / F 44 of the smart glasses 214 to acquire step data, which is then processed by the specific processing unit 290 of the data processing device 12. For example, the analysis unit is implemented by the specific processing unit 290 of the data processing device 12, which analyzes the data from the collection unit and the acquisition unit. For example, the generation unit is implemented by the specific processing unit 290 of the data processing device 12, which uses a generation AI to generate a menu. For example, the serving unit is implemented by the speaker 240 of the smart glasses 214 or the specific processing unit 290 of the data processing device 12, which provides the generated menu to the user. The correspondence between each unit and the device or control unit is not limited to the above examples and various changes can be made.
[0563] In the above embodiments, examples of specific processing by the data processing device 12 are given, but the technology disclosed herein is not limited to this, and specific processing may also be performed by the smart glasses 214.
[0564] Third Implementation Method Figure 5 An example of the configuration of the data processing system 310 according to the third embodiment is shown.
[0565] like Figure 5 As shown, the data processing system 310 includes a data processing device 12 and a head-mounted terminal 314. A server can be cited as an example of the data processing device 12.
[0566] The data processing apparatus 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" as understood in this disclosure. The computer 22 includes a processor 28, RAM 30, and memory 32. The processor 28, RAM 30, and memory 32 are connected to a bus 34. Furthermore, the database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[0567] The head-mounted terminal 314 includes a computer 36, a microphone 238, a speaker 240, a camera 42, a communication I / F 44, and a display 343. The computer 36 includes a processor 46, RAM 48, and memory 50. The processor 46, RAM 48, and memory 50 are connected to a bus 52. Furthermore, the microphone 238, speaker 240, camera 42, display 343, and communication I / F 44 are also connected to the bus 52.
[0568] Microphone 238 receives instructions from user 20 by receiving sounds emitted by user 20. Microphone 238 captures sounds emitted by user 20 and converts the captured sounds into sound data, which is then output to processor 46. Speaker 240 outputs sound according to instructions from processor 46.
[0569] Camera 42 is a small digital camera equipped with an optical system such as a lens, aperture and shutter, and imaging elements such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, which captures images of the user 20's surroundings (e.g., the field of view defined by an angle equivalent to the field of vision of an average healthy person).
[0570] Communication I / F44 is connected to network 54. Communication I / F44 and 26 are responsible for the transmission and reception of various information between processor 46 and processor 28 via network 54. The transmission and reception of various information between processor 46 and processor 28 using communication I / F44 and 26 is performed in a secure state.
[0571] Figure 6 This illustrates an example of the main functions of the data processing device 12 and the head-mounted terminal 314. For example... Figure 6 As shown, in the data processing device 12, specific processing is performed by the processor 28. The specific processing program 56 is stored in the memory 32.
[0572] The specific processing program 56 is an example of a "program" involved in the technology of this disclosure. The processor 28 reads the specific processing program 56 from the memory 32 and executes the read specific processing program 56 on the RAM 30. Specific processing is implemented by the processor 28 operating as a specific processing unit 290 according to the specific processing program 56 executed on the RAM 30.
[0573] The memory 32 stores the data generation model 58 and the emotion-specific model 59. The data generation model 58 and the emotion-specific model 59 are used by the specific processing unit 290.
[0574] In the head-mounted terminal 314, the processor 46 performs the acceptance / output processing. The memory 50 stores the acceptance / output program 60. The processor 46 reads the acceptance / output program 60 from the memory 50 and executes the read acceptance / output program 60 on the RAM 48. The acceptance / output processing is implemented by the processor 46 operating as a control unit 46A according to the acceptance / output program 60 executed on the RAM 48.
[0575] Next, the specific processing of the specific processing unit 290 of the data processing device 12 will be described. Each part of the system described below is implemented by the data processing device 12 and the head-mounted terminal 314. In the following description, the data processing device 12 will be referred to as the "server" and the head-mounted terminal 314 will be referred to as the "terminal".
[0576] Example 1 The process is the same as that of the specific process described in Embodiment 1 in the first embodiment above, so the description is omitted.
[0577] Application Example 1 The process is the same as that in the specific processing described in Application Example 1 of the first embodiment above, so the description is omitted.
[0578] Example 2 The process is the same as that of the specific process in Embodiment 2 described in the first embodiment above, so the description is omitted.
[0579] Application Example 2 The process is the same as that in the specific processing described in Application Example 2 of the first embodiment above, so the description is omitted.
[0580] The specific processing unit 290 sends the result of the specific processing to the head-mounted terminal 314. In the head-mounted terminal 314, the control unit 46A outputs the result of the specific processing to the speaker 240 and the display 343. The microphone 238 acquires sound input representing the user's input regarding the result of the specific processing. The control unit 46A sends the sound data representing the user's input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the sound data.
[0581] Data generation model 58 is a so-called generative AI (Artificial Intelligence). Examples of data generation models 58 include ChatGPT (registered trademark) (accessible via the internet (URL: https: / / openai.com / blog / chatgpt)). Data generation model 58 is obtained through deep learning on a neural network. Input to data generation model 58 includes prompt words containing instructions, and inference data such as sound data representing sound, text data representing text, and image data representing images (e.g., still image data or animation data). Data generation model 58 infers the input inference data based on the instructions represented by the prompt words and outputs the inference result in one or more data forms such as sound data, text data, and image data. Data generation model 58 includes, for example, text generation AI, image generation AI, and multimodal generation AI. Here, inference refers to, for example, analysis, classification, prediction, and / or induction. The specific processing unit 290 performs the aforementioned specific processing while using data generation model 58. The data generation model 58 can also be a model finely tuned to output inference results from prompts that do not contain instructions. In this case, the data generation model 58 can output inference results based on prompts that do not contain instructions. The data processing apparatus 12, etc., includes various data generation models 58, including AI other than the generation AI. AI other than the generation AI can be, for example, linear regression, logistic regression, decision trees, random forests, support vector machines (SVM), k-means clustering, convolutional neural networks (CNN), recurrent neural networks (RNN), generative adversarial networks (GAN), or Naive Bayes, and can perform various processes, but is not limited to this example. Furthermore, the AI can also be an AI agent. Furthermore, when the processing of the above-mentioned parts is performed by AI, the processing can be performed partially or entirely by AI, but is not limited to this example. Furthermore, the processing performed by the AI including the generation AI can be replaced by processing in the rule base, and the processing in the rule base can also be replaced by processing performed by the AI including the generation AI.
[0582] Furthermore, the processing of the aforementioned data processing system 10 is performed by the specific processing unit 290 of the data processing device 12 or the control unit 46A of the head-mounted terminal 314, but it can also be performed by both the specific processing unit 290 of the data processing device 12 and the control unit 46A of the head-mounted terminal 314. Additionally, the specific processing unit 290 of the data processing device 12 acquires or collects information required for processing from the head-mounted terminal 314 or external devices, and the head-mounted terminal 314 acquires or collects information required for processing from the data processing device 12 or external devices.
[0583] For example, the collection unit is implemented by the control unit 46A of the head-mounted terminal 314 or the specific processing unit 290 of the data processing device 12. For example, the acquisition unit uses the camera 42 or communication I / F 44 of the head-mounted terminal 314 to acquire step data, which is then processed by the specific processing unit 290 of the data processing device 12. For example, the analysis unit is implemented by the specific processing unit 290 of the data processing device 12 to analyze the data from the collection unit and the acquisition unit. For example, the generation unit is implemented by the specific processing unit 290 of the data processing device 12 to generate a menu using a generation AI. For example, the serving unit is implemented by the speaker 240 and display 343 of the head-mounted terminal 314 or the specific processing unit 290 of the data processing device 12 to provide the generated menu to the user. The correspondence between each unit and the device or control unit is not limited to the above examples and various changes can be made.
[0584] In the above embodiments, examples of specific processing by the data processing device 12 are given, but the technology disclosed herein is not limited to this, and specific processing may also be performed by the head-mounted terminal 314.
[0585] Fourth Implementation Method Figure 7 An example of the configuration of the data processing system 410 according to the fourth embodiment is shown.
[0586] like Figure 7 As shown, the data processing system 410 includes a data processing device 12 and a robot 414. A server can be cited as an example of the data processing device 12.
[0587] The data processing apparatus 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" as understood in this disclosure. The computer 22 includes a processor 28, RAM 30, and memory 32. The processor 28, RAM 30, and memory 32 are connected to a bus 34. Furthermore, the database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[0588] Robot 414 includes a computer 36, a microphone 238, a speaker 240, a camera 42, a communication I / F 44, and a controlled object 443. The computer 36 includes a processor 46, RAM 48, and memory 50. The processor 46, RAM 48, and memory 50 are connected to a bus 52. Furthermore, the microphone 238, speaker 240, camera 42, controlled object 443, and communication I / F 44 are also connected to the bus 52.
[0589] Microphone 238 receives instructions from user 20 by receiving sounds emitted by user 20. Microphone 238 captures sounds emitted by user 20 and converts the captured sounds into sound data, which is then output to processor 46. Speaker 240 outputs sound according to instructions from processor 46.
[0590] Camera 42 is a small digital camera equipped with an optical system such as a lens, aperture and shutter, and imaging elements such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, to photograph the area around robot 414 (e.g., the field of view defined by a perspective equivalent to the field of vision of an average healthy person).
[0591] Communication I / F44 is connected to network 54. Communication I / F44 and 26 are responsible for the transmission and reception of various information between processor 46 and processor 28 via network 54. The transmission and reception of various information between processor 46 and processor 28 using communication I / F44 and 26 is performed in a secure state.
[0592] The controlled object 443 includes a display device, LEDs (light-emitting diodes) for the eyes, and motors for driving the arms, hands, and feet. The posture or movement of the robot 414 is controlled by controlling the motors in the arms, hands, and feet. Some of the robot 414's emotions can be expressed by controlling these motors. In addition, the robot 414's facial expressions can also be expressed by controlling the illumination state of the LEDs in its eyes.
[0593] Figure 8 This illustrates an example of the main functions of the data processing device 12 and the robot 414. For example... Figure 8 As shown, in the data processing device 12, specific processing is performed by the processor 28. The specific processing program 56 is stored in the memory 32.
[0594] The specific processing program 56 is an example of a "program" involved in the technology of this disclosure. The processor 28 reads the specific processing program 56 from the memory 32 and executes the read specific processing program 56 on the RAM 30. Specific processing is implemented by the processor 28 operating as a specific processing unit 290 according to the specific processing program 56 executed on the RAM 30.
[0595] The memory 32 stores the data generation model 58 and the emotion-specific model 59. The data generation model 58 and the emotion-specific model 59 are used by the specific processing unit 290.
[0596] In robot 414, the processor 46 performs the acceptance and output processing. The memory 50 stores the acceptance and output program 60. The processor 46 reads the acceptance and output program 60 from the memory 50 and executes the read acceptance and output program 60 on RAM 48. The acceptance and output processing is implemented by the processor 46 acting as the control unit 46A according to the acceptance and output program 60 executed on RAM 48.
[0597] Next, the specific processing of the specific processing unit 290 of the data processing device 12 will be described. Each part of the system described below is implemented by the data processing device 12 and the robot 414. In the following description, the data processing device 12 will be referred to as the "server" and the robot 414 will be referred to as the "terminal".
[0598] Example 1 The process is the same as that of the specific process described in Embodiment 1 in the first embodiment above, so the description is omitted.
[0599] Application Example 1 The process is the same as that in the specific processing described in Application Example 1 of the first embodiment above, so the description is omitted.
[0600] Example 2 The process is the same as that of the specific process in Embodiment 2 described in the first embodiment above, so the description is omitted.
[0601] Application Example 2 The process is the same as that in the specific processing described in Application Example 2 of the first embodiment above, so the description is omitted.
[0602] The specific processing unit 290 sends the result of the specific processing to the robot 414. In the robot 414, the control unit 46A outputs the result of the specific processing to the speaker 240 and the controlled object 443. The microphone 238 acquires sound input representing the result of the specific processing. The control unit 46A sends the sound data representing the user input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the sound data.
[0603] Data generation model 58 is a so-called generative AI (Artificial Intelligence). Examples of data generation models 58 include ChatGPT (registered trademark) (accessible via the internet (URL: https: / / openai.com / blog / chatgpt)). Data generation model 58 is obtained through deep learning on a neural network. Input to data generation model 58 are prompt words containing instructions, and inference data such as sound data representing sound, text data representing text, and image data representing images (e.g., still image data or animation data). Data generation model 58 infers from the input inference data based on the instructions represented by the prompt words and outputs the inference result in one or more data forms, such as sound data, text data, and image data. Data generation model 58 includes, for example, text generation AI, image generation AI, and multimodal generation AI. Here, inference refers to, for example, analysis, classification, prediction, and / or induction. The specific processing unit 290 performs the aforementioned specific processing while using data generation model 58. The data generation model 58 can also be a model finely tuned to output inference results from prompts that do not contain instructions. In this case, the data generation model 58 can output inference results based on prompts that do not contain instructions. The data processing apparatus 12, etc., includes various data generation models 58, including AI other than the generation AI. AI other than the generation AI can be, for example, linear regression, logistic regression, decision trees, random forests, support vector machines (SVM), k-means clustering, convolutional neural networks (CNN), recurrent neural networks (RNN), generative adversarial networks (GAN), or Naive Bayes, and can perform various processes, but is not limited to this example. Furthermore, the AI can also be an AI agent. Furthermore, when the processing of the above-mentioned parts is performed by AI, the processing can be performed partially or entirely by AI, but is not limited to this example. Furthermore, the processing performed by the AI including the generation AI can be replaced by processing in the rule base, and the processing in the rule base can also be replaced by processing performed by the AI including the generation AI.
[0604] Furthermore, the processing of the aforementioned data processing system 10 is performed by the specific processing unit 290 of the data processing device 12 or the control unit 46A of the robot 414, but it can also be performed by both the specific processing unit 290 of the data processing device 12 and the control unit 46A of the robot 414. Additionally, the specific processing unit 290 of the data processing device 12 acquires or collects information required for processing from the robot 414 or external devices, and the robot 414 acquires or collects information required for processing from the data processing device 12 or external devices.
[0605] For example, the collection unit is implemented by the control unit 46A of the robot 414 or the specific processing unit 290 of the data processing device 12. For example, the acquisition unit uses the camera 42 or communication I / F 44 of the robot 414 to acquire step data, which is then processed by the specific processing unit 290 of the data processing device 12. For example, the analysis unit is implemented by the specific processing unit 290 of the data processing device 12, which analyzes the data from the collection unit and the acquisition unit. For example, the generation unit is implemented by the specific processing unit 290 of the data processing device 12, which uses a generation AI to generate a menu. For example, the serving unit is implemented by the speaker 240 of the robot 414 and the control object 443 or the specific processing unit 290 of the data processing device 12, which provides the generated menu to the user. The correspondence between each unit and the device or control unit is not limited to the above examples and various changes can be made.
[0606] In the above embodiments, examples of specific processing by the data processing device 12 are given, but the technology disclosed herein is not limited to this, and specific processing may also be performed by the robot 414.
[0607] Furthermore, the emotion-specific model 59, acting as an emotion engine, can determine a user's emotion based on a specific mapping. Specifically, the emotion-specific model 59 can determine a user's emotion based on an emotion graph that serves as a specific mapping (see [reference]). Figure 9 The emotion-specific model 59 can also determine the robot's emotion, and the specific processing unit 290 performs specific processing based on the robot's emotions.
[0608] Figure 9 This is a diagram representing an emotion map 400 that maps multiple emotions. In the emotion map 400, emotions are arranged in concentric circles radiating from the center. The closer to the center of the concentric circles, the more primitive the emotion is. On the outer side of the concentric circles, emotions representing states or behaviors arising from mood are arranged. Emotions are concepts that include feelings and mental states. Emotions generated by reactions occurring in the brain are arranged roughly to the left of the concentric circles. Emotions derived from situational judgments are arranged roughly to the right of the concentric circles. Emotions generated by reactions occurring in the brain and derived from situational judgments are arranged roughly above and below the concentric circles. Furthermore, "pleasant" emotions are arranged above the concentric circles, and "unpleasant" emotions are arranged below them. Thus, in the emotion map 400, multiple emotions are mapped based on the structure that generates emotions, and emotions that are likely to occur simultaneously are mapped close to each other.
[0609] These emotions are distributed at the three o'clock position of the emotion map 400, typically fluctuating between peace and anxiety. In the right half of the emotion map 400, situational awareness dominates over internal sensation, thus resulting in an impression of calm.
[0610] The inner side of the emotion map 400 represents the inner state, while the outer side represents behavior. Therefore, the further outward you are from the emotion map 400, the more visible the emotion becomes (manifested in behavior).
[0611] Here, human emotions are based on various balances such as posture and blood sugar levels. When these balances deviate from an ideal state, it indicates an unpleasant state; when they approach the ideal state, it indicates a pleasant state. Emotions in robots, cars, motorcycles, etc., can also be created in the following way: based on various balances such as posture and remaining battery power, when these balances deviate from an ideal state, it indicates an unpleasant state; when they approach the ideal state, it indicates a pleasant state. Emotion maps can be generated, for example, based on Dr. Mitsuyoshi's emotion map (Research on a Brain Physiological Signal Analysis System for Voice Emotion Recognition and Emotion, Tokushima University, Doctoral Dissertation: https: / / ci.nii.ac.jp / naid / 500000375379). In the left half of the emotion map, emotions belonging to the sensory-dominated region, called "response," are arranged. Furthermore, in the right half of the emotion map, emotions belonging to the situational cognition-dominated region, called "situation," are arranged.
[0612] In the emotion map, two types of emotions that promote learning are defined. One is a negative emotion on the situational side, in the middle or peripheral region of "repentance" or "reflection." This occurs when the robot experiences negative emotions such as "I don't want to experience this feeling again" or "I don't want to be blamed again." The other is a positive emotion on the response side, near the "desire" region. This occurs when there are positive feelings such as "wanting more" or "wanting to know more."
[0613] The emotion-specific model 59 inputs user input into a pre-trained neural network to obtain emotion values representing each emotion shown in the emotion map 400, thereby determining the user's emotion. This neural network is pre-trained based on multiple training data sets, which are combinations of user input and emotion values representing each emotion shown in the emotion map 400. Furthermore, this neural network... Figure 10 As shown in the sentiment graph 900, it was trained in a way that sentiments that are configured close to each other have similar values. Figure 10 The text shows examples of emotions such as "peace of mind", "stability", and "reassurance" that have similar emotion values.
[0614] The above description focuses on the functions of the data processing device 12, but the system of this disclosure is not necessarily installed on a server. The system of this disclosure can also be installed as a general information processing system. This disclosure can also be installed, for example, as a software program running on a personal computer, an application running on a smartphone, etc. The method of this disclosure can also be provided to users in the form of SaaS (Software as a Service).
[0615] In the above embodiments, an example of a specific process being performed by a single computer 22 is given. However, the technology disclosed herein is not limited to this, and the specific process can also be distributed among multiple computers, including computer 22. For example, the data generation model 58 can be located on an external device of the data processing apparatus 12, where data is generated based on the input data.
[0616] In the above embodiments, examples of storing a specific processing program 56 in the memory 32 have been described, but the technology disclosed herein is not limited thereto. For example, the specific processing program 56 may also be stored in a portable computer-readable non-transitory storage medium such as a USB (Universal Serial Bus) memory. The specific processing program 56 stored in the non-transitory storage medium is installed into the computer 22 of the data processing device 12. The processor 28 executes specific processing according to the specific processing program 56.
[0617] Alternatively, a specific processing program 56 may be pre-stored in a storage device such as a server connected to the data processing device 12 via the network 54, and the specific processing program 56 may be downloaded and installed on the computer 22 according to the requirements of the data processing device 12.
[0618] In addition, it is not necessary to store all the specific processing program 56 in the storage device such as the server connected to the data processing device 12 via the network 54 or in the memory 32; a portion of the specific processing program 56 may be stored in advance.
[0619] As hardware resources for performing specific processes, various processors, as shown below, can be used. For example, a CPU can be listed as a processor, which functions as a general-purpose processor that performs specific processes by executing software, i.e., a program. Furthermore, processors can be listed as special-purpose circuits such as FPGAs (Field-Programmable Gate Arrays), PLDs (Programmable Logic Devices), or ASICs (Application-Specific Integrated Circuits), which are processors with circuitry specifically designed to perform specific processes. Each processor has built-in or connected memory, and each processor executes specific processes using that memory.
[0620] The hardware resources for performing a specific process can consist of one of these various processors, or a combination of two or more processors of the same or different types (e.g., a combination of multiple FPGAs, or a combination of a CPU and an FPGA). Alternatively, the hardware resources for performing a specific process can be a single processor.
[0621] As an example of a single processor, there are two approaches: First, a processor is composed of a combination of one or more CPUs and software, which functions as a hardware resource to perform a specific process; second, as represented by a SoC (System-on-a-chip), a processor is used to implement the functionality of the entire system, which includes multiple hardware resources for performing a specific process, using a single IC (Integrated Circuit) chip. In this way, the specific process is implemented by using one or more of the aforementioned processors as hardware resources.
[0622] Furthermore, the hardware architecture of these various processors, more specifically, can utilize circuits that combine semiconductor elements and other circuit components. Moreover, the specific process described above is just one example. Therefore, without departing from the main point, unnecessary steps can certainly be deleted, new steps added, or the processing order changed.
[0623] The descriptions and illustrations above are detailed explanations of a portion of the technology disclosed herein, and are merely one example of the technology disclosed herein. For example, the above descriptions of the structure, function, effect, and results are just one example of the structure, function, effect, and results of a portion of the technology disclosed herein. Therefore, without departing from the spirit of the technology disclosed herein, unnecessary parts may be deleted, new elements added, or replacements may be made to the descriptions and illustrations above. Furthermore, to avoid confusion and facilitate understanding of a portion of the technology disclosed herein, explanations of common technical knowledge that do not require special explanation under the premise of being able to implement the technology disclosed herein have been omitted from the descriptions and illustrations above.
[0624] All documents, patent applications and technical specifications set forth in this specification are incorporated herein by reference to the same extent that each document, patent application and technical specification is specifically and individually described therein and referenced by reference.
[0625] In addition, the following notes are provided in response to the above explanation.
[0626] Example 1 (Note 1) An information processing system, characterized in that it comprises: An apparatus for acquiring a data structure and parsing all or part of the data structure based on the storage area identifier and attribute information contained in the data structure, and recording the parsing result as pattern information; A device for parsing information retrieval requests received from a user terminal in natural language or in a predetermined format, and for constructing, based on the pattern information and the information retrieval requests, a prompt statement for instructing a generative artificial intelligence model to generate a query language based on the prompt. A device for inputting the prompt statement into the generative artificial intelligence model, obtaining the output query language from the generative artificial intelligence model, performing retrieval processing on the data storage device based on the storage area and operation conditions contained in the query language, and converting the retrieval results obtained from the data storage device into output data. A means for sending the output data to a user terminal; An apparatus for checking the existence of prohibited statements, the validity of referenced objects, and syntactic consistency of the query language, and for dynamically correcting the prompt statement based on the check results and re-inputting it into the generative artificial intelligence model; An apparatus for recording the dialogue history of multiple information retrieval requests in association with identification information, and for providing context to the generative artificial intelligence model to generate query language by including the dialogue history in the prompt statement.
[0627] (Note 2) The information processing system according to Appendix 1 is characterized in that, The means for constructing the prompt statement is configured to include tabular information of the data structure, the name of the storage area, the attribute information, constraints on the output format of the query language, and default values for the information retrieval request in the prompt statement, so as to control the scope of the query language generated by the generative artificial intelligence model.
[0628] (Note 3) The information processing system according to Appendix 1 is characterized in that, The apparatus for converting output data is configured to convert the output data into structured data that can be displayed in tabular or graphical form on a user terminal, and to provide a query language for generating the output data in association with the output data.
[0629] Application Example 1 (Note 1) An information processing system, characterized in that it comprises: A means of parsing the data structure of a data storage device and using machine learning methods to learn all or part of the structural and attribute information of the data structure. A means of receiving information requests input in natural language from user terminals and performing semantic parsing on the information requests based on learned data structure information, thereby generating structured data requests that include the data set to be acquired, condition items, summary items, and visualization categories. A means for generating an intermediate representation corresponding to the query language syntax and the data structure of the data storage device based on the structured data request, and for automatically generating a query language based on the intermediate representation; Means for sending the automatically generated query language to the data storage device and obtaining information corresponding to the data request from the data storage device; Means for performing statistical processing and transformation processing on the acquired information to generate visual data including graphics or charts; Means for generating natural language explanatory text using a generative artificial intelligence model based on the visualization data and the acquired information, and converting the explanatory text and the visualization data into a form that can be output to the user's operating terminal; This is a means of automatically generating prompt statements for the generative artificial intelligence model to generate query language in response to the natural language information request, and providing the prompt statements as input to the generative artificial intelligence model to control the generation and processing of the query language.
[0630] (Note 2) The information processing system according to Appendix 1 is characterized in that, It also includes processing methods for obtaining natural language information requests sent to the system by the user's operating terminal, performing string normalization, segmentation, and format verification on the information request before inputting the information request into the generative artificial intelligence model, and dynamically correcting or completing the prompt statement based on the processing results.
[0631] (Note 3) The information processing system according to Appendix 1 is characterized in that, It also includes storing information obtained from the data storage device and historical natural language information requests from the user's operating terminal as historical data, and learning or adjusting the parameters of the generative artificial intelligence model based on the historical data, thereby continuously improving the automatic generation accuracy of query language and the processing methods for generating visual data content.
[0632] Example 2 (Note 1) An information processing system, characterized in that it comprises: A means for parsing the information structure stored in the data storage unit and learning candidate information acquisition conditions based on the information structure; Means for receiving information requests expressed in natural language or a predetermined format from a user terminal, and constructing prompt statements for instructing a generative artificial intelligence model to generate query language based on the content and structure of the information requests; Means for inputting the prompt statement into the generative artificial intelligence model and obtaining the query language generated by the generative artificial intelligence model; Means for using the query language to perform information acquisition processing on the data storage unit and generating user-oriented output information based on the acquired information; Means for converting the output information into display data in natural language or a predetermined format and sending it to the user terminal.
[0633] (Note 2) The information processing system according to Appendix 1 is characterized in that, The means for constructing the prompt statement is configured to extract time-related expressions and target item-related expressions from the information request, and map the time-related expressions and target item-related expressions to the search conditions and summary conditions in the query language, respectively, and embed them into the prompt statement.
[0634] (Note 3) The information processing system according to Appendix 1 is characterized in that, The means for generating user-oriented output information is configured to perform aggregation and unit conversion processing on numerical data obtained from the data storage unit, and generate output information containing explanatory text in natural language based on the processing results.
[0635] Application Example 2 (Note 1) An information processing system, characterized in that it comprises: A means executed by a computing processing device to obtain structural information related to the table structure of a data storage device, and to learn the relationship between multiple data sets and attributes within the data storage device based on the structural information; Means for receiving information requests expressed in natural language and emotional information representing the user's emotional state from an information input device, and generating prompt statements for instructing a generative artificial intelligence model to generate query language based on the content of the information request, the emotional information, and the structural information. A means for inputting the prompt statement into the generative artificial intelligence model, obtaining the output query language from the generative artificial intelligence model, and verifying and correcting the obtained query language so that the query language conforms to the structural information and security conditions; A means for adjusting the processing priority of information requests and the scope or level of detail of target data to be obtained in the query language based on the emotional information, and for performing query processing on the data storage device using the adjusted query language to obtain information. Means for controlling the summary content and display items of acquired information based on the emotional information, and outputting result information to the information input device.
[0636] (Note 2) According to the information processing system described in Appendix 1, the arithmetic processing device is configured to selectively parse and learn all or part of the table structure of the data storage device, and dynamically change the granularity and type of the structural information contained in the prompt statement based on the results of the parsing and learning.
[0637] (Note 3) According to the information processing system described in Appendix 1, the computing processing device is configured to generate structured data containing time information, object information, and processing content information in response to a natural language information request obtained from the information input device, and to determine the content of the prompt statement and the output constraints of the generative artificial intelligence model based on the structured data and the sentiment information.
Claims
1. An information processing system, characterized in that, include: processor; The processor is configured as follows: The table structure of the data storage device is parsed and the table structure is learned. Receive information requests from users in natural language or a specific format, and generate prompt text for generating query language using a generative artificial intelligence model; Furthermore, the query language is automatically generated based on the parsed prompt text, and information is retrieved from the data storage device.
2. The information processing system according to claim 1, characterized in that, The processor is configured to selectively parse and learn all or part of the table structure of the data storage device.
3. The information processing system according to claim 1, characterized in that, The processor is configured to parse information requests from users and generate prompt text to instruct the generation of query language.
Citation Information
Patent Citations
Persona chatbot control method and system
JP2022180282A