Industrial data query method and system based on improved triple-gan data enhancement
By employing improved Triple-GAN data augmentation and QLoRA quantization low-rank adaptation techniques, the ambiguity in model understanding and the problem of SQL semantic mapping in Chinese Text-to-SQL tasks were solved, enabling efficient industrial database queries and improving the model's professionalism and query accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INSPUR GENERSOFT CO LTD
- Filing Date
- 2026-01-04
- Publication Date
- 2026-06-02
Smart Images

Figure CN122132492A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of industrial database query technology, specifically to an industrial data query method and system based on improved Triple-GAN data augmentation. Background Technology
[0002] The statements in this section are merely background information relating to this disclosure and do not necessarily constitute prior art.
[0003] In the Text-to-SQL task of large language models, the SQL language requires completely precise commands to correctly operate the database. This places demands not only on the semantic accuracy of the generated large model but also on the complete correctness of the generated SQL structure. Furthermore, semantic ambiguity between natural language and databases makes it difficult to improve the accuracy of generating general-purpose SQL. For example, the expression "remaining amount" in natural language is completely different in industrial systems and financial systems; it might be "available_quantity" or "available_amount". Against this backdrop, building large-scale Text-to-SQL models for specialized domains can undoubtedly improve the model's practical application capabilities. Currently, there are no specific solutions for augmenting industrial datasets for Text-to-SQL tasks using large language models, especially for industrial database augmentation methods involving the conversion of Chinese natural language to SQL code.
[0004] For the task of training large-scale Text-to-SQL models to perform database operations in a specific domain, current technologies mostly employ methods such as collecting general Text-to-SQL data and fine-tuning large, high-parameter models to improve overall output accuracy; using Qwen-72B as a base for fine-tuning on general Text-to-SQL datasets. The main problem with this approach is that while increasing the size of a general Text-to-SQL model may improve accuracy, this leads to a waste of computational resources and makes it difficult to achieve the accuracy of a large-scale model specific to a particular domain. The root of the problem lies in its attempt to encompass massive amounts of knowledge through larger models and more parameters, rather than strengthening the model's specialized cognitive abilities through targeted knowledge input.
[0005] In summary, the existing technology implementation process has two main limitations: (1) The problem of high ambiguity in Chinese text during model understanding and conversion to SQL; (2) Pattern alignment and linking issues in the SQL semantic mapping process. Since the learning ability of large language models is now beyond doubt, the root cause of the above problems is the defects in the model's learning samples and the ambiguity of the model's instructions. Summary of the Invention
[0006] To address the aforementioned issues, this disclosure proposes an industrial data query method and system based on improved Triple-GAN data augmentation. By integrating the improved Triple-GAN into the existing Text-to-SQL training data associated with the industrial database in CSpider, targeted data augmentation is performed using a semi-supervised learning method. Furthermore, a prompt word project based on the SQL generated from the industrial database is designed to achieve a Test-to-SQL-to-Test application mode from the interface to the database and back to the interface.
[0007] According to some embodiments, the present disclosure adopts the following technical solutions: Industrial data query methods based on improved Triple-GAN data augmentation include: Obtain a general Chinese Text-to-SQL dataset and extract industrial data from it; Industrial data is input into a data augmentation model for data augmentation, generating sample labels and resulting in a data-augmented Chinese Text-to-SQL database. A pre-trained large-scale Text-to-SQL model is constructed, and the QLoRA quantization low-rank adaptation method is used to optimize the large-scale Text-to-SQL model to obtain a well-trained large-scale Text-to-SQL model. By integrating the large Text-to-SQL model into the MOM system via Ollama's API and introducing the prompt word project, it is possible to query the Chinese Text-to-SQL database form.
[0008] As one embodiment, the extraction of industrial data from the Text-to-SQL dataset includes: First, use the simple query function to provide the corresponding query for the question; Then use aggregation and grouping queries to provide the query for the question.
[0009] As one embodiment, the step of inputting industrial data into a data augmentation model for data augmentation includes: The extracted Chinese Text-to-SQL is used as the input to the data augmentation model, which uses an improved Triple-GAN (Generative Adversarial Network). The improved Triple-GAN consists of three components: a generator, a discriminator, and a classifier. It adds a classifier to the GAN network, and its function is to predict the label of the input data sample.
[0010] As one embodiment, the improved Triple-GAN contains labeled real data, unlabeled real data, and generator-generated data. The labeled real data flows into the discriminator as positive samples and then into the classifier to predict labels. The unlabeled real samples flow into the classifier to generate pseudo-label pairs and then into the discriminator as negative samples. The generator-generated data flows into the discriminator as negative samples and then into the classifier to predict labels.
[0011] As one embodiment, in the data augmentation model, three sets of adversarial relationships are formed, including: (1) The adversarial relationship between the generator and the discriminator, that is, the generator tries to generate data that is so realistic that the discriminator cannot identify it; (2) The adversarial relationship between the generator and the classifier, where the generator hopes that the generated data pairs can predict consistent results in the classifier; (3) The classifier and the discriminator are in opposition. The classifier hopes that its predicted false labels can deceive the discriminator in order to ensure that the false labels are close to the real ones.
[0012] As one embodiment, the loss function of the data augmentation model includes discriminator loss, classifier loss, and generator loss, wherein the discriminator loss is to maximize the differentiation between positive and negative samples, the classifier loss is to minimize the classification error of real data and maximize the error of generator pseudo samples, and the generator loss is to maximize the deception of the classifier and discriminator.
[0013] According to some embodiments, the present disclosure adopts the following technical solutions: An industrial data query system based on improved Triple-GAN data augmentation includes: The data acquisition module is used to acquire general Chinese Text-to-SQL datasets and extract industrial data from them. The data augmentation module is used to input industrial data into the data augmentation model for data augmentation, generate sample labels, and obtain a data-augmented Chinese Text-to-SQL database. The model integration module is used to build a pre-trained large Text-to-SQL model. The QLoRA quantization low-rank adaptation method is used to optimize the large Text-to-SQL model to obtain a trained large Text-to-SQL model. The query module is used to connect the large Text-to-SQL model to the MOM system via Ollam's API. After introducing the prompt word project, it enables querying of Chinese Text-to-SQL database forms.
[0014] According to some embodiments, the present disclosure adopts the following technical solutions: A computer program product includes a computer program that, when executed by a processor, implements the industrial data query method based on improved Triple-GAN data augmentation.
[0015] According to some embodiments, the present disclosure adopts the following technical solutions: A non-transitory computer-readable storage medium is provided for storing computer instructions, which, when executed by a processor, implement the industrial data query method based on improved Triple-GAN data augmentation.
[0016] According to some embodiments, the present disclosure adopts the following technical solutions: An electronic device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to perform the industrial data query method based on the improved Triple-GAN data augmentation.
[0017] Compared with the prior art, the beneficial effects of this disclosure are as follows: This disclosure presents an industrial data query method based on an improved Triple-GAN data augmentation. It integrates the existing Text-to-SQL training data associated with industrial databases from the existing CSpider dataset using an improved Triple-GAN generative adversarial network. Targeted data augmentation is then performed using a semi-supervised learning method to enhance the model's ability to learn specialized knowledge. Furthermore, prompt word engineering is applied to the model based on industrial database knowledge, helping it generate targeted SQL statements, reducing the illusion of large language models, and improving the accuracy of SQL generation.
[0018] This disclosure presents an industrial data query method based on improved Triple-GAN data augmentation. Building upon high-quality training data, and to minimize model complexity while maintaining accuracy, it employs QLoRA (Quantized Low-Rank Adaptation) for fine-tuning the model. BNB is used for quantization to ensure the model can be fine-tuned and trained normally under 40GB of GPU memory, as well as for subsequent dialogue. Finally, the trained model file is integrated into the MOM system via Ollam's API, and prompt word engineering is added to enable Chinese Text-to-SQL queries on database forms. Based on a fully trained Text-to-SQL model, prompt word engineering further strengthens the connection between the large language model and the industrial database, reducing the illusion of a large language model. Attached Figure Description
[0019] The accompanying drawings, which form part of this disclosure, are used to provide a further understanding of this disclosure. The illustrative embodiments of this disclosure and their descriptions are used to explain this disclosure and do not constitute an undue limitation of this disclosure.
[0020] Figure 1 This is a diagram illustrating the overall framework of the industrial data query method based on improved Triple-GAN data augmentation, as described in this disclosure. Figure 2 This is a network structure diagram for data enhancement according to an embodiment of the present disclosure. Detailed Implementation
[0021] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.
[0022] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains.
[0023] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this disclosure. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0024] Example 1 One embodiment of this disclosure provides an industrial data query method based on improved Triple-GAN data augmentation, the method comprising: Step 1: Obtain a general Chinese Text-to-SQL dataset, and extract industrial data from the Text-to-SQL dataset; Step 2: Input industrial data into the data augmentation model for data augmentation, generate sample labels, and obtain the data-augmented Chinese Text-to-SQL database; Step 3: Construct a pre-trained large-scale Text-to-SQL model, and optimize the large-scale Text-to-SQL model using the QLoRA quantization low-rank adaptation method to obtain a well-trained large-scale Text-to-SQL model; Step 4: Integrate the large Text-to-SQL model into the MOM system via Ollam's API, and after introducing the prompt word project, enable the querying of Chinese Text-to-SQL database forms.
[0025] As one embodiment, the industrial data query method based on improved Triple-GAN data augmentation disclosed herein, on the basis of a large Text-to-SQL model trained on a complete database, further strengthens the connection between the large language model and the industrial database through prompt word engineering, reducing the illusion of a large language model. The specific implementation process is as follows: Step 1: Obtain a general Chinese Text-to-SQL dataset and extract industrial data from it; Specifically, the first stage involves extracting data from the industrial sector, with the input being the complete CSpider dataset. This dataset, a general-purpose Chinese Text-to-SQL dataset, contains 10,181 Chinese questions paired with 5,693 unique SQL queries, encompassing database knowledge from fields such as university management systems, flight query systems, product inventory, and social media. The generation task includes SQL multi-table joins, subqueries, sorting, and grouping.
[0026] Since only a small portion of the dataset contains question-and-answer knowledge specific to the industrial sector, we extracted 518 data entries related to work order queries and process sorting within the high-quality dataset.
[0027] As one example, the process of extracting industrial data from a Text-to-SQL dataset can be as follows: (1) Simple query: Question: "List all work orders with a status of 'open'". Query: "SELECT * FROM tickets WHERE status = 'Open'"; (2) Aggregation and grouping queries: Question: "Count the number of work orders processed by each customer service representative." Query: "SELECT agent_name, COUNT(ticket_id) FROM tickets JOIN agentsON tickets.assigned_agent_id = agents.agent_id GROUP BY agent_name".
[0028] Step 2: Input industrial data into the data augmentation model for data augmentation, generate sample labels, and obtain the data-augmented Chinese Text-to-SQL database; The second stage involves using the 518 Chinese Text-to-SQL entries extracted in the first stage as input to the data augmentation model. The model employs an improved Triple-GAN (Generative Adversarial Network) to augment the data, expanding the data content to approximately 3000 entries. The specific method is as follows: Firstly, the Triple-GAN is improved to include three components: a generator, a discriminator, and a classifier. It adds a classifier to the GAN network, whose function is to process the input data samples. x Label prediction is performed. Based on this, the improved Triple-GAN generative adversarial network contains three types of data: (1) There is real data with labels. The sample flows into the discriminator as a positive sample and then into the classifier to predict the label. (2) Unlabeled real data Its input flows into the classifier and generates pseudo-label pairs. Then it flows into the discriminator as a negative sample; (3) Data generated by the generator The sample flows into the discriminator as a negative sample and then into the classifier for label prediction.
[0029] As one example, in the improved Triple-GAN generative adversarial network, three sets of adversarial relationships are formed, namely: (1) The adversarial relationship between the generator and the discriminator, that is, the generator tries to generate data that is indistinguishable from real data. This makes it impossible for the discriminator to identify; (2) The adversarial relationship between the generator and the classifier, where the generator simultaneously hopes to generate data that is compatible with the classifier. The classifier can predict consistent results, that is... This countermeasure ensures the reliability of the generated data; (3) The classifier and the discriminator are in opposition. The classifier hopes that its predicted false labels can deceive the discriminator in order to ensure that the false labels are close to the real ones.
[0030] As one example, the loss function of the improved Triple-GAN generative adversarial network consists of the following parts: (a) Discriminator loss, which is the loss that maximizes the distinction between positive and negative samples, is composed as follows:
[0031]
[0032]
[0033] in, It is the actual distribution of labeled data. It corresponds to the marginal distribution. The joint distribution generated by the generator. For the discriminator to analyze the data The predicted value, It is a classifier pair Predicted labels, It is for tags The generated data Therefore, the loss is calculated as follows: the discriminator needs to predict 1 for real data, 0 for pseudo-labels generated by the classifier, and 0 for pseudo-data generated by the generator.
[0034] (ii) Classifier loss, which is to minimize the classification error of the real data and maximize the error of the generator's pseudo-samples, is as follows:
[0035] in, This represents the conditional distribution predicted by the classifier. Its loss consists of supervised loss based on cross-entropy and unsupervised loss based on inverse cross-entropy.
[0036] (iii) Generator loss, which maximizes the deception of the classifier and discriminator, is as follows:
[0037] The generator loss consists of two terms: the first term is the standard generator loss, which is used to deceive the discriminator, and the second term is the cross-entropy of the classifier, which is used to deceive the classifier to ensure the consistency between the generated sample labels and features.
[0038] Step 3: Construct a pre-trained large-scale Text-to-SQL model, and optimize the large-scale Text-to-SQL model using the QLoRA quantization low-rank adaptation method to obtain a well-trained large-scale Text-to-SQL model; By integrating the large Text-to-SQL model into the MOM system via Ollama's API and introducing the prompt word project, it is possible to query the Chinese Text-to-SQL database form.
[0039] Specifically, in the third stage, based on high-quality training data, and since the target is a large-scale Chinese Text-to-SQL model for the industrial domain, only the Qwen3-14b model needs to be used as the base for training. Simultaneously, to minimize model complexity while maintaining accuracy, QLoRA (Quantized Low-Rank Adaptation) is used for fine-tuning. The quantization parameter is set to int-8, and BNB is used as the quantization method to ensure the model can be fine-tuned and trained normally under 40GB of GPU memory, as well as for subsequent dialogue. Finally, the trained model file is integrated into the MOM system via Ollam's API, and after adding prompt words, Chinese Text-to-SQL queries to the database form are implemented.
[0040] As one example, a prompt word engineering example is as follows: #System Roles and Commands You are a seasoned SQL expert specializing in e-commerce databases. Based on the following database structure, please translate the user's natural language question into an accurate and efficient MySQL query.
[0041] Please only output the final SQL code; do not include any other explanations or descriptions. # Database schema description ## Database table structure (order system): Table: `users` (Users Table) - `user_id` (INT, PRIMARY KEY): Unique user identifier - `username` (VARCHAR): Username - `email` (VARCHAR): Email address - `registration_date` (DATE): Registration date Table: `products` (Products Table) - `product_id` (INT, PRIMARY KEY): Unique identifier for the product. - `product_name` (VARCHAR): Product Name - `category` (VARCHAR): Product category (e.g., 'electronics', 'clothing', 'food') - `price` (DECIMAL(10,2)): Unit price of the product Table: `orders` (main order table) - `order_id` (INT, PRIMARY KEY): Unique identifier for the order. - `user_id` (INT, FOREIGN KEY REFERENCES users(user_id)): Order User ID - `order_date` (DATETIME): Order placement time - `status` (VARCHAR): Order status (e.g., 'Pending payment', 'Paid', 'Shipped', 'Completed', 'Cancelled') - `total_amount` (DECIMAL(10,2)): Total order amount Table: `order_items` (Order Details Table) - `item_id` (INT, PRIMARY KEY): Item ID - `order_id` (INT, FOREIGN KEY REFERENCES orders(order_id)): Order ID - `product_id` (INT, FOREIGN KEY REFERENCES products(product_id)): Product ID - `quantity` (INT): Purchase quantity - `subtotal` (DECIMAL(10,2)): Subtotal (unit price * quantity) As an example, one is given as follows: ## Example 1: "Find all user email addresses in the 'Electronics' category in 2023 with order amounts exceeding 1000 yuan." SELECT DISTINCT u.email FROM orders o JOIN users u ON o.user_id = u.user_id JOIN order_items oi ON o.order_id = oi.order_id JOIN products p ON oi.product_id = p.product_id WHERE YEAR(o.order_date) = 2023 AND p.category = 'electronic products' AND o.total_amount>1000; As one embodiment, the application process of the industrial data query method based on the improved Triple-GAN data augmentation disclosed herein includes: (1) Based on the CSpider dataset, this disclosure first filters out Text-to-SQL data related to industrial databases through data engineering. The base model Qwen3-14b is fine-tuned by the improved Triple-GAN generative adversarial network. Then, the prompt word engineering and the trained base model are introduced into the industrial management system to realize the Text-to-SQL query task in the database of the system.
[0042] Furthermore, the improved Triple-GAN generative adversarial network divides the selected CSpider data into blocks in an 8:2 ratio, treating 80% of the data as real labeled data. x,y Input the discriminator and classifier, and use the last 20% of the data as unlabeled real data. x Only the classifier is input. Based on this, the classifier undergoes supervised learning using labeled real data and then semi-supervised learning using unlabeled real data, thus adding two sets of adversarial semi-supervised learning processes to the GAN network.
[0043] Based on the loss changes of the improved Triple-GAN network proposed in this disclosure during training on CSpider data, it can be seen that the individual losses of the generator, discriminator, and classifier in the final network all decrease to a certain stage and remain stable.
[0044] This public training uses the int8 quantization QLoRA fine-tuning technique, with the following training parameters: learning rate 5e-5, quantization method BNB, dataset: the filtered and augmented test2sql_zh, and mixed precision bf16. Based on the original and smoothed trends of loss changes during training on the augmented dataset, it can be seen that the model can generally control the loss within 0.05 and maintain stability. After fine-tuning the Qwen3-14b model using augmented Text-to-SQL data, and combining it with prompt word engineering, an example of applying it to an order query system shows that the output results meet the task requirements.
[0045] Example 2 One embodiment of this disclosure provides an industrial data query system based on improved Triple-GAN data augmentation, comprising: The data acquisition module is used to acquire general Chinese Text-to-SQL datasets and extract industrial data from them. The data augmentation module is used to input industrial data into the data augmentation model for data augmentation, generate sample labels, and obtain a data-augmented Chinese Text-to-SQL database. The model integration module is used to build a pre-trained large Text-to-SQL model. The QLoRA quantization low-rank adaptation method is used to optimize the large Text-to-SQL model to obtain a trained large Text-to-SQL model. The query module is used to connect the large Text-to-SQL model to the MOM system via Ollam's API. After introducing the prompt word project, it enables querying of Chinese Text-to-SQL database forms.
[0046] As one embodiment, this disclosure provides an industrial data query system based on improved Triple-GAN data augmentation, specifically implementing the following method steps: Step (1): Obtain a general Chinese Text-to-SQL dataset and extract industrial data from it; Step (2): Input industrial data into the data augmentation model for data augmentation, generate sample labels, and obtain the data-augmented Chinese Text-to-SQL database; Step (3): Construct a pre-trained Text-to-SQL large model, and use the QLoRA quantization low-rank adaptation method to optimize the Text-to-SQL large model to obtain a trained Text-to-SQL large model; Step (4): Connect the Text-to-SQL large model to the MOM system via Ollam's API, and after introducing the prompt word project, realize the query of Chinese Text-to-SQL database form.
[0047] Example 3 One embodiment of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the industrial data query method based on improved Triple-GAN data augmentation. The method includes the following steps: Step (1): Obtain a general Chinese Text-to-SQL dataset and extract industrial data from it; Step (2): Input industrial data into the data augmentation model for data augmentation, generate sample labels, and obtain the data-augmented Chinese Text-to-SQL database; Step (3): Construct a pre-trained Text-to-SQL large model, and use the QLoRA quantization low-rank adaptation method to optimize the Text-to-SQL large model to obtain a trained Text-to-SQL large model; Step (4): Connect the Text-to-SQL large model to the MOM system via Ollam's API, and after introducing the prompt word project, realize the query of Chinese Text-to-SQL database form.
[0048] Example 4 One embodiment of this disclosure provides a non-transitory computer-readable storage medium for storing computer instructions. When executed by a processor, the computer instructions implement the industrial data query method based on improved Triple-GAN data augmentation. The method includes the following steps: Step (1): Obtain a general Chinese Text-to-SQL dataset and extract industrial data from it; Step (2): Input industrial data into the data augmentation model for data augmentation, generate sample labels, and obtain the data-augmented Chinese Text-to-SQL database; Step (3): Construct a pre-trained Text-to-SQL large model, and use the QLoRA quantization low-rank adaptation method to optimize the Text-to-SQL large model to obtain a trained Text-to-SQL large model; Step (4): Connect the Text-to-SQL large model to the MOM system via Ollam's API, and after introducing the prompt word project, realize the query of Chinese Text-to-SQL database form.
[0049] Example 5 One embodiment of this disclosure provides an electronic device, including a processor, a memory, and a computer program; wherein the processor is connected to the memory, and the computer program is stored in the memory. When the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to perform the industrial data query method based on the improved Triple-GAN data augmentation, the method steps of which include: Step (1): Obtain a general Chinese Text-to-SQL dataset and extract industrial data from it; Step (2): Input industrial data into the data augmentation model for data augmentation, generate sample labels, and obtain the data-augmented Chinese Text-to-SQL database; Step (3): Construct a pre-trained Text-to-SQL large model, and use the QLoRA quantization low-rank adaptation method to optimize the Text-to-SQL large model to obtain a trained Text-to-SQL large model; Step (4): Connect the Text-to-SQL large model to the MOM system via Ollam's API, and after introducing the prompt word project, realize the query of Chinese Text-to-SQL database form.
[0050] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0051] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0052] While the specific embodiments of this disclosure have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of this disclosure. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of this disclosure are still within the scope of protection of this disclosure.
Claims
1. An industrial data query method based on improved Triple-GAN data augmentation, characterized in that, include: Obtain a general Chinese Text-to-SQL dataset and extract industrial data from it; Industrial data is input into a data augmentation model for data augmentation, generating sample labels and resulting in a data-augmented Chinese Text-to-SQL database. A pre-trained large-scale Text-to-SQL model is constructed, and the QLoRA quantization low-rank adaptation method is used to optimize the large-scale Text-to-SQL model to obtain a well-trained large-scale Text-to-SQL model. By integrating the large Text-to-SQL model into the MOM system via Ollama's API and introducing the prompt word project, it is possible to query the Chinese Text-to-SQL database form.
2. The industrial data query method based on improved Triple-GAN data augmentation as described in claim 1, characterized in that, The extraction of industrial data from the Text-to-SQL dataset includes: First, use the simple query function to provide the corresponding query for the question; Then use aggregation and grouping queries to provide the query for the question.
3. The industrial data query method based on improved Triple-GAN data augmentation as described in claim 1, characterized in that, The process of inputting industrial data into a data augmentation model for data augmentation includes: The extracted Chinese Text-to-SQL is used as the input to the data augmentation model, which uses an improved Triple-GAN (Generative Adversarial Network). The improved Triple-GAN consists of three components: a generator, a discriminator, and a classifier. It adds a classifier to the GAN network, and its function is to predict the label of the input data sample.
4. The industrial data query method based on improved Triple-GAN data augmentation as described in claim 3, characterized in that, The improved Triple-GAN (Generative Adversarial Network) contains labeled real data, unlabeled real data, and generator-generated data. The labeled real data flows into the discriminator as positive samples and then into the classifier to predict labels. The unlabeled real samples flow into the classifier to generate pseudo-label pairs and then into the discriminator as negative samples. The generator-generated data flows into the discriminator as negative samples and then into the classifier to predict labels.
5. The industrial data query method based on improved Triple-GAN data augmentation as described in claim 1, characterized in that, In the data augmentation model, three sets of adversarial relationships are formed, including: (1) The adversarial relationship between the generator and the discriminator, that is, the generator tries to generate data that is so realistic that the discriminator cannot identify it; (2) The adversarial relationship between the generator and the classifier, where the generator hopes that the generated data pairs can predict consistent results in the classifier; (3) The classifier and the discriminator are in conflict. The classifier hopes that its predicted false labels can fool the discriminator in order to ensure that the false labels are close to the real ones.
6. The industrial data query method based on improved Triple-GAN data augmentation as described in claim 1, characterized in that, The loss function of the data augmentation model includes discriminator loss, classifier loss, and generator loss. The discriminator loss is to maximize the differentiation between positive and negative samples, the classifier loss is to minimize the classification error of real data and maximize the error of generator pseudo samples, and the generator loss is to maximize the deception of the classifier and discriminator.
7. An industrial data query system based on improved Triple-GAN data augmentation, characterized in that, include: The data acquisition module is used to acquire general Chinese Text-to-SQL datasets and extract industrial data from them. The data augmentation module is used to input industrial data into the data augmentation model for data augmentation, generate sample labels, and obtain a data-augmented Chinese Text-to-SQL database. The model integration module is used to build a pre-trained large Text-to-SQL model. The QLoRA quantization low-rank adaptation method is used to optimize the large Text-to-SQL model to obtain a trained large Text-to-SQL model. The query module is used to connect the large Text-to-SQL model to the MOM system via Ollam's API. After introducing the prompt word project, it enables querying of Chinese Text-to-SQL database forms.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the industrial data query method based on the improved Triple-GAN data augmentation as described in any one of claims 1-6.
9. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium is used to store computer instructions, which, when executed by a processor, implement the industrial data query method based on improved Triple-GAN data augmentation as described in any one of claims 1-6.
10. An electronic device, characterized in that, include: The device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to perform the industrial data query method based on the improved Triple-GAN data augmentation as described in any one of claims 1-6.