Food news event data query method and system based on big language model

By using a food news event data query method based on a large language model and RAG knowledge base, the automatic conversion of natural language into query statements was achieved, solving the problems of data dispersion and inconsistent formats, and improving query efficiency and data utilization efficiency.

CN121935352APending Publication Date: 2026-04-28NANJING TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610062797.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-16
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, food news event data is scattered and inconsistent in format, making it difficult for relevant personnel to quickly and accurately obtain the data they need, resulting in low query efficiency.

Method used

This method employs a large language model-based approach, combining the RAG knowledge base and a pre-defined food data model. By inputting query requests in natural language, it automatically constructs query statements and generates data summary results, and then uses the large language model for intelligent retrieval and analysis.

Benefits of technology

It significantly lowers the threshold for searching, improves the efficiency of locating core information in massive amounts of data, and provides support for consumer decision-making and industry regulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121935352A_ABST
    Figure CN121935352A_ABST
Patent Text Reader

Abstract

The invention discloses a food news event data query method and system based on a large language model, and the method comprises the steps: obtaining a query request inputted by a user, the query request being food news related question information (such as food safety event details, food policy interpretation, and quality spot check results) described by a natural language; retrieving at least one knowledge block from the RAG knowledge base according to the query request; constructing a first cue word based on the query request, the knowledge blocks and preset food data model information, and inputting the first cue word into a large language model to generate a query statement; event related data (including food types, risk levels, influence ranges, processing results and the like) are obtained from a food news target database according to the query statements; constructing a second cue word based on the query request, the query statement, preset food data model information and event related data, and inputting the second cue word into a large language model to generate a data summary result; and returning a data summary result to the user terminal. According to the method, by fusing the semantic comprehension ability of RAG retrieval and the big language model, accurate analysis and structured conversion of the food news complex query intention are achieved, and the intelligence level and the information acquisition efficiency of food news event data query are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, specifically to a method and system for querying food news event data based on a large language model. Background Technology

[0002] In information gathering and oversight within the food industry, accessing and monitoring food news events is a crucial element. Consumers, regulators, and industry professionals rely on food news event data (such as exposure of food safety issues, adjustments to food policies, and results of quality inspections) to understand industry dynamics, mitigate consumer risks, and conduct oversight work.

[0003] Currently, data related to food news events is scattered across various news platforms, regulatory websites, and industry databases, resulting in inconsistent data formats and severe information fragmentation. When relevant personnel search for information, they need to master professional database query syntax and sift through massive amounts of data to find relevant information—a cumbersome and time-consuming process. For non-professionals, it is difficult to quickly and accurately obtain the required data; even for professionals, facing complex query requirements (such as "the handling results of infant formula food safety incidents in the past six months and the companies involved"), a significant amount of time is required to construct query logic and integrate data, leading to low query efficiency and insufficient data utilization.

[0004] Therefore, there is an urgent need for a method and system that can lower the barrier to entry and intelligently assist relevant personnel in quickly querying food news and event data. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a method and system for querying food news event data based on a large language model, aiming to solve the problem that relevant personnel have difficulty efficiently querying food news event data, resulting in low data utilization efficiency.

[0006] This invention discloses a method for querying food news event data based on a large language model, characterized by comprising:

[0007] Obtain a query request input by the user, wherein the query request describes a query question related to food news in natural language;

[0008] Based on the query request, a retrieval operation is performed in the RAG knowledge base to obtain knowledge blocks related to the food field;

[0009] Based on the query request, the knowledge blocks, and the preset food data model information, a first prompt word is constructed, and the first prompt word is input into the large language model to generate the corresponding query statement;

[0010] Data related to the event is extracted from the food news target database based on the query statement;

[0011] Based on the query request, the query statement, the preset food data model information, and the event-related data, a second prompt word is constructed, and the second prompt word is input into the large language model to obtain a data summary result, which is a natural language summary of the event-related data.

[0012] The summarized data results are then output to the user terminal.

[0013] Preferably, before obtaining the query request input by the user, the method further includes:

[0014] Access a collection of knowledge documents, which includes standard documents in the food field, historical reports on food news, case studies of food incident handling, food policy documents, and summary documents of results.

[0015] The document parser is used to parse each document in the knowledge document set to obtain document information; the document information is then processed into content blocks, and the block-based document information is vectorized to obtain high-dimensional vectors;

[0016] A vector index is constructed based on high-dimensional vectors, and a RAG knowledge base is constructed based on high-dimensional vectors and vector indexes. The RAG knowledge base includes a food standards sub-base, a historical news sub-base, an event case sub-base, a policy interpretation sub-base, and a results summary sub-base.

[0017] Preferably, at least one knowledge block is retrieved from the RAG knowledge base according to the query request, including:

[0018] Extract keywords from the query request to obtain a keyword set (such as food name, event type, time range, area involved, etc.), and generate a text vector of the query request;

[0019] Keyword result sets that are relevant to the keyword set are retrieved from the food standards sub-database, historical news sub-database, event case sub-database, and policy interpretation sub-database, respectively. The keyword result sets are then sorted from high to low relevance to obtain the first sequence.

[0020] The similar vector result sets with similarity to the text vectors were retrieved from the food standards sub-database, historical news sub-database, event case sub-database, and policy interpretation sub-database, respectively. The similar vector result sets were then sorted from high to low similarity to obtain the second sequence.

[0021] The first and second sequences are weighted and merged to obtain a merged ranking result, and the number of search results with the highest ranking in the merged ranking result is used as knowledge blocks.

[0022] Preferably, the food news event data query method based on a large language model also includes:

[0023] A preset food data model is generated based on a food news target database. The preset food data model includes tags and indicators.

[0024] The preset food data model is preprocessed and configured, and the preset food data model information is obtained. The preset food data model information includes label name, business description information and indicator setting information.

[0025] Preferably, the preset food data model is preprocessed and configured, including: setting label names for the labels of the preset food data model, the label names being used to describe the business explanation of the labels; adding business description information to the preset food data model, the business description information being used to characterize the business relationship between multiple labels; setting indicator names for the indicators of the preset food data model, and annotating the indicator names with explanatory information.

[0026] Preferably, the first prompt keyword is constructed based on the query request, knowledge blocks, and pre-set food data model information, including:

[0027] The first role in generating the intelligent agent is a food news data query expert who writes query statements based on query requests.

[0028] The writing information is generated based on the query request. The writing information includes a description of the query syntax for the food news database, syntax rules, and writing examples.

[0029] A first task description is generated based on the query request. The first task description is used to instruct the large language model to generate query statements using a thought chain approach.

[0030] The first prompt word is integrated with the first role, writing information, first task description, knowledge blocks, and preset food data model information.

[0031] Preferably, a second prompt word is constructed based on the query request, query statement, preset food data model information, and event-related data, including:

[0032] Based on the query request and query statement, at least one summary knowledge block is retrieved from the RAG knowledge base. The summary knowledge block is either a food system information block, a historical news summary block, or an event analysis summary block.

[0033] The second role in generating the intelligent agent is a food news data analysis expert who analyzes key information based on event-related data.

[0034] A second task description is generated based on the query request and event-related data. The second task description is used to instruct the large language model to summarize key information (such as core details of the event, scope of impact, and response suggestions) based on the query request and event-related data.

[0035] The second prompt word is integrated with the second role, the summary knowledge block, the second task description, the query request, the query statement, the preset food data model information, and the event-related data.

[0036] Preferably, the food news event data query method based on a large language model further includes:

[0037] Return the query statement to the user terminal;

[0038] In response to the user's confirmation command for the query statement, execute the query statement and obtain event-related data;

[0039] Establish the association between query requests and query statements, and store the query requests and query statements in the RAG knowledge base.

[0040] Preferably, after returning the data summary results to the user terminal, the method further includes:

[0041] Obtain feedback information from user input, indicating whether the result is correct or incorrect;

[0042] If the feedback information indicates that the result is correct, a query block is generated based on the query request, query statement, event-related data, and data summary results, and the query block is stored in the RAG knowledge base;

[0043] If the feedback information indicates an error, an anomaly block is generated based on the query request, query statement, event-related data, and data summary results. The anomaly block is then stored in the anomaly knowledge base, which is used to perform fine-tuning and optimization operations on the large language model.

[0044] Compared with existing technologies, the beneficial effects of this invention are as follows: By introducing a large language model and RAG knowledge base, this invention achieves automatic conversion of natural language into query statements for food news events, effectively reducing the learning cost and usage threshold for relevant personnel. Simultaneously, this method can intelligently retrieve relevant knowledge blocks in the food field based on query requests and generate summary results containing key information, significantly improving the efficiency of relevant personnel in locating core information within massive amounts of food news data, providing strong support for consumer decision-making and industry regulation. Attached Figure Description

[0045] Figure 1 A flowchart illustrating the food news event data query method based on a large language model provided by this invention;

[0046] Figure 2 This is a schematic diagram of the structure of the food news event data query system based on a large language model provided by the present invention. Detailed Implementation

[0047] To make the technical objectives, solutions, and effects of the embodiments of the present invention clearer, the implementation methods of the present invention will now be further described in conjunction with the accompanying drawings. It should be understood that the following embodiments are only some implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Other implementation methods obtained by those skilled in the art based on the embodiments of the present invention without creative effort should fall within the scope of protection of the present invention.

[0048] Combination Figure 1 This invention provides a method for querying food news event data based on a large language model, which mainly includes the following steps.

[0049] First, obtain the query request submitted by the user.

[0050] The query requests are expressed in natural language and describe search needs related to food news. For example, users can enter "national infant formula safety incidents and their handling results in the past three months" or "which food categories are covered by the new food additive usage regulations implemented in 2025". Through natural language interaction, users can complete the retrieval of food news events without needing to master specialized query syntax.

[0051] In this embodiment, a preset food data model is constructed based on a food news target database. This preset food data model is a logical framework designed for the structural characteristics and query requirements of food news data, and it includes a tag system and an indicator system. Tags describe the business attributes of food news events, such as event type, food categories involved, risk level, and handling agency; indicators quantify the key characteristics of food news events, such as the number of regions involved, processing time, and sampling pass rate.

[0052] The system initializes and configures a preset food data model, acquiring relevant model information, including the names of each tag and their business meanings, as well as the names of each indicator and their corresponding explanations. Through this configuration process, business relationships are established between tags and between tags and indicators, thereby giving food news event data a clear, structured semantic expression and ensuring the accuracy of data generation and subsequent queries.

[0053] Subsequently, at least one knowledge block is retrieved from the RAG knowledge base based on the user's query request. The RAG knowledge base contains pre-stored structured knowledge content related to the food news field. By calling this knowledge base, the large language model can be supplemented with professional knowledge and private data in the food field, thereby improving the accuracy of retrieval and reasoning.

[0054] When building the RAG knowledge base, the first step is to acquire a collection of knowledge documents, including standard documents in the food field, historical reports on food news, case studies of food incident handling, food policy documents, and summary documents of results. These documents are pre-imported into the system by relevant personnel. Each document is then parsed to extract its text content, and the extracted text is segmented into blocks. Each block is then vectorized and encoded, and the resulting vectors are stored in a vector database with a corresponding index structure.

[0055] Specifically, the system uses a document parser to parse various documents in the knowledge document collection to obtain their textual and structural information. The parsed document content is then segmented, and the segmented text is vectorized to generate corresponding high-dimensional vector representations. Based on these high-dimensional vectors, a vector index is constructed, forming the RAG knowledge base, which includes sub-bases for food standards, historical news, event cases, policy interpretation, and results summaries.

[0056] The following example illustrates the construction process of the RAG knowledge base: For the knowledge document set, a document parsing module, Food_Data_Parser, is constructed to extract the source information of the documents. Based on common document formats in the food industry, parsing components including TextLoader, MarkdownLoader, DocLoader, and PdfLoader are set up. TextLoader is used to parse txt and markdown documents; MarkdownLoader and DocLoader are used to parse markdown, doc, and docx documents and retain their hierarchical structure information as the basis for subsequent block headings; PdfLoader is used to parse pdf documents and extract the corresponding hierarchical information based on their table of contents or outline structure.

[0057] After obtaining the document content, long texts need to be segmented to facilitate subsequent vector encoding and retrieval processing. During initial segmentation based on hierarchical structure, if the document contains headings, the content is divided according to these headings, and the corresponding headings are used as semantic identifiers for the segments. For text paragraphs lacking hierarchical structure or exceeding a preset threshold in length, they are segmented according to predefined text length rules. The segment length is dynamically adjusted based on the actual data scale to avoid increasing model processing overhead due to excessively large single segments, or causing overly fragmented semantic information due to overly fine segmentation, thereby affecting retrieval and model understanding performance.

[0058] After text segmentation, each segment and its corresponding title are vectorized. A pre-trained embedding model is used to convert the text content into high-dimensional semantic vectors, and the generated vectors are stored in a vector database to support subsequent similarity retrieval. This embodiment employs the GTE series embedding model, which enhances its ability to model contextual semantics by introducing a bidirectional attention mechanism and combines it with an instruction fine-tuning mechanism to adapt to query scenarios such as question answering and summarization. Furthermore, this model supports multilingual semantic representation, effectively covering Chinese standard documents, historical news, and English industry materials that coexist in the food field.

[0059] Multiple index structures are further established in the vector database, including a content field for storing the original text content, an embedding field (using dense_vector type) for storing vector representations, and a metadata field for recording information such as document source and page number. At the same time, an inverted index is built to accelerate keyword-based retrieval, and a vector nearest neighbor index based on HNSW is established to improve the efficiency of similarity search in high-dimensional space.

[0060] Following the above approach, food-related standard documents are constructed into a food standards sub-library, historical food news reports are constructed into a historical news sub-library, food incident handling cases are constructed into an incident case sub-library, food policy documents are constructed into a policy interpretation sub-library, and analysis and summary documents are constructed into a results summary sub-library, thereby forming a unified RAG knowledge base system.

[0061] The food standards sub-library stores national food safety standards, regulations on the use of food additives, and requirements for food quality sampling inspections, providing authoritative basis for the large language model when users query; the event case sub-library stores historical food safety incident handling cases, providing reference for the model to generate query statements and analysis logic; and the historical news sub-library stores reporting data on food news over the years, providing background support for the model to ensure the comprehensiveness of query results.

[0062] When performing knowledge retrieval, the system extracts keywords from the query request and generates semantic vectors. Keyword matching retrieval and vector similarity retrieval are performed in the food standards sub-database, historical news sub-database, event case sub-database, and policy interpretation sub-database, respectively, to obtain keyword matching result sequences and semantic similarity result sequences. The two sequences are then weighted, merged, and sorted, and the top-ranked results are selected from the merged and sorted results as the final knowledge blocks.

[0063] By employing the aforementioned multi-dimensional retrieval mechanism based on keywords and semantic vectors, combined with a fusion ranking strategy, high-quality knowledge blocks that closely match the user's query intent can be obtained, thereby significantly improving the accuracy and relevance of large language models when generating query statements.

[0064] After acquiring the knowledge blocks, the first prompt word is constructed based on the query request, the knowledge blocks, and the preset food data model information. The first prompt word is then input into the large language model to automatically generate the database query statement.

[0065] In the process of constructing the first prompt keyword, the system first sets the role of food news data query expert for the large language model, then generates corresponding grammar instructions, writing standards and example information according to the query request, and constructs the first task instruction to guide the model to deduce the query logic in a thought chain manner; finally, the role information, writing standards, task instructions, knowledge blocks and food data model information are integrated to form a complete first prompt keyword.

[0066] Through the aforementioned prompt word structure, the large language model can generate semantically accurate, structurally standardized query statements that conform to the characteristics of the food news database, under the combined effect of professional role guidance, knowledge support, and grammatical constraints.

[0067] Subsequently, the generated query statement is sent to the food news target database for execution. The food news target database stores information such as the subject, time, location, content, and processing results of food news events, and has a corresponding data organization structure. The database execution engine parses the query statement, identifies the filtering conditions and query fields, and retrieves data records related to the food news events accordingly.

[0068] Because food news event data is typically scattered across multiple tables with complex relationships between different data sets and inconsistent field naming conventions, directly returning the raw event data to users would result in incomprehensible and poorly readable results. Therefore, it is necessary to leverage a large language model to further integrate and analyze the semantics of the retrieved event data.

[0069] In this embodiment, after generating a query statement, the large language model first returns the query statement to the user terminal for user confirmation. Upon receiving the user's confirmation instruction for the query statement, the system executes the query statement to obtain the corresponding event data, establishes a mapping relationship between the query request and the query statement, and stores both in the RAG knowledge base to accumulate user historical query records, thereby continuously expanding the knowledge base and improving the accuracy and intelligence level of subsequent queries.

[0070] Subsequently, a second prompt word is constructed based on the query request, query statement, preset food data model information, and acquired event data. This second prompt word is then input into the large language model to generate a summary result of the event data.

[0071] The construction of the second prompt word guides the large language model to perform high-level semantic abstraction and information extraction of the query results. During the construction process, firstly, based on the query request and query statement, at least one summary-type knowledge block is retrieved from the RAG knowledge base to supplement food-related background knowledge and analytical logic relevant to the current query scenario. The summary knowledge block can be a food system information block, a historical news summary block, or an event analysis summary block.

[0072] The historical news sub-base and the results summary sub-base in the RAG knowledge base provide data support for summarizing knowledge blocks: the historical news sub-base stores high-quality summary examples of past food news events, which are used to retrieve similar cases after obtaining current event data and provide them to the large language model for reference, so that its output results are more in line with user preferences; the results summary sub-base stores the analysis framework and summary templates of typical events in the food field, providing standardized analysis ideas for the large language model, thereby ensuring the professionalism and logical consistency of the summary results.

[0073] When retrieving and summarizing knowledge blocks, based on the semantic features of the query request and query statement, a combination of keyword matching and vector similarity retrieval is used to obtain the summary knowledge content most relevant to the current query. The retrieval process is the same as the aforementioned knowledge block retrieval process, and will not be elaborated here.

[0074] Furthermore, a second intelligent agent role is defined for the large language model. This role is defined as a food news data analysis expert capable of extracting key information based on event data, and generating a second task instruction based on query requests and event data to guide the model in extracting core points from the data. Finally, the second agent, summarized knowledge blocks, second task instructions, query requests, query statements, preset food data model information, and event-related data are integrated to form the second prompt word.

[0075] When integrating the second prompt, a template-based approach is used to ensure logical consistency and hierarchical structure among the information units. The second role provides the model with a professional analytical perspective, summarizes knowledge blocks to provide the model with historical experience and mainstream analytical frameworks, clarifies the model's analytical objectives and reasoning paths, provides query requests and query statements to provide the original intent and operational basis, pre-defines the labels and indicator system of the food data model information, and inputs event data into the model as the analysis object.

[0076] After combining the above content according to the second prompt word template, input it into the large language model. The model can then generate accurate, comprehensive data summary results that conform to the professional analysis logic of the food industry based on multi-source information, and finally return the data summary results to the user terminal.

[0077] In this embodiment, the generated data summary results are displayed to the user through the user terminal, enabling the user to intuitively obtain the core analytical conclusions of food news events, thereby quickly understanding the key points of the events and providing a reference for consumer decisions, regulatory enforcement, or industry research.

[0078] After outputting the data summary results to the user terminal, the system further obtains the feedback information submitted by the user. This feedback information is used to indicate whether the current result is correct. When the feedback information indicates that the result is correct, a query knowledge block is generated based on the corresponding query request, query statement, event-related data, and data summary results, and this query knowledge block is written into the RAG knowledge base. When the feedback information indicates that the result is incorrect, an anomaly knowledge block is constructed based on the same information, and the anomaly knowledge block is stored in the anomaly knowledge base. The anomaly knowledge base is used for targeted fine-tuning and optimization training of the large language model.

[0079] By introducing a user feedback mechanism, effective data support can be provided for the continuous evolution of the system. When the query results are confirmed to be correct by the user, the corresponding content is added to the RAG knowledge base, which helps to continuously enrich the knowledge coverage and improve the accuracy of subsequent retrieval and analysis. When the results are judged to be incorrect, by storing the abnormal samples in the abnormal knowledge base, real-world scenario samples can be provided for model optimization, thereby enabling targeted improvements to the weak links of the system, making it more in line with the actual needs of users, and outputting more reliable analysis results.

[0080] like Figure 2 As shown, this invention also proposes a food news event data query system based on a large language model to implement the above query method. The system includes a request retrieval module, a RAG query module, a statement generation module, a data acquisition module, a data summarization module, and a result return module.

[0081] The request acquisition module is used to receive query requests input by users, and the query requests describe questions related to food news in natural language.

[0082] The RAG query module is used to retrieve at least one food domain knowledge block that is related to the query semantics from the RAG knowledge base according to the query request.

[0083] The statement generation module is used to construct the first prompt words based on the query request, knowledge blocks and preset food data model information, and input them into the large language model to generate the corresponding query statement.

[0084] The data acquisition module is used to extract relevant event data from the food news target database based on the generated query statement;

[0085] The data summary module is used to construct second prompt words based on query requests, query statements, preset food data model information, and event data, and input the second prompt words into the large language model to generate natural language summary results of the event data;

[0086] The results return module is used to send the summarized data results back to the user terminal.

[0087] In summary, this application provides a method and system for querying food news event data based on a large language model. Its core process includes: receiving a user query request, obtaining relevant knowledge blocks from the RAG knowledge base, generating first prompt words by combining them with a preset food data model, and driving the large language model to automatically generate a query statement; obtaining event data from the food news target database based on the query statement; constructing second prompt words and using the large language model to analyze and summarize the data, and finally outputting structured analysis results to the user.

[0088] By leveraging the powerful natural language understanding and generation capabilities of large language models, the system achieves automatic query construction and intelligent analysis of query results, significantly lowering the user barrier and improving retrieval efficiency. Simultaneously, by building a RAG knowledge base, professional knowledge and historical experience in the food industry are integrated into the query and analysis process, making the generated query statements and data summaries more accurate, standardized, and professional. Combined with a user feedback mechanism for continuous system optimization, this effectively enhances the overall intelligence level of queries and the reliability of results.

[0089] The above are merely preferred embodiments of the present invention and do not constitute a limitation thereof. For those skilled in the art, any modifications, substitutions, or improvements made without departing from the core ideas and technical solutions of the present invention should be considered to fall within the protection scope of the present invention.

Claims

1. A method for querying food news event data based on a large language model, characterized in that, include: Obtain a query request input by the user, wherein the query request describes a query question related to food news in natural language; Based on the query request, a retrieval operation is performed in the RAG knowledge base to obtain knowledge blocks related to the food field; Based on the query request, the knowledge blocks, and the preset food data model information, a first prompt word is constructed, and the first prompt word is input into the large language model to generate the corresponding query statement; Data related to the event is extracted from the food news target database based on the query statement; Based on the query request, the query statement, the preset food data model information, and the event-related data, a second prompt word is constructed, and the second prompt word is input into the large language model to obtain a data summary result, which is a natural language summary of the event-related data. The summarized data results are then output to the user terminal.

2. The method for querying food news event data based on a large language model according to claim 1, characterized in that, Before receiving a user's query request, the method further includes the following steps: Acquire a collection of knowledge documents, which includes standard documents related to the food field, historical food news reports, food incident handling cases, food policy documents, and result summary documents. Each document in the knowledge document set is parsed using a document parser to extract the corresponding document content information; The extracted document content is segmented and then vectorized to obtain the corresponding high-dimensional vector representation. A vector index is constructed based on the high-dimensional vector, and the RAG knowledge base is established using the high-dimensional vector and its vector index. The RAG knowledge base includes a food standards sub-base, a historical news sub-base, an event case sub-base, a policy interpretation sub-base, and a results summary sub-base.

3. The method for querying food news event data based on a large language model according to claim 2, characterized in that, The process of retrieving at least one knowledge chunk from the RAG knowledge base includes: The query request is semantically parsed to extract keyword information to form a keyword set, and a corresponding text vector representation is generated for the query request. Keyword-based matching retrieval is performed in the food standards sub-database, historical news sub-database, event case sub-database, and policy interpretation sub-database respectively to obtain multiple keyword matching results related to the keyword set. The results are then sorted according to the matching relevance to form a first candidate sequence. The search based on vector similarity is performed in the food standard sub-database, historical news sub-database, event case sub-database, and policy interpretation sub-database respectively to obtain vector matching results similar to the text vector, and sort them according to the similarity to form a second candidate sequence; The first candidate sequence and the second candidate sequence are weighted and fused to obtain a comprehensive ranking result, and the top-ranked search results of the comprehensive ranking result are selected as the knowledge blocks.

4. The method for querying food news event data based on a large language model according to claim 1, characterized in that, Also includes A preset food data model is generated based on a food news target database, and the preset food data model includes tags and indicators; The preset food data model is preprocessed and configured, and the preset food data model information is obtained, including label name, business description information and indicator setting information.

5. The method for querying food news event data based on a large language model according to claim 4, characterized in that, The preprocessing configuration of the preset food data model includes: Set label names for the labels of the preset food data model; the label names are used to describe the business interpretation of the labels. Add business description information to the preset food data model, the business description information being used to characterize the business relationships between the multiple tags; Set indicator names for the indicators in the preset food data model, and add explanatory information to the indicator names.

6. The method for querying food news event data based on a large language model according to claim 1, characterized in that, The process of constructing the first prompt word based on the query request, knowledge blocks and preset food data model information includes: constructing the first identity role of the intelligent agent, which is used as a food news data query expert to generate the corresponding query statement according to the query request; Based on the query request, writing guidance information is generated, which includes query syntax instructions, syntax rules and example content for the food news database; A first task instruction is generated based on the query request. The first task instruction is used to guide the large language model to construct a query statement in a thought chain manner. The first identity role, the writing guidance information, the first task instruction, the knowledge block, and the preset food data model information are combined to form the first prompt word.

7. The method for querying food news event data based on a large language model according to claim 6, characterized in that, The construction of the second prompt word based on the query request, the query statement, the preset food data model information, and the event-related data includes: Based on the query request and the query statement, at least one summary knowledge block is retrieved from the RAG knowledge base. The summary knowledge block is a food system information block, a historical news summary block, or an event analysis summary block. The second role of the generated intelligent agent is a food news data analysis expert who analyzes key information based on the event-related data. A second task description is generated based on the query request and the event-related data. The second task description is used to instruct the large language model to summarize key information (such as core details of the event, scope of impact, and response suggestions) based on the query request and the event-related data. The second role, the summarized knowledge block, the second task description, the query request, the query statement, the preset food data model information, and the event-related data are integrated into the second prompt word.

8. The method for querying food news event data based on a large language model according to claim 1, characterized in that, Also includes: The query statement is returned to the user terminal; In response to the user's confirmation instruction to input the query statement, the query statement is executed to obtain the event-related data; Establish the association between the query request and the query statement, and store the query request and the query statement in the RAG knowledge base.

9. The method for querying food news event data based on a large language model according to claim 1, characterized in that, After returning the data summary results to the user terminal, the method further includes: Obtain feedback information input by the user, wherein the feedback information indicates whether the result is correct or incorrect; If the feedback information indicates that the result is correct, a query block is generated based on the query request, the query statement, the event-related data, and the data summary result, and the query block is stored in the RAG knowledge base; If the feedback information indicates an error, an anomaly block is generated based on the query request, the query statement, the event-related data, and the data summary results. The anomaly block is then stored in an anomaly knowledge base, which is used to perform fine-tuning and optimization operations on the large language model.

10. A food news event data query system based on a large language model, characterized in that, A method for performing a food news event data query based on a large language model as described in any one of claims 1 to 9, comprising: The request retrieval module is configured to: retrieve a query request input by the user, wherein the query request is a question related to food news described in natural language; The RAG query module is configured to retrieve at least one knowledge block from the RAG knowledge base according to the query request, wherein the knowledge block is food-related knowledge information related to the query request. The statement generation module is configured to: construct a first prompt word based on the query request, the knowledge block and the preset food data model information, and input the first prompt word into the large language model to generate a query statement; The data acquisition module is configured to: acquire event-related data from the food news target database according to the query statement; The data summary module is configured to: construct a second prompt word based on the query request, the query statement, the preset food data model information, and the event-related data, and input the second prompt word into the large language model to generate a data summary result, wherein the data summary result is a natural language summary of the event-related data; the result return module is configured to: return the data summary result to the user terminal.