A tax rule task execution method, device and equipment based on multi-agent cooperation and a medium

By decomposing and verifying tax rules through a multi-agent collaborative approach, generating and correcting program code, the problems of rule omissions and calculation errors in existing technologies are solved, and the stable and accurate execution of tax rule tasks is achieved.

CN122152709APending Publication Date: 2026-06-05HANGZHOU HONGSHU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU HONGSHU INFORMATION TECH CO LTD
Filing Date
2026-03-25
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies suffer from rule omissions and confusion, unreliable code generation and execution, and a lack of test-driven closed-loop error correction when dealing with complex tax rule-guided reasoning tasks, resulting in unstable results and insufficient accuracy.

Method used

A multi-agent collaborative approach is adopted, which uses a large language model to decompose tax rules into sub-rules, generates program code, verifies it through test cases, iteratively corrects errors, and forms a closed-loop process to ensure the accuracy and stability of each step.

Benefits of technology

It improves the stability and accuracy of large language models in handling complex tax rule-guided reasoning tasks. Through automated decomposition, verification and correction, it reduces rule omissions and calculation biases, and improves the level of automation and the reliability of results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122152709A_ABST
    Figure CN122152709A_ABST
Patent Text Reader

Abstract

The application discloses a tax rule task execution method and device based on multi-agent cooperation, equipment and medium, and relates to the technical field of computers. It comprises: using a large language model to disassemble an original tax rule set to obtain a plurality of tax sub-rules; using a code generation agent to generate program code for implementing the current tax sub-rule, and using a test case generation agent to generate test cases; using a test verification agent to call a tool to run the program code and execute the test cases to generate a verification result; if the verification fails, the code generation agent is used to iteratively correct the program code until the termination condition is met; based on the target program code corresponding to all tax sub-rules, a target executable program is generated, and the target executable program is run to process target rule task input data to obtain a corresponding execution result. Thus, the stability and accuracy of the large language model in processing complex tax rule guided reasoning tasks can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and medium for executing tax rules based on multi-agent collaboration. Background Technology

[0002] In many real-world business scenarios and complex decision-making situations, there are numerous rule-guided reasoning tasks that require logical judgment and numerical calculation based on rules described in natural language, such as tax calculations, compliance reviews, and policy approvals. The core challenges of these tasks are twofold: firstly, the system must simultaneously recall and correctly apply multiple rules with dependencies or priority relationships; the omission or misuse of any key rule can lead to invalid results; secondly, the rule execution process often involves multi-step calculations and result aggregation, demanding extremely high numerical accuracy and logical consistency. Traditionally, these tasks have relied on manual parsing or dedicated rule engines, but their development and maintenance costs are high, and they are difficult to adapt to the needs of frequent rule changes or cross-domain migrations.

[0003] In recent years, with the rapid development of large language models, researchers have attempted to automate rule-based reasoning tasks by leveraging their powerful semantic understanding and generation capabilities. Existing technical approaches mainly fall into three categories: first, chain-based reasoning based on prompts, which inputs all rules and questions into the model and relies on it to autonomously generate the reasoning process; second, tool-enhanced code generation schemes, which require the model to write executable code based on the rules and run it through an external interpreter to obtain the results; and third, rule selection methods combining retrieval and structured representation, aiming to improve the accuracy and completeness of rule recall. These methods have promoted the automation of rule-based tasks to some extent, but still have significant limitations. Long rule omissions and confusion: When rules are lengthy or similar, the model is prone to incomplete rule recall or incorrect matching in a single prompt. Even if the reasoning process seems reasonable, the final result may still be biased due to the incorrect application of key rules. Unreliable code generation and execution: Although introducing code generation and external execution can reduce computational errors to some extent, the model may still make mistakes in rule understanding and code logic implementation, and the errors in the generated code itself lack effective automatic location and correction mechanisms. Lack of test-driven closed-loop error correction: Existing solutions mostly focus on single generation and execution, without building a process for continuous verification and iterative correction, which often leads to errors being exposed in the final stage, making it difficult to trace the root cause and achieve stable output.

[0004] As can be seen from the above, how to improve the stability and accuracy of large language models in handling complex tax rule-guided reasoning tasks is an urgent problem to be solved. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a method, apparatus, device, and medium for executing tax rules based on multi-agent collaboration, which can improve the stability and accuracy of large language models in handling complex tax rule-guided reasoning tasks. The specific solution is as follows: Firstly, this application provides a method for executing tax rule tasks based on multi-agent collaboration, including: Obtain the original set of tax rules in natural language form, and decompose the original set of tax rules using a preset large language model to obtain several tax sub-rules and the execution order and dependencies between the tax sub-rules; The system generates intelligent agents using preset code to implement the current tax sub-rules, and generates intelligent agents using preset test cases to cover different input scenarios based on the current tax sub-rules. The preset test verification agent calls a preset tool to run the program code and execute the test cases to generate verification results corresponding to the current tax sub-rule; If the verification result indicates that the test has failed, the preset code generation agent will use the verification result to iteratively correct the program code until the verification result meets the preset termination condition, and the current program code will be determined as the target program code. A target executable program is generated based on the target program code corresponding to all tax sub-rules, and the target executable program is run to process the target rule task input data to obtain an execution result that conforms to the constraints of the original set of tax rules.

[0006] Optionally, the step of decomposing the original set of tax rules using a preset large language model to obtain several tax sub-rules and the execution order and dependencies between the tax sub-rules includes: The original set of tax rules is semantically analyzed using a pre-defined large language model, and independent judgment conditions and / or calculation targets are identified and extracted based on the semantic analysis results. Several tax sub-rules are generated based on each independent judgment condition and the calculation objective, along with the execution order and dependencies between the tax sub-rules.

[0007] Optionally, the tax rule task execution method based on multi-agent collaboration further includes: The preset task scheduling agent is used to generate the preset code, the preset test case, and the preset test verification agent based on the execution order and dependencies between the tax sub-rules.

[0008] Optionally, the step of using a preset test verification agent to call a preset tool to run the program code and execute the test cases to generate verification results corresponding to the current tax sub-rule includes: The smart agent uses a preset test verification method to call a preset file operation tool through a preset tool interface to write the program code to an accessible file path. The preset test verification agent uses the preset tool interface to call the preset program execution tool to execute the program code under the accessible file path, and inputs the test cases as input parameters into the program code to obtain the corresponding verification results.

[0009] Optionally, the preset termination conditions include a first preset termination condition that all test cases corresponding to the current tax sub-rule have passed execution, and a second preset termination condition that the number of iterations to correct the program code of the current tax sub-rule has reached a preset maximum number of iterations.

[0010] Optionally, the test cases cover input scenarios including normal input, boundary condition input, and mixed input with preset error-prone conditions.

[0011] Optionally, the preset code generation agent, the preset test case generation agent, and the preset test verification agent are implemented by a large language model.

[0012] Secondly, this application provides a tax rule task execution device based on multi-agent collaboration, comprising: The original rule processing module is used to obtain a set of original tax rules in natural language form, and to decompose the set of original tax rules using a preset large language model to obtain several tax sub-rules and the execution order and dependencies between the tax sub-rules. The code generation module is used to generate program code to implement the current tax sub-rule based on the current tax sub-rule using a preset code generation agent, and to generate corresponding test cases covering different input scenarios based on the current tax sub-rule using a preset test case generation agent. The code verification module is used to use a preset test verification agent to call a preset tool to run the program code and execute the test cases, so as to generate a verification result corresponding to the current tax sub-rule; The code iteration and correction module is used to iteratively correct the program code based on the verification result if the verification result characterization test fails, using the preset code generation agent to perform the verification result until the verification result meets the preset termination condition, and then determine the current program code as the target program code. The executable program generation module is used to generate a target executable program based on the target program code corresponding to all tax sub-rules, and run the target executable program to process the target rule task input data to obtain an execution result that conforms to the constraints of the original set of tax rules.

[0013] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the aforementioned method for executing tax rules based on multi-agent cooperation.

[0014] Fourthly, this application provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned method for executing tax rule tasks based on multi-agent collaboration.

[0015] This application provides a method for executing tax rule tasks based on multi-agent collaboration. The method involves obtaining a set of original tax rules in natural language form, and then decomposing the original tax rule set using a preset large language model to obtain several tax sub-rules and the execution order and dependencies between these sub-rules. A preset code generation agent generates program code to implement the current tax sub-rules based on them, and a preset test case generation agent generates corresponding test cases covering different input scenarios based on the current tax sub-rules. A preset test verification agent calls a preset tool to run the program code and execute the test cases to generate verification results corresponding to the current tax sub-rules. If the verification result indicates test failure, the preset code generation agent iteratively corrects the program code based on the verification result until the verification result meets a preset termination condition, and the current program code is identified as the target program code. A target executable program is generated based on the target program code corresponding to all tax sub-rules, and the target executable program is run to process the target rule task input data to obtain execution results that conform to the constraints of the original set of tax rules.

[0016] As can be seen from the above, this application constructs an automated synthesis and verification closed loop from complex natural language rules to executable programs by introducing rule decomposition driven by a large language model, multi-agent collaboration (code generation, test case generation, and test verification), and an iterative correction mechanism based on tool execution and test results. By decomposing the rule task and performing test coverage and execution verification for each step, the application systematically solves the problems of rule omissions, application errors, and computational biases that exist when a single model processes long rules. This improves the stability and accuracy of large language models in handling complex tax rule-guided reasoning tasks. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0018] Figure 1 This is a flowchart of a tax rule task execution method based on multi-agent collaboration disclosed in this invention; Figure 2 This is a schematic diagram of a tax rule task execution device based on multi-agent collaboration disclosed in this invention; Figure 3 This is a structural diagram of an electronic device disclosed in this invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] In recent years, with the rapid development of large language models, researchers have attempted to automate rule-based reasoning tasks by leveraging their powerful semantic understanding and generation capabilities. Existing technical approaches mainly fall into three categories: first, chain-based reasoning based on prompts, which inputs all rules and questions into the model and relies on it to autonomously generate the reasoning process; second, tool-enhanced code generation schemes, which require the model to write executable code based on the rules and run it through an external interpreter to obtain the results; and third, rule selection methods combining retrieval and structured representation, aiming to improve the accuracy and completeness of rule recall. These methods have promoted the automation of rule-based tasks to some extent, but still have significant limitations. Long rule omissions and confusion: When rules are lengthy or similar, the model is prone to incomplete rule recall or incorrect matching in a single prompt. Even if the reasoning process seems reasonable, the final result may still be biased due to the incorrect application of key rules. Unreliable code generation and execution: Although introducing code generation and external execution can reduce computational errors to some extent, the model may still make mistakes in rule understanding and code logic implementation, and the errors in the generated code itself lack effective automatic location and correction mechanisms. Lack of test-driven closed-loop error correction: Existing solutions mostly focus on single generation and execution, without building a process for continuous verification and iterative correction. As a result, errors are often exposed in the final stage, making it difficult to trace the root cause and achieve stable output. To address this, this application provides a tax rule task execution scheme based on multi-agent collaboration, which can improve the stability and accuracy of large language models in handling complex tax rule-guided reasoning tasks.

[0021] See Figure 1 As shown in the figure, this application discloses a method for executing tax rule tasks based on multi-agent collaboration, including: Step S11: Obtain the original tax rule set in natural language form, and use a preset large language model to decompose the original tax rule set to obtain several tax sub-rules and the execution order and dependency relationship between the tax sub-rules.

[0022] In this embodiment, the system acquires a set of original tax rules described in natural language and performs deep semantic analysis on the set using a pre-defined large language model to decompose the original rules into a series of atomic tax sub-rules. Specifically, the decomposition of the original tax rule set using the pre-defined large language model to obtain several tax sub-rules and the execution order and dependencies between the tax sub-rules may include: performing semantic analysis on the original tax rule set using the pre-defined large language model, and identifying and extracting independent judgment conditions and / or calculation objectives based on the semantic analysis results; generating several tax sub-rules and the execution order and dependencies between the tax sub-rules based on each independent judgment condition and calculation objective. That is, all independent judgment conditions and tax calculation objectives in the original tax rules are identified through the large language model. Based on this analysis, each sub-rule corresponds to a clear logical judgment or calculation unit. At the same time, the model also needs to analyze and output the execution order and dependencies between these sub-rules. Through the above decomposition, complex rules are transformed into a series of manageable and individually verifiable steps, thereby reducing the instability caused by the model processing multiple rules simultaneously in a long context.

[0023] Step S12: Generate an intelligent agent using preset code to generate program code for implementing the current tax sub-rule based on the current tax sub-rule, and generate corresponding test cases covering different input scenarios using preset test cases based on the current tax sub-rule.

[0024] In this embodiment, a multi-agent collaborative process is initiated for each tax sub-rule. Specifically, a pre-defined code generation agent implemented using a large language model generates or modifies corresponding program code (e.g., a Python function) based on the semantic description and input / output requirements of the current sub-rule to implement the logic of that sub-rule. This code should be able to receive the corresponding input parameters and return results that meet the rule's expectations. Furthermore, a pre-defined test case generation agent (also implemented using a large language model) designs and generates test cases covering multiple input scenarios based on the same sub-rule. The input scenarios covered by the test cases include, but are not limited to, normal input, boundary condition input, and mixed input with pre-defined error-prone conditions. The test cases clarify the behavioral standards of the sub-rule under various circumstances.

[0025] Step S13: Use a preset test verification agent to call a preset tool to run the program code and execute the test cases to generate verification results corresponding to the current tax sub-rule.

[0026] In this embodiment, a pre-defined test verification agent, implemented using a large language model, verifies the correctness of the generated program code. Specifically, the pre-defined test verification agent invokes a pre-defined tool to run the program code and execute the test cases to generate verification results corresponding to the current tax sub-rule. This can include: using the pre-defined test verification agent to call a pre-defined file operation tool through a pre-defined tool interface to write the program code to an accessible file path; using the pre-defined test verification agent to call a pre-defined program execution tool through the pre-defined tool interface to execute the program code in the accessible file path, and inputting the test cases as input parameters into the program code to obtain the corresponding verification results. That is, to ensure the determinism and verifiability of the reasoning process, a tool invocation mechanism is introduced, enabling the agent to interact with the external execution environment. The tools include, but are not limited to, tools for creating and writing program files; executor tools for running specified programs or functions; and interfaces that return structured execution results (including output values ​​or error information). Through tool invocation, the correctness of the program no longer depends on the model's textual reasoning, but is verified by the actual execution results. The executor plays the role of "deterministic constraint" in this process, used to eliminate occasional errors in mathematical calculations or logical judgments of the model.

[0027] Furthermore, in some specific implementations, global coordination can be achieved using a pre-defined task scheduling agent. Specifically, the pre-defined task scheduling agent dynamically schedules the workflows of agents such as code generation, test case generation, and test verification based on the execution order and dependencies among the tax sub-rules determined in the aforementioned steps, deciding whether to process sub-rules sequentially or to process dependent sub-rules in parallel, thereby optimizing overall execution efficiency.

[0028] Step S14: If the verification result characterization test fails, the preset code generation agent is used to iteratively correct the program code based on the verification result until the verification result meets the preset termination condition, and the current program code is determined as the target program code.

[0029] In this embodiment, when a test fails, the detailed verification results generated in the preceding steps are used to iteratively correct the aforementioned program code. Specifically, after the program implementation of a certain sub-rule is completed, the system immediately runs the corresponding test cases; if all tests pass, the sub-rule is considered to have been verified successfully; if any tests fail, the failure information is fed back to the code generation agent to guide iterative modifications. The above process can be iterated multiple times until a preset termination condition is met; the preset termination condition includes a first preset termination condition whether all test cases corresponding to the current tax sub-rule have passed and a second preset termination condition whether the number of iterative corrections to the program code of the current tax sub-rule has reached a preset maximum number of iterations. Meeting either condition exits the correction loop for the current sub-rule. Through this mechanism, errors can be discovered and corrected as early as possible in local steps, rather than being concentrated and exposed in the final integration stage.

[0030] Step S15: Generate a target executable program based on the target program code corresponding to all tax sub-rules, and run the target executable program to process the target rule task input data to obtain an execution result that conforms to the constraints of the original set of tax rules.

[0031] In this embodiment, after all tax sub-rules have undergone the aforementioned steps and generated corresponding target program code, the system integrates and synthesizes these program codes according to the execution order and dependencies of each sub-rule to generate a complete target executable program. When specific task data needs to be processed, simply input the task data and run the target executable program to obtain accurate execution results that conform to all constraints of the original tax rule set.

[0032] As can be seen from the above, this application's embodiments construct an automated synthesis process from complex natural language tax rules to reliable executable programs by introducing tax rule decomposition driven by a large language model, multi-agent collaborative generation and verification, and an iterative correction mechanism based on tool execution results. First, the complex original rules are atomically decomposed into independently verifiable tax sub-rules, and their dependencies are clarified, significantly reducing the risk of rules being omitted or confused from the source. Then, code generation agents and test case generation agents work together to generate test cases covering normal, boundary, and error-prone mixed scenarios for each sub-rule, providing targeted verification standards for complex logic. Furthermore, the test verification agent calls file operation and program execution tools, entrusting the judgment of program correctness to a deterministic external executor, fundamentally eliminating the computational and logical biases that may arise from large language models in pure text reasoning. When verification fails, the system automatically feeds back specific error information to the code generation agent for iterative correction, forming a closed loop of "generation-testing-correction," ensuring that errors are discovered and fixed in a timely manner at local stages, avoiding concentrated exposure in the final stage. Ultimately, all verified sub-rule codes are integrated into a target executable program. Running this program allows for stable and accurate processing of specific tax task data. This embodiment effectively solves the problems of unstable results and insufficient accuracy in the tax field caused by the complexity of rules and the length of calculation chains, significantly improving the automation level, reliability of results, and traceability of the tax rule task execution process.

[0033] See Figure 2 As shown in the figure, this application discloses a tax rule task execution device based on multi-agent collaboration, including: The original rule processing module 11 is used to obtain a set of original tax rules in natural language form, and to decompose the set of original tax rules using a preset large language model to obtain several tax sub-rules and the execution order and dependency relationship between the tax sub-rules.

[0034] The code generation module 12 is used to generate program code for implementing the current tax sub-rule based on the current tax sub-rule using a preset code generation agent, and to generate corresponding test cases covering different input scenarios based on the current tax sub-rule using a preset test case generation agent; the input scenarios covered by the test cases include normal input, boundary condition input, and preset error-prone mixed input.

[0035] The code verification module 13 is used to call a preset tool to run the program code and execute the test cases using a preset test verification agent, so as to generate a verification result corresponding to the current tax sub-rule; the preset code generation agent, the preset test case generation agent and the preset test verification agent are implemented by a large language model.

[0036] The code iteration correction module 14 is used to, if the verification result characterization test fails, use the preset code generation agent to iteratively correct the program code based on the verification result until the verification result meets the preset termination condition, and determine the current program code as the target program code; the preset termination condition includes a first preset termination condition whether all test cases corresponding to the current tax sub-rule have passed the execution and a second preset termination condition whether the number of iterations to correct the program code of the current tax sub-rule has reached the preset maximum number of iterations.

[0037] The executable program generation module 15 is used to generate a target executable program based on the target program code corresponding to all tax sub-rules, and run the target executable program to process the target rule task input data to obtain an execution result that conforms to the constraints of the original set of tax rules.

[0038] In some specific embodiments, the original rule processing module 11 may specifically include: The original rule decomposition unit is used to perform semantic analysis on the original set of tax rules using a preset large language model, and to identify and extract independent judgment conditions and / or calculation targets based on the semantic analysis results. The relationship determination unit is used to generate several tax sub-rules and the execution order and dependency relationships between the tax sub-rules based on each of the independent judgment conditions and the calculation target.

[0039] In some specific embodiments, the code verification module 13 may specifically include: The tool invocation unit is used to use a preset test verification agent to call a preset file operation tool through a preset tool interface to write the program code to an accessible file path; The verification unit is used to use a preset test verification agent to call a preset program execution tool through the preset tool interface to execute the program code under the accessible file path, and input the test cases as input parameters into the program code to obtain the corresponding verification results.

[0040] In some specific embodiments, the tax rule task execution device based on multi-agent collaboration may further include: The task scheduling unit is used to utilize a preset task scheduling agent to schedule the preset code generation agent, the preset test case generation agent, and the preset test verification agent based on the execution order and dependency relationship between the tax sub-rules.

[0041] Furthermore, embodiments of this application also disclose an electronic device, Figure 3This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the multi-agent collaborative tax rule task execution method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0042] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0043] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0044] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the multi-agent collaborative tax rule task execution method disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.

[0045] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed method for executing tax rule tasks based on multi-agent cooperation. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0046] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0047] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0048] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0049] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0050] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for executing tax rules based on multi-agent collaboration, characterized in that, include: Obtain the original set of tax rules in natural language form, and decompose the original set of tax rules using a preset large language model to obtain several tax sub-rules and the execution order and dependencies between the tax sub-rules; The system generates intelligent agents using preset code to implement the current tax sub-rules, and generates intelligent agents using preset test cases to cover different input scenarios based on the current tax sub-rules. The preset test verification agent calls a preset tool to run the program code and execute the test cases to generate verification results corresponding to the current tax sub-rule; If the verification result indicates that the test has failed, the preset code generation agent will use the verification result to iteratively correct the program code until the verification result meets the preset termination condition, and the current program code will be determined as the target program code. A target executable program is generated based on the target program code corresponding to all tax sub-rules, and the target executable program is run to process the target rule task input data to obtain an execution result that conforms to the constraints of the original set of tax rules.

2. The method for executing tax rules based on multi-agent collaboration according to claim 1, characterized in that, The process of decomposing the original set of tax rules using a pre-defined large language model to obtain several tax sub-rules and the execution order and dependencies between the tax sub-rules includes: The original set of tax rules is semantically analyzed using a pre-defined large language model, and independent judgment conditions and / or calculation targets are identified and extracted based on the semantic analysis results. Several tax sub-rules are generated based on each independent judgment condition and the calculation objective, along with the execution order and dependencies between the tax sub-rules.

3. The method for executing tax rules based on multi-agent collaboration according to claim 1, characterized in that, Also includes: The preset task scheduling agent is used to generate the preset code, the preset test case, and the preset test verification agent based on the execution order and dependencies between the tax sub-rules.

4. The method for executing tax rules based on multi-agent collaboration according to claim 1, characterized in that, The step of using a preset test verification agent to call a preset tool to run the program code and execute the test cases to generate verification results corresponding to the current tax sub-rule includes: The smart agent uses a preset test verification method to call a preset file operation tool through a preset tool interface to write the program code to an accessible file path. The preset test verification agent uses the preset tool interface to call the preset program execution tool to execute the program code under the accessible file path, and inputs the test cases as input parameters into the program code to obtain the corresponding verification results.

5. The method for executing tax rules based on multi-agent collaboration according to claim 1, characterized in that, The preset termination conditions include a first preset termination condition that all test cases corresponding to the current tax sub-rule have passed execution, and a second preset termination condition that the number of iterations to correct the program code of the current tax sub-rule has reached the preset maximum number of iterations.

6. The method for executing tax rules based on multi-agent collaboration according to claim 1, characterized in that, The test cases cover input scenarios including normal input, boundary condition input, and mixed input with preset error-prone conditions.

7. The method for executing tax rules based on multi-agent collaboration according to claim 1, characterized in that, The preset code generation agent, the preset test case generation agent, and the preset test verification agent are implemented by a large language model.

8. A tax rule task execution device based on multi-agent collaboration, characterized in that, include: The original rule processing module is used to obtain a set of original tax rules in natural language form, and to decompose the set of original tax rules using a preset large language model to obtain several tax sub-rules and the execution order and dependencies between the tax sub-rules. The code generation module is used to generate program code to implement the current tax sub-rule based on the current tax sub-rule using a preset code generation agent, and to generate corresponding test cases covering different input scenarios based on the current tax sub-rule using a preset test case generation agent. The code verification module is used to use a preset test verification agent to call a preset tool to run the program code and execute the test cases, so as to generate a verification result corresponding to the current tax sub-rule; The code iteration and correction module is used to iteratively correct the program code based on the verification result if the verification result characterization test fails, using the preset code generation agent to perform the verification result until the verification result meets the preset termination condition, and then determine the current program code as the target program code. The executable program generation module is used to generate a target executable program based on the target program code corresponding to all tax sub-rules, and run the target executable program to process the target rule task input data to obtain an execution result that conforms to the constraints of the original set of tax rules.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor is configured to execute the computer program to implement the tax rule task execution method based on multi-agent collaboration as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the tax rule task execution method based on multi-agent cooperation as described in any one of claims 1 to 7.