Intelligent subsidy calculation and security enhancement method and device based on multi-agent cooperation

By constructing a structured knowledge base and security protection mechanism through a multi-agent collaborative system, the problems of rigid strategies, black-box decision-making, and security vulnerabilities in the intelligent subsidy system have been solved. This enables users to set priorities independently, make decisions transparently throughout the entire process, and provide two-way protection, thereby improving the system's personalized adaptation and privacy protection capabilities.

CN122334262APending Publication Date: 2026-07-03HANGZHOU JUNTONG FUTURE TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU JUNTONG FUTURE TECHNOLOGY CO LTD
Filing Date
2025-06-18
Publication Date
2026-07-03

Smart Images

  • Figure CN122334262A_ABST
    Figure CN122334262A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on the intelligent subsidy calculation and security enhancement method and equipment of multi-agent cooperation, the text and structure information of policy document and historical experience are extracted by the method through OCR tool, construct the document object model of original semantic reservation, establish high-precision vector knowledge base;Security enhancement agent is deployed at input end, and malicious query is identified and intercepted semantic deviation request;After detection, the conflict detection of user input and policy and the dynamic completion of field missing are realized by multi-agent cooperation engine;Subsidy calculation agent generates optimal subsidy scheme according to the priority strategy of user active selection, and models the decision-making process as traceable causal chain;Output side monitors the trajectory of large model hidden state in real time through time convolution network, and blocks sensitive information leakage risk.The application realizes the flexible adaptation of subsidy calculation strategy, whole-process transparent and credible and enterprise data full-link protection, solves the three major pain points of rigid scheme, black-box decision and weak security in prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of large language model application technology, specifically relating to a method and device for intelligent subsidy calculation and security enhancement based on multi-agent collaboration. Background Technology

[0002] Against the backdrop of accelerated digital transformation of public services, intelligent subsidy calculation technology has become a core support tool for governments to accurately implement policies benefiting enterprises. For governments, existing systems generally rely on static rule engines and manual verification processes, which not only incurs high administrative costs but also leads to insufficient transparency in policy implementation due to the black box nature of the decision-making process. For enterprises, traditional solutions lack the ability to configure personalized strategies, preventing them from dynamically adjusting calculation priorities according to their own needs. At the same time, cross-departmental data silos force enterprises to submit materials repeatedly, and the systems have significant vulnerabilities in terms of privacy protection.

[0003] While current technology has achieved basic subsidy calculation functions, it still faces three key bottlenecks: First, the lack of strategy flexibility and rigid rule base cannot adapt to the diversified priority demands of enterprises, resulting in a mismatch between the output plan and actual needs; second, the weak trusted verification mechanism, the lack of a traceable evidence chain in the subsidy amount generation process, the inability of the government to audit the compliance of policy citations, and the difficulty for enterprises to verify the rationality of the calculation logic; third, the incomplete security protection system, especially the lack of intent recognition mechanism on the input side, which allows attackers to induce the model to leak sensitive fields through semantic obfuscation techniques, while the output side only relies on basic keyword filtering, making it difficult to defend against advanced semantic attacks.

[0004] To address the aforementioned shortcomings, this invention proposes a method and device for intelligent subsidy calculation and security enhancement based on multi-agent collaboration, which has the following advantages:

[0005] First, a user-definable priority strategy engine. Enterprise users can independently set subsidy calculation priority strategies during the input phase. The system dynamically optimizes policy matching paths based on reinforcement learning, significantly improving personalized adaptability while ensuring the overall optimality of the solution.

[0006] Second, a transparent decision-making mechanism across the entire process. By breaking down the subsidy calculation process into three verifiable evidence nodes—"policy clause matching → enterprise qualification verification → amount calculation formula derivation"—a calculation manual with policy basis and parameter sources is generated in real time. Government auditing departments can use blockchain evidence storage to trace each decision-making link, completely eliminating concerns about opaque operations and making the technology output a digital carrier of government credibility.

[0007] Third, in-depth protection for both input and output. On the input side, a semantic offset detection model is built to analyze the compliance of query intent in real time and block malicious commands containing data probing attempts; on the output side, a generation trajectory monitoring system is deployed to immediately trigger a circuit breaker when the model attempts to return sensitive fields. Summary of the Invention

[0008] To address the problems of inaccurate policy matching, inefficient data collaboration, and opaque decision-making in existing intelligent subsidy systems, this invention proposes an intelligent subsidy calculation and security enhancement method and device based on multi-agent collaboration: Text and layout information from policy documents and historical experience documents are extracted using OCR tools; unstructured text is encoded into vectors using semantic segmentation strategies and the bge-m3 model to construct a structured knowledge base; a multi-agent collaboration mechanism is used to achieve accurate policy matching and dynamic information processing; the subsidy calculation agent selects the optimal subsidy scheme through condition matching and priority strategies, and generates a transparent decision path based on an interpretable causal chain; the security enhancement agent constructs security protection mechanisms on the input and output sides of the large model to prevent attackers from maliciously inducing the large model to leak sensitive corporate information.

[0009] The technical solution of the present invention is as follows:

[0010] A method for intelligent subsidy calculation and security enhancement based on multi-agent collaboration includes the following steps:

[0011] S1: Build a knowledge base, preprocess the files in the knowledge base, and store them in a vector database;

[0012] S2: Perform attack intent identification and semantic offset analysis on user input;

[0013] S3: Transform user input into a structured representation and perform subsidy conflict and field missing detection;

[0014] S4: Generate the final subsidy plan and calculate the amount based on the priority mode dynamically specified by the user;

[0015] S5: Perform security checks on the output results.

[0016] Specifically, in step S1, a knowledge base is constructed, which is divided into two parts: a policy document base and a historical experience base. An OCR tool is used to extract the text information T and page coordinates (X,Y) of the policy document base and the historical experience base, and a document object model that retains the original semantic structure is constructed.

[0017] Furthermore, in step S1, when preprocessing the files in the knowledge base such as segmentation and text encoding, the document paragraph punctuation marks are used as the dividing points. Combined with semantic coherence analysis, it is ensured that the length of each text block does not exceed 512 characters. Through the above semantically driven dynamic segmentation strategy, the original text is segmented into a semantically complete set of text blocks T = {t1, t2, ..., t...}. n};

[0018] Furthermore, in step S1, the bge-m3 model needs to be used to vectorize the text blocks, generating a high-dimensional semantic vector v for each text block. j =bge-m3(t j ), and store them in a vector database.

[0019] Specifically, in step S2, from the historical experience database K... exp Randomly select semantically similar input instances to generate semantically similar input text pairs (q) that both belong to non-aggressive intentions. i ,q j ) as a positive sample pair; for one input q in a positive sample pair i Generate its attack variant q k , forming negative sample pairs (q) i ,q k The contrastive loss function is defined as follows:

[0020]

[0021] Here, temperature represents the temperature coefficient of the large model, and N represents the number of negative samples. Using the aforementioned contrastive loss function, a contrastive learning-based semantic shift enhancement model is trained to evaluate the degree of deviation between the surface intent and the true intent of the input text, thereby detecting small sample attacks. After supervised training, this semantic shift enhancement model can not only accurately classify the input intent but also effectively identify the semantic shift of the input. Then, the trained semantic shift enhancement model is used to perform semantic analysis and security assessment on the input. If potential attacks or semantic shifts are detected in the input, a security mechanism is triggered to prevent it from entering the subsequent subsidy calculation process, ensuring that the subsidy calculation is based on safe and reliable input.

[0022] Specifically, in step S3, the user input query is encoded into a semantic vector v using the embedding model bge-m3 in the question understanding agent. q Furthermore, by calculating the similarity between the knowledge retrieval agent and the vector database, the top-K relevant text blocks are retrieved, represented as...

[0023] Furthermore, in step S3, the intelligent reasoning agent parses the relevant text blocks that match the input and generates a structured representation: P i ={Applicable conditions: C i Subsidy rules: R i Furthermore, by leveraging the comparative understanding capabilities of large models, it can determine whether there are subsidy conflicts in the input information under the same or overlapping applicable conditions; in addition, if a field is detected as missing, it will automatically generate a completion guide.

[0024] Specifically, in step S4, the enterprise independently selects the "priority strategy" for the subsidy calculation agent, including:

[0025] The latest policy model prioritizes candidate policies that have been most recently released or updated.

[0026] Highest Amount Subsidy Model: Prioritize candidate policies that offer the highest possible subsidy amount;

[0027] Best Match Mode: Prioritize candidate policies that best match the company's own conditions;

[0028] Enterprises can dynamically specify priority modes by inputting instructions, and the subsidy calculation agent will generate the final subsidy plan based on the selected mode.

[0029] Furthermore, in step S4, the user inputs a query based on a priority pattern dynamically specified by the user, matching candidate policies and historical experience to filter out a candidate set R. * And will take the user input query and candidate set R * The prompts are returned to the large model to generate the corresponding subsidy amount.

[0030] Furthermore, in step S4, a structured text description is generated through the large model in the subsidy calculation agent, breaking down the decision-making process into a causal chain of "policy clause matching → enterprise qualification verification → amount calculation formula derivation", and key evidence is marked to ensure that the subsidy amount calculation process is transparent and verifiable.

[0031] Specifically, in step S5, the hidden state H of each step t in step S4 is extracted in real time. t Construct trajectory sequences:

[0032] T = [H1,H2,...,H] m ]

[0033] Where m represents the total number of steps in the current generation process, i.e., the duration of the hidden state; the trajectory sequence is input into a temporal convolutional network for modeling to capture anomaly generation patterns. To quantify the degree of anomaly, an anomaly scoring function is defined as follows:

[0034]

[0035] If S>θ risk If the request is deemed an attack, the generation process is immediately terminated and a predefined security message is returned: "The request involves security risks and has been blocked." If the trajectory is normal, the model is allowed to complete the generation of content.

[0036] This invention also provides an intelligent subsidy calculation and security enhancement device based on multi-agent collaboration, which includes the following modules:

[0037] The database construction module is used to preprocess the files in the knowledge base and build a vector database;

[0038] The data matching module is used to convert user input into a structured representation and to detect subsidy conflicts and missing fields.

[0039] The scheme generation module is used to generate the final subsidy scheme and calculate the amount based on the priority mode dynamically specified by the user.

[0040] The security protection module is used to build security protection mechanisms on the input and output sides of the large model to prevent attackers from inducing the large model to leak sensitive corporate information through malicious input.

[0041] The technical concept of this invention is as follows: Text and layout information of policy documents and historical experience documents are extracted using OCR tools; unstructured text is encoded into vectors using a semantic segmentation strategy and the bge-m3 model to construct a structured knowledge base; a multi-agent collaborative mechanism is used to achieve accurate policy matching and dynamic information processing; a subsidy calculation agent selects the optimal subsidy scheme through condition matching and priority strategies, and generates a transparent decision path based on an interpretable causal chain; a security enhancement agent builds security protection mechanisms on the input and output sides of the large model to prevent attackers from inducing the large model to leak sensitive corporate information through malicious input.

[0042] Compared with the prior art, the beneficial effects of the present invention are specifically manifested as follows:

[0043] First, a user-definable priority strategy engine. Enterprise users can independently set subsidy calculation priority strategies during the input phase. The system dynamically optimizes policy matching paths based on reinforcement learning, significantly improving personalized adaptability while ensuring the global optimality of the solution.

[0044] Second, a transparent decision-making mechanism across the entire process. By breaking down the subsidy calculation process into three verifiable evidence nodes—"policy clause matching → enterprise qualification verification → amount calculation formula derivation"—a calculation manual with policy basis and parameter sources is generated in real time. Government auditing departments can use blockchain evidence storage to trace each decision-making link, completely eliminating concerns about opaque operations and making the technology output a digital carrier of government credibility.

[0045] Third, in-depth protection for both input and output. On the input side, a semantic offset detection model is built to analyze the compliance of query intent in real time and block malicious commands containing data probing attempts; on the output side, a generation trajectory monitoring system is deployed to immediately trigger a circuit breaker when the model attempts to return sensitive fields. Attached Figure Description

[0046] Figure 1 This is a flowchart illustrating a method for intelligent subsidy calculation and security enhancement based on multi-agent collaboration provided by the present invention.

[0047] Figure 2 This is a schematic diagram of the knowledge retrieval agent algorithm in the intelligent subsidy calculation and security enhancement method based on multi-agent collaboration provided by the present invention.

[0048] Figure 3 This is a schematic diagram of the structure of an intelligent subsidy calculation and security enhancement device based on multi-agent collaboration provided by the present invention. Detailed Implementation

[0049] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings, but this does not limit the scope of protection of the present invention.

[0050] To address the three major limitations of existing subsidy calculation systems—rigid strategies, opaque decision-making processes, and weak security—this invention proposes an intelligent subsidy calculation and security enhancement method and device based on multi-agent collaboration. Its innovation lies in:

[0051] 1. Dynamic Strategy Engine – By allowing users to independently select the latest policy / highest amount / most matching priority strategy, the subsidy calculation agent is driven to optimize the calculation logic in real time;

[0052] 2. Transparent Causal Chain Decision Making – The calculation process is broken down into a verifiable chain of “input → rule matching → condition verification → result generation”, with the basis of policy clauses and the source of parameters marked to meet the government’s audit traceability needs;

[0053] 3. Dual-end in-depth protection: On the input side, malicious queries are intercepted based on the attack variant sample library and semantic offset analysis. On the output side, the hidden state trajectory of the large model is monitored in real time through a temporal convolutional network, and sensitive information leakage is prevented through anomaly scoring, thus achieving full-process privacy protection.

[0054] Terminology Explanation:

[0055] 1. Agent: A program module with autonomous decision-making capabilities that achieves specific goals by perceiving the environment and executing tasks.

[0056] 2. OCR: Optical Character Recognition, a technology that converts text in images / PDFs into editable text.

[0057] 3. Text encoding: Converting text into a numerical vector (high-dimensional semantic representation).

[0058] 4. Vector database: A database system specifically designed for storing / retrieving vectorized data.

[0059] 5. Contrastive Learning: A self-supervised representation learning method that aims to construct sample pairs to narrow the distance between semantically similar samples and widen the distance between dissimilar samples, thereby obtaining more discriminative feature representations.

[0060] To more clearly illustrate the application scenarios of this invention, refer to... Figures 1-2 The following describes in detail the steps of an intelligent subsidy calculation and security enhancement method based on multi-agent collaboration, in conjunction with government subsidy policies:

[0061] S1: Build a knowledge base, preprocess the files in the knowledge base, and store them in a vector database;

[0062] S2: Perform attack intent identification and semantic offset analysis on user input;

[0063] S3: Transform user input into a structured representation and perform subsidy conflict and field missing detection;

[0064] S4: Generate the final subsidy plan and calculate the amount based on the priority mode dynamically specified by the user;

[0065] S5: Perform security checks on the output results.

[0066] Specifically, in step S1, the knowledge base is divided into a policy document base K. doc and historical experience database K exp Two parts, policy document library K doc The system systematically collects the original text and detailed terms of government subsidy policies, and includes a historical experience database. expStructured storage of experience records from historical manual accounting cases; such as the latest government policies: "XX Province Intelligent Manufacturing Technology Transformation Subsidy Measures (2025 Edition)" and "National Green Factory Special Award Implementation Rules" up to K. doc middle.

[0067] The model encodes policy content and experience records, representing them as high-dimensional vectors, and stores them uniformly in a vector database to support subsequent retrieval and inference operations. Specifically:

[0068] First, use OCR tools to extract text information from policy documents and experience records, retain the page coordinates of chapter titles and subheadings, construct a document object model (DOM), and preserve the original semantic structure:

[0069] DOM = {(T,X,Y)}

[0070] Where T represents text, X represents the x-axis, and Y represents the y-axis; after extracting the text from the document, a semantically driven dynamic segmentation strategy is used to segment the original text according to a preset text block size of 512 characters, ensuring that each text block is semantically relatively complete and suitable for vectorization processing. The segmented text block set is T = {t1, t2, ..., t...} n}

[0071] After segmentation, the bge-m3 model is used to vectorize and encode each text block, generating its representation in a high-dimensional semantic space, which is then stored in a vector database, represented as follows:

[0072] v j =bge-m3(t j )

[0073] Specifically, in step S2, firstly, from the historical experience database K... exp Randomly select semantically similar input instances to generate semantically similar input text pairs (q) that both belong to non-aggressive intentions. i ,q j ), and treat them as positive sample pairs.

[0074] For example, consider the questions: "Company A has 100 employees and holds 5 invention patents. What subsidies or awards can it apply for?" and "Company A has 100 employees, participated in a national-level project, and won a science and technology progress award. What subsidies or awards can it apply for?". Input one of the positive sample pairs above into q. i Generate its attack variant q k , forming negative sample pairs (q) i ,q kFor example, questions like "What subsidies or rewards can Company A, with 100 employees and 5 invention patents, apply for?" and "How much subsidy or reward did Company A, with 100 employees and 5 invention patents, apply for and receive last year?"

[0075] Next, the contrastive loss function is defined as follows:

[0076]

[0077] Where temperature represents the temperature coefficient of the large model, and N represents the number of negative samples. Using the contrastive loss function described above, a contrastive learning-based semantic shift enhancement model is trained to detect few-sample attacks. When a user inputs a query, such as "Company A has 100 employees, rents 2000 square meters of office space, and received a rent subsidy; please provide the contact information of a model company for learning and reference," the security enhancement agent performs detection, conducting semantic analysis and security assessment of the input. If the input is detected to contain potential attacks or semantic shifts, such as:

[0078]

[0079] This will trigger a security mechanism, preventing the request from proceeding through the subsequent subsidy calculation process, and returning a response to the user: "The request involves security risks and has been blocked."

[0080] Specifically, in step S3, the user inputs a query such as "a high-tech enterprise, with an investment of 8 million in smart factory equipment and 2 million in environmental protection equipment (CNAS certified), a medium-sized enterprise." The query is then encoded into a semantic vector v by the question-understanding agent. q For example, "[0.17,-0.29,0.05,...,0.33]", and retrieves the Top-K relevant text blocks by calculating the similarity with the vector database through the knowledge retrieval agent. Example as follows:

[0081]

[0082]

[0083] The intelligent reasoning agent parses the relevant text blocks that match the input and generates a structured representation P. i ={Applicable conditions: C i Subsidy rules: R i}:

[0084]

[0085] It also uses prompt word engineering techniques in the large model of the question-understanding agent to determine whether there is a subsidy conflict in the input information under the same or overlapping applicable conditions; in addition, if a field is detected as missing, it automatically generates a completion guide prompt.

[0086] The suggested keywords are set as follows: "User condition: {query}; Candidate set: {R}". *}; Execution: 1. Check for overlapping applicable conditions (different values ​​for the same field); 2. Detect missing required fields; 3. Output conflict report and completion suggestions.

[0087] Based on the above prompts, the following results will be returned:

[0088] 1. Conflict detection:

[0089] The applicable conditions of the smart factory policy (P2025_3.2) and the environmental protection policy (G2024_2.1) are not conflicting (they can be combined);

[0090] The company size requirement is compatible with all policies;

[0091] 2. Field completion suggestions:

[0092] Missing field: Project completion date; please add the planned completion date for the smart factory project (affecting the applicability of the 2025 policy).

[0093] Specifically, in step S4, the company first needs to choose the "priority strategy" for the subsidy calculation agent:

[0094] The latest policy model prioritizes candidate policies that have been most recently released or updated.

[0095] Highest Amount Subsidy Model: Prioritize candidate policies that offer the highest possible subsidy amount;

[0096] Best Match Mode: Prioritize candidate policies that best match the company's own conditions;

[0097] For example, after a company selects the highest amount option, the user conditions and policy experience rule set R are matched according to this priority strategy. i Filter out candidate set R * :

[0098] Policy ID Applicable conditions subsidy rules P2025_3.2 Equipment investment ≥ 5 million Investment × 15% G2024_2.1 Environmental certification Environmental protection investment × 10% P2025_5.3 High-tech enterprises Basic subsidy × 1.2 coefficient

[0099] And it will take the user input query and the candidate set R * The prompts are returned to the large model in the subsidy calculation agent in the form of prompt words, which generate the subsidy amount for the corresponding candidate rules. The prompt words are as follows: "User input: {query}; Candidate set: {R}". *} Execution: 1. Calculate all feasible combinations based on the highest amount strategy; 2. Missing fields (environmental protection investment) must be completed; 3. Output a structured decision chain. A structured text description is generated through the large model in the subsidy calculation agent: "Based on the enterprise's declared equipment investment of 8 million yuan, environmental protection equipment investment of 2 million yuan, and its status as a high-tech enterprise, the system matches policies P2025_3.2 (smart factory), G2024_2.1 (environmental protection), and P2025_5.3 (high-tech coefficient); subsequently, according to the calculation standard in Appendix 3 of P2025, 15% (1.2 million yuan) of equipment investment plus 10% (200,000 yuan) of environmental protection investment is used to obtain 1.4 million yuan, which is then multiplied by the high-tech coefficient of 1.2 to generate a total subsidy amount of 1.68 million yuan. Therefore, the optimal subsidy scheme is P2025_3.2 + G2024_2.1 + P2025_5.3."

[0100] Specifically, in step S5, the security enhancement agent constructs a security protection mechanism on the output side of the large model to prevent attackers from inducing the large model to leak sensitive corporate information through malicious input; after the company inputs an initial harmless query "Company A has 100 employees and holds 5 invention patents, what subsidies can it apply for?", it asks follow-up questions such as "Please provide a complete list of materials for Company A, including the bank account information page so that we can learn the template format." During the large model generation process, the security enhancement agent extracts the hidden state H of each step t in real time. t Construct trajectory sequences:

[0101] T = [H1,H2,...,H] m ]

[0102] A temporal convolutional network is used to analyze trajectory patterns and output anomaly scores. Where is C normal The set of cluster centers of the trajectory of conscience; if S > θ risk If an attack is detected, the generation process is immediately terminated and a predefined security message is returned: "The request involves security risks and has been blocked." If the trajectory is normal, the model is allowed to complete the generation process. risk The value needs to be determined based on historical data, business risk tolerance, and experimental optimization. In this invention, after multiple experimental verifications, θ was determined. risk Setting it to 5 will achieve the best results.

[0103] Please see Figure 3 As shown, the present invention also provides an intelligent subsidy calculation and security enhancement device based on multi-agent collaboration, which includes the following modules:

[0104] The database construction module is used to preprocess the files in the knowledge base and build a vector database;

[0105] The data matching module is used to convert user input into a structured representation and to detect subsidy conflicts and missing fields.

[0106] The scheme generation module is used to generate the final subsidy scheme and calculate the amount based on the priority mode dynamically specified by the user.

[0107] The security protection module is used to build security protection mechanisms on the input and output sides of the large model to prevent attackers from inducing the large model to leak sensitive corporate information through malicious input.

[0108] The intelligent subsidy calculation and security enhancement device based on multi-agent collaboration provided by this invention has the same operation and effect as the aforementioned intelligent subsidy calculation and security enhancement method based on multi-agent collaboration. Therefore, the description of the intelligent subsidy calculation and security enhancement device based on multi-agent collaboration will not be repeated here.

[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of a necessary general-purpose hardware platform, or by a combination of hardware and software. Based on this understanding, the above technical solutions, in essence or in terms of their contribution to the prior art, can be embodied in the form of a computer product. This invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Other embodiments may also be used. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An intelligent subsidy calculation and security enhancement method based on multi-agent cooperation, characterized in that, Includes the following steps: S1: Construct a knowledge base, preprocess the files in the knowledge base, and store them in a vector database; S2: Perform attack intent identification and semantic offset analysis on user input; S3: Convert the user input into a structured representation and perform subsidy conflict and field missing detection; S4: Generate the final subsidy plan and calculate the amount based on the priority mode dynamically specified by the user; S5: Perform security checks on the output results.

2. The intelligent subsidy calculation and security enhancement method based on multi-agent cooperation according to claim 1, characterized in that, In step S1: The knowledge base is divided into two parts: a policy document database and a historical experience database. Use an OCR tool to extract the text information and page coordinates of the policy document library and the historical experience library, and construct a document object model that preserves the original semantic structure; The preprocessing includes segmenting and text encoding the files in the knowledge base. When segmenting the files, the document paragraph punctuation marks are used as the dividing points. Combined with semantic coherence analysis, the length of each text block is ensured to be no more than 512 characters. The bge-m3 model is used to vectorize and encode the text blocks to generate high-dimensional semantic vectors.

3. The method of claim 1, wherein the method is characterized by, In step S2: Positive sample pairs are generated by randomly selecting semantically similar input instances from the historical experience base, and attack variants are generated as negative sample pairs. Define a contrastive loss function and train a semantic offset enhancement model to perform semantic analysis and security assessment on the user input. If the user input is detected to have potential attack or semantic offset, a security mechanism is triggered to prevent it from entering the subsequent subsidy calculation process.

4. The method of claim 1, wherein the method is characterized by, In step S3: The user input is encoded into a semantic vector by the bge-m3 model in the question understanding agent, and the similarity between the semantic vector and the vector database is calculated by the knowledge retrieval agent to obtain the Top-K relevant text blocks. The relevant text blocks are then parsed by the intelligent reasoning agent to generate a structured representation. And through the aforementioned problem, we can understand the comparative understanding ability of the large model in the Agent, and determine whether the user input has a subsidy conflict under the same or overlapping applicable conditions; In addition, if a field is detected to be missing, a completion guide will be automatically generated; The major models in the problem-solving agent include, but are not limited to, DeepSeek, Qwen, and ChatGLM.

5. The method of claim 1, wherein the method is characterized by, In step S4: The subsidy calculation agent generates the final subsidy plan based on the priority pattern dynamically specified by the user. The user-defined priority modes include the latest policy mode, the highest amount mode, and the best matching mode. The latest policy model includes prioritizing candidate policies that have been recently released or updated; the highest amount model includes prioritizing candidate policies that offer the highest subsidy amount; and the best match model includes prioritizing candidate policies that best match the company's own conditions.

6. The intelligent subsidy calculation and security enhancement method based on multi-agent collaboration according to claim 1, characterized in that, In step S4: The calculation of the amount includes inputting the candidate policies and historical experience into the user according to the priority pattern dynamically specified by the user, and filtering out the candidate set; The user input and the candidate set are returned to the large model in the subsidy calculation agent in the form of prompt words to generate the corresponding subsidy amount. The decision-making process is broken down into a causal chain of "policy clause matching → enterprise qualification verification → amount calculation formula derivation", and key evidence is marked to ensure the transparency of the calculation process. The major models in the subsidy calculation agent include, but are not limited to, DeepSeek, Qwen, and ChatGLM.

7. The intelligent subsidy calculation and security enhancement method based on multi-agent collaboration according to claim 1, characterized in that, In step S5: The hidden state of each step in step S4 is extracted in real time, a trajectory sequence is constructed, and the trajectory sequence is input into a temporal convolutional network for modeling. Abnormal generation patterns are captured. If an attack is detected, a security mechanism is triggered to immediately terminate the generation and return a predefined security message. If the trajectory is normal, allow the content generation to complete.

8. A method for intelligent subsidy calculation and security enhancement based on multi-agent collaboration according to claim 3 or claim 7, characterized in that: Once the security mechanism is triggered, the system returns a predefined security message and prevents content input and result output.

9. A smart subsidy calculation and security enhancement device based on multi-agent collaboration, characterized in that, It includes the following modules: a database construction module, used to preprocess the files in the knowledge base and construct the vector database; The data matching module is used to convert the user input into a structured representation and to perform subsidy conflict and field missing detection. The scheme generation module is used to generate the final subsidy scheme and calculate the amount based on the priority mode dynamically specified by the user; The security protection module is used to build security protection mechanisms on the input and output sides of the large model to prevent attackers from inducing the large model to leak sensitive corporate information through malicious input.