Government affair data query method and device, electronic equipment and storage medium

Through a large language model, the government data query technology is used to identify intentions and match vectors, and SQL statements are generated, which solves the problems of high costs, inaccurate query results and slow response in the existing technology, and achieves fast and accurate government data query, which reduces labor costs and improves the system response speed.

CN120508566APending Publication Date: 2025-08-19CHINA MOBILE GROUP SHANDONG +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510523832.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-24
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

The existing government data query technology has high costs, inaccurate query results and slow response. It is mainly because the construction of knowledge vectors depends on the high cost of standardization and vectorization of data, frequent updates of government data, and some solutions rely too much on data table structure information, resulting in irregular naming or inability to accurately reflect the meaning of the data, which affects the accuracy and efficiency of query statement generation.

Method used

The pre-trained large language model uses the intention to identify the problem statements entered by the user, match the indicator radius vector in the government index vector library, generate SQL statements that conform to SQL syntax, query the target data in the government database, avoid the need to update government data frequently, reduce labor costs, and use prompt word engineering to constrain the output of the large language model, avoiding the vector splicing exceeding the input length limit.

Benefits of technology

It realizes fast and accurate government data query, eliminates indicator ambiguity, improves the accuracy of query results and system response speed, saves labor costs, and improves the efficiency and accuracy of government data query.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508566A_ABST
    Figure CN120508566A_ABST
Patent Text Reader

Abstract

The invention discloses a government affair data query method and device, electronic equipment and a storage medium, and is used for solving the problems of relatively high cost, inaccurate query result and relatively slow response of a related government affair data query technology. The method comprises the steps of obtaining a question statement input by a user; performing intention recognition on the question statement based on a pre-trained large language model to obtain a recognition result; under the condition that it is determined that data of government affair indexes need to be queried in a government affair database according to the recognition result, matching corresponding index aperture vectors in a preset government affair index vector library based on the question statements, and determining query index vectors corresponding to the index aperture vectors; wherein the query index vector and a plurality of index aperture vectors corresponding to the query index vector are stored in a government affair index vector library in an associated manner; and through a large language model, according to the query index vector and a preset prompt word project, generating an SQL statement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of natural language processing technology, and specifically relates to a government data query method, device, electronic device and storage medium. Background Art

[0002] With the rapid development of information technology, government services are constantly striving for higher efficiency, more accurate decision-making, and a better public service experience. In today's digital age, vast amounts of data are constantly being generated and accumulated in the government sector. Accessing this data often relies on manually written database query commands or indicator query scripts, which is inefficient and requires high technical skills from government personnel. This limits the government's internal data analysis and decision support efficiency, as well as its external data responsiveness. Large Language Models (LLMs), a powerful natural language processing (NLP) technology, not only demonstrate exceptional capabilities in language understanding, generation, and knowledge reasoning, but also show strong potential in code generation areas such as Structured Query Language (SQL). Their introduction into the government sector is expected to revolutionize traditional government intelligent question-and-answer methods, providing efficient intelligent question-and-answer services for government officials and the public.

[0003] However, existing government data query methods primarily achieve intelligent query functionality by converting database information into knowledge vectors and combining them with user questions to generate prompts, or by matching vectorized user questions with data table structure information to generate prompts, or by splicing the vectorized database information and user questions into a large model to generate answers. These methods offer certain advantages in improving query accuracy and timeliness. However, these methods have several drawbacks: First, the construction of knowledge vectors relies on data standardization and vectorization management, requiring high technical skills from database administrators. Furthermore, frequent government data updates significantly increase knowledge base maintenance costs. Second, some solutions overly rely on data table structure information. If naming is not standardized or does not accurately reflect the data's meaning, coupled with the fact that government personnel often do not use highly specialized terminology when performing query operations, this can affect the accuracy of matching and query generation. Finally, splicing vectors into a large model may exceed input length limits, reducing system response efficiency.

[0004] In other words, relevant government data query technologies have problems such as high costs, inaccurate query results or slow responses. Summary of the Invention

[0005] The embodiments of the present application provide a government data query method, device, electronic device and storage medium, which can solve the problems of related government data query technologies, such as high cost, inaccurate query results and slow response.

[0006] In a first aspect, an embodiment of the present application provides a government data query method, the method comprising: obtaining a question statement input by a user; performing intent recognition on the question statement based on a pre-trained large language model to obtain a recognition result; when it is determined according to the recognition result that it is necessary to query data of government indicators in a government database, based on the question statement, matching corresponding indicator scope dimensions in a preset government indicator vector library, and determining a query indicator vector corresponding to the indicator scope dimension; wherein the query indicator vector and its corresponding multiple indicator scope dimensions are associated with the government indicator vector library; the query indicator vector is determined based on the storage field of the government indicator in the government database; the multiple indicator scope dimensions are related to the government indicators in multiple expressions; through the large language model, an SQL statement is generated according to the query indicator vector and a preset prompt word project; wherein the SQL statement is used to query the government database to obtain the target data corresponding to the question statement; the prompt word project is used to enable the large language model to generate the SQL statement that conforms to the SQL grammar.

[0007] In a second aspect, an embodiment of the present application provides a government data query device, the device comprising: an acquisition module for acquiring a question statement input by a user; an intent recognition module for performing intent recognition on the question statement based on a pre-trained large language model to obtain a recognition result; a vector matching module for matching corresponding indicator scope dimensions in a preset government indicator vector library based on the question statement when it is determined according to the recognition result that data of government indicators needs to be queried in a government database, and determining a query indicator vector corresponding to the indicator scope dimension; wherein the query indicator vector is associated with a plurality of the indicator scope dimensions corresponding to it and is stored in the government indicator vector library; the query indicator vector is determined based on the storage field of the government indicator in the government database; the plurality of indicator scope dimensions are related to the government indicators in multiple expressions; an SQL generation module for generating an SQL statement through the large language model according to the query indicator vector and a preset prompt word project; wherein the SQL statement is used to query the government database to obtain the target data corresponding to the question statement; the prompt word project is used to enable the large language model to generate the SQL statement that conforms to the SQL grammar.

[0008] In a third aspect, an embodiment of the present application provides an electronic device comprising: a processor; and a memory arranged to store computer-executable instructions, wherein the executable instructions are configured to be executed by the processor, and the executable instructions include instructions for executing the government data query method as described in the first aspect.

[0009] In a fourth aspect, an embodiment of the present application provides a storage medium for storing computer-executable instructions, wherein the computer-executable instructions enable a computer to execute the government data query method as described in the first aspect.

[0010] In the fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the government data query method described in the first aspect.

[0011] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the government data query method as described in the first aspect.

[0012] In an embodiment of the present application, a question statement input by a user is obtained; based on a pre-trained large language model, the question statement is subjected to intent recognition to obtain a recognition result; when it is determined according to the recognition result that it is necessary to query data of government indicators in a government database, based on the question statement, the corresponding indicator scope metric is matched in a preset government indicator vector library, and a query indicator vector corresponding to the indicator scope metric is determined; wherein the query indicator vector and its corresponding multiple indicator scope metric are associated with each other and stored in the government indicator vector library; the query indicator vector is determined based on the storage field of the government indicators in the government database; the multiple indicator scope metric is related to government indicators in multiple expressions; through the large language model, an SQL statement is generated according to the query indicator vector and a preset prompt word project; wherein the SQL statement is used to query the government database to obtain target data corresponding to the question statement; the prompt word project is used to enable the large language model to generate an SQL statement that conforms to SQL grammar. Compared to related government data query technologies, this application associates query indicator vectors (determined based on the storage fields of government indicators in a government database) with their corresponding multiple indicator scope metrics (related to government indicators in various representations) and stores them in a government indicator vector library. This allows for better understanding and processing of government indicators in different representations by matching the indicator scope metrics corresponding to the question statement, eliminating indicator ambiguity and enabling rapid and accurate location of the storage fields of government indicators in the government database, thereby improving the accuracy of query results (target data corresponding to the question statement). Furthermore, the pre-set government indicator vector library only stores the correspondence between query indicator vectors and indicator scope metrics and does not involve the storage of government data (government indicator data). Therefore, there is no need to regularly integrate and update government data, significantly saving labor costs. Furthermore, by using prompt word engineering to constrain the output of a large language model, SQL statements can be generated by simply inputting the query indicator vector, avoiding situations where vector concatenation into the large model may exceed the input length limit, thereby improving system response speed. This addresses the issues of high cost, inaccurate query results, and slow response times associated with related government data query technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 This is a flowchart of a government data query method provided by an embodiment of the present application; Figure 2 A flowchart of another government data query method provided in an embodiment of the present application; Figure 3 A flowchart of another government data query method provided in an embodiment of the present application; Figure 4 This is a schematic diagram of the structure of a government data query device provided in an embodiment of the present application; Figure 5 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0014] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0015] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.

[0016] The government data query method, device, electronic device and storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0017] Figure 1 An embodiment of the present invention provides a method for querying government data. This method can be performed by an electronic device, which may include a server and / or a terminal device, such as a vehicle-mounted terminal or a mobile phone terminal. In other words, the method can be performed by software or hardware installed on the electronic device, and includes the following steps: S102: Obtain the question statement input by the user.

[0018] S104: Based on the pre-trained large language model, perform intent recognition on the question sentence to obtain a recognition result.

[0019] The recognition result can be related to whether the question statement belongs to the category of government intelligent question and whether the question statement belongs to general (normal) question and answer. It should be noted that the question statement can belong only to government intelligent question and answer, only to general question and answer, or both. For example, the question statement is "What is the industrial operating income situation in XX province this year?" This question statement involves both general information inquiries and data query elements. In other words, it belongs to both general question and answer and government intelligent question and answer. In this case, the large language model should not only respond with "how is the industrial operating income situation" but also return data on the corresponding government indicators.

[0020] Specifically, if the recognition result indicates that the question statement belongs to the government intelligent question number, it is determined that the government indicator data needs to be queried in the government database. If the recognition result indicates that the question statement only belongs to general question answering, the large language model directly outputs the question answer result corresponding to the question statement.

[0021] S106: When it is determined according to the recognition result that it is necessary to query the data of the government affairs indicator in the government affairs database, based on the question statement, the corresponding indicator scope radial quantity is matched in the preset government affairs indicator vector library, and the query indicator vector corresponding to the indicator scope radial quantity is determined.

[0022] Among them, the query indicator vector and its corresponding multiple indicator scope radial quantities are associated and stored in the government affairs indicator vector library; the query indicator vector is determined based on the storage field of the government affairs indicator in the government affairs database; and the multiple indicator scope radial quantities are related to the government affairs indicators in multiple expressions.

[0023] For example, government indicators such as "year-on-year growth in total profits of industrial enterprises above designated size" may be expressed as "how much the profits of industrial enterprises above designated size have increased compared with last year", "year-on-year growth in profits of industrial enterprises above designated size", "year-on-year profit growth of industrial enterprises above designated size", "profit situation of industrial enterprises above designated size", etc.

[0024] Specifically, a query indicator vector is first determined based on the storage fields of government indicators in the government database. Each query indicator vector is then associated and stored in the government indicator vector library with multiple indicator scope metrics corresponding to that query indicator vector. Subsequently, when a user inquires about a government indicator using non-technical terms, the multiple indicator scope metrics in the government indicator vector library can still match the indicator scope metrics corresponding to the user's input question statement. This allows the query indicator vector corresponding to the indicator scope metrics to be determined, i.e., the query indicator vector corresponding to the question statement. Because the government indicator vector library only stores the correspondence between query indicator vectors and indicator scope metrics and does not involve the storage of government data (government indicator data), there is no need to regularly integrate and update government data, significantly saving labor costs. Furthermore, the system can better understand and process government indicators expressed in different ways, eliminate indicator ambiguity, and quickly and accurately locate the required government data through vector matching.

[0025] S108: Generate SQL statements through the large language model according to the query index vector and the preset prompt word project.

[0026] Among them, SQL statements are used to query the government database to obtain the target data corresponding to the question statement; the prompt word engineering is used to enable the large language model to generate SQL statements that conform to SQL syntax.

[0027] In actual applications, SQL statements can be generated and used by users to query the government database. Query scripts including SQL statements can also be generated to automatically query the government database and obtain the target data required by the user.

[0028] In addition, the actual executed SQL statements and related business descriptions or annotation corpus extracted from the government database query log can be used to fine-tune the large language model to improve the quality and accuracy of the SQL statements generated by the large language model.

[0029] The government data query method provided by the embodiment of the present invention obtains a question statement input by a user; based on a pre-trained large language model, the question statement is used to identify the intent and obtain an identification result; when it is determined according to the identification result that it is necessary to query the data of government indicators in the government database, based on the question statement, the corresponding indicator scope metric is matched in a preset government indicator vector library, and a query indicator vector corresponding to the indicator scope metric is determined; wherein the query indicator vector and its corresponding multiple indicator scope metric are associated with each other and stored in the government indicator vector library; the query indicator vector is determined based on the storage field of the government indicators in the government database; the multiple indicator scope metric is related to the government indicators in multiple expressions; through the large language model, an SQL statement is generated according to the query indicator vector and a preset prompt word project; wherein the SQL statement is used to query the government database to obtain the target data corresponding to the question statement; the prompt word project is used to enable the large language model to generate an SQL statement that conforms to the SQL grammar. Compared to related government data query technologies, this application associates query indicator vectors (determined based on the storage fields of government indicators in a government database) with their corresponding multiple indicator scope metrics (related to government indicators in various representations) and stores them in a government indicator vector library. This allows for better understanding and processing of government indicators in different representations by matching the indicator scope metrics corresponding to the question statement, eliminating indicator ambiguity and enabling rapid and accurate location of the storage fields of government indicators in the government database, thereby improving the accuracy of query results (target data corresponding to the question statement). Furthermore, the pre-set government indicator vector library only stores the correspondence between query indicator vectors and indicator scope metrics and does not involve the storage of government data (government indicator data). Therefore, there is no need to regularly integrate and update government data, significantly saving labor costs. Furthermore, by using prompt word engineering to constrain the output of a large language model, SQL statements can be generated by simply inputting the query indicator vector, avoiding situations where vector concatenation into the large model may exceed the input length limit, thereby improving system response speed. This addresses the issues of high cost, inaccurate query results, and slow response times associated with related government data query technologies.

[0030] In one implementation, the following steps A1 to A3 may be further performed to associate the query indicator vector with its corresponding multiple indicator scope dimensions and store them in the government indicator vector library: Step A1, obtain multiple indicator caliber information in government affairs work and storage fields in the government affairs database.

[0031] Among them, multiple indicator caliber information is information related to government affairs indicators in various ways of expression.

[0032] Considering that government officials often do not use very professional terms when asking questions in government affairs intelligently, for example, when a government official asks "the income of industries above designated size in 2023", it is necessary to correspond "the income of industries above designated size" with the table structure name "business income of industries above designated size" in the government affairs database. In addition, time generalizations such as "last year" and "last quarter" need to be automatically parsed by the system to the corresponding time. Therefore, the indicator caliber information is preset to interpret and generalize the government affairs indicators (storage fields in the government affairs database), so that the system can better understand and process government affairs indicators with different expressions.

[0033] Specifically, information on multiple indicators in government affairs can be collected based on the experience of government affairs experts. The indicator information can be words, phrases, or sentences related to government affairs indicators in various ways of expression, such as the year-on-year growth value of total profits of large-scale industries.

[0034] In step A2, a vector conversion process is performed on multiple indicator scope information and storage fields through an NLP text vectorization model to obtain multiple indicator scope quantities and query indicator vectors.

[0035] Specifically, the NLP text vectorization model may be, for example, acge_text_embedding, Word2vec model, etc., without specific limitation.

[0036] Step A3: for each query indicator vector, determine a plurality of indicator scope dimensional quantities corresponding thereto, and associate the query indicator vector with the plurality of indicator scope dimensional quantities corresponding thereto and store them in the government affairs indicator vector library.

[0037] In this embodiment, by presetting multiple indicator scope metrics, the system can eliminate indicator ambiguity and accurately and quickly locate the required data through vector matching; at the same time, considering the diverse sources of data in government databases, including business systems of different departments, historical archives, etc., the data formats and standards are inconsistent; and the update cycle of government data is short, and the real-time requirements are high. It is necessary to formulate unified data standards and migration specifications, and to update and integrate various types of departmental data in real time to ensure the accuracy and timeliness of the intelligent query system, which is costly. Therefore, the government indicator vector library that is constructed only saves the correspondence between the query indicator vector and the indicator scope metric, and does not involve the storage of government data. Therefore, it does not need to be updated frequently on schedule, which greatly saves labor costs.

[0038] In one implementation, based on a pre-trained large language model, the question sentence is subjected to intent recognition to obtain a recognition result (i.e., S104). Specifically, steps B1 to B4 may be performed as follows: Step B1: semantically split the question statement to obtain short sentences.

[0039] Among them, multiple short sentences can be split and meaningless short sentences can be removed to obtain one or more short sentences to be processed next.

[0040] In step B2, for each short sentence, the large language model is used to perform intent analysis on the short sentence to obtain a first analysis result.

[0041] Among them, the first analysis result may be related to whether the short sentence belongs to government affairs intelligent question and answer or whether the short sentence belongs to general question and answer.

[0042] Exemplarily, the first analysis result S1 may range from 0 to 1, where 0 indicates that the short sentence tends to be general question and answer, and 1 indicates that the short sentence tends to be government affairs intelligent question and answer.

[0043] In step B3, for each short sentence, similarity calculation is performed based on the short sentence and the preset index query statement using a preset text vector matching algorithm based on image recognition to obtain a second analysis result.

[0044] The indicator query statement is a statement for querying data on government affairs indicators. The second analysis result may be related to whether the short sentence belongs to government affairs intelligent question data or the short sentence belongs to general question answering.

[0045] Exemplarily, the second analysis result S2 may range from 0 to 1, where 0 indicates that the short sentence tends to be general question and answer, and 1 indicates that the short sentence tends to be government affairs intelligent question and answer.

[0046] Step B4: Determine the recognition result based on the first analysis result and the second analysis result.

[0047] Specifically, the importance weights of the first analysis result and the second analysis result can be preset respectively. and ,and For each short sentence, the comprehensive score S is calculated using the following formula:

[0048] Taking into account that when faced with colloquial or complex inquiries, relevant technologies find it difficult to accurately understand user intentions and are prone to misclassification of intent due to ambiguous or ambiguous text, in this embodiment, a pre-trained large language model is used to perform (coarse-grained) intent recognition on the question statement to obtain a first analysis result, and a large language model based on an image recognition-based text vector matching algorithm is used to perform (fine-grained) intent recognition on the question statement to obtain a second analysis result. The results of the two methods are integrated to ensure that the user's question intention can be accurately identified in complex and diverse user expressions. In addition, by combining the large language model and the image recognition-based text vector matching algorithm, the question statement is multimodally identified, and the recognition result is more accurate.

[0049] In one implementation, the prompt word engineering is related to one or more of the definition of the concept of time, the field range queried in the government database, and the generation rules of SQL statements.

[0050] Specifically, the prompt word project may include one or more of the following information: The first information that clarifies the current date and the identity of the large language model is an expert in government databases and is proficient in the SQL syntax of the government database; The task is to write SQL code that complies with the syntax of the government data and answer the user's question (question statement) by referring only to the given table structure information. The second information is that you cannot write Data Manipulation Language (DML) code; Third information related to rules for querying tables in a government database; The fourth information defines the concept of time; The fifth information is related to instructing the large language model to confirm whether the generated SQL statement complies with the SQL grammar.

[0051] This includes DML code, such as add, delete, and modify statements. Third, for example, query only columns and fields related to the problematic statement and pay attention to the table in which they are located. If the problematic statement does not specify query details, perform summation and statistics. However, if the government indicators being queried contain specific keywords, detailed queries are required. Fourth, for example, information defining "last year," "this year," "last month," "this month," "a few days ago," etc. Fifth, for example, double-check whether the generated SQL statement contains syntax errors, and do not fabricate or guess at tables and fields.

[0052] In this embodiment, by restricting the prompt word project, the large language model can generate SQL statements according to the specifications. By using preset time concept definitions and combining table structure information, it can quickly and accurately write SQL query code that meets user needs. This significantly improves the accuracy and usability of the code, effectively avoiding syntax errors and unfounded table field speculation. Furthermore, the large language model does not require additional input of large sections of knowledge base text vectors. Instead, it only needs to use the field name of the query database (indicator scope metric) as input to output SQL statements, thereby obtaining the required government data from the government database. This provides a faster response speed and greatly improves the user experience.

[0053] In one implementation, based on the short sentence and the preset indicator query statement, similarity calculation is performed using a preset text vector matching algorithm based on image recognition to obtain the second analysis result (i.e., step B3). The steps b1 to b4 can be specifically performed as follows: Step b1: perform a first similarity calculation based on the short sentence and the indicator query statement to obtain a first matrix.

[0054] The first matrix includes a first similarity result of each first word in the short sentence and each second word in the indicator query sentence.

[0055] Step b2: performing a second similarity calculation based on the short sentence and the indicator query statement to obtain a second matrix.

[0056] The second matrix includes a second similarity result of each first word in the short sentence and each second word in the indicator query sentence. Both the first word and the second word are meaningful words.

[0057] For example, the first similarity calculation is cosine similarity calculation, and the second similarity calculation is Euclidean distance calculation; the first word corresponding to the short sentence H is h i , the second word corresponding to the indicator query sentence G is g j , matching each element M in the matrix M ij Indicates the basic interaction, that is, the first word h i and the second word g j The similarity result between them is expressed as follows:

[0058] in, and Respectively represent matching statements 、 No. and j words, ※ represents the similarity calculator between two words.

[0059] In this way, the matching matrix is considered as an image, where each element (i.e. the first word h i and the second word g j The similarity result between the two words) represents the corresponding pixel value. Different types of ※ can be used to compare the first word h i and the second word g j The interaction between the two words is modeled to obtain different types of original images (first matrix and second matrix). The following formulas can be used to model the interaction between the two words. i and the second word g j Perform cosine similarity calculation (first similarity calculation) and Euclidean distance calculation (second similarity calculation) to obtain the first similarity result and the second similarity result respectively, and then obtain the corresponding first matrix and second matrix:

[0060]

[0061] It should be noted that the first similarity calculation is not limited to cosine similarity calculation, and the second similarity calculation is not limited to Euclidean distance calculation. Other similarity calculation methods may also be used, and there is no specific limitation on the first similarity calculation and the second similarity calculation.

[0062] In step b3, based on the first matrix and the second matrix, a first matching score corresponding to the first matrix and a second matching score corresponding to the second matrix are obtained through a pre-trained residual network (ResNet) and a fully connected layer.

[0063] Continuing with the above example, after obtaining the first matrix and the second matrix (different types of original images), we use them as input to the ResNet-18 network to learn the feature map z, and use a fully connected layer to generate the first matching score S0 corresponding to the first matrix and the second matching score S1 corresponding to the second matrix, as shown in the following formula:

[0064] in, is the matching score of the corresponding category (the first matching score S0 corresponding to the first matrix and the second matching score S1 corresponding to the second matrix); z is the final output of the ResNet-18 network; σ is the activation function; b1 and b2 are bias vectors; W2 and W1 are weight matrices.

[0065] Step b4: Generate a second analysis result by activating the function according to the first matching score and the second matching score.

[0066] Continuing with the above example, the activation function can be the softmax function, and the following formula is used to calculate the second analysis results of the short sentence and the indicator query statement: :

[0067] In addition, cross entropy can be used as the objective function of training, and the Adam optimizer can be used for optimization to train the residual network and the fully connected layer.

[0068]

[0069] Among them, y is the target P1, and 1-y is the target P0.

[0070] In one implementation, the following steps C1 to C3 may also be performed to display the target data to the user: Step C1: query the government database according to the SQL statement to obtain the target data.

[0071] At least two sets of code logic related to data filtering are set up to filter government data retrieved from the government database before displaying the target data to the user. The first set of code logic is for scenarios where government staff display the data internally, and mainly removes redundant government data to obtain the target data; the second set of code logic is for scenarios where government staff display the data externally, and filters out sensitive data in the government data to obtain the target data.

[0072] Step C2: sorting and processing the target data to obtain data distribution characteristics of the target data.

[0073] Step C3: Determine a target visualization method based on the data distribution characteristics and the preset visualization method, and display the target data to the user through the target visualization method.

[0074] Among them, the preset visualization methods include but are not limited to bar charts, line charts, pie charts, and tables.

[0075] Specifically, efficient data visualization engines can be used to transform complex government data into intuitive, easy-to-understand charts, such as bar charts, line charts, and pie charts, allowing government officials to quickly grasp key information. Furthermore, the visualization front-end can adopt a responsive design that adapts to the screen sizes of different devices, ensuring clear and accurate visualization across multiple devices, including desktop computers, tablets, and mobile phones.

[0076] In this embodiment, by determining the data distribution characteristics of the target data and determining the target visualization method from the set multiple visualization methods according to the data distribution characteristics, the target data can be displayed more intuitively and the user experience can be better.

[0077] Figure 2 This is a flow chart of another government data query method provided by the embodiment of this application. Figure 2 As shown, the method includes: Step 202: Obtain multiple indicator caliber information in government affairs and storage fields in the government affairs database.

[0078] Among them, multiple indicator caliber information is information related to government affairs indicators in various ways of expression.

[0079] In step 204, a vector conversion process is performed on the multiple indicator scope information and storage fields through the NLP text vectorization model to obtain query indicator vectors corresponding to the multiple indicator scope quantities and storage fields.

[0080] Step 206: for each query indicator vector, determine a plurality of indicator scope dimensions corresponding thereto, and associate the query indicator vector with the plurality of indicator scope dimensions corresponding thereto and store them in the government affairs indicator vector library.

[0081] Step 208: Obtain the question statement input by the user.

[0082] Step 210: semantically split the question statement to obtain short sentences.

[0083] In step 212 , for each short sentence, the large language model is used to perform intent analysis on the short sentence to obtain a first analysis result.

[0084] In step 214 , for each short sentence, similarity calculation is performed based on the short sentence and the preset index query statement using a preset text vector matching algorithm based on image recognition to obtain a second analysis result.

[0085] Among them, the indicator query statement is a statement for querying the data of the government affairs indicator.

[0086] Step 216: Determine a recognition result for the question statement based on the first analysis result and the second analysis result.

[0087] Step 218, when it is determined based on the recognition result that it is necessary to query the government affairs indicator data in the government affairs database, based on the question statement, the corresponding indicator scope radial quantity is matched in the preset government affairs indicator vector library, and the query indicator vector corresponding to the indicator scope radial quantity is determined.

[0088] Among them, multiple indicators are quantitatively related to government affairs indicators with various expressions.

[0089] Step 220: Generate an SQL statement using the large language model based on the query index vector and the preset prompt word project.

[0090] Among them, the prompt word engineering is used to enable the large language model to generate SQL statements that conform to SQL syntax; the prompt word engineering is related to one or more of the definition of the time concept, the field range queried in the government database, and the generation rules of SQL statements.

[0091] Step 222: query the government affairs database according to the SQL statement to obtain the target data corresponding to the question statement.

[0092] Step 224 , combing the target data to obtain data distribution characteristics of the target data.

[0093] Step 226 : Determine a target visualization method based on the data distribution characteristics and the preset visualization method, and display the target data to the user through the target visualization method.

[0094] The specific process of the above steps 202 to 226 has been described in detail in the above embodiment and will not be repeated here.

[0095] In addition, the embodiment of the present application provides a flowchart of another government data query method, such as Figure 3 As shown, a data filtering module is provided to perform the aforementioned filtering on the government data retrieved from the government database to obtain the target data, and a dimension conversion module is provided to perform the aforementioned step 224. Furthermore, an intelligent insight module is provided to generate analytical results for the target data using a large language model. Data analysis algorithms can be configured to perform in-depth mining of the target data, automatically identifying trends, patterns, and outliers within the target data through machine learning algorithms and data mining techniques. For example, cluster analysis algorithms can be used to classify different types of government data, helping staff identify potential problem areas and improvement areas. Regarding the interaction between the visualization front-end and intelligent analysis, users can interact with visualization charts (target data in target visualization mode) through an intuitive interface to further analyze the data. For example, users can click on specific areas in the chart (target data in target visualization mode) to display relevant statistical information and analysis results in different formats. The system also supports question recommendation, recommending multiple relevant government indicator questions based on the user's question, significantly improving the user experience.

[0096] In this embodiment, a question statement input by a user is obtained; based on a pre-trained large language model, the question statement is subjected to intent recognition to obtain a recognition result; when it is determined according to the recognition result that data of government indicators needs to be queried in a government database, corresponding indicator scope dimensions are matched in a preset government indicator vector library based on the question statement, and a query indicator vector corresponding to the indicator scope dimension is determined; wherein the query indicator vector and its corresponding multiple indicator scope dimensions are associated and stored in the government indicator vector library; the query indicator vector is determined based on the storage field of the government indicators in the government database; the multiple indicator scope dimensions are related to government indicators in multiple expressions; through the large language model, an SQL statement is generated according to the query indicator vector and a preset prompt word project; wherein the SQL statement is used to query the government database to obtain target data corresponding to the question statement; the prompt word project is used to enable the large language model to generate an SQL statement that conforms to SQL grammar. Compared to related government data query technologies, this application associates query indicator vectors (determined based on the storage fields of government indicators in a government database) with their corresponding multiple indicator scope metrics (related to government indicators in various representations) and stores them in a government indicator vector library. This allows for better understanding and processing of government indicators in different representations by matching the indicator scope metrics corresponding to the question statement, eliminating indicator ambiguity and enabling rapid and accurate location of the storage fields of government indicators in the government database, thereby improving the accuracy of query results (target data corresponding to the question statement). Furthermore, the pre-set government indicator vector library only stores the correspondence between query indicator vectors and indicator scope metrics and does not involve the storage of government data (government indicator data). Therefore, there is no need to regularly integrate and update government data, significantly saving labor costs. Furthermore, by using prompt word engineering to constrain the output of a large language model, SQL statements can be generated by simply inputting the query indicator vector, avoiding situations where vector concatenation into the large model may exceed the input length limit, thereby improving system response speed. This addresses the issues of high cost, inaccurate query results, and slow response times associated with related government data query technologies.

[0097] Corresponding to the government data query method provided in the above embodiment, based on the same technical concept, the embodiment of the present invention also provides a government data query device. Figure 4 is a schematic diagram of the structure of a government data query device according to an embodiment of the present invention, wherein the government data query device is used to execute Figures 1 to 3 The government data query method described in Figure 4 As shown, the government data query device includes: an acquisition module 410, an intention recognition module 420, a vector matching module 430 and a generation module 440.

[0098] An acquisition module 410 is used to acquire a question statement input by a user; Intent recognition module 420, used to perform intent recognition on the question sentence based on the pre-trained large language model and obtain a recognition result; Vector matching module 430 is configured to, when it is determined based on the recognition results that a query for government indicator data is required in the government database, match corresponding indicator scope dimensions in a preset government indicator vector library based on the question statement, and determine a query indicator vector corresponding to the indicator scope dimension; wherein the query indicator vector and its corresponding multiple indicator scope dimensions are associated and stored in the government indicator vector library; the query indicator vector is determined based on the storage fields of the government indicators in the government database; and the multiple indicator scope dimensions are associated with government indicators expressed in multiple ways; The SQL generation module 440 is used to generate SQL statements based on the query indicator vector and the preset prompt word engineering through the large language model; wherein the SQL statement is used to query the government database to obtain the target data corresponding to the question statement; the prompt word engineering is used to enable the large language model to generate SQL statements that conform to SQL syntax.

[0099] In one implementation, the government data query device further includes a storage module. The storage module is used to: Obtaining multiple indicator caliber information in government affairs and storage fields in a government affairs database; wherein the multiple indicator caliber information is information related to government affairs indicators in multiple expression methods; Through the natural language processing (NLP) text vectorization model, multiple indicator caliber information and storage fields are vectorized to obtain multiple indicator caliber quantities and query indicator vectors; For each query indicator vector, a plurality of indicator scope radial quantities corresponding thereto are determined, and the query indicator vector and the plurality of indicator scope radial quantities corresponding thereto are associated and stored in a government affairs indicator vector library.

[0100] In one implementation, the intent recognition module 420 includes: Splitting unit, used to semantically split the question sentence into short sentences; The large model analysis unit is configured to perform intent analysis on each short sentence using the large language model to obtain a first analysis result; a text vector matching analysis unit configured to calculate a similarity between each short sentence and a preset indicator query statement using a preset text vector matching algorithm based on image recognition, thereby obtaining a second analysis result; wherein the indicator query statement is a statement for querying data on government indicators; The intention determination unit is used to determine the recognition result based on the first analysis result and the second analysis result.

[0101] In one implementation, the prompt word engineering is related to one or more of the definition of the concept of time, the field range queried in the government database, and the generation rules of SQL statements.

[0102] In one implementation, the text vector matching analysis unit is specifically configured to: Performing a first similarity calculation based on the short sentence and the indicator query statement to obtain a first matrix; wherein the first matrix includes a first similarity result of each first word in the short sentence and each second word in the indicator query statement; Perform a second similarity calculation based on the short sentence and the indicator query statement to obtain a second matrix; wherein the second matrix includes a second similarity result of each first word in the short sentence and each second word in the indicator query statement; According to the first matrix and the second matrix, a first matching score corresponding to the first matrix and a second matching score corresponding to the second matrix are obtained through a pre-trained residual network ResNet and a fully connected layer; A second analysis result is generated according to the first matching score and the second matching score by activating the function.

[0103] In one implementation, the government data query device further includes a display module. The display module is used to: According to the SQL statement, query the government database to obtain the target data; Combing and processing the target data to obtain the data distribution characteristics of the target data; According to the data distribution characteristics and the preset visualization method, the target visualization method is determined, and the target data is displayed to the user through the target visualization method.

[0104] In this embodiment, a question statement input by a user is obtained; based on a pre-trained large language model, the question statement is subjected to intent recognition to obtain a recognition result; when it is determined according to the recognition result that data of government indicators needs to be queried in a government database, corresponding indicator scope dimensions are matched in a preset government indicator vector library based on the question statement, and a query indicator vector corresponding to the indicator scope dimension is determined; wherein the query indicator vector and its corresponding multiple indicator scope dimensions are associated and stored in the government indicator vector library; the query indicator vector is determined based on the storage field of the government indicators in the government database; the multiple indicator scope dimensions are related to government indicators in multiple expressions; through the large language model, an SQL statement is generated according to the query indicator vector and a preset prompt word project; wherein the SQL statement is used to query the government database to obtain target data corresponding to the question statement; the prompt word project is used to enable the large language model to generate an SQL statement that conforms to SQL grammar. Compared to related government data query technologies, this application associates query indicator vectors (determined based on the storage fields of government indicators in a government database) with their corresponding multiple indicator scope metrics (related to government indicators in various representations) and stores them in a government indicator vector library. This allows for better understanding and processing of government indicators in different representations by matching the indicator scope metrics corresponding to the question statement, eliminating indicator ambiguity and enabling rapid and accurate location of the storage fields of government indicators in the government database, thereby improving the accuracy of query results (target data corresponding to the question statement). Furthermore, the pre-set government indicator vector library only stores the correspondence between query indicator vectors and indicator scope metrics and does not involve the storage of government data (government indicator data). Therefore, there is no need to regularly integrate and update government data, significantly saving labor costs. Furthermore, by using prompt word engineering to constrain the output of a large language model, SQL statements can be generated by simply inputting the query indicator vector, avoiding situations where vector concatenation into the large model may exceed the input length limit, thereby improving system response speed. This addresses the issues of high cost, inaccurate query results, and slow response times associated with related government data query technologies.

[0105] Those skilled in the art should understand that the above-mentioned government data query device can be used to implement the government data query method mentioned above, and the detailed description thereof should be similar to the description of the method part mentioned above. To avoid repetition, it will not be repeated here.

[0106] Based on the same technical concept, an embodiment of the present application further provides an electronic device for executing the above-mentioned government data query method. Figure 5The following is a schematic diagram of the structure of an electronic device for implementing various embodiments of the present application. Electronic devices may vary significantly due to different configurations or performance, and may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540. The processor 510, the communications interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 may call a computer program stored in the memory 530 and executable on the processor 510 to perform the following steps: Get the question statement entered by the user; Based on the pre-trained large language model, the intent of the question sentence is recognized to obtain the recognition result; When it is determined based on the recognition results that it is necessary to query data on government indicators in the government database, based on the question statement, a corresponding indicator scope dimension is matched in a preset government indicator vector library, and a query indicator vector corresponding to the indicator scope dimension is determined; wherein the query indicator vector and its corresponding multiple indicator scope dimensions are associated and stored in the government indicator vector library; the query indicator vector is determined based on the storage field of the government indicators in the government database; the multiple indicator scope dimensions are related to government indicators expressed in multiple ways; Through the large language model, a structured query language SQL statement is generated based on the query indicator vector and the preset prompt word project; the SQL statement is used to query the government database to obtain the target data corresponding to the question statement; the prompt word project is used to enable the large language model to generate SQL statements that conform to SQL syntax.

[0107] In this embodiment, a question statement input by a user is obtained; based on a pre-trained large language model, the question statement is subjected to intent recognition to obtain a recognition result; when it is determined according to the recognition result that data of government indicators needs to be queried in a government database, corresponding indicator scope dimensions are matched in a preset government indicator vector library based on the question statement, and a query indicator vector corresponding to the indicator scope dimension is determined; wherein the query indicator vector and its corresponding multiple indicator scope dimensions are associated and stored in the government indicator vector library; the query indicator vector is determined based on the storage field of the government indicators in the government database; the multiple indicator scope dimensions are related to government indicators in multiple expressions; through the large language model, an SQL statement is generated according to the query indicator vector and a preset prompt word project; wherein the SQL statement is used to query the government database to obtain target data corresponding to the question statement; the prompt word project is used to enable the large language model to generate an SQL statement that conforms to SQL grammar. Compared to related government data query technologies, this application associates query indicator vectors (determined based on the storage fields of government indicators in a government database) with their corresponding multiple indicator scope metrics (related to government indicators in various representations) and stores them in a government indicator vector library. This allows for better understanding and processing of government indicators in different representations by matching the indicator scope metrics corresponding to the question statement, eliminating indicator ambiguity and enabling rapid and accurate location of the storage fields of government indicators in the government database, thereby improving the accuracy of query results (target data corresponding to the question statement). Furthermore, the pre-set government indicator vector library only stores the correspondence between query indicator vectors and indicator scope metrics and does not involve the storage of government data (government indicator data). Therefore, there is no need to regularly integrate and update government data, significantly saving labor costs. Furthermore, by using prompt word engineering to constrain the output of a large language model, SQL statements can be generated by simply inputting the query indicator vector, avoiding situations where vector concatenation into the large model may exceed the input length limit, thereby improving system response speed. This addresses the issues of high cost, inaccurate query results, and slow response times associated with related government data query technologies.

[0108] The specific execution steps can refer to the various steps of the above-mentioned government data query method embodiment, and can achieve the same technical effect. To avoid repetition, they will not be repeated here.

[0109] It should be noted that the electronic devices in the embodiments of the present application include: servers, terminals, or other devices other than terminals.

[0110] The above electronic device structure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the input unit may include a graphics processing unit (GPU) and a microphone, and the display unit may be configured as a display panel in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit includes at least one of a touch panel and other input devices. A touch panel is also called a touch screen. Other input devices may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick, which will not be detailed here.

[0111] The memory can be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory may include volatile memory or non-volatile memory, or the memory may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus random access memory (DRRAM).

[0112] The processor may include one or more processing units; optionally, the processor may integrate an application processor and a modem processor, wherein the application processor primarily handles operations related to the operating system, user interface, and application programs, and the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into the processor.

[0113] An embodiment of the present application also provides a storage medium on which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the various processes of the above-mentioned government data query method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, they will not be repeated here.

[0114] The processor is the processor in the electronic device described in the above embodiment. The storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk.

[0115] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned government data query method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0116] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0117] An embodiment of the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the various processes of the above-mentioned government data query method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0118] It should be noted that, in this article, the terms "comprises", "includes" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include multitasking and parallel processing according to the functions involved, and may also add, omit, or combine various steps. In addition, the features described with reference to certain examples may be combined in other examples.

[0119] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a more preferred embodiment. Based on this understanding, the technical solution of this application, or the part that contributes to the existing technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of this application.

[0120] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A government data query method, characterized in that: The method comprises: Get the question statement entered by the user; Based on the pre-trained large language model, the intent of the question sentence is recognized to obtain a recognition result; When it is determined, based on the recognition result, that it is necessary to query data of government indicators in a government database, based on the question statement, a corresponding indicator scope dimension is matched in a preset government indicator vector library, and a query indicator vector corresponding to the indicator scope dimension is determined; wherein the query indicator vector is associated with and stored in the government indicator vector library with a plurality of corresponding indicator scope dimensions; the query indicator vector is determined based on a storage field for the government indicator in the government database; and the plurality of indicator scope dimensions are related to the government indicators in a plurality of expressions; Through the large language model, a structured query language SQL statement is generated according to the query indicator vector and a preset prompt word project; wherein the SQL statement is used to query the government database to obtain the target data corresponding to the question statement; the prompt word project is used to enable the large language model to generate the SQL statement that conforms to SQL grammar.

2. The method according to claim 1, characterized in that The method further comprises: Acquire multiple indicator caliber information in government affairs and the storage fields in the government affairs database; wherein the multiple indicator caliber information is information related to the government affairs indicators in multiple expression modes; Performing vector conversion processing on the plurality of indicator scope information and the storage fields through a natural language processing (NLP) text vectorization model to obtain a plurality of indicator scope dimensions and the query indicator vector; For each query indicator vector, a plurality of indicator scope dimensional quantities corresponding thereto are determined, and the query indicator vector and the plurality of indicator scope dimensional quantities corresponding thereto are associated and stored in the government affairs indicator vector library.

3. The method according to claim 1, characterized in that The pre-trained large language model is used to perform intent recognition on the question statement to obtain a recognition result, including: Performing semantic splitting on the question sentence to obtain short sentences; For each of the short sentences, performing intent analysis on the short sentence using the large language model to obtain a first analysis result; For each of the short sentences, similarity calculation is performed based on the short sentence and a preset indicator query statement using a preset text vector matching algorithm based on image recognition to obtain a second analysis result; wherein the indicator query statement is a statement for querying the data of the government indicator; The recognition result is determined according to the first analysis result and the second analysis result.

4. The method according to claim 1, wherein The prompt word project is related to one or more of the definition of the time concept, the field range queried in the government affairs database, and the generation rule of the SQL statement.

5. The method according to claim 3, characterized in that The similarity calculation based on the short sentence and the preset indicator query statement is performed by using a preset text vector matching algorithm based on image recognition to obtain a second analysis result, including: Performing a first similarity calculation based on the short sentence and the indicator query statement to obtain a first matrix; wherein the first matrix includes a first similarity result of each first word in the short sentence and each second word in the indicator query statement; Performing a second similarity calculation based on the short sentence and the indicator query statement to obtain a second matrix; wherein the second matrix includes a second similarity result of each first word in the short sentence and each second word in the indicator query statement; According to the first matrix and the second matrix, obtaining a first matching score corresponding to the first matrix and a second matching score corresponding to the second matrix through a pre-trained residual network ResNet and a fully connected layer; The second analysis result is generated by activating a function according to the first matching score and the second matching score.

6. The method according to claim 1, characterized in that The method further comprises: According to the SQL statement, query the government affairs database to obtain the target data; Sorting and processing the target data to obtain data distribution characteristics of the target data; A target visualization method is determined according to the data distribution characteristics and a preset visualization method, and the target data is displayed to the user through the target visualization method.

7. A government data query device, characterized in that: The device comprises: The acquisition module is used to obtain the question statement input by the user; An intent recognition module is used to recognize the intent of the question sentence based on a pre-trained large language model to obtain a recognition result; A vector matching module, configured to, when it is determined based on the recognition result that a query for government indicator data is required in a government indicator database, match corresponding indicator scope quantities in a preset government indicator vector library based on the question statement, and determine a query indicator vector corresponding to the indicator scope quantity; wherein the query indicator vector is associated with and stored in the government indicator vector library with a plurality of corresponding indicator scope quantities; the query indicator vector is determined based on a storage field for the government indicator in the government indicator database; and the plurality of indicator scope quantities are associated with the government indicator in a plurality of expressions; An SQL generation module is configured to generate an SQL statement using the large language model, based on the query indicator vector and a preset prompt word project; wherein the SQL statement is used to query the government database to obtain target data corresponding to the question statement; and the prompt word project is configured to enable the large language model to generate the SQL statement that conforms to SQL grammar.

8. An electronic device, characterized in that: include: processor; as well as A memory arranged to store computer-executable instructions, wherein the executable instructions are configured to be executed by the processor, and the executable instructions include instructions for executing the government data query method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is used to store computer-executable instructions, and the computer-executable instructions enable a computer to execute the government data query method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, implements the government data query method as described in any one of claims 1 to 6.

Citation Information

Cited By

  • Question and answer query method and device based on large model

    CN120910222A