Template generation method and device, equipment, storage medium and product
By obtaining sample data and using a general big model to generate template description information and search information, the problem of low accuracy of SQL code generation in the banking field is solved, the number collection efficiency and accuracy are improved, and the reliability of the code template is ensured.
Patent Information
- Application Number
- CN202411544031.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-03-14
AI Technical Summary
The accuracy of the existing technology in generating SQL code in specific fields of banks is not high, resulting in inefficient number collection and difficult to adapt to the number collection requirements in various scenarios.
By obtaining the requirements information and query code in the sample data, using a general big model for semantic understanding, obtaining template description information, and obtaining the search information through matching to generate code templates.
It improves the accuracy of data retrieval and positioning, improves the efficiency and accuracy of generating query statements, and ensures the reliability of the code template and the reliability of subsequently generated query statements.
Smart Images

Figure CN119621757A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of database technology, and in particular to a template generation method, device, equipment, storage medium and product. Background Art
[0002] In related technologies, due to business needs, the database needs to support temporary data retrieval needs such as customer complaints and business analysis. Data developers will write Structured Query Language (SQL) code and execute it in the database to provide data to the business department.
[0003] There are a lot of repeated demands in daily data retrieval. To improve query efficiency, a large model has been developed to generate corresponding SQL codes based on demand, such as text-to-SQL code conversion technology (Text-To-SQL). However, there are many banking businesses involving many database tables. The current large model has a low accuracy rate in generating SQL codes in specific banking fields, resulting in low data retrieval efficiency and difficulty in adapting to data retrieval needs in various scenarios.
[0004] Therefore, how to improve the efficiency and accuracy of data acquisition is a problem that needs to be solved urgently. Summary of the invention
[0005] The main purpose of this application is to provide a template generation method, device, equipment, storage medium and product, aiming to solve the technical problem of how to improve the efficiency and accuracy of data acquisition.
[0006] To achieve the above purpose, the present application proposes a template generation method, which includes: Acquire sample data, the sample data including demand information and a query code corresponding to the demand information, the demand information is determined according to the historical data acquisition demand of the business, and the query code is used to acquire corresponding data in the database; Perform semantic understanding on the demand information and the query code through a general large model to obtain template description information; Obtaining search information corresponding to the template description information through general large model matching, wherein the search information is used to characterize the data source of the sample data in the database and the data usage of the sample data; A code template is generated based on the template description information and the search information.
[0007] In some embodiments, the semantic understanding of the demand information and the query code by using a general macro model to obtain template description information includes: Through the universal large model, semantic understanding is performed on the demand information and query code in each sample data to obtain multiple keywords; A set of keywords included in each sample data is determined as the template description information.
[0008] In some embodiments, the template description information includes a table name and a field name; the retrieval information corresponding to the template description information obtained by matching the general large model includes: Through the universal big model, in the preset knowledge base, based on the table name and field name in the template description information, the corresponding business knowledge and structural knowledge are matched as the retrieval information; wherein, the business knowledge is used to describe the data usage of the table and / or field, and the structural knowledge is used to describe the connection relationship between tables.
[0009] In some embodiments, generating a code template based on the template description information and the search information includes: The template description information and the search information are spliced according to the query template of the general large model to form a query statement consisting of a target field, a target table, a query path and a query condition; The query statement is input into the general big model, and a statement conversion model is called by the general big model to generate a code template, wherein the statement conversion model is used to convert the query statement into a corresponding query code.
[0010] In some embodiments, after obtaining the sample data, the method further includes: Splitting the sample data into multiple data groups, each data group corresponding to a demand category; For each data group corresponding to the requirement category, the steps of performing semantic understanding of the requirement information and the query code through a universal big model, obtaining template description information, obtaining retrieval information corresponding to the template description information through universal big model matching, and generating a code template based on the template description information and the retrieval information are performed to obtain a code template corresponding to each requirement category.
[0011] In some embodiments, after generating the code template based on the template description information and the search information, the method further includes: In response to receiving the new demand information, obtaining a target demand category corresponding to the new demand information; Based on the target requirement category, obtaining a corresponding target code template; Generate a query statement based on the target code template and the new requirement information; The query statement is used to perform a query operation in the database to obtain target data.
[0012] In addition, to achieve the above purpose, the present application also proposes a template generation device, the template generation device comprising: A data acquisition module, used to acquire sample data, wherein the sample data includes demand information and a query code corresponding to the demand information, wherein the demand information is determined according to the historical data acquisition requirements of the business, and the query code is used to acquire corresponding data in the database; A first information acquisition module is used to perform semantic understanding on the demand information and the query code through a general large model to acquire template description information; A second information acquisition module is used to obtain search information corresponding to the template description information through general large model matching, wherein the search information is used to characterize the data source of the sample data in the database and the data usage of the sample data; The template generation module is used to generate a code template based on the template description information and the search information.
[0013] In addition, to achieve the above objectives, the present application also proposes a template generation device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the template generation method described above.
[0014] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the template generation method described above are implemented.
[0015] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the template generation method described above are implemented.
[0016] One or more technical solutions proposed in this application have at least the following technical effects: The general large model is used to understand the semantics of the demand information and query code in the sample data, obtain the template description information, and then match the general large model to obtain the retrieval information corresponding to the template description information, thereby improving the accuracy of data retrieval positioning; based on more accurate retrieval information, a code template is generated based on the template description information and the retrieval information, so that whenever a data acquisition demand is received in the future, the corresponding code template can be directly used to generate a query statement. Compared with related technologies, the generation efficiency of query statements based on code templates is higher. In addition, since the code template is generated based on sample data in advance and has sufficient historical template support, the reliability of the code template can be guaranteed, thereby ensuring the reliability of the query statement generated subsequently. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 A schematic diagram of a template making process in a related technology provided by an exemplary embodiment of the present application is shown; Figure 2 A schematic diagram of a process flow of a template generation method provided in an embodiment of the present application is shown; Figure 3 A schematic diagram of a process flow of a template generation method provided by another embodiment of the present application is shown; Figure 4 A schematic diagram of the structure of a template generating device provided in an embodiment of the present application is shown; Figure 5 A schematic diagram of the structure of a template generation device provided in an embodiment of the present application is shown.
[0020] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0021] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0022] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0023] The main solution of the embodiment of the present application is: obtaining sample data, the sample data includes demand information and a query code corresponding to the demand information, the demand information is determined according to the historical data acquisition requirements of the business, and the query code is used to obtain the corresponding data in the database; semantically understanding the demand information and the query code through a general big model to obtain template description information; obtaining retrieval information corresponding to the template description information through matching with the general big model, the retrieval information is used to characterize the data source of the sample data in the database and the data purpose of the sample data; generating a code template based on the template description information and the retrieval information.
[0024] In related technologies, due to business needs, data warehouses need to support temporary data retrieval needs such as customer complaints and business analysis. Data developers will write SQL codes to execute in the database and provide data to the business. There are a large number of repeated requirements in daily data retrieval. In order to improve query efficiency, a large model has been developed to generate corresponding SQL codes based on requirements, such as Text-To-SQL technology. However, the accuracy of Text-To-SQL technology is not high in banking business, because the table items involved in banking business are complicated and the relationship between tables is also relatively complex.
[0025] Based on this, data developers currently manually solidify the SQL codes corresponding to historical data acquisition requirements as data acquisition templates, which are reused when the same data acquisition requirements appear again in the future. Figure 1 As shown, data developers analyze historical data retrieval requirements, combine daily data retrieval experience and banking business knowledge to configure repeated data retrieval requirements into templates and publish them to users.
[0026] However, developing templates based on manual analysis has obvious disadvantages: ① The threshold is high. Developers need to have complete business knowledge and data asset reserves, as well as a lot of experience in data acquisition. ② It takes a long time. Data developers need to manually analyze a large number of requirements, summarize the requirements, write code to verify them, and then implement them into templates, which takes a long time. ③ Manually configured templates cannot cover all repeated requirements. Due to the large number of temporary data acquisition requirements, manual analysis will pay more attention to the data acquisition requirements with large amounts of repetition, and fewer repetitive requirements will be ignored.
[0027] In summary, how to improve the efficiency and accuracy of data acquisition is a problem that needs to be solved urgently.
[0028] Based on this, the present application provides a solution to generate a reliable code template through a general large model, so that the query statements generated by the subsequent calls to the code template are efficient and accurate.
[0029] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a template generation device capable of realizing the above functions, etc. The following takes the template generation device as an example to illustrate this embodiment and the following embodiments.
[0030] Reference Figure 2 , Figure 2 The schematic diagram of the process of the template generation method provided by an embodiment of the present application is shown. The template generation method can be applied to a template generation device, and includes the following steps S110 to S140: Step S110, obtaining sample data.
[0031] The sample data includes demand information and a query code corresponding to the demand information. The demand information is determined according to the historical data acquisition requirements of the business, and the query code is used to obtain corresponding data in the database.
[0032] Demand information refers to instructions issued by users (including customers or staff) to achieve specified purposes. For example, demand information can be "query customer's fund transaction information based on customer information" or "query customer's deposit information based on customer information". It is understandable that the specific terms included in the demand information can be stored in the bank's database system. For example, customer information, fund transaction information, and deposit information can all be stored in the database in the form of a table (or an item in a table), and are interrelated.
[0033] Since the data acquisition requirements described in the embodiments of the present application refer to query operations, it is necessary to use the specified language of the database (i.e., query code) to perform query operations in the database to obtain specified data. The query code refers to the SQL code mentioned above, i.e., structured query language, which is a programming language specifically used to manage relational database systems. Through SQL code, users can perform various database operations, such as querying, inserting, updating, and deleting data, as well as creating and managing database objects, such as tables, indexes, views, stored procedures, and triggers.
[0034] In some embodiments, during the normal operation of the bank's business system, each time a data retrieval demand is completed, the demand information corresponding to the current data retrieval demand and the corresponding query code (i.e., the SQL statement in the above text) are saved to the local database or server and associated to form a record of historical data retrieval demands.
[0035] The sample data may be a part of the historical demand data, for example, a part of the historical demand data within a set time range. The set time range may be the latest month or the latest six months, etc., which is not limited in this embodiment.
[0036] Step S120: semantically understand the demand information and the query code through a general large model to obtain template description information.
[0037] Among them, the general large model refers to a model that has been pre-trained with business rules.
[0038] Since banks have many data collection needs and the sample data volume is huge, it is difficult to input it into a general large model at one time to execute subsequent steps. Therefore, in some implementations, the sample data can be classified according to the set classification strategy, and subsequent steps can be executed for each category.
[0039] In some implementations, during the normal operation of the banking business system, each time a data acquisition requirement is completed, the requirement category corresponding to the current data acquisition requirement can also be recorded, and the requirement category can be recorded in the historical data acquisition requirement. The requirement category can be obtained according to a set classification strategy, and the set classification strategy can be based on business classification. For example, the business classification can include "retail customer fund transactions", "corporate customer bill transactions", etc., which is not limited in this embodiment.
[0040] In some implementations, the general big model may be pre-trained. Specifically, the historical data acquisition requirements may be input into the general big model in batches to train the general big model, so that the general big model can predict the corresponding demand category based on the input demand information and query code.
[0041] After the training is completed, the sample data can be input into the general large model. The general large model splits the sample data into multiple data groups by predicting the demand category, and each data group corresponds to a demand category.
[0042] It is understandable that different demand categories correspond to different business classifications, that is, the data acquisition targets they require may be different. Therefore, classifying the sample data and executing the subsequent steps for each demand category can not only ensure that the data volume of the data group can be smoothly input into the general large model for subsequent analysis, but also configure the corresponding code template for each business classification separately, thereby improving the accuracy of subsequent SQL statement generation.
[0043] For ease of understanding, the following specific descriptions of step S120 to step S140 are all specific descriptions performed for any demand category.
[0044] In some implementations, a semantic understanding is performed on the demand information and query code in each sample data through a general large model to obtain multiple keywords; a set of keywords contained in each sample data is determined as template description information.
[0045] Specifically, the general large model may include a language large model, such as a BERT model. The BERT model is used to perform semantic understanding of the demand information and query code, thereby extracting the field name and table name (i.e., keywords) in each sample data. The common field names and table names are determined as template description information.
[0046] For example, in the sample data group corresponding to the business type of "retail customer fund transactions", customer information is a common field name, table_a and table_b are common table names, and customer information, table_a, and table_b can be determined as template description information of the sample data group corresponding to the business type of "retail customer fund transactions".
[0047] Step S130, obtaining search information corresponding to the template description information through universal large model matching.
[0048] In some implementations, a general large model can be used to match corresponding business knowledge and structural knowledge in a preset knowledge base based on the table name and field name in the template description information as the retrieval information.
[0049] Among them, business knowledge is used to describe the data usage of tables and / or fields, and structural knowledge is used to describe the connection relationship between tables. It can be understood that a preset knowledge base is pre-set in the database, which contains the business knowledge and structural knowledge of the entire database and business system. Business knowledge can be specifically understood as an introduction to basic business according to different preset classification levels, such as what data a certain business category needs to query, and in which tables / fields these data are stored. Structural knowledge can be specifically understood as the connection between tables and tables, and between tables and fields.
[0050] The table name and field name are analyzed through the general big model to determine the business type to which they belong, so that the corresponding business knowledge can be retrieved in the preset knowledge base; at the same time, the location and search path of the data to be found can be determined according to the table name and field name, that is, the corresponding structural knowledge can be retrieved in the preset knowledge base.
[0051] Step S140: Generate a code template based on the template description information and the search information.
[0052] Since the code template should be a template of an SQL statement, in some implementations, an SQLCode model may be used to generate an SQL statement.
[0053] However, the SQLCode model requires a complete description statement containing semantic information as input before it can output the corresponding SQL statement. Therefore, in some implementations, the description information can be combined with the search information so that it can be correctly called by the SQLCode model.
[0054] Specifically, the template description information and the retrieval information can be spliced according to the query template of the general big model to form a query statement consisting of the target field, target table, query path and query conditions; the query statement is input into the general big model, and the statement conversion model (i.e., SQLCode model) is called by the general big model to generate a code template. The statement conversion model is used to convert the query statement into the corresponding query code.
[0055] The query template is the input format specification of the SQLCode model. The template description information (including field names and table names) and the search information (including business knowledge and structural knowledge) are input into the general big model, so that the general big model can perform natural language splicing on the template description information and the search information to generate a complete query statement containing semantic information, wherein the query statement contains the target field, target table, query path and query conditions. The query condition can contain semantic information to realize the concatenation of the target field, target table and query path.
[0056] For example, the target fields may include: customer information, fund product information, transaction time, and transaction amount; the target table may include a customer information table and a transaction information table; the query path may include querying customer information through the customer information table, and querying fund product information, transaction time, and transaction amount through the transaction information table; the query condition may be to obtain only data within one month in the transaction information table. A complete query statement can be constructed with the above information.
[0057] After obtaining the query statement, the SQLCode model can be called through the general large model so that SQLCode automatically outputs the corresponding SQL code according to the query statement, which can be used as a code template corresponding to the current demand category.
[0058] This embodiment provides a template generation method, which uses a general large model to semantically understand the demand information and query code in the sample data, obtains the template description information, and then matches the general large model to obtain the retrieval information corresponding to the template description information, thereby improving the accuracy of data retrieval positioning; based on more accurate retrieval information, a code template is generated based on the template description information and the retrieval information, so that whenever a data acquisition demand is received in the future, the corresponding code template can be directly used to generate a query statement. Compared with related technologies, the generation efficiency of query statements based on code templates is higher. In addition, since the code template is generated based on the sample data in advance and has sufficient historical template support, the reliability of the code template can be guaranteed, thereby ensuring the reliability of the query statement generated subsequently. In addition, setting a code template for each demand category can further ensure the accuracy of SQL statement generation and improve data query efficiency.
[0059] Reference Figure 3 In some implementations, the template generation method may further include the following steps S210 to S240 in the business application stage: Step S210, in response to receiving the new demand information, obtaining a target demand category corresponding to the new demand information.
[0060] The new demand information may be a data acquisition demand input by a user (customer or staff). After the new demand information is obtained, the new demand information may be input into the general large model as described in step S120 to predict the target demand category corresponding to the new demand information.
[0061] Step S220, based on the target requirement category, obtain the corresponding target code template.
[0062] Since a corresponding code template is configured for each requirement category through the above steps S110 to S140, after obtaining the target requirement category, it can be determined whether there is a code template corresponding to the target requirement category.
[0063] If there is a code template corresponding to the target requirement category, the code template may be determined as a target code template, and the subsequent step S230 is performed.
[0064] If there is no code template corresponding to the target requirement category, you can directly generate the SQL code corresponding to the new requirement information based on other methods (such as using the Text-To-SQL method), and record the new requirement information, the final generated SQL code, and the target requirement category.
[0065] In addition, a number threshold can also be set. If the number of demand information recorded in the target demand category reaches the number threshold, steps S110 to S140 can be executed for the target demand category to configure a code template for the target demand category to facilitate subsequent business data acquisition for the target demand category.
[0066] Step S230: Generate a query statement based on the target code template and the new requirement information.
[0067] Step S240: Use a query statement to perform a query operation in the database to obtain target data.
[0068] In some implementations, the new requirement information may include a specified field or table name. By filling the specified field or table name into a specific part of the target code template, a complete SQL code may be formed.
[0069] You can call the complete SQL code to quickly search for data based on the query logic preset in the target code template.
[0070] This application also provides a template generation device, please refer to Figure 4 , the template generating device 100 comprises: The data acquisition module 110 is used to acquire sample data, wherein the sample data includes demand information and a query code corresponding to the demand information, wherein the demand information is determined according to the historical data acquisition demand of the business, and the query code is used to acquire corresponding data in the database; A first information acquisition module 120 is used to perform semantic understanding on the demand information and the query code through a general large model to acquire template description information; The second information acquisition module 130 is used to obtain the search information corresponding to the template description information through general large model matching, and the search information is used to characterize the data source of the sample data in the database and the data usage of the sample data; The template generating module 140 is used to generate a code template based on the template description information and the search information.
[0071] The template generation device 100 provided in the present application adopts the template generation method in the above embodiment, which can solve the technical problem of how to improve the efficiency and accuracy of data acquisition. Compared with the related art, the beneficial effects of the template generation device 100 provided in the present application are the same as the beneficial effects of the template generation method provided in the above embodiment, and the other technical features in the template generation device 100 are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0072] The present application provides a template generation device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the template generation method in the above-mentioned embodiment 1.
[0073] Reference below Figure 5 , which shows a schematic diagram of the structure of a template generation device suitable for implementing the embodiments of the present application. The template generation device in the embodiments of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The template generation device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0074] like Figure 5As shown, the template generation device 200 may include a processing device 210 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 220 or a program loaded from a storage device 230 to a random access memory (RAM: Random Access Memory) 240. In RAM240, various programs and data required for the operation of the template generation device are also stored. The processing device 210, ROM220 and RAM240 are connected to each other through a bus 250. An input / output (I / O) interface 260 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 260: an input device 270 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 280 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 230 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 290. The communication device 290 can allow the template generation device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a template generation device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0075] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device, or installed from the storage device 230, or installed from the ROM 220. When the computer program is executed by the processing device 210, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0076] The template generation device provided by the present application adopts the template generation method in the above embodiment, which can solve the technical problem of how to improve the efficiency and accuracy of data acquisition. Compared with the related art, the beneficial effects of the template generation device provided by the present application are the same as the beneficial effects of the template generation method provided by the above embodiment, and the other technical features in the template generation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0077] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0078] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0079] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the template generation method in the above-mentioned embodiment.
[0080] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0081] The computer-readable storage medium may be included in the template generating device; or may exist independently without being assembled into the template generating device.
[0082] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the template generation device, the template generation device can write computer program codes for performing the operations of the present application in one or more programming languages or a combination thereof. The programming languages include object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0083] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0084] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0085] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned template generation method, and can solve the technical problem of how to improve the efficiency and accuracy of data acquisition. Compared with the related art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the template generation method provided in the above-mentioned embodiment, and will not be repeated here.
[0086] The present application also provides a computer program product, including a computer program, which implements the steps of the template generation method as described above when executed by a processor.
[0087] The computer program product provided by this application can solve the technical problem of how to improve the efficiency and accuracy of data acquisition. Compared with the related art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the template generation method provided by the above embodiment, which will not be repeated here.
[0088] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A template generation method, characterized in that: The template generation method comprises: Acquire sample data, the sample data including demand information and a query code corresponding to the demand information, the demand information is determined according to the historical data acquisition demand of the business, and the query code is used to acquire corresponding data in the database; Perform semantic understanding on the demand information and the query code through a general large model to obtain template description information; Obtaining search information corresponding to the template description information through general large model matching, wherein the search information is used to characterize the data source of the sample data in the database and the data usage of the sample data; A code template is generated based on the template description information and the search information.
2. The template generation method according to claim 1, characterized in that: The semantic understanding of the demand information and the query code by using a general large model to obtain template description information includes: Through the universal large model, semantic understanding is performed on the demand information and query code in each sample data to obtain multiple keywords; A set of keywords included in each sample data is determined as the template description information.
3. The template generation method according to claim 2, characterized in that: The template description information includes table name and field name; The retrieval information corresponding to the template description information is obtained by matching the universal large model, including: Through the universal big model, in the preset knowledge base, based on the table name and field name in the template description information, the corresponding business knowledge and structural knowledge are matched as the retrieval information; wherein, the business knowledge is used to describe the data usage of the table and / or field, and the structural knowledge is used to describe the connection relationship between tables.
4. The template generation method according to claim 3, characterized in that: The generating a code template based on the template description information and the search information includes: The template description information and the search information are spliced according to the query template of the general large model to form a query statement consisting of a target field, a target table, a query path and a query condition; The query statement is input into the general big model, and a statement conversion model is called by the general big model to generate a code template, wherein the statement conversion model is used to convert the query statement into a corresponding query code.
5. The template generation method according to any one of claims 1 to 4, characterized in that: After obtaining the sample data, the method further includes: Splitting the sample data into multiple data groups, each data group corresponding to a demand category; For each data group corresponding to the requirement category, the steps of performing semantic understanding of the requirement information and the query code through a universal big model, obtaining template description information, obtaining retrieval information corresponding to the template description information through universal big model matching, and generating a code template based on the template description information and the retrieval information are performed to obtain a code template corresponding to each requirement category.
6. The template generation method according to claim 5, characterized in that: After generating the code template based on the template description information and the search information, the method further includes: In response to receiving the new demand information, obtaining a target demand category corresponding to the new demand information; Based on the target requirement category, obtaining a corresponding target code template; Generate a query statement based on the target code template and the new requirement information; The query statement is used to perform a query operation in the database to obtain target data.
7. A template generating device, characterized in that: The template generating device comprises: A data acquisition module, used to acquire sample data, wherein the sample data includes demand information and a query code corresponding to the demand information, wherein the demand information is determined according to the historical data acquisition requirements of the business, and the query code is used to acquire corresponding data in the database; A first information acquisition module is used to perform semantic understanding on the demand information and the query code through a general large model to acquire template description information; A second information acquisition module is used to obtain search information corresponding to the template description information through general large model matching, wherein the search information is used to characterize the data source of the sample data in the database and the data usage of the sample data; The template generation module is used to generate a code template based on the template description information and the search information.
8. A template generating device, characterized in that: The template generating device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the template generating method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the template generation method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the template generation method according to any one of claims 1 to 6 are implemented.