Insurance commission testing automation method, apparatus, device, and medium
Patent Information
- Application Number
- CN202611160858.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-10-23
AI Technical Summary
[0005]有鉴于此,本申请提供了一种保险佣金测试自动化方法、装置、设备及介质,主要目的在于解决目前保险行业佣金测试尝试引入大语言模型(LLM)以辅助解析自然语言规则,但其整体技术架构仍沿用传统模式,模块间协同性较差,实际效能提升有限的技术问题
[0010]本申请提供的保险佣金测试自动化方法、装置、设备及介质,与现有技术相比,本申请可通过业务交互层接收用户上传的包含佣金规则的非结构化文档,并对非结构化文档进行预处理;通过规则解析智能体对预处理后的非结构化文档进行分层语义解析,将非结构化文档中的自然语言佣金规则转换为结构化规则,其中,结构化规则为由条件集合、动作集合和约束集合构成的;基于结构化规则,通过语义映射引擎查询多源数据源以获取测试所需的基础数据,并将基础数据转换为统一格式;通过脚本生成智能体将结构化规则和统一格式的基础数据注入预设测试框架模板,生成可执行测试脚本;执行测试脚本,将执行结果与预期结果进行对比以生成测试报告,并将结构化规则、测试脚本和测试报告存储至知识库并进行版本管理。
Smart Images

Figure CN122963958A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software testing automation technology, and can be applied to the financial and medical fields. Specifically, it relates to an automated method, apparatus, equipment, and medium for testing insurance commissions. Background Technology
[0002] Insurance commission calculation is a core business link between insurance companies and agents, and its accuracy directly affects the stability of the agent team and the company's operating costs. In recent years, with the increasing diversification of insurance product forms (such as increasing whole life insurance, participating annuity insurance, and customized group insurance products) and the deepening of tiered channel operation models (such as individual agents, bancassurance channels, and brokerage channels), the complexity of commission rules has increased exponentially. Currently, the commission rules of a mainstream life insurance product typically include more than 20 sub-items in 5 major categories, such as basic commission, renewal commission, management allowance, development bonus, and persistency bonus, and involve a combination of conditions from more than 10 dimensions, including policy premium, payment period, agent level, policy persistency rate, and team size.
[0003] Meanwhile, the iteration cycle of insurance products has been significantly shortened from the traditional 6-12 months to 2-3 months. Furthermore, frequent updates to regulatory policies (such as the "Regulations on the Supervision of Insurance Agents") and adjustments to internal incentive policies require commission testing to have minute-level response capabilities. However, existing testing technologies are insufficient to meet the agility demands of current business operations, becoming a key bottleneck restricting the rapid launch of insurance products.
[0004] Currently, commission testing in the insurance industry primarily employs a "manually written script + traditional automation framework" model. The typical technical path involves testers manually writing Structured Query Language (SQL) scripts and API call code based on requirements documents, and then building test cases using a Behavior-Driven Development (BDD) framework (such as Behave) to automate the verification of commission calculation logic. In recent years, some solutions have attempted to introduce Large Language Models (LLMs) to assist in parsing natural language rules; however, their overall technical architecture still follows the traditional model, resulting in poor inter-module collaboration and limited actual performance improvement. Summary of the Invention
[0005] In view of this, this application provides an automated method, apparatus, device and medium for insurance commission testing. The main purpose is to solve the technical problem that the current insurance industry commission testing attempts to introduce Large Language Models (LLM) to assist in parsing natural language rules, but its overall technical architecture still follows the traditional mode, with poor inter-module coordination and limited actual performance improvement.
[0006] According to a first aspect of this application, an automated method for testing insurance commissions is provided, the method comprising: The business interaction layer receives unstructured documents containing commission rules uploaded by users and preprocesses the unstructured documents. The rule parsing agent performs hierarchical semantic parsing on the preprocessed unstructured document, converting the natural language commission rules in the unstructured document into structured rules, wherein the structured rules are composed of a set of conditions, a set of actions, and a set of constraints. Based on the structured rules, the semantic mapping engine queries multiple data sources to obtain the basic data required for testing, and converts the basic data into a unified format; The intelligent agent generated by the script injects the structured rules and the basic data in a unified format into a preset test framework template to generate an executable test script. The test script is executed, the execution result is compared with the expected result to generate a test report, and the structured rules, the test script and the test report are stored in the knowledge base and version managed.
[0007] According to a second aspect of this application, an automated apparatus for testing insurance commissions is provided, the apparatus comprising: The receiving module is used to receive unstructured documents containing commission rules uploaded by users through the business interaction layer, and to preprocess the unstructured documents. The parsing module is used to perform hierarchical semantic parsing on the preprocessed unstructured document through a rule parsing agent, and to convert the natural language commission rules in the unstructured document into structured rules, wherein the structured rules are composed of a set of conditions, a set of actions, and a set of constraints. The conversion module is used to query multiple data sources to obtain the basic data required for testing through a semantic mapping engine based on the structured rules, and convert the basic data into a unified format; The first generation module is used to inject the structured rules and the basic data in a unified format into a preset test framework template through a script-generated intelligent agent to generate an executable test script. The second generation module is used to execute the test script, compare the execution result with the expected result to generate a test report, and store the structured rules, the test script and the test report in a knowledge base for version management.
[0008] According to a third aspect of this application, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform the method of the first aspect described above.
[0009] According to a fourth aspect of this application, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of the first aspect described above.
[0010] Compared with existing technologies, the insurance commission testing automation method, apparatus, equipment, and medium provided in this application can receive unstructured documents containing commission rules uploaded by users through a business interaction layer and preprocess the unstructured documents; perform hierarchical semantic parsing on the preprocessed unstructured documents through a rule parsing agent, converting the natural language commission rules in the unstructured documents into structured rules, wherein the structured rules are composed of a set of conditions, a set of actions, and a set of constraints; based on the structured rules, query multiple data sources through a semantic mapping engine to obtain the basic data required for testing, and convert the basic data into a unified format; inject the structured rules and the unified formatted basic data into a preset test framework template through a script generation agent to generate an executable test script; execute the test script, compare the execution results with the expected results to generate a test report, and store the structured rules, test script, and test report in a knowledge base for version management.
[0011] According to the solution proposed in this application, an intelligent rule parsing agent directly converts unstructured documents into structured rules (conditions, actions, constraints), and then an intelligent script generation agent automatically injects the rules and data into a preset template to generate an executable script. This process completely replaces the traditional manual coding step, realizing automated generation from document to script.
[0012] This application constructs an event-driven intelligent agent collaborative architecture. By organically linking modules such as the business interaction layer, rule parsing intelligent agent, semantic mapping engine, and script generation intelligent agent through document upload events, rule parsing completion events, data query result events, and script generation completion events, this architecture achieves loose coupling between modules while maintaining tight integration of business logic, ensuring smooth data flow and significantly improving the overall collaborative capability and response speed of the system.
[0013] This application utilizes a rule-parsing intelligent agent for hierarchical semantic parsing, going beyond simply extracting text to transform natural language into structured rules containing sets of conditions, actions, and constraints. This deep semantic understanding enables computers to accurately capture complex commission calculation logic, rather than simple text matching, truly leveraging the advantages of LLM in understanding complex business logic.
[0014] This application utilizes a semantic mapping engine to automatically query multiple data sources based on structured rules and converts the query results into a unified format. This step shields the heterogeneity of the underlying data sources and automatically prepares standardized basic data for subsequent script generation, solving the problem of data preparation and script generation being disconnected in the traditional model.
[0015] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A schematic diagram of the application environment for an automated insurance commission testing method provided in an embodiment of this application; Figure 2 A flowchart illustrating an automated method for testing insurance commissions provided in an embodiment of this application; Figure 3 A schematic diagram of the structure of an automated insurance commission testing device provided in this application embodiment; Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of another computer device provided in an embodiment of this application. Detailed Implementation
[0019] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0020] The automated insurance commission testing method provided in this application embodiment can be applied to, for example, Figure 1 In this application environment, the client communicates with the server via a network. The server can receive unstructured documents containing commission rules uploaded by users through the business interaction layer and preprocess the unstructured documents. A rule parsing agent performs layered semantic parsing on the preprocessed unstructured documents, converting the natural language commission rules in the unstructured documents into structured rules, which consist of a set of conditions, actions, and constraints. Based on the structured rules, a semantic mapping engine queries multiple data sources to obtain the basic data required for testing and converts the basic data into a unified format. A script generation agent injects the structured rules and the unified formatted basic data into a preset test framework template to generate an executable test script. The test script is executed, and the execution results are compared with the expected results to generate a test report. The structured rules, test scripts, and test reports are stored in a knowledge base and version managed.
[0021] According to the solution proposed in this application, an intelligent rule parsing agent directly converts unstructured documents into structured rules (conditions, actions, constraints), and then an intelligent script generation agent automatically injects the rules and data into a preset template to generate an executable script. This process completely replaces the traditional manual coding step, realizing automated generation from document to script.
[0022] This application constructs an event-driven intelligent agent collaborative architecture. By organically linking modules such as the business interaction layer, rule parsing intelligent agent, semantic mapping engine, and script generation intelligent agent through document upload events, rule parsing completion events, data query result events, and script generation completion events, this architecture achieves loose coupling between modules while maintaining tight integration of business logic, ensuring smooth data flow and significantly improving the overall collaborative capability and response speed of the system.
[0023] This application utilizes a rule-parsing intelligent agent for hierarchical semantic parsing, going beyond simply extracting text to transform natural language into structured rules containing sets of conditions, actions, and constraints. This deep semantic understanding enables computers to accurately capture complex commission calculation logic, rather than simple text matching, truly leveraging the advantages of LLM in understanding complex business logic.
[0024] This application utilizes a semantic mapping engine to automatically query multiple data sources based on structured rules and converts the query results into a unified format. This step shields the heterogeneity of the underlying data sources and automatically prepares standardized basic data for subsequent script generation, solving the problem of data preparation and script generation being disconnected in the traditional model.
[0025] Please see Figure 2 As shown, Figure 2 A flowchart illustrating the automated insurance commission testing method provided in this application embodiment includes the following steps: Step 101: Receive the unstructured document containing commission rules uploaded by the user through the business interaction layer, and preprocess the unstructured document.
[0026] Unstructured documents include, but are not limited to, PDF, Word, and image formats.
[0027] Specifically, the business interaction layer provides a document upload interface. Users can upload commission rule documents (i.e., unstructured documents) written by actuaries through this interface. The business interaction layer can preprocess the unstructured documents, converting them into plain text format, removing non-text content such as headers, footers, images, and tables, and then performing sentence and word segmentation on the converted plain text to generate standardized text data. The document upload event can carry a unique document identifier, document name, and standardized text data for subsequent processing by downstream components.
[0028] For example, a salesperson uploads a PDF document containing personal life insurance agent commission rules through the business interaction layer. The business interaction layer converts the PDF document into plain text format, removes headers, footers, and images, and obtains standardized text containing the commission rules and terms, and then publishes a document upload event.
[0029] Step 102: The rule parsing agent performs hierarchical semantic parsing on the preprocessed unstructured document, converting the natural language commission rules in the unstructured document into structured rules.
[0030] The structured rules consist of a set of conditions, a set of actions, and a set of constraints.
[0031] In this embodiment, a rule-parsing agent performs hierarchical semantic parsing on unstructured documents, converting the natural language commission rules in the unstructured documents into structured rules. Specifically, this may include: Syntactic analysis is performed on unstructured documents to extract their syntactic structure; the syntactic structure includes at least a subject, predicate, object, and modification relations. Optionally, the spaCy dependency parser can be used to segment and word-segment the standardized text data, extracting the subject-verb-object structure and modification relations of each sentence.
[0032] Identify domain terms in the syntactic structure and link the domain terms to corresponding entities in the pre-built insurance commission domain ontology library; wherein the insurance commission domain ontology library includes at least policy, agent, commission type entities, as well as computational basis, triggering conditions, and proportional coefficient relationships.
[0033] Specifically, a pre-trained language model, fine-tuned from historical commission rule documents, can be used to identify domain terms. This pre-trained language model is a BERT-wwm model fine-tuned based on over 100,000 historical commission rule documents. The insurance commission domain ontology is formally represented using OWL DL, containing over 200 domain entities across 5 major categories and over 100 relation types. The identified terms are then linked to their corresponding entities in the insurance commission domain ontology, achieving standardized terminology mapping.
[0034] The semantic relationships between linked entities are extracted based on a pre-trained relation classification model. Optionally, the relation classification model can be a pre-trained relation classification model based on RoBERTa.
[0035] Based on the logical rules in the insurance commission ontology, the semantic relationships between entities are transformed into structured rules. These structured rules are triples consisting of a condition set, an action set, and a constraint set. The condition set can be composed of atomic conditions consisting of "entity-operator-value," supporting logical AND, OR, and NOT combinations. The action set contains the specific operations for commission calculation, and the constraint set contains the rule's scope and exceptions.
[0036] After completing the above analysis, publish a rule parsing completion event, which carries a unique document identifier and a list of structured rules.
[0037] For example, the analysis of the rule "Agents who have been employed for 6 months and hold the rank of senior manager with a policy persistency rate of ≥90% are eligible for an additional 5% management allowance" is as follows: Syntactic analysis stage: Subject "agent", predicate "enjoy", object "management allowance", modifiers "employed for 6 months", "rank as senior supervisor", "policy persistency rate ≥ 90%" and "additional 5%" can be extracted.
[0038] Entity Linking Phase: "Agent" can be linked to the "Agent" entity in the ontology, "6 months of employment" can be linked to the "Employment Duration" attribute, "Senior Supervisor" can be linked to the "Job Level" entity, "Period Continued" can be linked to the "Policy Period Continued" attribute, and "Management Allowance" can be linked to the "Management Allowance" entity.
[0039] Relationship extraction phase: Can extract "employment duration ≥ 6 months" → "meets the condition", "job level = senior supervisor" → "meets the condition", "renewal rate ≥ 90%" → "meets the condition", "meets all conditions" → "enjoy management allowance", "management allowance ratio = 5%".
[0040] Rule generation phase: The following structured rules can be generated: Condition set: (Agent.tenure ≥ 6 months) ∧ (Agent.rank = Senior Supervisor) ∧ (Policy.persistency rate ≥ 90%); Action set: Commission.management allowance += Policy.premium × 5%; Constraint set: None.
[0041] Step 103: Based on structured rules, a semantic mapping engine is used to query multi-source data sources to obtain basic data required for testing, and the basic data is converted into a unified format.
[0042] In this embodiment, querying multi-source data sources through the semantic mapping engine based on structured rules to obtain the basic data required for testing may specifically include: Extract all entity information from the condition set of the structured rule.
[0043] Query the preset MCP semantic mapping library according to the entity information to obtain the target data source, target field name and data conversion function corresponding to each entity; the MCP semantic mapping library stores ternary mapping relationships of "domain entity - data source - field", and each mapping relationship includes an entity URI, a data source identifier, a field name, a data type, a conversion function and a confidence level.
[0044] Specifically, the MCP semantic mapping library is represented in RDF language. For example, for the entity "Policy.persistency rate", the mapping information is: data source "mysql: / / commission_db", table "policy", field "persistency_rate", type "float", conversion function "x 100", confidence level "0.98".
[0045] Generate a query statement for the corresponding data source according to the target data source, the target field name and the condition value in the condition set, and execute the query statement to obtain raw test data. The query statement includes but is not limited to an SQL query statement or an API call request. For example, for the condition "Agent.rank = Senior Supervisor", the generated SQL query statement is "SELECT FROM agent WHERE rank = 'Senior Supervisor'".
[0046] The raw test data is converted into basic data in a unified format by using the data conversion function, such as agent rank, policy information, persistency rate, etc. Optionally, the unified format may be a JSON format. For example, the value of the "persistency_rate" field is multiplied by 100 to be converted into a percentage form.
[0047] After completing the above query, publish the data query result event, which carries a unique document identifier, a list of structured rules, and a structured test dataset in a uniform format.
[0048] Step 104: Generate an intelligent agent by injecting structured rules and basic data in a unified format into a preset test framework template to generate an executable test script.
[0049] In this embodiment, a script-generated intelligent agent injects structured rules and basic data into a preset test framework template to generate an executable test script, which may specifically include: Based on each structured rule, a corresponding Behavior-Driven Development (BDD) test scenario is generated. The BDD test scenario includes given input conditions, actions to be performed, and the expected output format. Optionally, the test scenario is a Gherkin format scenario, containing three parts: "Given - When - Then".
[0050] Basic data is injected as parameters into the input conditions of the behavior-driven development test scenario. That is, the test dataset is injected into the scenario's input parameters. For example, data such as the agent's actual length of employment, job level, and policy persistency rate are injected into the scenario.
[0051] Based on the set of actions in the structured rules and the injected input conditions, calculate the expected commission for each behavior-driven development and testing scenario.
[0052] Combine the expected commission calculation results of all behavior-driven development test scenarios into a complete executable test script. Optionally, the executable test script can be a feature file compatible with the Behave testing framework (i.e., a Behave feature file).
[0053] After the script generation is completed, publish a script generation completion event. The script generation completion event carries a unique document identifier and the executable test script file (i.e., the content of the feature file).
[0054] Step 105: Execute the test script, compare the execution result with the expected result to generate a test report, and store the structured rules, test script and test report in the knowledge base for version management.
[0055] Specifically, a pre-defined behavior-driven development and testing framework (such as the Behave framework) can be invoked to run executable test scripts (i.e., feature files) to simulate the business system's commission calculation and obtain the actual calculation results. The actual calculation results are compared with the expected results, marking successful or failed test cases and generating detailed test reports. The comparison supports numerical precision comparison, fuzzy string matching, and in-depth comparison of structured objects; the test reports include information such as test case execution status, failure reason analysis, and difference statistics.
[0056] Structured rules, test scripts, and test reports are associated and stored in a knowledge base, and version management is implemented. Upon completion of testing, the system automatically stores new structured rules, test scripts, and test reports in the knowledge base. The MCP semantic mapping layer automatically adjusts the confidence level of mapping relationships based on test results and user feedback. The rule parsing agent periodically uses new data from the knowledge base for incremental fine-tuning to improve parsing accuracy. Furthermore, the system supports users manually editing entities, relationships, and mapping relationships in the knowledge base, and records all modifications for version management.
[0057] Once completed, a test completion event is published, with the event payload including the document ID and a link to the test report. The business interaction layer subscribes to this event and displays the test report to the user.
[0058] This embodiment also includes an interactive rule adjustment process, which specifically includes the following steps: Step 201: Receive the natural language rule adjustment instruction input by the user and publish a rule adjustment request event.
[0059] Specifically, the business interaction layer provides a natural language dialogue interface, through which users can input their adjustment requests in natural language, such as "increase the management allowance for mid-level managers who have been with the company for more than one year from 8% to 10%, but this only applies to policies effective after January 1, 2025." The business interaction layer converts the user input into text and publishes a rule adjustment request event.
[0060] Step 202: In response to the rule adjustment request event, the intent-understanding agent engages in multi-turn dialogue with the user based on the PPO reinforcement learning model to understand the user's adjustment intent and generate a list of adjustment actions based on the adjustment intent.
[0061] In this embodiment, the multi-turn dialogue process in step 202 may specifically include: Step 2021: Construct a state vector from the current dialogue context, existing structured rules, and user history feedback information; Step 2022: Select actions based on the state vector through the PPO policy network. The actions include at least 10 basic actions such as: confirming the adjustment range, querying missing information, modifying condition values, adding new conditions, deleting conditions, modifying action values, adding new actions, deleting actions, regenerating scripts, or ending the dialogue. Step 2023: Execute the selected action and obtain user feedback, i.e., interact with the user based on the selected action. For example, the system asks: "Do you want to modify the management allowance for all mid-level managers, or only for mid-level managers who have been with the company for more than one year?" The user replies: "Only for mid-level managers who have been with the company for more than one year." The system continues to ask: "When will this adjustment take effect?" The user replies: "January 1, 2025." The system updates the state vector and selects the "End Dialogue" action; Step 2024: Calculate reward values based on user feedback to update the PPO policy network. The reward function may include: 10 points for user confirmation of correct adjustment, 10 points for pointing out an error; 5 points for successfully obtaining missing information, 5 points for user refusal to provide it; and a penalty of -1 point per dialogue round. Step 2025: Repeat steps 2021 to 2024 above until the user confirms the adjustment is complete or the maximum number of dialogue rounds is reached, generate a list of adjustment actions, and issue an intent understanding completion event.
[0062] Step 203: Based on the list of adjustment actions, update the corresponding structured rules in the knowledge base and publish the script adjustment completion event.
[0063] Specifically, modify the corresponding structured rules based on the action list, including adding conditions, deleting conditions, and modifying action values. After the rule update is complete, publish the script to complete the adjustment event.
[0064] For example, after the script-generated agent subscribes to the intent understanding completion event, it updates the structured rules based on the adjusted action list: Adding requirements: Agent. Employment duration ≥ 12 months Add condition: Policy effective date ≥ 2025-01-01 Modification: The management allowance ratio has been changed from 8% to 10%.
[0065] Step 204: In response to the script adjustment completion event, regenerate the executable test script based on the updated structured rules.
[0066] Specifically, the script generation agent subscribes to and responds to the script adjustment completion event, regenerates the test script according to the updated structured rules, supports incremental script adjustment, modifies only the affected test scenarios, and retains the unchanged parts.
[0067] In other words, after the test execution and knowledge management layer subscribes to the "script adjustment complete event," it re-executes the affected test cases, generates an adjusted test report, and displays a comparison before and after the modification. Business personnel review the test report to confirm the adjustment is correct. The system updates the PPO strategy network based on user feedback to optimize future intent understanding capabilities.
[0068] This embodiment also includes an incremental parsing and update process, which specifically includes the following steps: Step 301: When the content of an unstructured document is updated, a text difference algorithm is used to locate the changed paragraphs in the unstructured document to identify the changed text content. Optionally, the text difference algorithm can be the Myers difference algorithm.
[0069] When the requirements document is updated, the system uses the Myers differential algorithm to locate the updated content, re-parseing only the changed paragraphs. For example, if only the "Management Allowance Ratio" in the document is adjusted from 5% to 6%, the system will locate the change in that paragraph.
[0070] Step 302: Only perform hierarchical semantic parsing on the changed text content to generate updated structured rules.
[0071] The system only re-executes hierarchical semantic parsing on the changed text content to generate updated structured rules. For the change in "management allowance ratio", a new action set is generated by re-parsing: Commission.Management Allowance += Policy.Premium × 6%.
[0072] Step 303: Retain the existing parsing results for the unchanged parts of the unstructured document.
[0073] The system retains the existing parsing results for unchanged portions of unstructured documents, avoiding full parsing and improving efficiency. Performance metrics: Parsing time for a single rule update < 1 second; full parsing time for a 100-page document < 5 minutes.
[0074] Step 304: Merge the updated structured rules with the existing parsing results of the unchanged parts to generate the complete updated structured rules.
[0075] The system merges the updated structured rules with the existing parsing results of the unchanged parts to generate complete updated structured rules, and publishes a "rule parsing completion event" to trigger the subsequent MCP multi-source data query and test script generation process.
[0076] Through the above incremental parsing and update process, the parsing time for a single rule update is less than 1 second, and the full parsing time for a 100-page document is less than 5 minutes, which greatly improves the processing efficiency when updating documents.
[0077] This embodiment also adds a real-time data synchronization function for MCP, the specific steps of which are as follows: Step 401: The MCP semantic mapping layer establishes long connections with each data source to perceive changes in data structure and content in real time.
[0078] The MCP semantic mapping layer establishes long-lived connections with various data sources to detect changes in data structure and content in real time. For example, when agent rank data is updated, the MCP layer immediately detects the change.
[0079] Step 402: Use a caching mechanism to store frequently used data and mapping relationships, with a query response time of less than 200 milliseconds.
[0080] The MCP layer uses a caching mechanism to store frequently used data and mapping relationships, resulting in a query response time of less than 200 milliseconds. For example, query results for the "Senior Manager" job title can be cached, allowing subsequent queries to retrieve data directly from the cache, thus improving efficiency.
[0081] Step 403: Support data change event subscription. When the commission operator or basic data is updated, the relevant test cases will be automatically re-executed.
[0082] The MCP layer supports data change event subscription, automatically triggering the re-execution of relevant test cases when commission operators or basic data are updated. For example, when the calculation logic of the "continue rate" field changes, the system automatically re-executes all test cases involving the "continue rate" to ensure the accuracy of test results.
[0083] This embodiment adds event-driven dynamic script adjustment functionality. The specific steps are as follows: Step 501: The system adopts an event bus mechanism, and all interactions between modules are triggered by events.
[0084] The system uses Kafka as its event bus, and all interactions between modules are triggered by events. For example, when the business interaction layer publishes a "document upload event," the layered semantic intelligence layer subscribes to the event and initiates rule parsing.
[0085] Step 502: When the rule adjustment event is triggered, the agent completes intent understanding and script update within 10 seconds.
[0086] When a rule adjustment event is triggered, the agent completes intent understanding and script update within 10 seconds. For example, after a user inputs an adjustment request, the system completes multiple rounds of dialogue, rule updates, and script regeneration within 10 seconds, achieving a minute-level response time.
[0087] Step 503: Supports parallel execution of batch test tasks, with an execution time of less than 3 minutes for 1000 test cases.
[0088] The system supports the parallel execution of batch test tasks, with an execution time of less than 3 minutes for 1000 test cases. For example, for large-scale commission testing tasks, the system executes multiple test cases in parallel, significantly improving testing efficiency.
[0089] In summary, the insurance commission testing automation method provided in this application, compared with existing technologies, can receive unstructured documents containing commission rules uploaded by users through the business interaction layer and preprocess the unstructured documents; perform hierarchical semantic parsing on the preprocessed unstructured documents through a rule parsing agent, converting the natural language commission rules in the unstructured documents into structured rules, wherein the structured rules consist of a set of conditions, a set of actions, and a set of constraints; based on the structured rules, query multiple data sources through a semantic mapping engine to obtain the basic data required for testing, and convert the basic data into a unified format; inject the structured rules and the unified formatted basic data into a preset test framework template through a script generation agent to generate an executable test script; execute the test script, compare the execution results with the expected results to generate a test report, and store the structured rules, test scripts, and test reports in a knowledge base for version management.
[0090] According to the solution proposed in this application, an intelligent rule parsing agent directly converts unstructured documents into structured rules (conditions, actions, constraints), and then an intelligent script generation agent automatically injects the rules and data into a preset template to generate an executable script. This process completely replaces the traditional manual coding step, realizing automated generation from document to script.
[0091] This application constructs an event-driven intelligent agent collaborative architecture. By organically linking modules such as the business interaction layer, rule parsing intelligent agent, semantic mapping engine, and script generation intelligent agent through document upload events, rule parsing completion events, data query result events, and script generation completion events, this architecture achieves loose coupling between modules while maintaining tight integration of business logic, ensuring smooth data flow and significantly improving the overall collaborative capability and response speed of the system.
[0092] This application utilizes a rule-parsing intelligent agent for hierarchical semantic parsing, going beyond simply extracting text to transform natural language into structured rules containing sets of conditions, actions, and constraints. This deep semantic understanding enables computers to accurately capture complex commission calculation logic, rather than simple text matching, truly leveraging the advantages of LLM in understanding complex business logic.
[0093] This application utilizes a semantic mapping engine to automatically query multiple data sources based on structured rules and converts the query results into a unified format. This step shields the heterogeneity of the underlying data sources and automatically prepares standardized basic data for subsequent script generation, solving the problem of data preparation and script generation being disconnected in the traditional model.
[0094] Based on the above Figure 1 The specific implementation of the method shown in this embodiment provides an automated device for testing insurance commissions, such as... Figure 3 As shown, the device includes: a receiving module 31, a parsing module 32, a conversion module 33, a first generation module 34, and a second generation module 35; The receiving module 31 is used to receive an unstructured document containing commission rules uploaded by a user through the business interaction layer, and to preprocess the unstructured document. The parsing module 32 is used to perform hierarchical semantic parsing on the preprocessed unstructured document through a rule parsing agent, and to convert the natural language commission rules in the unstructured document into structured rules, wherein the structured rules are composed of a set of conditions, a set of actions, and a set of constraints. The conversion module 33 is used to query multiple data sources to obtain the basic data required for testing through a semantic mapping engine based on the structured rules, and convert the basic data into a unified format; The first generation module 34 is used to inject the structured rules and the basic data in a unified format into a preset test framework template through a script-generated intelligent agent to generate an executable test script. The second generation module 35 is used to execute the test script, compare the execution result with the expected result to generate a test report, and store the structured rules, the test script and the test report in a knowledge base for version management.
[0095] In specific application scenarios, the parsing module 32 can be used to perform syntactic analysis on the unstructured document to extract its syntactic structure. The syntactic structure includes at least a subject, predicate, object, and modification relations. It identifies domain terms within the syntactic structure and links these terms to corresponding entities in a pre-built insurance commission domain ontology. The insurance commission domain ontology includes at least policy, agent, and commission type entities, as well as computational basis, triggering conditions, and proportional coefficient relations. Based on a pre-trained relation classification model, it extracts the semantic relationships between the linked entities. Finally, according to the logical rules in the insurance commission domain ontology, it converts these semantic relationships into structured rules.
[0096] In specific application scenarios, the conversion module 33 can be used to extract all entity information from the condition set of the structured rules; query the preset MCP semantic mapping library according to the entity information to obtain the target data source, target field name and data conversion function corresponding to each entity; generate a query statement for the corresponding data source according to the target data source, the target field name and the condition value in the condition set; execute the query statement to obtain the original test data, and use the data conversion function to convert the original test data into the basic data in a unified format.
[0097] In a specific application scenario, the first generation module 34 can be used to generate a corresponding behavior-driven development test scenario based on each of the structured rules. The behavior-driven development test scenario includes given input conditions, execution actions, and expected output format. The basic data is injected as parameters into the input conditions of the behavior-driven development test scenario. Based on the action set in the structured rules and combined with the injected input conditions, the expected commission calculation result of each behavior-driven development test scenario is calculated. The expected commission calculation results of all behavior-driven development test scenarios are combined into a complete executable test script.
[0098] In specific application scenarios, such as Figure 3 As shown, the device also includes: an update module 36; The update module 36 is configured to receive a natural language rule adjustment instruction input by the user and issue a rule adjustment request event; in response to the rule adjustment request event, through an intent understanding agent, conduct multi-turn dialogue with the user based on the PPO reinforcement learning model to understand the user's adjustment intent, and generate an adjustment action list based on the adjustment intent; update the corresponding structured rules in the knowledge base according to the adjustment action list, and issue a script adjustment completion event; in response to the script adjustment completion event, regenerate the executable test script based on the updated structured rules.
[0099] In specific application scenarios, the update module 36 is also used to construct a state vector from the current dialogue context, existing structured rules, and user historical feedback information; select an action based on the state vector through the PPO policy network, the action including at least: confirming the adjustment range, asking for missing information, modifying condition values, adding new conditions, deleting conditions, modifying action values, adding new actions, deleting actions, regenerating scripts, or ending the dialogue; execute the selected action and obtain user feedback, and calculate a reward value based on the user feedback to update the PPO policy network.
[0100] In specific application scenarios, such as Figure 3 As shown, the device also includes: a merging module 37; The merging module 37 is used to locate the changed paragraphs in the unstructured document using a text difference algorithm when the content of the unstructured document is updated, so as to identify the changed text content in the unstructured document; re-execute the hierarchical semantic parsing only on the changed text content to generate updated structured rules; retain the existing parsing results of the unchanged parts in the unstructured document; and merge the updated structured rules with the existing parsing results of the unchanged parts to generate complete updated structured rules.
[0101] This application provides an automated device for insurance commission testing. It uses a rule parsing agent to directly convert unstructured documents into structured rules (conditions, actions, constraints), and then a script generation agent automatically injects the rules and data into a preset template to generate an executable script. This process completely replaces the traditional manual coding step, achieving automated generation from document to script.
[0102] This application constructs an event-driven intelligent agent collaborative architecture. By organically linking modules such as the business interaction layer, rule parsing intelligent agent, semantic mapping engine, and script generation intelligent agent through document upload events, rule parsing completion events, data query result events, and script generation completion events, this architecture achieves loose coupling between modules while maintaining tight integration of business logic, ensuring smooth data flow and significantly improving the overall collaborative capability and response speed of the system.
[0103] This application utilizes a rule-parsing intelligent agent for hierarchical semantic parsing, going beyond simply extracting text to transform natural language into structured rules containing sets of conditions, actions, and constraints. This deep semantic understanding enables computers to accurately capture complex commission calculation logic, rather than simple text matching, truly leveraging the advantages of LLM in understanding complex business logic.
[0104] This application utilizes a semantic mapping engine to automatically query multiple data sources based on structured rules and converts the query results into a unified format. This step shields the heterogeneity of the underlying data sources and automatically prepares standardized basic data for subsequent script generation, solving the problem of data preparation and script generation being disconnected in the traditional model.
[0105] Specific limitations regarding the automated insurance commission testing device can be found in the limitations of the automated insurance commission testing method described above, and will not be repeated here. Each module in the aforementioned automated insurance commission testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0106] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a server-side method for automating insurance commission testing.
[0107] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the client-side functions or steps of an automated insurance commission testing method.
[0108] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: The business interaction layer receives unstructured documents containing commission rules uploaded by users and preprocesses the unstructured documents. The rule parsing agent performs hierarchical semantic parsing on the preprocessed unstructured document, converting the natural language commission rules in the unstructured document into structured rules, wherein the structured rules are composed of a set of conditions, a set of actions, and a set of constraints. Based on the structured rules, the semantic mapping engine queries multiple data sources to obtain the basic data required for testing, and converts the basic data into a unified format; The intelligent agent generated by the script injects the structured rules and the basic data in a unified format into a preset test framework template to generate an executable test script; The test script is executed, the execution result is compared with the expected result to generate a test report, and the structured rules, the test script and the test report are stored in the knowledge base and version managed.
[0109] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: The business interaction layer receives unstructured documents containing commission rules uploaded by users and preprocesses the unstructured documents. The rule parsing agent performs hierarchical semantic parsing on the preprocessed unstructured document, converting the natural language commission rules in the unstructured document into structured rules, wherein the structured rules are composed of a set of conditions, a set of actions, and a set of constraints. Based on the structured rules, the semantic mapping engine queries multiple data sources to obtain the basic data required for testing, and converts the basic data into a unified format; The intelligent agent generated by the script injects the structured rules and the basic data in a unified format into a preset test framework template to generate an executable test script; The test script is executed, the execution result is compared with the expected result to generate a test report, and the structured rules, the test script and the test report are stored in the knowledge base and version managed.
[0110] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0111] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0112] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0113] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.
[0114] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application 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 this application, and should all be included within the protection scope of this application.
Claims
1. An automated method for testing insurance commissions, characterized in that, The method includes: The business interaction layer receives unstructured documents containing commission rules uploaded by users and preprocesses the unstructured documents. The rule parsing agent performs hierarchical semantic parsing on the preprocessed unstructured document, converting the natural language commission rules in the unstructured document into structured rules, wherein the structured rules are composed of a set of conditions, a set of actions, and a set of constraints. Based on the structured rules, the semantic mapping engine queries multiple data sources to obtain the basic data required for testing, and converts the basic data into a unified format; The intelligent agent generated by the script injects the structured rules and the basic data in a unified format into a preset test framework template to generate an executable test script. The test script is executed, the execution result is compared with the expected result to generate a test report, and the structured rules, the test script and the test report are stored in the knowledge base and version managed.
2. The automated method for testing insurance commissions according to claim 1, characterized in that, The step of performing hierarchical semantic parsing on the preprocessed unstructured document using a rule-parsing agent to convert the natural language commission rules in the unstructured document into structured rules includes: The unstructured document is subjected to syntactic analysis to extract its syntactic structure; wherein the syntactic structure includes at least a subject, predicate, object, and modification relation. Identify domain terms in the syntactic structure and link the domain terms to corresponding entities in a pre-built insurance commission domain ontology library; wherein, the insurance commission domain ontology library includes at least policy, agent, commission type entities, as well as computational basis, triggering conditions, and proportional coefficient relationships; Based on a pre-trained relation classification model, the semantic relationships between the linked entities are extracted. Based on the logical rules in the insurance commission domain ontology library, the semantic relations are converted into the structured rules.
3. The automated method for testing insurance commissions according to claim 1, characterized in that, Based on the structured rules, the process involves querying multiple data sources through a semantic mapping engine to obtain the basic data required for testing, and then converting the basic data into a unified format, including: Extract all entity information from the set of conditions of the structured rules; Based on the entity information, query the preset MCP semantic mapping library to obtain the target data source, target field name and data transformation function corresponding to each entity; Based on the target data source, the target field name, and the condition values in the condition set, generate a query statement for the corresponding data source; The query statement is executed to obtain the original test data, and the data conversion function is used to convert the original test data into the basic data in a unified format.
4. The automated method for testing insurance commissions according to claim 1, characterized in that, The step of generating an intelligent agent through scripting involves injecting the structured rules and the basic data in a unified format into a preset test framework template to generate an executable test script, including: Based on each of the structured rules, a corresponding behavior-driven development test scenario is generated, wherein the behavior-driven development test scenario includes given input conditions, execution actions, and expected result output format; The basic data is injected as parameters into the input conditions of the behavior-driven development and testing scenario; Based on the action set in the structured rules and the injected input conditions, calculate the expected commission calculation result for each behavior-driven development and testing scenario; Combine the expected commission calculation results of all behavior-driven development test scenarios into a complete executable test script.
5. The automated method for testing insurance commissions according to claim 4, characterized in that, The method further includes: Receive natural language rule adjustment instructions from users and publish rule adjustment request events; In response to the rule adjustment request event, the intent-understanding agent engages in multi-turn dialogue with the user based on the PPO reinforcement learning model to understand the user's adjustment intent and generate a list of adjustment actions based on the adjustment intent. Based on the list of adjustment actions, update the corresponding structured rules in the knowledge base and publish a script adjustment completion event; In response to the script adjustment completion event, the executable test script is regenerated based on the updated structured rules.
6. The automated method for testing insurance commissions according to claim 5, characterized in that, The multi-turn dialogue with the user based on the PPO reinforcement learning model includes: Construct a state vector from the current dialogue context, existing structured rules, and user history feedback information; The PPO policy network selects an action based on the state vector, and the action includes at least: confirming the adjustment range, querying missing information, modifying the condition value, adding a new condition, deleting a condition, modifying the action value, adding a new action, deleting an action, regenerating the script, or ending the dialogue. Execute the selected action and obtain user feedback, calculate the reward value based on the user feedback to update the PPO policy network.
7. The automated method for testing insurance commissions according to claim 1, characterized in that, The method further includes: When the content of the unstructured document is updated, a text difference algorithm is used to locate the changed paragraphs in the unstructured document in order to identify the changed text content in the unstructured document. The hierarchical semantic parsing is re-executed only on the changed text content to generate updated structured rules; The existing parsing results for the unchanged parts of the unstructured document are retained; The updated structured rules are merged with the existing parsing results of the unchanged parts to generate complete updated structured rules.
8. An automated device for testing insurance commissions, characterized in that, include: The receiving module is used to receive unstructured documents containing commission rules uploaded by users through the business interaction layer, and to preprocess the unstructured documents. The parsing module is used to perform hierarchical semantic parsing on the preprocessed unstructured document through a rule parsing agent, and to convert the natural language commission rules in the unstructured document into structured rules, wherein the structured rules are composed of a set of conditions, a set of actions, and a set of constraints. The conversion module is used to query multiple data sources to obtain the basic data required for testing through a semantic mapping engine based on the structured rules, and convert the basic data into a unified format; The first generation module is used to inject the structured rules and the basic data in a unified format into a preset test framework template through a script-generated intelligent agent to generate an executable test script. The second generation module is used to execute the test script, compare the execution result with the expected result to generate a test report, and store the structured rules, the test script and the test report in a knowledge base for version management.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the insurance commission testing automation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the insurance commission testing automation method according to any one of claims 1 to 7.