Data operation method and device, storage medium and computer equipment
Through the large language model, natural language is transformed into structured query language, which solves the problem of high threshold for use of existing data operation methods and insufficient accuracy, and realizes the efficiency and flexibility of data operation.
Patent Information
- Application Number
- CN202411496621.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-25
AI Technical Summary
The existing data operation methods have problems such as high threshold for use, insufficient data accuracy and poor flexibility, and cannot meet the users' real-time data operation needs.
The first query language is generated through a large language model, the query content information is analyzed and generated, the correction results are output, and the structured query language is generated for data operations.
It lowers the threshold for data operation, improves the efficiency and accuracy of data operation, and meets the needs of real-time data operation.
Smart Images

Figure CN119513127A_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to the field of computer technology, and in particular to a data operation method, device, storage medium and computer equipment. [Background technology]
[0002] Structured Query Language (SQL) is a standardized programming language for managing and querying relational databases. It is widely used in various business fields, including finance, sales, human resources, supply chain, etc. As the amount of data continues to increase, it becomes crucial to query and analyze data efficiently. Therefore, mastering some advanced query techniques is essential to improve query efficiency and optimize query results.
[0003] However, existing data manipulation methods have many shortcomings. On the one hand, general users do not have professional SQL knowledge and need to rely on system developers and data developers to connect data and develop query pages. This process has a long connection path, which not only leads to low efficiency, but also fails to meet user needs in a timely manner. On the other hand, existing methods have limitations in data accuracy. Since users cannot directly operate data, data requirements may not be accurately communicated. They are also not flexible enough and cannot quickly adapt to changes in different user groups and business scenarios. They are not applicable to different user groups, and only people with professional SQL knowledge can effectively operate data. [Summary of the invention]
[0004] In view of this, embodiments of the present invention provide a data operation method, apparatus, storage medium and computer device to reduce the usage threshold of data operation while meeting the needs of real-time data operation and improving the efficiency of data operation.
[0005] On the one hand, an embodiment of the present invention provides a data operation method, including:
[0006] receiving a data operation statement input by a user, wherein the data operation statement is in natural language;
[0007] Generate a first query language through a large language model according to the data operation statement;
[0008] Parsing the first query language to generate query content information;
[0009] Correct according to the query content information and output the correction result;
[0010] generating a second query language according to the correction result;
[0011] Data operations are performed according to the second query language.
[0012] Optionally, generating a first query language by using a large language model according to the data operation statement includes:
[0013] The data operation statements are processed based on the Text2SQL technology of the large language model to generate the first query language, which is a pseudo-structured query language.
[0014] Optionally, the Text2SQL technology based on the large language model processes the data operation statement to generate the first query language, including:
[0015] The data operation statements are processed based on the Text2SQL technology of the large language model, wherein the processing process includes data preprocessing, prompt word engineering processing and large model service processing to generate a first query language.
[0016] Optionally, the data preprocessing includes performing synonym correction on fields in the data operation statements; the prompt word engineering processing includes prompting users with data operation statements through initial prompt word design, context information addition, language adjustment, structure adjustment, example adjustment, dynamic adjustment and user feedback adjustment; the big model service processing includes constructing prompt words and quantizing low-rank self-adjusting models to construct big model services, and encapsulating the big model service as an application programming interface mode through big model inference acceleration technology.
[0017] Optionally, parsing the first query language to generate query content information includes:
[0018] The first query language is parsed according to rules to group and decompose the fields of the first query language to generate query content information.
[0019] Optionally, the performing correction according to the query content information and outputting a correction result includes:
[0020] Output one or more user intention information according to the query content information;
[0021] The user intention information input by the user is obtained, and a correction result is generated according to the user intention information.
[0022] Optionally, generating a second query language according to the correction result includes:
[0023] The second query language is generated according to each field in the correction result based on the Text2SQL technology, and the second query language is a structured query language.
[0024] On the other hand, an embodiment of the present invention provides a data operation device, including:
[0025] A receiving module, used for receiving a data operation statement input by a user, wherein the data operation statement is a natural language;
[0026] A first generating module, configured to generate a first query language through a large language model according to the data operation statement;
[0027] A second generating module, used for parsing the first query language to generate query content information;
[0028] An output module, which performs correction according to the query content information and outputs the correction result;
[0029] A third generating module, used to generate a second query language according to the correction result;
[0030] An operation module is used to perform data operations according to the second query language.
[0031] On the other hand, an embodiment of the present invention provides a storage medium, including: the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above-mentioned data operation method.
[0032] On the other hand, an embodiment of the present invention provides a computer device, including a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, wherein the program instructions implement the steps of the above-mentioned data operation method when loaded and executed by the processor.
[0033] In the technical solution of the data operation method provided by the embodiment of the present invention, a data operation statement input by a user is received, and the data operation statement is a natural language; a first query language is generated through a large language model according to the data operation statement; the first query language is parsed to generate query content information; correction is performed according to the query content information, and a correction result is output; a second query language is generated according to the correction result; and data operation is performed according to the second query language. In the technical solution provided by the embodiment of the present invention, natural language can be converted into a structured query language for data operation, which can reduce the threshold for using data operation while meeting the demand for real-time data operation and improving the efficiency of data operation.
Brief Description of the Drawings
[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0035] Figure 1A flowchart of a data operation method provided by an embodiment of the present invention;
[0036] Figure 2 A schematic diagram of a data operation method provided by an embodiment of the present invention;
[0037] Figure 3 A schematic diagram of the structure of a data operation device provided by an embodiment of the present invention;
[0038] Figure 4 A schematic diagram of a computer device provided by an embodiment of the present invention. [Specific implementation method]
[0039] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0040] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0042] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0043] In the industrial field, the amount of data is huge and complex, and traditional data operation methods often require users to have certain SQL knowledge. In the embodiment of the present invention, the Text2SQL (Text-to-SQL) technology based on the Large Language Model (LLM) can automatically convert natural language queries into SQL statements, thereby simplifying the data operation process and improving efficiency and accuracy.
[0044] Based on natural language processing (NLP) technology, database technology and large model application technology, the embodiment of the present invention provides a data operation method. Figure 1 A flowchart of a data operation method provided by an embodiment of the present invention, Figure 2 A schematic diagram of a data operation method provided by an embodiment of the present invention is shown as follows: Figure 1 or Figure 2 As shown, the method includes:
[0045] Step 102: receiving a data operation statement input by a user, where the data operation statement is a natural language.
[0046] In the embodiment of the present invention, each step is performed by a computer device. For example, the computer device includes a computer, a tablet computer, or an industrial automation device.
[0047] The embodiments of the present invention can be widely used in the analysis and retrieval of various industrial data, including production data, quality data, equipment operation data, etc., and have broad application prospects and market demand. It can monitor and analyze various data in the production process in real time, support intelligent decision-making and optimization, and improve production efficiency and product quality.
[0048] In the embodiment of the present invention, the data operation statements include statements for performing operations such as adding, deleting, modifying, and querying data.
[0049] For example, the data operation statement that the user can enter is "query the output of the first workshop in factory A".
[0050] Step 104: Generate a first query language based on the data operation statement using a large language model.
[0051] Specifically, the data operation statements may be processed based on the Text2SQL technology of the large language model to generate a first query language, where the first query language is a pseudo-structured query language.
[0052] In the embodiment of the present invention, the large language model can understand and process complex natural languages through pre-training and fine-tuning.
[0053] In the embodiment of the present invention, the pseudo-structured query language is a logical SQL code that shields the specific query environment (data tables, fields, etc.). It is an intermediate representation that does not rely on specific data tables and fields, and provides a higher level of semantic information understanding for subsequent steps, facilitating further processing.
[0054] For example, if the data operation statement is "query the output of the first workshop in factory A", the first query language generated according to the data operation statement is "select output from table where factory = factory A and workshop = first workshop".
[0055] In the embodiment of the present invention, the data operation statement is processed based on the Text2SQL technology of the large language model, and the processing process includes data preprocessing, prompt word engineering processing and large model service processing to generate the first query language.
[0056] Among them, data preprocessing includes synonym correction for fields in data operation statements; prompt word engineering processing includes prompting users for data operation statements through initial prompt word design, context information addition, language adjustment, structure adjustment, example adjustment, dynamic adjustment and user feedback adjustment; large model service processing includes building prompt words and quantizing low-rank self-adjusting models to build large model services, and encapsulating the large model service as an application programming interface mode through large model inference acceleration technology.
[0057] Data preprocessing is a crucial core step in the embodiment of the present invention. It is responsible for extracting the mapping dictionary containing the corresponding Chinese meaning from the source data field in the database, setting up virtual fields for mapping, and then supplementing synonyms for the terms with multiple names for the Chinese meaning of the field. For example, different users have different ways of expression for workshops and floors. For another example, different users also have their own habits for the names of regions (for example: comprehensive bonded areas and airport areas, etc.). In addition, the storage formats of various databases for floors are various. In the data preprocessing stage, these values are extracted, and in the query stage, the fields in the data operation statements entered by the user can be recalled and replaced by similarity, so that the user's fuzzy description can obtain accurate SQL execution. Virtual fields can be set for complex indicators and mapping relationships with related basic data fields can be established. For example, for production efficiency indicators, when multiple basic data fields (such as production time, output, etc.) are involved, a virtual field "production efficiency" can be set to facilitate the system to more conveniently obtain and process data when users query relevant information. This is an innovative way to process complex data and helps to improve the efficiency and accuracy of data operations.
[0058] In an embodiment of the present invention, first, a dictionary containing terms and their synonyms in common fields can be established, and data operation statements can be decomposed into single fields through a lexical analysis tool. The semantic similarity between the fields and each term in the dictionary is calculated by a similarity algorithm (such as a cosine similarity algorithm) and context understanding to infer the similarity between the fields and their synonyms in the data operation statements input by the user, and if the similarity is higher than a threshold (such as 0.8), recall and replace. The similarity calculation method of the above fields is more systematic and accurate, and can better adapt to the various expressions of the same concept by different users.
[0059] If the similarity is lower than the threshold or cannot be guessed, the user is prompted that the user input field cannot be understood, suggestions and guidance are provided to the user to modify the input, and step 104 is re-executed after receiving the data operation statement modified by the user.
[0060] Prompt engineering, also known as prompt engineering, is a technology that uses carefully designed prompt words to guide artificial intelligence models to produce specific outputs. Prompt engineering processes the steps of building query templates, adding context, language adjustment, structure adjustment, example adjustment, dynamic adjustment, user feedback adjustment, small sample learning and constraint generation results through the initial prompt design, to generate and optimize high-quality prompts to ensure that the big model can accurately understand and respond to the user's natural language queries. For example, by dynamically passing in the table fields of the business scenario that the user wants to query, as well as special business instructions and image relationships, the big model can quickly match the content that the user wants to query with the data in the data table, which not only improves the efficiency of the model to generate SQL but also improves the accuracy of the model to generate SQL.
[0061] Large model service processing is the core component of the embodiment of the present invention. The Prompt project and the Quantized Low-Rank Adaptation (Qlora) fine-tuning model are constructed to build an industrial large model. Finally, the large model reasoning acceleration technology of the Vectorized Large Language Model Serving System (vLLM) is used to encapsulate the local large model service into an Application Programming Interface (API) mode, providing reasoning support for the steps involving large model reasoning in the embodiment of the present invention.
[0062] Step 106: Parse the first query language to generate query content information.
[0063] Specifically, the first query language is parsed according to rules to group and decompose the fields of the first query language to generate query content information.
[0064] In the embodiment of the present invention, the first query language (pseudo structured query language) is parsed. The first query language is a logical SQL code that shields the specific query environment (data table, field, etc.), and is an intermediate representation that does not rely on specific data tables and fields. Parsing this unique query language can provide a higher level of semantic information understanding for subsequent steps, which is convenient for further processing, which is different from the traditional parsing method that directly targets structured SQL statements.
[0065] In an embodiment of the present invention, the skeleton of the first query language can be parsed by rules to group and decompose its fields to generate query content information. The specific parsing rules cover words such as select, where, groupby, orderby, having, etc., and there are clear extraction rules and customized processing logic for different words. For example, words such as select, where, groupby, orderby, having, etc. in the first query language can be grouped and decomposed to generate query content information.
[0066] The above-mentioned systematic parsing rules can extract query content information comprehensively and accurately, providing a solid foundation for subsequent modification and generation of structured query language. Compared with some methods that lack systematic parsing rules, they can better ensure the accuracy and effectiveness of data operations.
[0067] Step 108: Correct the query content information and output the correction result.
[0068] Specifically, one or more user intent information is output according to the query content information; the user intent information input by the user is obtained, and a correction result is generated according to the user intent information.
[0069] For example, a user simply inputs a data operation statement "the output of c6 in workshop A of the factory", and the user intention information "Do you want to query the output of c6 in workshop A of the factory today", "Do you want to query the output of c6 in workshop A of the factory yesterday", and "Do you want to query the output of c6 in workshop A of the factory last week" can be output and displayed. The user can choose "Query the output of c6 in workshop A of the factory today", and then continue to execute step 110. If the user feels that he wants to query the output of c6 in workshop A of the factory today, the user can perform multiple rounds of interaction and input the user intention information "Query the output of the past week". The model will reorganize it according to the context and output "Do you want to query the output of c6 in workshop A of the factory in the past week". If the user agrees, it will be corrected according to the query content information to output the correction result.
[0070] The correction result is the result of using the standard information stored in the database to correct some non-standard inputs of the user. For example, the query content information entered by the user includes workshop c6, but there is actually no workshop c6 in the database, but workshop C06, then the correction result includes "query the output of workshop C06 in factory A in the past week". For another example, if the query content information entered by the user includes 2022030810, then 2022030810 can be corrected to 2022 / 03 / 08 / 10:00:00, and so on.
[0071] In the embodiment of the present invention, through multiple iterations and feedback mechanisms, users can check whether the results generated and recalled by the large model are accurate, thereby reducing the possibility of query data errors, allowing users to clearly identify the data to be operated during interaction, thereby improving the accuracy of data operations.
[0072] Step 110: Generate a second query language according to the correction result.
[0073] Specifically, a second query language is generated according to each field in the correction result based on the Text2SQL technology, and the second query language is a structured query language.
[0074] Because the generated second query language will eventually be sent to the database to execute step 112, the database will not recognize Chinese fields and their synonyms. It can only recognize the English letters or abbreviations of the fields set when the database is established. For example, "query the output of workshop No. 3 in Guanlan factory area". The corresponding relationship of each database will be different, for example ("Guanlan" corresponds to the field GL, "factory area" corresponds to the field factory, "workshop" corresponds to the field floor, "No. 3" corresponds to the field A3, and "output" corresponds to the field count_1).
[0075] In addition, for some calculation indicators or complex processing logic, multiple fields can be mixed to calculate information. For example, Overall Equipment Effectiveness (OEE) is ((actual running time / planned time)*(actual speed / theoretical speed)*(good_products / total_produced)), and the second query language (SQL statement) corresponding to the overall equipment efficiency OEE is: "((actual_run_time / plan_time)*(actual_speed / theoretical_speed)*(good_products / total_produced))AS oee".
[0076] In the embodiment of the present invention, the characteristics of the database in the industrial field can be optimized, and the recall mapping can be performed based on the specific terms in the industrial field. The optimization process includes syntax checking of the second query language (SQL statement) and business logic verification, etc., to ensure that the generated SQL statement is accurate.
[0077] Step 112: Perform data operations according to the second query language.
[0078] In an embodiment of the present invention, the second query language "((actual_run_time / plan_time)*(actual_speed / theoretical_speed)*(good_pro ducts / total_produced))AS oee" can be sent to the database for data operation to obtain the output result corresponding to "((actual_run_time / plan_time)*(actual_speed / theoretical_speed)*(good_pro ducts / total_produced))AS oee".
[0079] In the technical solution provided by the embodiment of the present invention, a data operation statement input by a user is received, and the data operation statement is a natural language; a first query language is generated through a large language model according to the data operation statement; the first query language is parsed to generate query content information; correction is performed according to the query content information, and a correction result is output; a second query language is generated according to the correction result; and data operation is performed according to the second query language. In the technical solution provided by the embodiment of the present invention, natural language can be converted into a structured query language for data operation, which can reduce the use threshold of data operation while meeting the demand for real-time data operation and improving the efficiency of data operation.
[0080] In the technical solution provided by the embodiment of the present invention, a large model is used to realize efficient conversion from natural language to SQL, improve the flexibility of data operation, and optimize the operation according to the characteristics of industrial data, thereby providing an accurate and user-friendly data operation method. Its structural design integrates key components such as a large model, an SQL optimization module, and an SQL execution engine, which realize intelligent and automated data operations through collaboration. The model structure in the embodiment of the present invention is more complex and intelligent, and can effectively process natural language and generate efficient SQL statements.
[0081] The technical solution provided by the embodiment of the present invention not only improves the accuracy and efficiency of data operations, but also greatly improves the user experience. Although the initial development cost of the technical solution provided by the embodiment of the present invention is relatively high, its efficient data operation capabilities and low usage threshold demonstrated in practical applications can significantly reduce manpower and time costs. From a long-term perspective, the technical solution provided by the embodiment of the present invention has lower total costs and higher economic benefits.
[0082] Compared with traditional data retrieval solutions, users need to have certain SQL knowledge and the threshold for use is high. Business personnel need to put forward query requirements to system personnel and database management personnel to develop fixed-mode query systems. Not only is the development cycle long, but the flexibility is not high. The embodiments of the present invention combine the capabilities of large models to convert natural language into SQL, helping users to quickly, timely and flexibly obtain data and improve data operation efficiency.
[0083] In the technical solution provided by the embodiment of the present invention, users can directly perform data operations through natural language without the need for users to have SQL knowledge, which greatly reduces the threshold for using data operations and is suitable for all types of users.
[0084] In the technical solution provided by the embodiment of the present invention, the efficiency and accuracy of data operations are greatly improved through automatic SQL generation and optimization, saving manpower and time costs.
[0085] The technical solution provided by the embodiment of the present invention supports real-time retrieval of large-scale data and meets the requirements of the industrial field for data real-time and timeliness.
[0086] An embodiment of the present invention provides a data operation device. Figure 3 A schematic diagram of a data operation device according to an embodiment of the present invention is shown in FIG. Figure 3 As shown, the device includes: a receiving module 11, a first generating module 12, a second generating module 13, an output module 14, a third generating module 15 and an operating module 16.
[0087] The receiving module 11 is used to receive data operation statements input by a user, where the data operation statements are in natural language.
[0088] The first generating module 12 is used to generate a first query language according to the data operation statement through a large language model.
[0089] The second generating module 13 is used to parse the first query language and generate query content information.
[0090] The output module 14 performs correction according to the query content information and outputs the correction result.
[0091] The third generating module 15 is used to generate a second query language according to the correction result.
[0092] The operation module 16 is used to perform data operations according to the second query language.
[0093] In the embodiment of the present invention, the first generating module 12 is specifically used to process the data operation statement based on the Text2SQL technology of the large language model to generate a first query language, and the first query language is a pseudo-structured query language.
[0094] In the embodiment of the present invention, the first generation module 12 is specifically used to process data operation statements based on the Text2SQL technology of the large language model, and the processing process includes data preprocessing, prompt word engineering processing and large model service processing to generate the first query language.
[0095] In an embodiment of the present invention, data preprocessing includes performing synonym correction on fields in data operation statements; prompt word engineering processing includes prompting users with data operation statements through initial prompt word design, context information addition, language adjustment, structure adjustment, example adjustment, dynamic adjustment and user feedback adjustment; big model service processing includes constructing prompt words and quantizing low-rank self-adjusting models to construct big model services, and encapsulating the big model service as an application programming interface mode through big model inference acceleration technology.
[0096] In the embodiment of the present invention, the second generating module 13 is specifically used to perform rule parsing on the first query language to group and decompose the fields of the first query language to generate query content information.
[0097] In the embodiment of the present invention, the output module 14 is specifically used to output one or more user intention information according to the query content information; obtain the user intention information input by the user, and generate a correction result according to the user intention information.
[0098] In the embodiment of the present invention, the third generating module 15 is specifically used to generate a second query language according to each field in the correction result based on the Text2SQL technology, and the second query language is a structured query language.
[0099] In the technical solution provided by the embodiment of the present invention, a data operation statement input by a user is received, and the data operation statement is a natural language; a first query language is generated through a large language model according to the data operation statement; the first query language is parsed to generate query content information; correction is performed according to the query content information, and a correction result is output; a second query language is generated according to the correction result; and data operation is performed according to the second query language. In the technical solution provided by the embodiment of the present invention, natural language can be converted into a structured query language for data operation, which can reduce the use threshold of data operation while meeting the demand for real-time data operation and improving the efficiency of data operation.
[0100] The data operation device provided in this embodiment can be used to implement the above Figure 1 or Figure 2 For the data operation method in, the specific description can be found in the embodiment of the above-mentioned data operation method, which will not be repeated here.
[0101] An embodiment of the present invention provides a storage medium, which includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the steps of the embodiment of the above-mentioned data operation method. For a specific description, please refer to the embodiment of the above-mentioned data operation method.
[0102] An embodiment of the present invention provides a computer device, including a memory and a processor, the memory is used to store information including program instructions, the processor is used to control the execution of the program instructions, and when the program instructions are loaded and executed by the processor, the steps of the embodiment of the above-mentioned data operation method are implemented. For a specific description, please refer to the embodiment of the above-mentioned data operation method.
[0103] Figure 4 A schematic diagram of a computer device provided by an embodiment of the present invention. Figure 4 As shown, the computer device 20 of this embodiment includes: a processor 21, a memory 22, and a computer program 23 stored in the memory 22 and executable on the processor 21. When the computer program 23 is executed by the processor 21, the data operation method in the embodiment is implemented. To avoid repetition, it is not described one by one here. Alternatively, when the computer program is executed by the processor 21, the functions of each model / unit in the data operation device in the embodiment are implemented. To avoid repetition, it is not described one by one here.
[0104] The computer device 20 includes, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will appreciate that Figure 4 It is only an example of the computer device 20 and does not constitute a limitation of the computer device 20. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0105] The processor 21 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0106] The memory 22 may be an internal storage unit of the computer device 20, such as a hard disk or memory of the computer device 20. The memory 22 may also be an external storage device of the computer device 20, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 20. Further, the memory 22 may also include both an internal storage unit of the computer device 20 and an external storage device. The memory 22 is used to store computer programs and other programs and data required by the computer device. The memory 22 may also be used to temporarily store data that has been output or is to be output.
[0107] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0108] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0109] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0110] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0111] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (Processor) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0112] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A data operation method, characterized in that: include: receiving a data operation statement input by a user, wherein the data operation statement is in natural language; Generate a first query language through a large language model according to the data operation statement; Parsing the first query language to generate query content information; Correct according to the query content information and output the correction result; generating a second query language according to the correction result; Data operations are performed according to the second query language.
2. The method according to claim 1, characterized in that Generating a first query language through a large language model according to the data operation statement includes: The data operation statements are processed based on the Text2SQL technology of the large language model to generate the first query language, which is a pseudo-structured query language.
3. The method according to claim 2, characterized in that The Text2SQL technology based on the large language model processes the data operation statement to generate the first query language, including: The data operation statements are processed based on the Text2SQL technology of the large language model, wherein the processing process includes data preprocessing, prompt word engineering processing and large model service processing to generate a first query language.
4. The method according to claim 3, characterized in that The data preprocessing includes performing synonym correction on the fields in the data operation statements; the prompt word engineering processing includes prompting users with data operation statements through initial prompt word design, context information addition, language adjustment, structure adjustment, example adjustment, dynamic adjustment and user feedback adjustment; the big model service processing includes constructing prompt words and quantizing low-rank self-adjusting models to build big model services, and encapsulating the big model service as an application programming interface mode through big model reasoning acceleration technology.
5. The method according to claim 1, characterized in that The parsing of the first query language to generate query content information includes: The first query language is parsed according to rules to group and decompose the fields of the first query language to generate query content information.
6. The method according to claim 1, characterized in that The correcting according to the query content information and outputting the correction result includes: Output one or more user intention information according to the query content information; The user intention information input by the user is obtained, and a correction result is generated according to the user intention information.
7. The method according to claim 1, characterized in that Generating a second query language according to the correction result includes: The second query language is generated according to each field in the correction result based on the Text2SQL technology, and the second query language is a structured query language.
8. A data operation device, characterized in that: include: A receiving module, used for receiving a data operation statement input by a user, wherein the data operation statement is a natural language; A first generating module, configured to generate a first query language through a large language model according to the data operation statement; A second generating module, used for parsing the first query language to generate query content information; An output module, which performs correction according to the query content information and outputs the correction result; A third generating module, used to generate a second query language according to the correction result; An operation module is used to perform data operations according to the second query language.
9. A storage medium, characterized in that: include: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the data operation method according to any one of claims 1 to 7.
10. A computer device comprising a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, characterized in that: When the program instructions are loaded and executed by the processor, the steps of the data operation method according to any one of claims 1 to 7 are implemented.