A method, device, equipment and medium for improving NL2SQL system capability

By determining capability items from the capability index database in the NL2SQL system, conducting level assessment and constructing a module matrix, the problem of low efficiency and high complexity in capability improvement in existing technologies is solved, and efficient and refined improvements in system capabilities are achieved.

CN118331986BActive Publication Date: 2024-10-01TRANSWARP TECHNOLOGY (SHANGHAI) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410432250.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-11
Publication Date
2024-10-01
Estimated Expiration
2044-04-11

AI Technical Summary

Technical Problem

The existing NL2SQL system lacks effective capability measurement methods and precise data set construction methods in the improvement method, resulting in low efficiency in capability improvement, and the loss spike phenomenon often occurs during large model training, increasing complexity.

Method used

By determining the capability items of the NL2SQL system to be improved in the target scenario from the pre-built capability indicator library, the capability level assessment and improvement module matrix construction are carried out, and the best target capability improvement tasks are selected for collective grouping scheduling to achieve efficient capabilities. Perception increases.

Benefits of technology

It achieves efficient and refined improvements in NL2SQL system capabilities, reduces complexity, and improves measurement efficiency and comprehensiveness of measurement results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118331986B_ABST
    Figure CN118331986B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and medium for improving the capabilities of an NL2SQL system. The method includes: determining the capability items required by the NL2SQL system to be improved in the target scenario from a capability index library; evaluating the capability level of each capability item according to a preset scenario test question library to determine the capability level details; determining the capability improvement module matrix corresponding to the capability item based on the capability level details; selecting the best target capability improvement tasks based on the task improvement category to which each capability improvement task belongs in the capability improvement module matrix for collective grouping, obtaining a target group combination after grouping, and scheduling the target group combination to improve the capability perception of the NL2SQL system to be improved. The embodiment of the present invention, through the above technical solution, can perform comprehensive and detailed quantitative measurement of the NL2SQL system, and has an efficient combined scheduling method, so as to achieve efficient and refined improvement of the capability perception of the NL2SQL system with low improvement complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of NL2SQL system capability perception technology, and in particular to a method, device, equipment and medium for improving the capability of an NL2SQL system. Background Art

[0002] Nowadays, the development of technologies such as big data, cloud computing, and the Internet of Things has brought about an explosive growth in the amount of data. These data are usually stored in a structured form in the database and interacted with using the Structured Query Language (SQL) query language. However, for non-professional users, learning, understanding, and using the SQL language is a challenging task. Therefore, many researchers have begun to explore methods to convert natural language into NL2SQL (Natural Language to SQL, NL2SQL) to reduce the user's learning cost and improve the convenience of interaction with the database.

[0003] The capabilities required in the NL2SQL system field are very complex. Currently, there are some problems with the general improvement methods for the NL2SQL system as follows: 1) The current improvement methods lack effective capability measurement methods and effective methods for building fine data sets. They blindly increase data to improve system capabilities, resulting in low efficiency of capability improvement; the current methods lack effective model capability measurement methods and blindly increase data to improve model capabilities, resulting in poor performance of capability improvement. When training, the new corpus used may cause conflicts in the data optimization direction, reducing the optimization efficiency; 2) Secondly, in the current large model capability improvement process, there is a lack of an efficient combined scheduling method for data and training methods. In the existing methods, the types of data and training methods are too complex, and loss spikes often occur during pre-training. The reason for this phenomenon is that during pre-training, the average gradient is used to jointly optimize the direction. When there are too many types of tasks, the commonality of the data is difficult to obtain, so the loss value is difficult to decrease, or decreases slowly; therefore, in the specific implementation, there is a high degree of complexity. From the perspective of effect and efficiency, a method for improving the capabilities of the NL2SQL system is urgently needed to solve the above technical problems. Summary of the invention

[0004] In view of this, the present invention provides a method, device, equipment and medium for improving the capabilities of the NL2SQL system, which can perform comprehensive and detailed quantitative measurement of the NL2SQL system, with higher measurement efficiency and more comprehensive measurement results, and has an efficient combined scheduling method, which can achieve high-efficiency improvement of the NL2SQL system capability perception with low improvement complexity.

[0005] According to one aspect of the present invention, an embodiment of the present invention provides a method for improving the capabilities of an NL2SQL system, the method comprising:

[0006] Determine the capability items required for the NL2SQL system to be improved in the target scenario from the pre-built capability indicator library;

[0007] Perform capability level assessment on each capability item according to a preset scenario test question bank to obtain capability level details of the NL2SQL system to be improved;

[0008] Determine the capability improvement module matrix corresponding to the capability item based on the capability level details; wherein each element in the capability improvement module matrix represents a capability improvement task of the corresponding capability item; the horizontal axis in the capability improvement module matrix represents the capability item of the NL2SQL system to be improved, and the vertical axis represents the capability improvement task category of the NL2SQL system to be improved;

[0009] Based on the task improvement category to which each of the capability improvement tasks in the capability improvement module matrix belongs, the best target capability improvement tasks are selected for collective grouping to obtain a target group combination after grouping, and the target group combination is scheduled to perform capability perception improvement on the NL2SQL system to be improved.

[0010] According to another aspect of the present invention, an embodiment of the present invention further provides a device for improving the capability of an NL2SQL system, the device comprising:

[0011] A capability item determination module is used to determine the capability items required for the NL2SQL system to be improved in the target scenario from a pre-built capability indicator library;

[0012] A level detail determination module is used to evaluate the level of each capability item according to a preset scenario test question bank to obtain the capability level details of the NL2SQL system to be improved;

[0013] An improvement matrix determination module is used to determine the capability improvement module matrix corresponding to the capability item based on the capability level details; wherein each element in the capability improvement module matrix represents a capability improvement task of the corresponding capability item; the horizontal axis in the capability improvement module matrix represents the capability item of the NL2SQL system to be improved, and the vertical axis represents the capability improvement task category of the NL2SQL system to be improved;

[0014] The improvement module is used to select the best target capability improvement tasks based on the task improvement category to which each capability improvement task in the capability improvement module matrix belongs, group them together, obtain the target group combination after grouping, and schedule the target group combination to perform capability perception improvement on the NL2SQL system to be improved.

[0015] According to another aspect of the present invention, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the NL2SQL system capability improvement method described in any embodiment of the present invention.

[0019] According to another aspect of the present invention, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the NL2SQL system capability enhancement method described in any embodiment of the present invention when executed.

[0020] The technical solution of the embodiment of the present invention can narrow the scope of subsequent NL2SQL capability perception and improvement capability items by determining the capability items required by the NL2SQL system to be improved in the target scenario from the capability indicator library, thereby quickly completing the adaptation of the NL2SQL system to the specific scenario; the capability level of each capability item is evaluated by a preset scenario test question bank to determine the capability level details of the NL2SQL system to be improved, and the NL2SQL system can be comprehensively and carefully quantified. The measurement efficiency is higher and the measurement results are more comprehensive. The capability improvement module matrix corresponding to the capability item is determined through the capability level details. Each capability improvement module matrix contains one or more capability improvement tasks. The best target capability improvement tasks are selected according to the task improvement category to which they belong for collective grouping, so as to perform scheduling based on the grouping results, thereby achieving an efficient combined scheduling method, and realizing efficient and refined improvement of the NL2SQL system capability perception with low improvement complexity.

[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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.

[0023] Figure 1 A flowchart of a method for improving the capabilities of an NL2SQL system provided by an embodiment of the present invention;

[0024] Figure 2 A flowchart of another NL2SQL system capability enhancement method provided by an embodiment of the present invention;

[0025] Figure 3 A schematic diagram of constructing a final execution sequence provided by an embodiment of the present invention;

[0026] Figure 4 A schematic diagram of another NL2SQL system capability enhancement method provided by an embodiment of the present invention;

[0027] Figure 5 A structural block diagram of a device for improving the capability of an NL2SQL system provided by an embodiment of the present invention;

[0028] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] In one embodiment, Figure 1 A flowchart of a method for improving the capabilities of an NL2SQL system is provided for an embodiment of the present invention. This embodiment is applicable to the situation when the capability perception of the NL2SQL system is improved. The method can be executed by an NL2SQL system capability improvement device. The NL2SQL system capability improvement device can be implemented in the form of hardware and / or software. The NL2SQL system capability improvement device can be configured in an electronic device.

[0032] like Figure 1 As shown, the NL2SQL system capability improvement method in this embodiment is applied to a database node. The method specifically includes the following steps:

[0033] S110. Determine the capability items required for the NL2SQL system to be improved in the target scenario from a pre-built capability indicator library.

[0034] The NL2SQL system to be improved refers to the NL2SQL system that needs to improve its perception capability. The target scenario can be understood as one or more specific scenarios applicable to the NL2SQL system, and the target scenario can be defined or selected according to user needs.

[0035] In this embodiment, the capability items may include multiple types of capability items. For example, they may include capability items belonging to the "content" type, capability items belonging to the "form" type, and so on. This embodiment does not limit this. Of course, the capability items belonging to the "content" type and the capability items belonging to the "form" type can also be split into other capability items. For example, the capability items belonging to the "content" type can be subdivided into two categories: "concept" and "operation"; the capability items belonging to the "form" type can be subdivided into two categories: "explicit logic" and "implicit logic". It should be noted that each capability item corresponds to a corresponding capability indicator and test case. It can be understood that the capability item and the capability indicator are in a one-to-one correspondence, and each capability indicator and the corresponding test case are in a one-to-one correspondence. In this embodiment, each capability item corresponds to a capability indicator, and the capability indicator corresponds to an indicator test case.

[0036] In this embodiment, the filtering of scenario capability indicators can be completed in a variety of ways. In one embodiment, the log and other files provided by the scenario can be analyzed to provide an approximate range of capability items required by the NL2SQL system to be improved in the target scenario. On this basis, the automatically analyzed indicator range can be supplemented to finally obtain the capability items that need to be targetedly improved in the NL2SQL system. In another embodiment, keyword matching and other methods can be used to filter out the approximate range of capability items required by the NL2SQL system to be improved in the target scenario. This embodiment does not limit this.

[0037] In one embodiment, each capability indicator in the capability indicator library corresponds to a corresponding indicator test case;

[0038] The establishment of the capability index library includes: using a preset keyword extraction algorithm to identify keywords in the first original document related to the NL2SQL system to be improved, and taking each keyword as a first candidate for the first capability item; wherein the preset keyword extraction algorithm includes: one of: a word frequency counting method, a part-of-speech tagging method, a named entity method, a term frequency-inverse document frequency (TF-IDF) method or a graph ranking method TextRank;

[0039] Collect the second original document related to the NL2SQL system to be improved, extract the query statement and the corresponding structured query statement SQL in the second original document, find the logical features contained in the query statement and the corresponding structured query statement SQL, and use the logical features as the second candidate of the second capability item;

[0040] The first candidate and the second candidate respectively form two categories of first target capability item and second target capability item, thereby forming a capability index library; wherein the first target capability item includes the first capability item; and the second target capability item includes the second capability item;

[0041] Among them, the construction of indicator test cases includes: for each capability item belonging to the first target capability item category, constructing a first type of test case in the form of a first category, for each capability item belonging to the second target capability item category, constructing a second type of test case in the form of a second category, and putting the first type of test cases and the second type of test cases into the capability indicator library.

[0042] In this embodiment, the first capability item can be understood as two categories of capability items, namely, "concept" and "operation", which belong to the "content" capability item, wherein "concept" involves every capability item related to the concept in NL2SQL, such as the definition of the "SELECT" keyword, etc.; "operation" involves the definition of every operation in NL2SQL, such as the "SUM" function can calculate the sum of a specified column; the second capability item in this embodiment can be understood as two categories of capability items, namely, "explicit logic" and "implicit logic", which belong to the "form" capability item, wherein "explicit logic" refers to the logic knowledge explicitly expressed in SQL, such as the combination of logical conditions using the "AND" and "OR" keywords; "implicit logic" refers to the logic knowledge not explicitly stated in NL2SQL, such as the commonly accepted norms in some industries, and the hidden logic not expressed in the text expression, such as the data duplication problem that may be caused when JOIN connects multiple tables, and the need to introduce distinct or group by to remove duplicates, etc.

[0043] In this embodiment, the first target capability item is the capability item belonging to "content", and the second target capability item is the capability item belonging to "form". The first capability item and the second capability item can be used as candidates to form two major categories of the first target capability item and the second target capability item respectively; it can be understood that, first, original documents containing domain knowledge related to NL2SQL are collected, such as SQL professional books, query and optimization logs of actual databases, SQL scripts, relevant training materials, relevant papers, web pages, etc.; then, the key terms and specific entities in the field are identified by using methods such as word frequency statistics, part-of-speech tagging, named entity recognition, etc., or keyword extraction algorithms such as TF-IDF, TextRank, etc. are used to extract keywords and phrases related to the field from the text, As candidates for "concept" and "operation" capability items; secondly, collect relevant materials of NL2SQL, such as training sets, database logs, SQL scripts with comments, etc., extract the query statements and the corresponding query SQL, and then write appropriate prompts, and use the large model to extract the "explicit logic" and "implicit logic" contained in the query statements and query SQL pairs as candidates for related capability items; finally, the available capability indicator library is composed of candidates for "concept" and "operation" capability items, as well as candidates for "explicit logic" and "implicit logic" related capability items, and the candidates for "concept", "operation", "explicit logic" and "implicit logic" capability candidates are screened and supplemented to form an available capability indicator library, and the capability indicator library is updated regularly.

[0044] In this embodiment, when the preset keyword extraction algorithm is one of the word frequency statistics method, the part-of-speech tagging method, and the named entity method, the preset keyword extraction algorithm is used to identify the keywords in the first original document related to the NL2SQL system to be improved, which can specifically include: using word frequency statistics, part-of-speech tagging, named entity recognition and other methods to identify key terms and specific entities in the field. For example, first, the collected field-related text data is preprocessed to remove special characters, punctuation marks, etc. in the text, and then a word segmentation operation is performed to divide the text into separate words or words. Word frequency statistics can be used to calculate the frequency of each word in the text and select words with higher frequency of occurrence to identify the key belonging and specific entities in the field. In this process, the part-of-speech tagging method can also be used to determine the part of speech of the selected word, such as noun, verb, adjective, etc., and it can also be through obvious entity recognition, such as training a machine learning model, to identify specific types of entities in the text, to assist the key belonging and specific entity recognition process previously performed by word frequency statistics.

[0045] In this embodiment, when the preset keyword extraction algorithm is one of the word frequency-inverse document frequency TF-IDF method or the graph sorting method TextRank, the preset keyword extraction algorithm is used to identify the keywords in the first original document related to the NL2SQL system to be improved, which may specifically include: the TF-IDF method can be used to extract keywords and phrases related to the field, specifically, by calculating the frequency of the word in the text (word frequency) and the product of the inverse document frequency (IDF) in the entire corpus, the TF-IDF value is obtained, and the TF-IDF value is sorted to extract keywords with high TF-IDF values. These keywords are usually the most relevant words to the text content, that is, the keywords and phrases being sought; in some embodiments, the TextRank method can also be used. TextRank is a graph-based sorting algorithm that determines the importance of phrases by analyzing the relationship between words in the text. Specifically, you can construct a graph with words in the text as nodes, use the co-occurrence relationship between words as the weight of the edge, and then run the TextRank algorithm to calculate the importance score of each word. Finally, extract phrases with higher scores as key phrases based on the importance score.

[0046] In this embodiment, for each capability item that is split out and belongs to the "content" category, test cases in the form of filling in the blanks, selection, and judgment are constructed; for the capability items that are split out and belong to the "form" category, test cases in the form of generation, error correction, and optimization are constructed; the test cases can be constructed manually or through automated methods such as template extraction and large model generation, and the generated test cases are finally placed in the indicator library for subsequent use. Specifically, when constructing the test cases, you can design specific templates, and then extract relevant content separately, fill in the templates, and generate test cases. You can also design special prompts, and then use the large model to generate corresponding test cases, and finally put the generated test cases into the indicator library for subsequent use.

[0047] S120. Evaluate the capability level of each capability item according to the preset scenario test question bank to obtain the capability level details of the NL2SQL system to be improved.

[0048] Among them, the capability level details include the first level, the second lower level, the third level, the fourth level and the fifth level. Of course, the capability levels have a sequence. Specifically, the first level is less than the second level, the second level is less than the third level, the third level is less than the fourth level, and the fourth level is less than the fifth level. Among them, the first level can be understood as the test cases corresponding to different types of capability items have no score; the second level can be understood as the test case scores corresponding to each capability item belonging to the "content" category have reached the preset first score requirement, but the test cases corresponding to the capability items belonging to the "form" category have not scored; the third level can be understood as the score of the first type of test case has reached the preset second score requirement, and the test cases belonging to the generation type in the capability items belonging to the "form" category have reached the preset second score requirement; the fourth level can be understood as the test cases belonging to the generation type in the capability items belonging to the "form" category have reached the preset third score requirement, and the test cases belonging to the error correction type in the capability items belonging to the "form" category have reached the preset third score requirement; the fifth level can be understood as if the scores of the test cases of different types of capability items have basically reached the preset fourth score requirement.

[0049] In this embodiment, each type of test case in the test cases corresponding to each capability item can be tested through the scenario test question bank to obtain corresponding results, and the score results corresponding to the various types of test cases can be determined based on the results and the preset expected results, and the capability level of the NL2SQL system to be improved can be graded based on the score results to obtain the capability level details; in another embodiment, it is also possible to grade by weighting the scores of the answers to each test case, or by classifying the general situation of different types of questions and grading them according to the classification results, and this embodiment is not limited here.

[0050] S130. Determine the capability improvement module matrix corresponding to the capability item based on the capability level details.

[0051] Among them, the capability improvement module matrix can also be called the Improvement Matrix. Each element in the capability improvement module matrix represents the capability improvement task (Improvement Block) of the corresponding capability item; the horizontal axis in the capability improvement module matrix represents the capability item of the NL2SQL system to be improved, and the vertical axis represents the capability improvement task category of the NL2SQL system to be improved.

[0052] In this embodiment, the capability level details include capability items that meet the level standards and capability items that do not meet the level standards. For capability items that meet the level standards, since the capability items are up to standard, it is not necessary to generate a capability improvement module matrix, or a capability improvement module matrix that maintains the capability can be generated; for capability items that do not meet the level standards, different methods can be selected to construct corresponding capability improvement module matrices according to the types of different capability items that do not meet the level standards; specifically, in the case where the capability item that does not meet the level standards belongs to the first target capability item, if the capability level details are the first level, a data set corresponding to the first target capability item is constructed, and a preset mask learning method can be used for Knowledge injection is used as the capability enhancement module matrix, or a data set of instruction fine-tuning is constructed as the capability enhancement module matrix; if the capability level details are the second level, the supervised fine-tuning SFT method can be used for concept alignment, or the capability enhancement module matrix can be determined by an external knowledge base or knowledge injection in prompt; in the case where the non-compliant capability items belong to the second target capability items, if the capability level details are the third level, the capability enhancement module matrix is ​​determined by formal alignment through instruction learning; if the capability level details are the fourth level, the implicit logic can be converted into explicit logic through intent recognition and few-shot learning, or fine-tuning can be performed by adding intent recognition corpus, or the capability enhancement module matrix can be determined by a knowledge base in the form of an external text or knowledge graph; of course, other existing methods can also be selected to determine the capability enhancement module matrix in the case of different capability item levels and types, and this embodiment is not limited here.

[0053] S140. Based on the task improvement category to which each capability improvement task in the capability improvement module matrix belongs, the best target capability improvement task is selected for collective grouping, a target group combination after grouping is obtained, and the target group combination is scheduled to perform capability perception improvement on the NL2SQL system to be improved.

[0054] Each target grouping combination includes one or more capability improvement tasks.

[0055] Among them, the task improvement categories may include but are not limited to mask learning, instruction learning, adaptor learning, reinforcement learning from human feedback optimization language model (RLHF), and in-context learning (ICL). The target capability improvement task is the best capability improvement task. In this embodiment, the best capability improvement task may include one or more. The target group combination may include one or more group combinations, which can be scheduled according to the execution order of one or more group combinations.

[0056] In this embodiment, the capability improvement module matrix of each capability improvement task is grouped by the task improvement category to which each capability improvement task belongs in the capability improvement module matrix to obtain the grouped Group Block; wherein each Group Block contains one or more Improvement Blocks, all Group Blocks are scheduled, a pipeline for the final execution of the Group Block is constructed and optimized, and the Group Block is scheduled and run according to the pipeline to improve the capability of the NL2SQL system to be improved. Specifically, the capability improvement tasks belonging to the same task improvement category can be merged to obtain a first merged result, and the best capability improvement task can be selected from the first merged result according to preset requirements for a second merge to obtain a second merged result, and the target capability improvement tasks with the best second merged result are grouped together, and the execution order is obtained according to the execution dependency relationship between each target group combination for scheduling and running, so as to improve the capability of the NL2SQL system to be improved.

[0057] The technical solution of the embodiment of the present invention can narrow the scope of subsequent NL2SQL capability perception and improvement capability items by determining the capability items required by the NL2SQL system to be improved in the target scenario from the capability indicator library, thereby quickly completing the adaptation of the NL2SQL system to the specific scenario; by determining the capability level details of the NL2SQL system to be improved through each capability item, the NL2SQL system can be comprehensively and carefully quantified, with higher measurement efficiency and more comprehensive measurement results; the capability improvement module matrix corresponding to the capability item is determined through the capability level details, each capability improvement module matrix contains one or more capability improvement tasks, and the best target capability improvement tasks are selected according to the task improvement category to which they belong for collective grouping, so as to perform scheduling based on the grouping results, thereby achieving an efficient combined scheduling method, and realizing efficient and refined improvement of the NL2SQL system capability perception with low improvement complexity.

[0058] In one embodiment, after the capability perception of the NL2SQL system to be enhanced is enhanced, the method further includes:

[0059] Determine whether the NL2SQL system with enhanced capability perception meets the preset requirements of the target scenario;

[0060] If satisfied, the target NL2SQL system is directly applied to the application scenario;

[0061] If not, return to the step of determining the capability improvement module matrix corresponding to the capability item based on the capability level details until the NL2SQL system with enhanced capability perception meets the preset requirements of the target scenario.

[0062] In this embodiment, it is determined whether the NL2SQL system after the capability perception is improved meets the preset requirements of the target scenario. If it meets the preset requirements of the target scenario, the target NL2SQL system is directly applied to the application scenario. If it does not meet the requirements, the step of determining the capability improvement module matrix corresponding to the capability item based on the capability level details is returned again until the NL2SQL system after the capability perception is improved meets the preset requirements of the target scenario. The preset requirements refer to the pre-set scenario requirements, which can be set manually according to certain requirements.

[0063] In one embodiment, Figure 2A flowchart of another NL2SQL system capability improvement method provided for an embodiment of the present invention. Based on the above embodiments, this embodiment determines the capability items required for the NL2SQL system to be improved in the target scenario from a pre-constructed capability indicator library, and evaluates the capability level of each capability item according to a preset scenario test question bank to obtain the capability level details of the NL2SQL system to be improved; determines the capability improvement module matrix corresponding to the capability items based on the capability level details; selects the best target capability improvement tasks based on the task improvement category to which each capability improvement task in the capability improvement module matrix belongs, and groups them together to obtain the target group combination after grouping; and schedules the target group combination to further refine the capability perception improvement of the NL2SQL system to be improved.

[0064] like Figure 2 As shown, the NL2SQL system capability improvement method in this embodiment may specifically include the following steps:

[0065] S210: Obtain historical log files stored in the target scenario by the NL2SQL system to be upgraded.

[0066] Among them, the historical log file refers to the log file generated in a specific scenario. Each scenario corresponds to a corresponding scenario log file. The log file may include the relevant capability items of the NL2SQL system to be improved in the specific scenario, the scores of the test cases corresponding to the capability items, the level details, etc.

[0067] In this embodiment, historical log file information such as relevant capability items stored in the target scenario, scores of test cases corresponding to the capability items, level details, etc. of the NL2SQL system to be improved is obtained.

[0068] S220. Filter out a target range of capability items required in a target scenario from a capability indicator library according to historical log files; wherein the target range includes capability indicators corresponding to the capability items and indicator test cases corresponding to the capability indicators.

[0069] In this embodiment, the capability items and target ranges required in the target scenario can be filtered out from the capability indicator library based on the historical log files; wherein the target range includes capability indicators corresponding to the capability items and indicator test cases corresponding to the capability indicators. In this embodiment, the filtering method for the capability items required in the target scenario is not limited, and the filtering can be performed by existing methods in the prior art.

[0070] S230, testing the first type of test cases in the test cases corresponding to each capability item according to the preset scenario test question bank to obtain a first result, and determining the first score results corresponding to each first type of test case according to the first result and the preset first expected result.

[0071] Among them, the first type of test cases may include but are not limited to test cases in the form of fill-in-the-blank, selection, judgment, etc. This type of test case belongs to the test case corresponding to the capability item of the "content" class. It can be understood that for each capability item belonging to the "content" class, a test case in the form of fill-in-the-blank, selection, and judgment can be constructed. The preset first expected result refers to the standard result set by the user according to experience and other methods.

[0072] In this embodiment, a scenario test question bank is obtained, and a first result can be obtained by testing the first type of test cases in the test cases corresponding to each capability item through the scenario test question bank, and a first score result corresponding to each first type of test case is determined based on the first result and a preset first expected result. Specifically, the first result is compared with the preset first expected result. When the first result is less than the preset first expected result, the first score result corresponding to each first type of test case is determined to be unqualified and no score is scored; if the first result is greater than or equal to the preset first expected result, the first score result corresponding to each first type of test case is determined to be qualified and a score is scored.

[0073] S240. Test the second type of test cases in the test cases corresponding to each capability item according to the preset scenario test question bank to obtain a second result, and determine the second score results corresponding to each second type of test case according to the degree of conformity between the second result and the preset second expected result.

[0074] Among them, the second type of test cases may include but are not limited to test cases in the form of generation, error correction and optimization. This type of test cases belongs to the test cases corresponding to the capability items of the "form" category. It can be understood that the capability items belonging to the "form" category can construct test cases in the form of generation, error correction and optimization. The preset second expected result refers to the standard result set by the user according to experience and other methods. It should be noted that the preset first expected result and the preset second expected result can be the same or different, and are set according to needs.

[0075] In this embodiment, a preset scenario test question bank is obtained, and the second type of test cases in the test cases corresponding to each capability item can be tested through the preset scenario test question bank to obtain a second result, and the second score results corresponding to each second type of test case are determined based on the second result and the preset second expected result. Specifically, the second result is compared with the preset second expected result. When the second result is less than the preset second expected result, the second score results corresponding to each second type of test case are determined to be unqualified and no score is scored; if the second result is greater than or equal to the preset second expected result, the second score results corresponding to each second type of test case are determined to be qualified and a score is scored.

[0076] It should be noted that the method of testing the first type of test cases and the second type of test cases in the test cases corresponding to each capability item through the preset scenario test question bank can include an average distribution method or a weighted average method. For example, with a total score of 100 points, all test cases in the indicator are assigned corresponding total scores according to certain rules. For test cases in the form of fill-in-the-blank, selection, judgment, etc., it is judged whether their results are consistent with the standard results. If they are consistent, they are scored, and if they are not consistent, they are not scored. For generation, optimization, and error correction, the degree of compliance between their answers and the standard answers is judged, and scores are given between 0 and full marks according to the degree of compliance. All judgments can be completed manually, or judgment results can be given through special models.

[0077] S250 , grading the capability level of the NL2SQL system to be improved according to the first scoring result and the second scoring result, and obtaining capability level details.

[0078] Among them, the ability level details include: first level, second level, third level, fourth level, and fifth level.

[0079] In this embodiment, the capability level of the NL2SQL system to be improved is graded according to the first scoring result and the second scoring result to obtain corresponding capability level details. In one embodiment, the method of dividing the capability level details includes: when the first type test case and the second type test case in the NL2SQL system to be upgraded have no score, determining the capability level details as the first level; when the score of the first type test case reaches the preset first score requirement, and the second type test case has no score, determining the capability level details as the second level; when the score of the first type test case reaches the preset second score requirement, and the score of the second type test case reaches the preset second score requirement, determining the capability level details as the third level; when the score of the first type test case reaches the preset third score requirement, and the score of the second type test case reaches the preset third score requirement, determining the capability level details as the fourth level; when the score of the first type test case reaches the preset fourth score requirement, and the score of the second type test case reaches the preset fourth score requirement, determining the capability level details as the fifth level; wherein the first level is less than the second level, the second level is less than the third level, the third level is less than the fourth level, and the fourth level is less than the fifth level; the preset first score requirement is less than the preset second score requirement; the preset second score requirement is less than the preset third score requirement; the preset third score requirement is less than the preset fourth score requirement.

[0080] In this embodiment, when neither the first type of test case nor the second type of test case in the NL2SQL system to be improved scores, the capability level details are determined to be the first level; when the score of the first type of test case reaches the preset first score requirement, and the second type of test case does not score, the capability level details are determined to be the second level; when the score of the first type of test case reaches the preset second score requirement, and the score of the second type of test case reaches the preset second score requirement, the capability level details are determined to be the third level; when the score of the first type of test case reaches the preset third score requirement, and the score of the second type of test case reaches the preset third score requirement, the capability level details are determined to be the fourth level; in the first type When the score of the test case reaches the preset fourth score requirement, and the score of the second type of test case reaches the preset fourth score requirement, the capability level details are determined to be the fifth level; it can be understood that for each capability indicator, its capability is divided into five levels from low to high, namely "None", "understand", "unfamiliar", "available", and "master", among which "None" means that there is no SQL-related knowledge at all and the SQL task is not answered correctly; "Understand" means that the model can master the grammatical rules; "Unfamiliar" means that the model can complete the corresponding SQL task with the help of prompt projects such as few shots on the basis of understanding the SQL grammatical rules; "Master" means that the model can complete the application of SQL queries for actual query problems, including the judgment of whether the SQL statement is correct and the ability to generate corresponding SQL query statements according to the query statements in natural language form; "Master" means that the model can judge the good or bad use of SQL statements, including correcting problematic SQL statements or optimizing SQL statements.

[0081] In this embodiment, in order to rate each capability item, a specific capability rating method can be designed. For example, the system can use the weighted sum of the scores of each capability item to rate the knowledge point, with 0-20 points for "none", 20-40 points for "understand", and so on. The NL2SQL system to be improved can also be graded according to the answers to various types of questions. If all types of test cases are not scored, the capability level of the capability item is "none". If filling in the blanks, selection, and judgment can basically score, but generation, optimization, and error correction cannot score, the capability level of the capability item is "understand". On this basis, if the test cases of the generation type of the NL2SQL system to be improved can basically score, the capability level of the capability item is "unfamiliar". On this basis, if the test cases of the error correction type of the NL2SQL system to be improved can basically score, the capability level of the capability item is "available". On this basis, if the test cases of the optimization type of the NL2SQL system to be improved can basically score, the capability level of the capability item is "master". Of course, the specific rating rules can be adjusted according to actual conditions.

[0082] S260. Select, from the capability level details, the non-compliant capability items whose capability levels do not meet the standards, and the compliant capability items whose capability levels meet the standards.

[0083] In this embodiment, non-standard competence items whose competence levels are not up to standard and standard competence items whose competence levels are up to standard are selected from the competence level details. Non-standard competence items refer to competence levels whose competence levels are the first level, the second level, the third level and the fourth level, that is, the competence levels of "none", "understand", "unfamiliar", and "available"; standard competence items refer to competence levels whose competence levels are the fifth level, that is, the competence levels of "master".

[0084] S270. For the capability items that fail to meet the standards, if the capability items that fail to meet the standards belong to the capability items of the first target capability items, and if the capability level details are the first level, a data set corresponding to the first target capability items is constructed, and a preset mask learning method is used for knowledge injection to construct a capability improvement module matrix.

[0085] Among them, the first target capability item is every capability item belonging to the "content" category.

[0086] In this embodiment, for the unqualified capability items, when the unqualified capability items belong to the capability items of the first target capability items, if the capability level details are the first level, a data set corresponding to the first target capability item is constructed, and a preset mask learning Mask Learning method is used to select full-amount fine-tuning for knowledge injection as the capability improvement module matrix, or an instruction fine-tuning method is used as the capability improvement module matrix. It can be understood that for the capability items belonging to "content", if the score on the capability item is very low and is "none", a data set corresponding to the capability item can be constructed, and a Mask Learning method can be used to select full-amount fine-tuning for knowledge injection, or instruction fine-tuning data can be constructed, that is, the preset mask learning method for knowledge injection or instruction fine-tuning is used as the ordinate of the capability improvement module matrix, and the capability items belonging to "content" are used as the abscissa. In this embodiment, the preset mask learning Mask Learning method is a learning method in the prior art, and this embodiment does not describe the specific method here.

[0087] S280. In the case where the unsatisfactory competency item belongs to the competency item of the first target competency item, if the competency level detail is the second level, the competency enhancement module matrix is ​​constructed by using either the supervised fine-tuning SFT method for concept alignment or the plug-in knowledge base.

[0088] In this embodiment, when the non-standard capability item belongs to the capability item of the first target capability item, if the capability level detail is the second level, the supervised fine-tuning (SFT) method of the generative model GPT is used for concept alignment, or the capability improvement module matrix is ​​determined through an external knowledge base or knowledge injection in the prompt. It can be understood that if the system scores "unfamiliar" on this capability item, the SFT instruction fine-tuning method can be used to align concepts, or the relevant capability improvement can be performed through an external knowledge base or knowledge injection in the prompt, that is, the supervised fine-tuning SFT method for concept alignment and any one of the external knowledge base methods are used as the vertical coordinate of the capability improvement module matrix, and the capability items belonging to "content" are used as the horizontal coordinate. In this embodiment, the SFT instruction fine-tuning is a learning method in the prior art, and the specific method is not described in this embodiment.

[0089] S290. In the case where the unsatisfactory competency item belongs to the competency item of the second target competency item, if the competency level detail is the third level, a competency improvement module matrix is ​​constructed by performing formal alignment through instructional learning.

[0090] Among them, the second target capability item is every capability item belonging to the "form" category.

[0091] In this embodiment, when the unmet capability item belongs to the capability item of the second target capability item, if the capability level detail is the third level, the capability improvement module matrix is ​​determined by formal alignment through the instructing learning method. It can be understood that for the capability item belonging to "form", if the evaluation on the capability item is "understand", the formal alignment can be performed through the instructing learning method (instruct SFT Learning), that is, the formal alignment method of the instructing learning method is used as the vertical coordinate of the capability improvement module matrix, and the capability item belonging to "form" is used as the horizontal coordinate. In this embodiment, the instructing learning method is a method in the prior art, and this embodiment will not be described in detail here.

[0092] S2100. In the case where the unsatisfactory capability item belongs to the second target capability item, if the capability level detail is the fourth level, a capability enhancement module matrix is ​​constructed through a few-sample learning method, a fine-tuning method, or any one of the methods in the plug-in knowledge graph.

[0093] In this embodiment, when the unqualified capability item belongs to the capability item of the second target capability item, if the capability level detail is the fourth level, the implicit logic can be converted into explicit logic through intent recognition and few-shot learning, or fine-tuned by adding intent recognition corpus, or determined by a knowledge base in the form of external text or knowledge graph. It can be understood that if the evaluation is "available", the implicit logic can be converted into explicit logic through intent recognition and few shot examples (few-shot learning), or fine-tuned (fine-tuning in deep learning) by adding intent recognition corpus, or by a knowledge base in the form of external text or KG (knowledge graph), to improve the performance of the model on the relevant capability items, that is, the few-shot learning method, the fine-tuning method, or any one of the methods in the external knowledge graph is used as the vertical coordinate of the capability improvement module matrix, and the capability item belonging to "form" is used as the horizontal coordinate.

[0094] S2110. For the capability items that meet the standards, there is no need to generate a capability improvement module matrix, or a capability improvement module matrix for maintaining the capability is generated.

[0095] In this embodiment, for the capability items that meet the standards, there is no need to generate a capability improvement module matrix, or a capability improvement module matrix for maintaining the capability is generated.

[0096] In one embodiment, in order to better understand the relationship between the NL2SQL capability item and the capability improvement module matrix Improvement Matrix, Table 1 is a schematic table of the relationship between the NL2SQL capability item and the capability improvement module matrix Improvement Matrix provided by one embodiment of the present invention. Among them, Mask Learning in the table refers to mask learning, Few-shot Learning refers to few-shot learning, instruct SFT Learning refers to the instruction learning method, RLHF refers to optimizing the language model based on human feedback in a reinforcement learning manner (Reinforcement Learning from Human Feedback), and Adaptor Learning refers to adaptation learning.

[0097] Table 1: Schematic diagram of the relationship between NL2SQL capability items and the Improvement Matrix

[0098]

[0099] S2120, determine whether the capability improvement tasks are of the same task improvement category, if so, execute S2130; if not, execute S2140.

[0100] In this embodiment, it is determined whether each capability improvement task belongs to the same task improvement category. If so, the capability improvement tasks of the same task improvement category are merged to obtain a merged result, and the best capability improvement task is selected from the merged result according to preset requirements for secondary merging. The target capability improvement tasks with the best two merged results are grouped together to obtain a target group combination after grouping.

[0101] S2130, the capability improvement tasks of the same task improvement category are merged for the first time to obtain a first merged result, and the best capability improvement task is selected from the first merged result according to preset requirements for a second merge to obtain a second merged result, and the target capability improvement tasks with the best second merged result are grouped together to obtain a target group combination after grouping.

[0102] Among them, the preset requirements include: ability improvement tasks with the largest difference in training corpora, or ability improvement tasks with the most similar training corpora.

[0103] In this embodiment, when the capability improvement tasks belong to the same task improvement category, the capability improvement tasks of the same task improvement category are merged for the first time to obtain a first merged result, and the best capability improvement task is selected from the first merged result according to preset requirements for a second merged result to obtain a second merged result, and the target capability improvement tasks with the best second merged result are grouped together to obtain a target group combination after grouping.

[0104] In this embodiment, the best Improvement Block is selected for merging. For example: 1. When merging the Improvement Blocks of the SFT training task, the Block with the most similar training corpus can be selected, and its corpus can be merged to form a Group Block, which can reduce the difficulty of model training; 2. When merging the ImprovementBlocks of the pre-training task, the Block with the largest difference in training corpus can be selected for merging, and the corpus of each block can be disrupted according to certain rules to improve the diversity of training samples and avoid model overfitting. According to certain rules, the Improvement Blocks in the Improvement Matrix are merged into a series of Group Blocks, and each GroupBlock contains one or more Improvement Blocks. The merging logic of the Group Block needs to take many factors into consideration. In this embodiment, the merged Improvement Blocks should belong to the same type of improvement method; secondly, in order to achieve the best improvement effect, the best merging granularity needs to be selected when merging, and the best Improvement Block is selected for merging according to the capability item to which the Improvement Block belongs. Of course, the merging rules are not limited to the items listed above. In practice, the merging rules need to be designed according to actual conditions.

[0105] S2140, no merging is performed.

[0106] In this embodiment, when the capability improvement tasks do not belong to the same task improvement category, they are not merged.

[0107] S2150. Obtain an execution order according to the execution dependency relationship between each target group combination.

[0108] The dependency relationship includes: serial execution or parallel execution.

[0109] In this embodiment, the execution order is obtained according to the execution dependency relationship between each target group combination; wherein the dependency relationship includes: serial execution or parallel execution. In this embodiment, all target group combination Group Blocks are scheduled, and the execution order pipeline of the target group combination Group Block is constructed and optimized. The execution order represents the execution dependency relationship between all target group combination Group Blocks. Generally speaking, the GroupBlocks in the pipeline are executed serially or in parallel according to the type of dependency relationship. When there are Group Blocks that can be executed in parallel, they will be merged into one target group combination and then put into the pipeline. By optimizing the pipeline, the model capability can be improved and the overall efficiency of the task can be improved.

[0110] S2160. In the execution order, according to whether the resources for executing the target group combination are sufficient, one or at least two target group combinations are selected for execution until all target group combinations are scheduled.

[0111] In this embodiment, in the execution order, according to whether the resources for executing the target group combination are sufficient, one or at least two target group combinations are selected for execution until all target group combinations are scheduled. It can be understood that the Group Block is scheduled and run according to the logic of the pipeline. Specifically, it will start from the first Group Block or Parallel Block in the pipeline. After the Block is executed, the Group Block or Parallel Block without unexecuted dependencies will be selected for execution. At the pipeline level, when there is more than one optional Group Block or Parallel Block, this module will select one or more Group Blocks (Parallel Blocks) for execution based on whether the resources supporting the execution of Block are sufficient; at the Parallel Block level, when the resources supporting the execution of Group Block in ParallelBlock are sufficient, it is more likely to select more Group Blocks for parallel execution. When all Group Blocks (Parallel Blocks) in the pipeline are executed, the NL2SQL capability of the system is improved, and the NL2SQL capability of the improved system needs to be evaluated again. The evaluation results can be used to determine whether the improved model fully meets the requirements.

[0112] In this example, to better understand pipeline construction, Figure 3A schematic diagram of a final execution sequence provided in one embodiment of the present invention. Figure 3 As shown, Group Block includes: Group Block 1, Group Block 2, ..., Group Block n, which respectively represent the target group combinations in the above embodiment; wherein, Group Block 1 includes: Improvement Block n1, Improvement Block n2, ..., ImprovementBlock nm, and Improvement Block represents the target capability improvement task in the above embodiment. After scheduling, the execution dependency relationship between the target group combinations obtains the execution order. The execution order in this embodiment is as follows: Group Block 1, Group Block 2, Group Block 3 and Group Block 4 are executed in parallel, Group Block n-1, GroupBlock n, wherein Group Block 3 and Group Block 4 can form a Parallel Block.

[0113] The above technical solution of the embodiment of the present invention filters out the capability indicators corresponding to the capability items of the capability items required in the target scenario from the capability indicator library through historical log files, as well as the indicator test cases corresponding to the capability indicators, so as to better match the needs of the scenario, be more efficient, and improve the efficiency of scenario adaptation. The NL2SQL of the NL2SQL system can be comprehensively and meticulously quantified, and its measurement efficiency is higher, and the measurement results are more comprehensive and meticulous, providing data guidance for the subsequent NL2SQL capability improvement. The scenario test question library is used to test different types of test cases in the test cases corresponding to each capability item to obtain results, and the score results corresponding to each test case are determined according to the results and the preset expected results. The capability level of the NL2SQL system to be improved is graded according to the score results to obtain the capability level details, and the corresponding non-standard capability items are constructed based on the non-standard capability items and the qualified capability items in the capability level details, and the capability improvements belonging to the same type of task improvement category are merged and scheduled at the optimal merging granularity, so as to further achieve an efficient combined scheduling method, and realize the efficient and refined improvement of the capability perception of the NL2SQL system under the condition of low improvement complexity.

[0114] For example, to better understand the NL2SQL system capability improvement method, Figure 4A schematic diagram of another NL2SQL system capability improvement method provided by an embodiment of the present invention. In this embodiment, it is assumed that the capability indicator system has been constructed in the Indicator warehouse to form a capability indicator library. In this embodiment, "concept" and "operation" are the first capability items in the above embodiment; "implicit logic" and "explicit logic" are the second capability items in the above embodiment; the capability items in the "content" category are the first target capability items in the above embodiment; the capability items belonging to the "form" category are the second target capability items in the above embodiment; "proficient" is the fifth level in the capability level details; "mastery" is the fourth level in the capability level details; "understanding" is the third level in the capability level details; "unfamiliar" is the second level in the capability level details; "none" is the first level in the capability level details; Improvement Matrix is ​​the capability improvement module matrix in the above embodiment; Improvement Block is the capability improvement task in the above embodiment; Group Block is the target grouping combination in the above embodiment; pipeline is the final execution order in the above embodiment;

[0115] a1. Filter the capability items required by the NL2SQL system in specific scenarios from the pre-built capability indicator library.

[0116] In this embodiment, the scenario indicator filter targets a new NL2SQL usage scenario, which filters out the following NL2SQL capability items: "SELECT" and "WHERE" in the "concept" category, "COUNT operation" and "MAX operation" in the "operation" category, "logical combination of AND and OR" in the "explicit logic" category, and "multi-table join counts need to be deduplicated" in the "implicit logic" category. The required capability level is "proficient". For these capability items, the capability items belonging to the "content" category have been constructed with two questions of "fill in the blank", "selection" and "judgment", and the capability items belonging to the "form" category have been constructed with two questions of "generation", "error correction" and "optimization".

[0117] a2. Obtain the capability item classification details of the NL2SQL system.

[0118] In this embodiment, the Measurement Module uses a preset scenario test question bank to test the existing NL2SQL system and obtains the following test results: 1) "SELECT": 2 correct questions for filling in the blanks, 2 correct questions for selecting, and 2 correct questions for judging, and the ability is judged as "proficient"; 2) "WHERE": 1 correct question for filling in the blanks, 1 correct question for selecting, and 1 correct question for judging, and the ability is judged as "understanding"; 3) "COUNT operation": 2 correct questions for filling in the blanks, 1 correct question for selecting, and 2 correct questions for judging, and the ability is judged as "mastering"; 4) "MAX operation": 1 correct question for filling in the blanks, 1 correct question for selecting, and 2 correct questions for judging, and the ability is judged as "unfamiliar"; 5) "Logical combination of AND and OR": 2 correct questions for "generation", 1 correct question for "error correction", and 1 correct question for "optimization", and the ability is judged as "unfamiliar"; 6) "Multi-table join count needs to be deduplicated": 1 correct question for "generation", 0 correct questions for "error correction", and 1 correct question for "optimization", and the ability is judged as "understanding".

[0119] a3. Construct capability deficiency items for the capability items that do not meet the standards in the capability item classification details.

[0120] In this embodiment, the Planning Module specifies the improvement method Improvement Block corresponding to each capability item according to the NL2SQL capability perception result: 1) "SELECT" because the capability is judged as "proficient", which meets the needs of the scenario, so there is no need to generate an Improvement Block (an Improvement Block that maintains the capability can also be generated, but it is not generated in this embodiment); 2) "WHERE": because the capability is judged as understanding, an Improvement Block 1 of Instrction Learning using the full parameters of the "WHERE" corpus is constructed; 3) "COUNT operation": because the capability is judged as "mastered", and according to the characteristics of the "COUNT" capability item itself, an Improvement Block 2 of AdaptorLearning containing the "COUNT" corpus is constructed; 4) "MAX operation": because the capability is judged as "unfamiliar", and according to the characteristics of the "MAX" capability item itself, an Improvement Block of Adaptor Learning containing the "MAX" corpus is constructed Block 3; 5) "Logical combination of AND and OR": Because the ability is judged as "unfamiliar" and according to the characteristics of the ability item "Logical combination of AND and OR", an Improvement Block 4 of Adaptor Learning containing the corpus of "Logical combination of AND and OR" is constructed; 6) "Multi-table join counts need to be deduplicated": Because the ability is judged as "understanding" and according to the characteristics of the ability item "Multi-table join counts need to be deduplicated", an Improvement Block 5 of Mask Learning containing the corpus of "Multi-table join counts need to be deduplicated" is constructed, and at the same time an Improvement Block 6 of intent recognition is constructed. This Improvement Block performs intent recognition on the input text, and when the logic of "Multi-table join counts" is recognized, the prompt "Multi-table join counts need to be deduplicated" is added to the Prompt.

[0121] a4. Merge the Improvement Blocks in the Improvement Matrix according to the rules to form a GroupBlock.

[0122] In this embodiment, the Group Module groups the generated Improvement Blocks into Groups. In this embodiment, a method of merging Improvement Blocks belonging to the same stage into one Group Block is adopted to construct the Group Block. 1) Improvement Block 5 belongs to the pre-training stage. There are no other blocks in this stage in this embodiment, so Group Block 1 is constructed, and only Improvement Block 5 is included in this Group Block; 2) Improvement Block 1 belongs to full fine-tuning. There are no other blocks in this stage in this embodiment, so GroupBlock2 is constructed, and only Improvement Block 1 is included in this Group Block; 3) Improvement Block 2, Improvement Block 3, and Improvement Block 4 all belong to Adaptor Learning, so they are merged, and the training corpus used in Improvement Block 2, Improvement Block 3, and Improvement Block 4 are merged to generate a total instruction fine-tuning training corpus containing "COUNT", "MAX", and "logical combination of AND and OR", and Group Block 3 is constructed; 4) Improvement Block6 belongs to the prompt engineering part. There are no other blocks in this stage in this embodiment, so Group Block4 is constructed separately.

[0123] a5. Build and optimize the execution pipeline of Group Block: Block Scheduler uses the generated GroupBlock to build the pipeline.

[0124] In this embodiment, since there is no logic that can be executed in parallel in Group Blocks 1 to 4, Group Block 1->Group Block 2->Group Block 3->Group Block 4 is finally constructed as the final pipeline.

[0125] a6. Capacity improvement and assessment.

[0126] In this embodiment, the Improvement & Eval Module runs Group Blocks 1 to 4 in sequence according to the logical order of the pipeline. 1) Run Group Block 1, use the "multi-table join count needs to be deduplicated" corpus to perform Mask Learning training on the model in the system to obtain the improved model; 2) Run Group Block 2, use the Instrction Learning corpus containing the "WHERE" corpus, and then fine-tune the model with all parameters; 3) Run Group Block 3, use the general instruction fine-tuning training corpus containing "COUNT", "MAX", and "logical combination of AND and OR", and then perform adapter Learning on the model; 4) Run Group Block 4, train an RNN model for intent recognition, and be able to identify whether the query statement contains the intent of "multi-table join count needs to be deduplicated", and then find a suitable prompt format through prompt engineering, add the prompt of "multi-table join count needs to be deduplicated" in the final prompt, and add this intent recognition and prompt logic to the overall process of the system; 5) Improvement & Eval Modul calls MeasurementModule to re-evaluate the NL2SQL capability of the upgraded system.

[0127] a7. Determine whether the NL2SQL system meets the scenario requirements after the capability improvement. If so, execute a8. If not, return to a3 until the NL2SQL system after the capability improvement meets the preset requirements of the target scenario. And determine whether the improved system is available based on the evaluation results of the improved system capability.

[0128] a8. Apply the target NL2SQL system directly to the application scenario.

[0129] In this embodiment, the evaluation results of the improved model are as follows: 1) "SELECT": the ability is judged as "proficient"; 2) "WHERE": the ability is judged as "proficient"; 3) "COUNT operation": the ability is judged as "proficient"; 4) "MAX operation": the ability is judged as "proficient"; 5) "Logical combination of AND and OR": the ability is judged as "proficient"; 6) "Multi-table join counts need to be deduplicated": the ability is judged as "proficient".

[0130] In this embodiment, the improved model capabilities meet the usage requirements of the scenario and can be used in the scenario.

[0131] In one embodiment, Figure 5This is a structural block diagram of a NL2SQL system capability enhancement device provided in one embodiment of the present invention. The device is suitable for enhancing the capability perception of the NL2SQL system. The device can be implemented by hardware / software. It can be configured in an electronic device to implement a NL2SQL system capability enhancement processing method in an embodiment of the present invention.

[0132] like Figure 5 As shown, applied to a database node, the device includes: a capability item determination module 510, a level detail determination module 520, a promotion matrix determination module 530 and a promotion module 540.

[0133] The capability item determination module 510 is used to determine the capability items required for the NL2SQL system to be improved in the target scenario from a pre-built capability indicator library;

[0134] A level detail determination module 520 is used to evaluate the level of each capability item according to a preset scenario test question bank to obtain the capability level details of the NL2SQL system to be improved;

[0135] The improvement matrix determination module 530 is used to determine the capability improvement module matrix corresponding to the capability item based on the capability level details; wherein each element in the capability improvement module matrix represents a capability improvement task of the corresponding capability item; the horizontal axis in the capability improvement module matrix represents the capability item of the NL2SQL system to be improved, and the vertical axis represents the capability improvement task category of the NL2SQL system to be improved;

[0136] The improvement module 1040 is used to select the best target capability improvement tasks based on the task improvement category to which each capability improvement task in the capability improvement module matrix belongs, and group them together to obtain the target group combination after grouping, and schedule the target group combination to perform capability-aware improvement on the NL2SQL system to be improved; wherein each target group combination contains at least one capability improvement task.

[0137] In the embodiment of the present invention, the capability item determination module can narrow the scope of capability indicators for subsequent NL2SQL capability perception and improvement by determining the capability items required by the NL2SQL system to be improved in the target scenario from the capability indicator library, thereby quickly completing the adaptation of the NL2SQL system to the specific scenario; the improvement matrix determination module and the improvement module can determine the capability level details of the NL2SQL system to be improved through each capability item, and can perform comprehensive and detailed quantitative measurement of the NL2SQL system, with higher measurement efficiency and more comprehensive measurement results. The capability improvement module matrix corresponding to the capability item is determined through the capability level details, and each capability improvement module matrix contains one or more capability improvement tasks. The best target capability improvement tasks are selected according to the task improvement category to which they belong for collective grouping, so as to perform scheduling based on the grouping results, thereby achieving an efficient combined scheduling method, and realizing efficient and refined improvement of the NL2SQL system capability perception under the condition of low improvement complexity.

[0138] In one embodiment, the device further comprises:

[0139] A judgment module, used for judging whether the NL2SQL system after the capability perception improvement meets the preset requirements of the target scenario after the capability perception improvement is performed on the NL2SQL system to be improved;

[0140] An application module, used for directly applying the target NL2SQL system to an application scenario if the conditions are met;

[0141] A loop module is used to return to the step of determining the capability improvement module matrix corresponding to the capability item based on the capability level details if the requirement is not met, until the NL2SQL system with enhanced capability perception meets the preset requirements of the target scenario.

[0142] In one embodiment, each capability indicator in the capability indicator library corresponds to a corresponding indicator test case;

[0143] The establishment of the capability index library includes:

[0144] Using a preset keyword extraction algorithm to identify keywords in the first original document related to the NL2SQL system to be improved, and taking each of the keywords as a first candidate for the first capability item; wherein the preset keyword extraction algorithm includes: one of: word frequency statistics, part-of-speech tagging, named entity, word frequency-inverse document frequency TF-IDF or graph ranking TextRank;

[0145] Collect the second original document related to the NL2SQL system to be improved, extract the query statement and the corresponding structured query statement SQL in the second original document, find the logical features contained in the query statement and the corresponding structured query statement SQL, and use the logical features as the second candidate of the second capability item;

[0146] The first candidate and the second candidate respectively form two categories, namely, the first target capability item and the second target capability item, thereby forming the capability index library; wherein, the first target capability item includes the first capability item; and the second target capability item includes the second capability item;

[0147] The construction of the indicator test case includes:

[0148] For each capability item belonging to the first target capability item category, a first type of test case in the form of the first category is constructed; for each capability item belonging to the second target capability item category, a second type of test case in the form of the second category is constructed; and the first type of test case and the second type of test case are placed in the capability indicator library.

[0149] In one embodiment, the capability item determination module 510 includes:

[0150] A file acquisition unit, used to acquire the historical log files stored in the target scenario by the NL2SQL system to be upgraded;

[0151] A range determination unit is used to filter out a target range of capability items required in the target scenario from the capability indicator library based on the historical log file, wherein the target range includes capability indicators corresponding to the capability items and indicator test cases corresponding to the capability indicators.

[0152] In one embodiment, the level detail determination module 520 includes:

[0153] A first result determination unit, configured to test a first type of test case in the test cases corresponding to each of the capability items according to the preset scenario test question bank to obtain a first result, and determine a first score result corresponding to each of the first type of test cases according to the first result and a preset first expected result;

[0154] A second result determination unit is used to test the second type of test cases in the test cases corresponding to each of the capability items according to the preset scenario test question bank to obtain a second result, and determine the second score results corresponding to each of the second type of test cases according to the degree of conformity between the second result and a preset second expected result;

[0155] A level determination unit is used to grade the capability level of the NL2SQL system to be improved according to the first scoring result and the second scoring result to obtain capability level details; wherein the capability level details include: first level, second level, third level, fourth level, and fifth level.

[0156] In one embodiment, the method of dividing the capability level details includes: when the first type of test case and the second type of test case in the NL2SQL system to be improved have no score, determining the capability level details as the first level; when the score of the first type of test case reaches the preset first score requirement, and the second type of test case has no score, determining the capability level details as the second level; when the score of the first type of test case reaches the preset second score requirement, and the score of the second type of test case reaches the preset second score requirement, determining the capability level details as the third level; when the score of the first type of test case reaches the preset third score requirement, and the score of the second type of test case reaches the preset third score requirement, determining the capability level details as the fourth level; when the score of the first type of test case reaches the preset fourth score requirement, and the score of the second type of test case reaches the preset fourth score requirement, determining the capability level details as the fifth level;

[0157] Among them, the first level is lower than the second level, the second level is lower than the third level, the third level is lower than the fourth level, and the fourth level is lower than the fifth level; the preset first score requirement is lower than the preset second score requirement; the preset second score requirement is lower than the preset third score requirement; the preset third score requirement is lower than the preset fourth score requirement.

[0158] In one embodiment, the lifting matrix determination module 530 includes:

[0159] A selection unit, used to select, from the capability level details, non-compliant capability items whose capability levels do not meet the standards and compliant capability items whose capability levels meet the standards;

[0160] A first level determination unit is used for constructing a data set corresponding to the first target capability item for the unsatisfactory capability item, and adopting a preset mask learning method to perform knowledge injection to construct a capability improvement module matrix if the capability item that does not meet the standard belongs to the capability item of the first target capability item and the capability level detail is the first level;

[0161] A second level determination unit is used for constructing a capability improvement module matrix by using a supervised fine-tuning SFT method for concept alignment and a plug-in knowledge base if the capability item that fails to meet the standard belongs to the capability item of the first target capability item and the capability level detail is the second level;

[0162] A third level determination unit is used for constructing a capability improvement module matrix by performing formal alignment in a manner of indicating learning if the unsatisfactory capability item belongs to a capability item of the second target capability item and if the capability level detail is the third level;

[0163] A fourth level determination unit, configured to construct a capability improvement module matrix by a few-sample learning method, a fine-tuning method, or any one of the plug-in knowledge graphs if the unqualified capability item belongs to a capability item of the second target capability item and the capability level detail is the fourth level;

[0164] The fifth level determination unit is used for generating no capability enhancement module matrix for the capability item that meets the standard, or generating a capability enhancement module matrix for maintaining the capability.

[0165] In one embodiment, the lifting module 540 includes:

[0166] A category determination unit, used to determine whether each of the capability improvement tasks is of the same task improvement category;

[0167] a grouping unit, for: if yes, merging the capability improvement tasks of the same task improvement category for the first time to obtain a first merging result, selecting the best capability improvement task from the first merging result according to preset requirements for the second merging to obtain a second merging result, and grouping the target capability improvement tasks with the best target capability improvement results in the second merging result to obtain a target group combination after grouping;

[0168] Determine the unit, if not, do not merge.

[0169] In one embodiment, the lifting module 540 includes:

[0170] A sequence determination unit, used to obtain an execution sequence according to the execution dependency relationship between the target group combinations; wherein the dependency relationship includes: serial execution or parallel execution;

[0171] The scheduling unit is used to select one or at least two target group combinations for execution in the execution order according to whether the resources for executing the target group combinations are sufficient until all target group combinations are scheduled.

[0172] The NL2SQL system capability enhancement device provided in the embodiment of the present invention can execute the NL2SQL system capability enhancement processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0173] In one embodiment, Figure 6 A schematic diagram of the structure of an electronic device provided for an embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0174] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0175] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0176] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the NL2SQL system capability enhancement method.

[0177] In some embodiments, the NL2SQL system capability enhancement processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the NL2SQL system capability enhancement method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the NL2SQL system capability enhancement method in any other appropriate manner (e.g., by means of firmware).

[0178] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0179] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable NL2SQL system capability enhancement device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0180] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0181] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0182] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0183] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0184] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0185] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for improving the capability of an NL2SQL system, characterized in that: include: Determine the capability items required for the NL2SQL system to be improved in the target scenario from the pre-built capability indicator library; Perform capability level assessment on each capability item according to a preset scenario test question bank to obtain capability level details of the NL2SQL system to be improved; Determine the capability improvement module matrix corresponding to the capability item based on the capability level details; wherein each element in the capability improvement module matrix represents a capability improvement task of the corresponding capability item; the horizontal axis in the capability improvement module matrix represents the capability item of the NL2SQL system to be improved, and the vertical axis represents the task improvement category of the NL2SQL system to be improved; Based on the task improvement category to which each of the capability improvement tasks in the capability improvement module matrix belongs, the best target capability improvement tasks are selected for collective grouping, a target group combination after grouping is obtained, and the target group combination is scheduled to perform capability perception improvement on the NL2SQL system to be improved; Wherein, the determining of the capability improvement module matrix corresponding to the capability item based on the capability level details includes: Selecting, from the capability level details, the non-compliant capability items whose capability levels do not meet the standards and the compliant capability items whose capability levels meet the standards; For the unsatisfactory capability item, if the unsatisfactory capability item belongs to the capability item of the first target capability item, if the capability level detail is the first level, construct a data set corresponding to the first target capability item, and use a preset mask learning method to perform knowledge injection to construct a capability improvement module matrix; In the case where the unsatisfactory capability item belongs to the capability item of the first target capability item, if the capability level detail is the second level, a capability enhancement module matrix is ​​constructed by using any one of the supervised fine-tuning SFT method for concept alignment and the plug-in knowledge base; In the case where the unsatisfactory competency item belongs to the competency item of the second target competency item, if the competency level detail is the third level, a competency improvement module matrix is ​​constructed by means of form alignment through instruction learning; In the case where the unsatisfactory capability item belongs to the capability item of the second target capability item, if the capability level detail is the fourth level, a capability improvement module matrix is ​​constructed by a few-sample learning method, a fine-tuning method, or any one of the methods in the plug-in knowledge graph; For the above-mentioned qualified capability items, there is no need to generate a capability improvement module matrix, or a capability improvement module matrix for maintaining the capability is generated; Among them, the task improvement category to which each of the capability improvement tasks in the capability improvement module matrix belongs is selected based on the best target capability improvement tasks for collective grouping to obtain the target group combination after grouping, including: Determine whether each of the capability improvement tasks is of the same type of task improvement category; If so, the ability improvement tasks of the same task improvement category are merged for the first time to obtain a first merged result, and the best ability improvement task is selected from the first merged result according to the preset requirements for a second merge to obtain a second merged result, and the target ability improvement tasks with the best second merged result are grouped together to obtain a target group combination after grouping; wherein the preset requirements include: the ability improvement task with the largest difference in training corpus, or the ability improvement task with the most similar training corpus; If not, no merge is performed.

2. The method according to claim 1, characterized in that After the capability perception of the NL2SQL system to be improved is improved, the method further includes: Determine whether the NL2SQL system with enhanced capability perception meets the preset requirements of the target scenario; If satisfied, the target NL2SQL system is directly applied to the application scenario; If not, return to the step of determining the capability enhancement module matrix corresponding to the capability item based on the capability level details until the NL2SQL system with enhanced capability perception meets the preset requirements of the target scenario.

3. The method according to claim 1, characterized in that Each capability indicator in the capability indicator library corresponds to a corresponding indicator test case; The establishment of the capability index library includes: Using a preset keyword extraction algorithm to identify keywords in the first original document related to the NL2SQL system to be improved, and taking each of the keywords as a first candidate for the first capability item; wherein the preset keyword extraction algorithm includes: one of: a word frequency counting method, a part-of-speech tagging method, a named entity method, a word frequency-inverse document frequency TF-IDF method or a graph ranking method; Collect the second original document related to the NL2SQL system to be improved, extract the query statement and the corresponding structured query statement SQL in the second original document, find the logical features contained in the query statement and the corresponding structured query statement SQL, and use the logical features as the second candidate of the second capability item; The first candidate and the second candidate respectively form two categories, namely, the first target capability item and the second target capability item, thereby forming the capability index library; wherein, the first target capability item includes the first capability item; and the second target capability item includes the second capability item; The construction of the indicator test case includes: For each capability item belonging to the first target capability item category, a first type of test case in the form of the first category is constructed; for each capability item belonging to the second target capability item category, a second type of test case in the form of the second category is constructed; and the first type of test case and the second type of test case are placed in the capability indicator library.

4. The method according to claim 1, characterized in that: Determining the capability items required for the NL2SQL system to be improved in the target scenario from the pre-built capability indicator library includes: Obtain the historical log files stored in the target scenario by the NL2SQL system to be upgraded; A target range of capability items required in the target scenario is filtered out from the capability indicator library according to the historical log file, wherein the target range includes capability indicators corresponding to the capability items and indicator test cases corresponding to the capability indicators.

5. The method according to claim 1, characterized in that The capability level assessment is performed on each capability item according to the preset scenario test question bank to obtain the capability level details of the NL2SQL system to be improved, including: Testing the first type of test cases in the test cases corresponding to each of the capability items according to the preset scenario test question bank to obtain a first result, and determining a first score result corresponding to each of the first type of test cases according to the first result and a preset first expected result; Testing the second type of test cases in the test cases corresponding to each of the capability items according to the preset scenario test question bank to obtain a second result, and determining a second score result corresponding to each of the second type of test cases according to the degree of conformity between the second result and a preset second expected result; The capability level of the NL2SQL system to be improved is graded according to the first scoring result and the second scoring result to obtain capability level details; wherein the capability level details include: first level, second level, third level, fourth level, and fifth level.

6. The method according to claim 5, characterized in that The method of dividing the capability level details includes: when the first type of test case and the second type of test case in the NL2SQL system to be improved have no score, determining the capability level details as the first level; when the score of the first type of test case reaches the preset first score requirement, and the second type of test case has no score, determining the capability level details as the second level; when the score of the first type of test case reaches the preset second score requirement, and the score of the second type of test case reaches the preset second score requirement, determining the capability level details as the third level; when the score of the first type of test case reaches the preset third score requirement, and the score of the second type of test case reaches the preset third score requirement, determining the capability level details as the fourth level; when the score of the first type of test case reaches the preset fourth score requirement, and the score of the second type of test case reaches the preset fourth score requirement, determining the capability level details as the fifth level; Among them, the first level is lower than the second level, the second level is lower than the third level, the third level is lower than the fourth level, and the fourth level is lower than the fifth level; the preset first score requirement is lower than the preset second score requirement; the preset second score requirement is lower than the preset third score requirement; the preset third score requirement is lower than the preset fourth score requirement.

7. The method according to claim 1, characterized in that The scheduling of the target group combination includes: Obtaining an execution order according to the execution dependency relationship between each of the target group combinations; wherein the dependency relationship includes: serial execution or parallel execution; In the execution sequence, one or at least two target group combinations are selected for execution according to whether the resources for executing the target group combinations are sufficient until all target group combinations are scheduled.

8. A device for improving the capability of NL2SQL system, characterized in that: include: A capability item determination module is used to determine the capability items required for the NL2SQL system to be improved in the target scenario from a pre-built capability indicator library; A level detail determination module, used to evaluate the level of each capability item according to a preset scenario test question bank, so as to obtain the capability level details of the NL2SQL system to be improved; An improvement matrix determination module is used to determine the capability improvement module matrix corresponding to the capability item based on the capability level details; wherein each element in the capability improvement module matrix represents a capability improvement task of the corresponding capability item; the horizontal axis in the capability improvement module matrix represents the capability item of the NL2SQL system to be improved, and the vertical axis represents the capability improvement task category of the NL2SQL system to be improved; An improvement module, for selecting the best target capability improvement tasks for collective grouping based on the task improvement categories to which each capability improvement task belongs in the capability improvement module matrix, obtaining a target group combination after grouping, and scheduling the target group combination to improve the capability perception of the NL2SQL system to be improved; Among them, the lifting matrix determination module includes: A selection unit, used to select, from the capability level details, non-compliant capability items whose capability levels do not meet the standards and compliant capability items whose capability levels meet the standards; A first level determination unit is used for constructing a data set corresponding to the first target capability item for the unsatisfactory capability item, and adopting a preset mask learning method to perform knowledge injection to construct a capability improvement module matrix if the capability item that does not meet the standard belongs to the capability item of the first target capability item and the capability level detail is the first level; A second level determination unit is used for constructing a capability improvement module matrix by using a supervised fine-tuning SFT method for concept alignment and a plug-in knowledge base if the capability item that fails to meet the standard belongs to the capability item of the first target capability item and the capability level detail is the second level; A third level determination unit is used for constructing a capability improvement module matrix by performing formal alignment in a manner of indicating learning if the unsatisfactory capability item belongs to a capability item of the second target capability item and if the capability level detail is the third level; A fourth level determination unit, configured to construct a capability improvement module matrix by a few-sample learning method, a fine-tuning method, or any one of the plug-in knowledge graphs if the unqualified capability item belongs to a capability item of the second target capability item and the capability level detail is the fourth level; A fifth level determination unit is used for generating no capability enhancement module matrix for the capability item that meets the standard, or generating a capability enhancement module matrix for maintaining the capability; Among them, the upgrading module includes: A category determination unit, used to determine whether each of the capability improvement tasks is of the same task improvement category; A grouping unit, for: if yes, merging the capability improvement tasks of the same task improvement category for the first time to obtain a first merging result, and selecting the best capability improvement task from the first merging result according to preset requirements for a second merging to obtain a second merging result, and grouping the target capability improvement tasks with the best second merging result to obtain a target grouping combination after grouping; wherein the preset requirements include: the capability improvement task with the largest difference in training corpus, or the capability improvement task with the most similar training corpus; Determine the unit, if not, do not merge.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the NL2SQL system capability improvement method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the NL2SQL system capability improvement method according to any one of claims 1 to 7 when executed.