Insurance data extraction SQL (Structured Query Language) generation method

By adopting a large model-based method in the insurance industry, natural language query is converted into SQL query statements, the problem of complex and inefficient data extraction operations in the existing technology is solved, and more efficient and accurate data extraction is achieved.

CN120030033APending Publication Date: 2025-05-23CHINA LIFE INSURANCE CO LTD HEBEI BRANCH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411960892.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The prior art relies on professional SQL language writing in the data extraction process in the insurance industry, resulting in high operational complexity, low efficiency and poor accuracy.

Method used

Using a big model-based method, the user's natural language query is automatically converted into SQL query statements by defining insurance business scenario templates, natural language processing, SQL query condition generation, SQL optimization and other steps.

Benefits of technology

It reduces operational complexity, improves the efficiency and accuracy of data extraction, and is suitable for specific scenarios in the insurance industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120030033A_ABST
    Figure CN120030033A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of NL2SQL, and particularly relates to an insurance data extraction SQL language generation method, which designs a series of common insurance business scene templates, special natural language processing models and SQL generation rules (including insurance policy numbers, insurance slip numbers, names, identity card numbers and addresses of customers) aiming at specific scenes of the insurance industry. And desensitizing the name, the identity card number and the like of the salesman). An interactive interface is provided, a user is allowed to input data extraction requirements, company science and technology department personnel are allowed to modify and optimize generated SQL query statements, SQL query statements which do not meet requirements are regenerated by a system, and company science and technology department personnel are allowed to perform first-stage confirmation on query results; the user is allowed to finally confirm the query result, and the user experience is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of NL2SQL technology, and in particular is a method for generating SQL language for extracting insurance data. Background Art

[0002] In the insurance industry, data analysis and processing are crucial links. With the development of artificial intelligence technology, especially the emergence of large language models (LLM), it is possible to automatically generate SQL statements.

[0003] The purpose of the present invention is to provide a SQL language generation method for data extraction based on a large model and applicable to insurance scenarios. The method can convert the user's natural language query into an SQL query statement, thereby reducing the complexity of the operation and improving the efficiency and accuracy of data extraction.

[0004] Traditional data extraction methods rely on professional SQL language writing, which is not only time-consuming and laborious, but also requires users to have certain database knowledge and programming skills, which limits the rapid acquisition and analysis of data. Therefore, a method that can convert natural language into SQL query statements is needed to reduce the complexity of operations and improve the efficiency and accuracy of data extraction. In view of the above problems, a SQL language generation method for insurance data extraction is proposed. Summary of the invention

[0005] In order to make up for the deficiencies of the prior art and solve at least one technical problem raised in the background technology, the present invention proposes a method for generating SQL language for extracting insurance data.

[0006] The technical solution adopted by the present invention to solve the technical problem is: a method for generating SQL language for extracting insurance data described in the present invention comprises the following steps:

[0007] S1: Scenario template definition: define a series of insurance business scenario templates, each of which contains scenario description, relevant database tables and field information; and classify the scenarios according to channel, marketing, collection and development, group insurance and bancassurance business scenarios;

[0008] S2: User input: Users describe their data extraction requirements in natural language;

[0009] S3: Natural language processing: The system processes the received natural language and extracts key information;

[0010] S4: Query condition generation: Automatically generate SQL query conditions with a relatively uniform format based on the structured query conditions and scenario templates processed by natural language processing;

[0011] S5: Large model generation: Generate preliminary SQL query statements using the pre-trained large model combined with the SQL query conditions generated in the previous step and the existing table structure and related data in the Gaussian database;

[0012] S6: SQL optimization: By comparing the execution efficiency and result accuracy of different SQL statements, the system optimizes the generated SQL query statements, including but not limited to performance tuning and syntax checking;

[0013] S7: Execution and feedback: The system sends the optimized SQL query statement to the Gaussian database for execution, and feeds back the execution results to the user through an interactive graphical interface in the form of execl tables, bar charts, pie charts, etc., and logs the operations to the database.

[0014] Preferably, a similar scenario description in S1 is as follows: extracting the number of customers whose annual long-term insurance total premium is more than 6 million yuan in the past three years; the related database tables involved are: v_contract, v_branch.

[0015] Preferably, the user input proposed in S2 includes text input and voice input.

[0016] Preferably, the query conditions and contents in S3, including data table names, field names, etc., convert the user's natural language query requirements into structured query conditions.

[0017] Preferably, the S3 proposes to extract key information, generate corresponding data classifications through user description of requirements, and generate classification pages, so that users can select classifications by themselves and generate a specific interface.

[0018] Preferably, the classification page includes time, location, and personnel information.

[0019] Preferably, the operation log proposed in S7 is a user operation record, including user query information, filtered information, and the interface after system feedback, which are all recorded and uploaded to the background.

[0020] Beneficial effects of the present invention:

[0021] The present invention provides an insurance data extraction SQL language generation method. Aiming at the specific scenarios of the insurance industry, the method designs a series of common insurance business scenario templates, a special natural language processing model and SQL generation rules (including desensitizing the customer's policy number, application form number, name, ID number, address, and the salesperson's name, ID number, etc.).

[0022] Provide an interactive interface that allows users to input data extraction requirements, allows personnel in the company's science and technology department to modify and optimize the generated SQL query statements, regenerates the SQL query statements that do not meet the requirements by the system, allows personnel in the company's science and technology department to conduct the first-phase confirmation of the query results, and allows users to conduct the final confirmation of the query results, enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present invention, form a part of this application, and the schematic embodiments and descriptions thereof of the present invention are used to explain the present invention and do not constitute an improper limitation to the present invention.

[0024] In the drawings:

[0025] Figure 1 is the overall architecture diagram of the method of the present invention;

[0026] Figure 2 is the specific implementation flowchart of the user interaction interface of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0027] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0028] The following gives specific embodiments.

[0029] Please refer to Figure 1-Figure 2 , the present invention provides a method for generating an SQL language for insurance data extraction, including the following steps:

[0030] S1: Scenario template definition: Define a series of insurance business scenario templates, each template including scenario descriptions, relevant database tables and field information; and perform scenario classification, classifying according to channel, marketing, business expansion, group insurance and bancassurance business scenarios;

[0031] S2: User input: The user describes their data extraction requirements in natural language;

[0032] S3: Natural language processing: The system processes the received natural language and extracts key information;

[0033] S4: Query condition generation: Automatically generate relatively unified SQL query conditions according to the structured query conditions processed by natural language and the scenario templates;

[0034] S5: Large model generation: Use the pre-trained large model to combine the SQL query conditions generated in the previous step and the existing table structure and related data in the Gaussian database to generate preliminary SQL query statements;

[0035] S6: SQL optimization: By comparing the execution efficiency and result accuracy of different SQL statements, the system optimizes the generated SQL query statements, including but not limited to performance tuning and syntax checking;

[0036] S7: Execution and feedback: The system sends the optimized SQL query statement to the Gaussian database for execution, and feeds back the execution results to the user through an interactive graphical interface in the form of execl tables, bar charts, pie charts, etc., and logs the operations to the database.

[0037] Similar scenario description in S1: Extract the number of customers with annual long-term insurance total premium of more than 6 million yuan in the past three years; the relevant database tables involved are: v_contract, v_branch.

[0038] The user input proposed in S2 includes text input and voice input; for text input, users input their needs through the input method, the system extracts keywords, and judges the user's needs through the big data model combined with the input text. When the customer cannot use the input method for input, that is, when the customer has input needs for a long time, the system will push a prompt voice to remind the user that they can choose voice input, and at the same time flash the voice input icon to remind the customer the location of the voice input icon, so as to perform voice input. Due to the vast territory of my country, different regions have different dialects. When pre-training the large model, the dialects of different regions are connected for training at the same time, so that the system can recognize different dialects for the convenience of users in different regions.

[0039] The query conditions and content in S3, including the data table name, field name, etc., convert the user's natural language query requirements into structured query conditions.

[0040] S3 proposes to extract key information, generate corresponding data classifications through user description of requirements, and generate classification pages, allowing users to select categories and generate specific interfaces;

[0041] To generate a specific interface, such as searching for the number of users with a premium of XXX million yuan, the system will screen the database, and then generate a personnel table with a premium of XXX million yuan. The table contains the customer's daily information, such as name, gender, age, ID number (desensitized), marital status, insurance date and current address, etc. Based on this information, the system will produce some categories, including the same surname, same name, similar age, same place, same premium, etc., for a total of user queries.

[0042] The classification page includes time, location, and personnel information;

[0043] The time is the current residential address of the insured person; the time is from the insured person's first insurance participation to the expiration date of the insurance; the personal information is the person's specific information, including name, age, gender, education level and marital status.

[0044] The operation log proposed in S7 is a record of user operations, including user query information, filtered information, and the interface after system feedback, which are all recorded and uploaded to the background.

[0045] Working principle:

[0046] Step 1. Scenario template definition: define a series of insurance business scenario templates, each of which contains scenario description, relevant database tables and field information; and classify scenarios by channel (marketing, collection and development, group insurance, bancassurance), business scenario, etc.

[0047] Similar to "Scenario description: Extract the number of customers (people) with annual long-term insurance premiums of more than 6 million yuan in the past three years; the relevant database tables involved are: v_contract, v_branch;

[0048] Field information: customer’s city, county, customer ID number (de-sensitized), insurance enrollment date, total long-term insurance premium.

[0049] Step 2. User input: The user describes his / her data extraction requirements in natural language;

[0050] For example, "Please retrieve the number of customers (people) in a certain province whose total long-term insurance premiums were more than 3 million yuan in the past three years."

[0051] Step 3. Natural language processing: The system processes the received natural language and extracts key information;

[0052] Such as the query conditions and content, the data table names and field names involved, etc., converting the user's natural language query requirements into structured query conditions;

[0053] For example, "in the past three years", "long-term insurance", "total premium of 3 million yuan", "number of customers", etc.

[0054] Step 4. Query condition generation: Based on the structured query conditions and scenario templates processed by natural language processing, SQL query conditions with a relatively uniform format are automatically generated.

[0055] Step 5. Large model generation: Use the pre-trained large model to combine the SQL query conditions generated in the previous step and the existing table structure and related data in the Gaussian database to generate preliminary SQL query statements.

[0056] Step 6. SQL optimization: By comparing the execution efficiency and result accuracy of different SQL statements, the system optimizes the generated SQL query statements, including but not limited to performance tuning, syntax checking, etc.

[0057] Step 7. Execution and feedback: The system sends the optimized SQL query statement to the Gaussian database for execution, and feeds back the execution results to the user through an interactive graphical interface in the form of execl tables, bar charts, pie charts, etc.

[0058] Aiming at the specific scenarios in the insurance industry, this method designs a series of common insurance business scenario templates (mentioned in step 1 above), a special natural language processing model (mentioned in step 3 above) and SQL generation rules (including desensitizing the customer's policy number, application number, name, ID number, address, and the salesperson's name, ID number, etc.).

[0059] Provide an interactive interface that allows users to input data extraction requirements, allow the company's technology department personnel to modify and optimize the generated SQL query statements, and allow the system to regenerate SQL query statements that do not meet the requirements. It also allows the company's technology department personnel to perform the first stage confirmation of the query results and allows users to make the final confirmation of the query results, thereby enhancing the user experience.

[0060] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.

Claims

1. A method for generating SQL language for insurance data extraction, characterized in that: The following steps are involved: S1: Scenario template definition: define a series of insurance business scenario templates, each of which contains scenario description, relevant database tables and field information; and classify the scenarios according to channel, marketing, collection and development, group insurance and bancassurance business scenarios; S2: User input: Users describe their data extraction requirements in natural language; S3: Natural language processing: The system processes the received natural language and extracts key information; S4: Query condition generation: Automatically generate SQL query conditions with a relatively uniform format based on the structured query conditions and scenario templates processed by natural language processing; S5: Large model generation: Use the pre-trained large model to combine the SQL query conditions generated in the previous step and the existing table structure and related data in the Gaussian database to generate preliminary SQL query statements; S6: SQL optimization: By comparing the execution efficiency and result accuracy of different SQL statements, the system optimizes the generated SQL query statements, including but not limited to performance tuning and syntax checking; S7: Execution and feedback: The system sends the optimized SQL query statement to the Gaussian database for execution, and feeds back the execution results to the user through an interactive graphical interface in the form of execl tables, bar charts, pie charts, etc., and logs the operations to the database.

2. The method for generating SQL language for extracting insurance data according to claim 1, characterized in that: A similar scenario description in S1 is as follows: extract the number of customers whose annual long-term insurance total premium is more than 6 million yuan in the past three years; the related database tables involved are: v_contract, v_branch.

3. The method for generating SQL language for extracting insurance data according to claim 1, characterized in that: The user input proposed in S2 includes text input and voice input.

4. The method for generating SQL language for extracting insurance data according to claim 1, characterized in that: The query conditions and contents in S3, including the data table names, field names, etc., convert the user's natural language query requirements into structured query conditions.

5. The method for generating SQL language for extracting insurance data according to claim 1, characterized in that: The S3 proposes to extract key information, generate corresponding data classifications through user description of requirements, and generate classification pages, so that users can select classifications by themselves and generate specific interfaces.

6. The method for generating SQL language for extracting insurance data according to claim 5, characterized in that: The classification page includes time, location, and personnel information.

7. The method for generating SQL language for extracting insurance data according to claim 1, characterized in that: The operation log proposed in S7 is a user operation record, including user query information, filtered information, and the interface after system feedback, which are all recorded and uploaded to the background.