Prompt prompt template automatic construction method for intelligent reimbursement system
By constructing a dual semantic model of fields and context, the system automatically generates Prompt templates, solving the problems of static and poor generalization capabilities of prompt content in intelligent reimbursement systems. This enables personalized and automated intelligent prompts, improving user experience and form-filling efficiency.
Patent Information
- Application Number
- CN202511341253.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2025-10-24
AI Technical Summary
The existing intelligent expense reimbursement system's prompt templates lack dynamic adaptability, resulting in high maintenance costs and poor generalization ability of prompt content, making it impossible to deeply integrate with form fields, business rules, and user context.
By constructing a dual semantic model of fields and context, a Prompt template is automatically generated, and personalized prompt content is achieved by combining a large language model.
It significantly improves the accuracy and adaptability of the intelligent reimbursement system's prompts, enables personalized and automated generation of user experience, and solves the problems of static prompt content and disconnect from business operations in traditional systems.
Smart Images

Figure CN120832371A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of intelligent financial management, and particularly relates to a Prompt prompt template automatic construction method for an intelligent reimbursement system. BACKGROUND
[0002] The intelligent reimbursement system in the prior art adopts a verification mechanism based on fixed rules and a static prompt template, and the prompt content is pre-configured by manual work, lacking dynamic adaptability. When the reimbursement document type, field structure or business rule changes, the prompt logic needs to be manually adjusted, which is high in maintenance cost and slow in response. Although some systems introduce a large language model to realize intelligent question answering, the Prompt prompt is still manually designed, and the form field, business rule and user context are not deeply fused, resulting in poor generalization ability and insufficient accuracy of the prompt content. SUMMARY
[0003] In order to solve at least one aspect of the technical problems in the background art, the application provides a Prompt prompt template automatic construction method for an intelligent reimbursement system, which realizes automatic and personalized generation of the Prompt prompt template by constructing a field-contextual dual semantic model, and significantly improves the accuracy, adaptability and user experience of the large model prompt in the intelligent reimbursement system.
[0004] The technical scheme adopted by the application is as follows: The first aspect embodiment of the application provides a Prompt prompt template automatic construction method for an intelligent reimbursement system, comprising: obtaining form structure information of a current reimbursement document, extracting field attributes, control configurations and business rules in a main table and a sub-table, and constructing a field semantic model; collecting contextual information in a user filling process, including user identity role, organization dimension, current operation state and historical behavior data, and generating a contextual semantic model; based on the field semantic model and the contextual semantic model, identifying a user intention in a current filling stage, and determining a corresponding prompt task type; according to the prompt task type, matching a target template structure from a preset template library, and parameterizing filling of field semantics, rule constraints, contextual features and task targets into the template to generate a structured natural language Prompt prompt template; delivering the generated Prompt prompt template as input to a large language model agent to drive it to generate intelligent prompt content for the user.
[0005] According to one embodiment of the present application, the form structure information of the current reimbursement form is acquired, the field attributes, control configuration and business rules in the main table and the sub-table are extracted, and a field semantic model is constructed, specifically: The runtime data structure of all main table fields and sub-table fields in the current reimbursement form page is acquired by calling the front-end runtime data interface, including the field identifier, field name, control type, data type, whether it is mandatory, the name of the sub-table to which it belongs, and the field arrangement order; The control-level configuration attributes of each field are acquired by simultaneously calling the front-end view configuration object, including whether the field is visible, whether it is hidden, the display condition expression, whether it is read-only, whether it participates in formula calculation, the calculation expression, the verification rule, and the logical binding relationship; Based on the visibility state of the field, a field set that satisfies visible==true or the display condition expression is true is filtered out as the effective prompt candidate field set; The filtered field is annotated with business semantics, and is marked as "field to be verified", "dependent field", "calculation field", "recommended field", or "high-frequency error field"; The fields are divided into main table fields, expense detail sub-table fields, invoice information sub-table fields, and payment detail sub-table fields according to the structure to which they belong, and a hierarchical structure and a dependency graph are established among the fields; The format verification rule, enumeration value constraint, and cross-field logical judgment expression are extracted from the field configuration and are formalized into a parseable rule function or logical expression to construct a field-level rule set; The structured field semantic model is constructed by integrating the field basic attributes, advanced configuration, logical grouping, and rule set.
[0006] According to one embodiment of the present application, the context information in the user filling process is collected, including the user identity role, organizational dimension, current operation state, and historical behavior data, and a context semantic model is generated, specifically: The static identity attributes of the user are acquired, including the user ID, post type, company code, department code, cost center number, reimbursement permission level, and approval role; In the user filling process, dynamic operation state information is collected in real time, including the current focused field, field input content, input text length, input keywords, field modification times, filling time consumption, page dwell time, and form saving frequency; The reimbursement process node, form type, submission mode, and approval stage currently being in are identified; The historical filling records, commonly used values, high-frequency error patterns, intelligent prompt adoption rates, and correction behavior sequences of the user or the user group in the same or similar fields are extracted from the historical behavior database; The static identity attribute, the dynamic operation state, the process context and the historical behavior data are fused in multiple dimensions to construct a structured context feature vector; Based on a preset context classification rule, a scene type to which the current context belongs is identified, and the scene type includes first-time form filling, error correction, batch completion, cross-organization reimbursement, and high-risk field input. According to the scene type, the context feature vector is weighted and abstracted to generate a context semantic model with semantic representation capability.
[0007] According to an embodiment of the present application, the field semantic model and the context semantic model are used to identify the user's intention in the current form filling stage and determine the corresponding prompt task type, specifically: The field semantic model of the current focused field is semantically aligned and matched with the real-time generated context semantic model; The filling state of the field is determined, including whether it is empty, whether it is first input, whether the input content conforms to the format specification, whether there is a logical conflict or missing dependent field; Combined with the business attribute label of the field, it is identified whether it is a "mandatory field", a "high-frequency error field", a "cross-table dependent field" or a "policy sensitive field"; Based on the user role, historical filling behavior and current process node in the context semantic model, the user's operation target and potential confusion point are analyzed; According to a preset intention recognition rule matrix, the analysis results are mapped to a standard prompt intention label.
[0008] According to an embodiment of the present application, the prompt intention label includes value recommendation, content completion, format correction, field explanation, logical verification, example guidance and historical reference.
[0009] According to an embodiment of the present application, according to the prompt task type, a target template structure is matched from a preset template library, and the field semantics, rule constraints, context features and task target are parameterized to fill the template to generate a structured natural language Prompt template, specifically: A Prompt template library containing multiple task types is constructed in advance, each template corresponds to one or more prompt task types, and has a standardized text structure and replaceable variable placeholder, and the template type includes guidance type, completion type, correction type, explanation type and example type; When one or more prompt task types output by the intention recognition module are received, the system performs matching retrieval in the template library, if there is a single complete matching template, it is directly selected, if there are multiple candidate templates, the optimal template is selected according to a preset priority strategy, or multiple templates are content fused to generate a composite Prompt structure. extract the field name, field label, data type, enumeration value list, mandatory status and association rule expression in the current field semantic model; extract the user role, organization information, filling stage, historical behavior characteristics and scene classification label in the context semantic model; Map the above field semantics and context features to the corresponding variable key-value pairs in the template, and fill the actual values into the placeholder positions in the template through string replacement or structured injection; In the filling process, according to the field dependency relationship and logical condition, it is judged whether to enable the conditional branch statement in the template, and multi-path semantic generation is realized; After completing the variable filling, the generated Prompt text is subjected to syntax integrity check and semantic consistency check.
[0010] According to an embodiment of the present application, the generated Prompt template is input into a large language model agent to drive it to generate intelligent prompt content for users, specifically: The generated structured Prompt template is packaged into a standard input format conforming to the calling interface specification of the large language model, and the input format includes a task description section, a field context section, a constraint condition section, an output requirement section and a tone control parameter; Send the packaged Prompt input to the pre-trained large language model agent through the API interface, and the agent performs inference calculation based on its language understanding and generation capability; Receive the natural language response content returned by the large language model, and perform compliance filtering and sensitive information detection to remove expressions that do not conform to enterprise systems or have ambiguities; Render the prompt content that passes the check to the corresponding field area of the reimbursement form interface, and present it to the user in the form of a floating prompt box, inline suggestion, error annotation or dialogue guide; At the same time, record the complete interaction log of this Prompt input and model output.
[0011] The second aspect embodiment of the present application provides a Prompt template automatic construction device for an intelligent reimbursement system, comprising: A semantic model construction module is adapted to obtain the form structure information of the current reimbursement form, extract the field attributes, control configuration and business rules in the main table and sub-table, and construct a field semantic model; An information acquisition module is adapted to acquire context information in the user filling process, including user identity role, organization dimension, current operation state and historical behavior data, and generate a context semantic model; The identification module is adapted to identify a user intention of a current form-filling stage and determine a corresponding prompt task type based on the field semantic model and the context semantic model; The template construction module is adapted to match a target template structure from a preset template library according to the prompt task type, and parameterize the field semantics, rule constraints, context features and task target into the template to generate a structured natural language Prompt template. The result display module is adapted to pass the generated Prompt template as input to a large language model agent to drive it to generate intelligent prompt content for a user.
[0012] The third aspect of the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the Prompt template automatic construction method for the intelligent reimbursement system in any of the embodiments of the first aspect.
[0013] The present application also provides a non-volatile computer storage medium having computer executable instructions stored thereon, wherein the computer executable instructions are executed by a processor to implement the Prompt template automatic construction method for the intelligent reimbursement system in any of the embodiments of the first aspect.
[0014] As a result of adopting the above technical solutions, the present application has the following beneficial effects: According to the prompt template automatic construction method for the intelligent reimbursement system provided in the first aspect of the application, the form structure information of the reimbursement document is systematically obtained, the field attributes, control configuration and business rules in the main table and the sub-table are extracted, the field semantic model capable of accurately reflecting the field semantics and logical dependency relationship is constructed, and the deep modeling of the business structure in the complex reimbursement scene is realized. At the same time, the dynamic context semantic model is generated by combining the multi-dimensional context information such as the user identity role, the organization dimension, the current operation state and the historical behavior data, and the understanding ability of the system to the user filling intention is enhanced. On this basis, the field semantic model and the context semantic model are fused for comprehensive analysis, the user intention in the current filling stage is accurately identified, and is mapped to specific prompt task types such as value recommendation, content completion, format correction and logic verification, so that the prompt behavior has high pertinence and scene adaptability. Then, the optimal template structure is intelligently matched from the preset template library according to the task type, and the field semantics, rule constraints, context features and task targets are filled into the template in a parameterized manner, so that the natural language prompt template with clear structure and complete semantics is automatically generated, and the automation level and maintainability of the prompt construction are significantly improved. Finally, the generated prompt is taken as an input to be delivered to the large language model agent, the intelligent prompt content with high quality and personification is driven to be output and presented to the user, and the natural interaction guidance with the user is realized. The method effectively solves the problems of static prompt content, poor generalization ability and disconnection with the business in the traditional reimbursement system, breaks through the technical bottleneck of low efficiency and difficulty in adapting to various scenes in the artificial design of the prompt, realizes the personalization, culturalization and automatic generation of the intelligent prompt, and greatly improves the user filling efficiency and accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0015] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and serve to explain the application without imposing undue limitation thereon. In the drawings: Figure 1 A flowchart of the prompt template automatic construction method for the intelligent reimbursement system provided in the embodiments of the application; Figure 2 A structure diagram of the prompt template automatic construction device for the intelligent reimbursement system provided in the embodiments of the application; Figure 3 A structure diagram of the electronic device provided in the embodiments of the application.
[0016] Reference signs: 110, semantic model construction module; 120, information collection module; 130, identification module; 140, template construction module; 150, result display module; 810, processor; 820, communication interface; 830, memory; 840, communication bus. DETAILED DESCRIPTION
[0017] In order to more clearly illustrate the overall concept of the present application, the following will be described in detail with reference to the accompanying drawings.
[0018] In the following description, a lot of specific details are set forth in order to facilitate a thorough understanding of the application, but the application can also be implemented in other ways different from those described herein, therefore, the scope of protection of the application is not limited by the specific embodiments disclosed below. It should be noted that the embodiments of the application and the features in each embodiment can be combined with each other without conflict.
[0019] In the present application, unless otherwise explicitly specified and limited, the first feature is "on" or "under" the second feature, which can be direct contact between the first and second features, or indirect contact between the first and second features through an intermediate medium. In the description of the present application, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present application, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0020] As Figure 1 shown, the first aspect embodiment of the present application provides a Prompt prompt template automatic construction method for an intelligent reimbursement system, comprising: Step 100, obtaining the form structure information of the current reimbursement document, extracting the field attributes, control configuration and business rules in the main table and the sub-table, and constructing a field semantic model.
[0021] Step 200, collecting the context information in the user filling process, including user identity role, organization dimension, current operation state and historical behavior data, and generating a context semantic model.
[0022] Step 300, based on the field semantic model and the context semantic model, identifying the user's intention at the current filling stage, and determining the corresponding prompt task type.
[0023] Step 400, according to the prompt task type, matching the target template structure from the preset template library, and parameterizing the field semantics, rule constraints, context features and task target into the template to generate a structured natural language Prompt prompt template.
[0024] Step 500, the generated Prompt prompt template is passed as input to the large language model agent, driving it to generate user-oriented intelligent prompt content.
[0025] In step 100, the system obtains the field structure information of the main table and all sub-tables (such as expense details, invoice information, payment plan, etc.) in the current reimbursement document page by calling the front-end runtime data interface roPageData() and the view configuration object idp.uiview.viewConfig.controls, including field identifier, field name, control type, data type, whether mandatory, visibility, read-only state, display condition, calculation expression and verification rule; based on the above metadata, the effective field set participating in intelligent prompting is filtered out, and the fields are semantically annotated (such as "mandatory field", "dependent field", "high-frequency error field"), the format constraints and logical judgment rules are extracted and formalized into parseable rule functions, and then a structured field semantic model containing field attributes, hierarchical relationships and business rules is constructed, providing basic data support for subsequent accurate generation of context-related prompts.
[0026] In step 200, the system collects multi-dimensional dynamic context information in the user filling process in real time, including static identity attributes (such as user ID, job type, affiliated company / department / cost center), dynamic operation behavior (such as current focused field, filled content, input text keywords, modification times, filling time consumption) and process state (such as document type, current approval node, submission mode); at the same time, the past filling record, common value preference, typical error mode and prompt adoption of the user or similar role user are retrieved from the historical behavior database; the above information is fused to form a feature vector that can represent the current filling scenario, and the belonging context scenario type (such as "first-time filling", "error correction", "cross-organization reimbursement") is identified through pre-set classification rules, and finally a context semantic model with semantic abstraction ability is generated, realizing comprehensive perception of the user's environment.
[0027] In step 300, the system semantically aligns and jointly analyzes the field semantic model of the current field with the context semantic model generated in real time, judges the field filling state (whether it is empty, whether it is format error, whether there is logical conflict), combines the field label and user behavior trajectory, and identifies the user's potential intention; through the preset intention recognition rule matrix, the analysis result is mapped to the standardized prompt task type, including but not limited to: value recommendation (when empty and enumerable), content completion (when input is incomplete), format correction (when regular or data type is violated), field explanation (when new user first operates), logical check (when dependent field is missing), example guidance (when free text input), historical reference (when similar historical documents exist); output one or more prompt task types with the highest matching degree as the decision basis for the next step template matching, to ensure that the prompt behavior has high situational adaptability and user intention fit degree.
[0028] In step 400, the system determines the prompt task type according to step 300, and performs matching retrieval in the pre-constructed Prompt template library. The template library stores various template structures such as guide type, completion type, correction type, explanation type, and example type. Each template contains a fixed semantic framework and replaceable variable placeholders (such as {field_label}, {allowed_values}, {user_role}). If there is a single optimal match, it is directly selected. If there are multiple candidate templates, the priority strategy is selected or the content is fused to generate a composite Prompt. Then, the system fills the field name in the field semantic, the format requirement in the rule constraint, the user role and scene label in the context feature, and the task target and other parameters into the template placeholders in key-value mapping mode, and according to the enable state of the conditional logic control statement branch, completes parameterized injection. Finally, after syntax verification and integrity check, a natural language Prompt prompt template with consistent semantics and clear structure is generated, realizing the automatic and personalized construction of prompt content.
[0029] In step 500, the system encapsulates the generated Prompt template into a standard input format conforming to the large language model API call specification, including task description, field context, constraint conditions, output requirements, and tone style control parameters, and sends it to the large language model agent through the interface; the large model generates natural language response content based on its language understanding and reasoning ability; the system performs compliance filtering and sensitive information detection on the received results, removes expressions that do not conform to enterprise policies or have ambiguities, and then renders the final intelligent prompt content to the reimbursement interface corresponding field area in the form of a floating box, inline suggestion, error annotation, etc., to realize real-time interactive guidance for users; at the same time, record the complete interaction log of this Prompt input and model output for subsequent prompt effect evaluation and template optimization iteration, forming a closed-loop mechanism of "generation-use-feedback-optimization".
[0030] According to the first aspect of the present application, the Prompt template automatic construction method for the intelligent reimbursement system is provided. By systematically obtaining the form structure information of the reimbursement document, extracting the field attributes, control configuration and business rules in the main table and sub-table, a field semantic model that can accurately reflect the semantic and logical dependency of the fields is constructed, and the deep modeling of the business structure in the complex reimbursement scenario is realized. At the same time, combined with multi-dimensional context information such as user identity role, organization dimension, current operation state and historical behavior data, a dynamically perceived context semantic model is generated, which enhances the understanding ability of the system to the user's filling intention. On this basis, by integrating the field semantic model and the context semantic model for comprehensive analysis, the user's intention at the current filling stage is accurately identified and mapped to specific prompt task types such as value recommendation, content completion, format correction, logic verification, etc., to ensure that the prompt behavior has high pertinence and scene adaptability. Then, according to the task type, the optimal template structure is intelligently matched from the preset template library, and the field semantics, rule constraints, context features and task targets are filled into the template in a parameterized manner, to automatically generate a natural language Prompt template with clear structure and complete semantics, which significantly improves the automation level and maintainability of Prompt construction. Finally, the generated Prompt is passed as input to the large language model agent, which drives it to output high-quality, personified intelligent prompt content and present it to the user, realizing natural interactive guidance with the user. This method effectively solves the problems of static prompt content, poor generalization ability and disconnection with business in traditional reimbursement systems, breaks through the technical bottleneck of low efficiency and difficulty in adapting to various scenarios in manual design of Prompt, realizes personalized, contextualized and automatic generation of intelligent prompts, and greatly improves the user's filling efficiency and accuracy.
[0031] In some embodiments of the present application, the form structure information of the current reimbursement document is obtained, the field attributes, control configuration and business rules in the main table and sub-table are extracted, and the field semantic model is constructed, specifically: Call the front-end runtime data interface to obtain the runtime data structure of all main table fields and sub-table fields in the current reimbursement document page, including field identifier, field name, control type, data type, whether it is required, sub-table name, and field arrangement order; At the same time, call the front-end view configuration object to obtain the control-level configuration attributes of each field, including whether the field is visible, whether it is hidden, display condition expression, whether it is read-only, whether it participates in formula calculation, calculation expression, verification rule, and logical binding relationship; Based on the visibility state of the field, filter out the field set that meets visible==true or the display condition expression is true, as the effective prompt candidate field set; Business semantic annotation is performed on the filtered fields, which are marked as "fields to be checked", "dependent fields", "calculation fields", "recommended fields", or "high-frequency error fields"; According to the structure to which the field belongs, it is divided into main table fields, expense detail sub-table fields, invoice information sub-table fields, and payment detail sub-table fields, and a hierarchical structure and dependency graph are established between the fields; Format verification rules, enumeration value constraints, and cross-field logical judgment expressions are extracted from the field configuration and formalized into parseable rule functions or logical expressions to construct a field-level rule set; Comprehensive field basic attributes, advanced configuration, logical grouping, and rule set, construct a structured field semantic model.
[0032] First, the system dynamically obtains the runtime data structure of all main table (such as reimbursers, reimbursement reasons, and total amount) and sub-table (such as expense details, invoice information, and payment plan) fields in the current reimbursement document page by calling the front-end runtime data interface roPageData(). The data structure includes the basic attributes of each field: field identifier (such as ROBXFK_FYLB), field name (such as "expense type"), control type (dropdown, text input, date selector, etc.), data type (string, number, enumeration), whether it is required, sub-table name, and field arrangement order in the form.
[0033] At the same time, the system calls the front-end view configuration object idp.uiview.viewConfig.controls to obtain the advanced control-level configuration properties of each field, including: whether the field is visible (visible), whether it is hidden (hidden), the display condition expression (such as "when the 'reimbursement type' is travel, display 'Business trip city'"), whether it is read-only, whether it participates in formula calculations, the specific calculation expression (such as "Transportation fee + accommodation fee = total travel cost"), the verification rules (such as the amount must be greater than 0), and the logical binding relationship with other fields (such as "Number of accommodation days × daily standard ≤ total limit").
[0034] Based on this, the system filters based on the visibility status of the fields: only fields that satisfy visible == true or whose display condition expression evaluates to true are retained, forming the "valid prompt candidate field set." For example, in a general expense report, the "Business Trip City" field may be hidden because the user did not select "Travel Expenses." In this case, this field will not be included in the prompt generation range to avoid unnecessary interference.
[0035] The system then annotates the filtered fields with business semantics and assigns them high-level semantic labels to guide subsequent intelligent prompt strategies. For example: If a field is associated with complex validation logic (e.g., "the invoice total must equal the detailed total"), it is marked as "field requiring validation"; If the filling of a field depends on other fields (such as "the subsidy amount is determined by the number of business trip days and the city level"), it is marked as "dependent field"; If the field is automatically calculated by the system (e.g. "Tax Amount = Tax Amount × Tax Rate"), it is marked as "Calculated Field"; Commonly used enumeration fields (such as "Expense Type" and "Payment Method") are marked as "Recommended Fields"; Based on historical data analysis, fields with high error rates (such as "invoice code" format errors) are identified and marked as "high-frequency error fields."
[0036] Furthermore, the system categorizes fields into main table fields, expense details sub-table fields, invoice information sub-table fields, and payment details sub-table fields, based on their structure. It also establishes a hierarchical structure and dependency graph between fields. For example, the "Expense Type" field in the "Expense Details" sub-table may affect the "Budget Item" in the main table, forming a cross-table dependency chain. Another example is the aggregate calculation relationship between "Number of Invoices" and "Total Invoice Amount." These are all modeled as nodes and edges in a directed graph, supporting subsequent contextual reasoning.
[0037] In addition, the system extracts various constraint rules from the field configuration and formalizes them into programmable rule functions or logical expressions to build a field-level rule set. For example: Format check rule: "Invoice code must be 12 digits" -> Regular expression \d{12}; Enumeration constraint: "Opposite nature ∈ {internal staff, counterpart, expert library}"; Cross-field logical judgment: "If 'whether overseas business trip' is yes, 'foreign currency' must be filled in."
[0038] Finally, by integrating the field basic attributes, control configuration, logical grouping, semantic labels and rule sets, the system constructs a structured field semantic model. The model is organized in JSON or object graph form, which fully describes the static metadata, dynamic behavior characteristics of each field and its semantic role in the entire document.
[0039] This step realizes full, dynamic and semantic modeling of the reimbursement form structure through dual-source data fusion (runtime data + view configuration), breaking through the limitations of traditional methods that rely only on static configuration or manual maintenance of templates.
[0040] In some embodiments of the present application, context information during user filling is collected, including user identity role, organizational dimension, current operation state and historical behavior data, to generate a context semantic model, specifically: Obtain the static identity attributes of the user, including user ID, job type, company code, department code, cost center number, reimbursement permission level, and approval role; During the user filling process, real-time collection of dynamic operation state information is performed, including the current focused field, field input content, input text length, input keywords, field modification times, filling time consumption, page dwell time, and form saving frequency; Identify the current reimbursement process node, document type, submission mode, and approval stage; Extract the user's or the same-post user group's historical filling records, commonly used values, high-frequency error patterns, intelligent prompt adoption rates, and correction behavior sequences on the same or similar fields from the historical behavior database; Fuse the above-mentioned static identity attributes, dynamic operation state, process context and historical behavior data in multiple dimensions to construct a structured context feature vector; Based on the preset context classification rules, identify the scene type to which the current context belongs, including: first-time filling, error correction, batch completion, cross-organization reimbursement, and high-risk field input; According to the scene type, weight and abstract the context feature vector to generate a context semantic model with semantic representation capability.
[0041] The system first obtains the static identity attributes of the user through the enterprise unified identity authentication and organizational structure interface, including: user ID, post type (such as ordinary employee, project manager, financial officer), company code, department code, cost center number, reimbursement permission level (such as whether high-end hotels can be reimbursed), approval role (such as whether it is an approver or a budget controller). These attributes constitute the fixed portrait of the user in the organization and are the basis for determining their business permissions and behavior patterns.
[0042] During the user's filling of the reimbursement form, the system collects a series of dynamic operation state information in real time through front-end embedding and event listening mechanisms, including: current focus field (such as currently inputting "invoice code"), filled content text, input character length, input keywords (such as "meal expenses", "ride-hailing"), field modification times, single field dwell time, overall page filling time consumption, form automatic saving frequency, etc. For example, when a user repeatedly deletes and re-enters in the "transportation expenses" field and the dwell time exceeds the average value by 50%, the system can preliminarily determine that there is input hesitation or uncertainty.
[0043] At the same time, the system identifies the current reimbursement process context in combination with the process engine and routing information, including: current form type (travel reimbursement, daily expenses, project expenditure), process node (new, edit, pending submission, in review), submission mode (new / copy the previous form / create from template), and approval stage (first-level approval, financial audit, leader final review). This information is used to determine the user's current operation intention and risk level.
[0044] Further, the system retrieves historical behavior data of the user or a group of users with the same post type and department attributes from the historical behavior database in the same or similar fields, including: Historical filling records (such as the user's past three months of 80% of the meal invoice amount concentrated in 200-400 yuan); Common value preferences (such as often choosing "subway + bus" as the mode of transportation); High-frequency error patterns (such as having repeatedly filled "invoice number" as "order number"); Smart prompt adoption rate (such as 75% of the recommended "expense type" for the user being accepted); Correction behavior sequence (such as being able to quickly correct each time the format is prompted to be incorrect).
[0045] Subsequently, the system multi-dimensionally fuses the above four types of information - static identity attributes, dynamic operation state, process context, and historical behavior data - to construct a structured context feature vector. This vector represents the current filling environment in a numerical and labeled manner.
[0046] On this basis, the system identifies and classifies the current scene according to the preset context classification rules. For example: If is_first_fill == true and user_role == 'new_employee' -> determine as "first-time filling" scene; If edit_count > 2 and validate_failed == true -> determine as "error correction" scene; If multiple sub-table row items are filled in succession and the time consumption is short -> determine as "batch completion" scene; If the "reimbursement company" and "expense location" cross legal entities -> determine as "cross-organization reimbursement" scene; If it involves "large cash payment" or "overseas expenses" -> determine as "high-risk field input" scene.
[0047] Finally, the system performs weighted processing and semantic abstraction on the original feature vector according to different scene types. For example, in the "first-time filling" scene, the weights of "position type" and "process node" are increased; in the "error correction" scene, the influence coefficients of "modification times" and "historical error rate" are enhanced. After weighted fusion, a context semantic model with semantic representation ability is generated, which not only describes "who does what at what time", but also expresses "what kind of help the user may need now".
[0048] This step realizes all-around, fine-grained and dynamic perception of user filling behavior, breaks through the limitation of traditional systems relying only on static roles or single field state, and significantly improves the accuracy and humanization level of intelligent prompts.
[0049] In some embodiments of the present application, based on the field semantic model and the context semantic model, the user's intention in the current filling stage is identified, and the corresponding prompt task type is determined, specifically: The field semantic model of the current focused field is semantically aligned and matched with the real-time generated context semantic model; Judge the filling state of the field, including whether it is empty, whether it is first input, whether the input content conforms to the format specification, whether there is a logical conflict or missing dependent field; Combine the business attribute tags of the field to identify whether it is a "mandatory field", "high-frequency error field", "cross-table dependent field" or "policy-sensitive field"; Based on the user role, historical filling behavior and current process node in the context semantic model, analyze the user's operation target and potential confusion points; According to the preset intention recognition rule matrix, the above analysis results are mapped to standard prompt intention labels.
[0050] The system semantically aligns and matches the field semantic model corresponding to the field the current user is focusing on with the context semantic model generated in real time. This process realizes the fusion understanding from "field capability" to "user context" by establishing the association mapping relationship between the two models. For example, the system not only knows that "invoice code" is a 12-digit field that must be filled in (from the field semantic model), but also knows that the current user is a new employee, is filling in the travel expense report for the first time, and has modified the field three times (from the context semantic model), so it judges that there may be input confusion.
[0051] On this basis, the system comprehensively judges the filling state of the field, including: Whether it is empty (null value detection); Whether it is the first input (combined with input history and modification times); Whether the input content conforms to the preset format specification (such as regular check, data type check); Whether there is a logical conflict (such as "overnight stay days" is 5 days but "trip start date" and "end date" are only 2 days apart); Whether there is a missing dependent field (such as "overseas trip" is selected but "foreign currency" is not filled in).
[0052] At the same time, the system calls the business attribute tags pre-labeled in the field semantic model to further enhance the accuracy of intent recognition. For example: If the field is marked as "required field", the guiding type prompt is triggered first when it is empty; If it is a "high-frequency error field" (such as "invoice number" is often misfilled as "order number"), format checking and example reminding are strengthened during input; If it is a "cross-table dependent field" (such as "budget subject" affects cost allocation in payment details), active prompt of linkage influence is given when related fields are changed; If it is a "policy sensitive field" (such as "gift giving amount" exceeds the company's limit), compliance warning and approval prompt are triggered.
[0053] Further, the system analyzes the user's operation target and potential confusion point based on the user role, historical behavior and process node in the context semantic model. For example: For financial personnel, they may pay more attention to compliance and accounting accuracy in the "budget subject" field; For ordinary employees, they may need more popular explanations and recommended options when selecting "expense type"; If the user has been returned many times due to "incomplete invoices", the system automatically prompts "Please confirm whether all invoice scans have been uploaded" when the user fills in "number of attachments".
[0054] Finally, the system inputs the above multi-dimensional analysis results into a pre-set intention recognition rule matrix, which is defined in the dimensions of "field state x field label x user context", and defines the standard prompt intention label that should be triggered under different combinations.
[0055] Through the dual alignment of field semantics and context semantics, the "one-size-fits-all" prompt is avoided, and the fine service of "different for different people and different for different scenes" is realized; multiple prompt tasks (such as recommending values and explaining rules) are supported in one scene, meeting complex business needs; instead of being limited to passive response to errors, it is based on behavior prediction to intervene in advance, improving user experience and filling efficiency; the intention recognition process is based on a clear rule matrix, with transparent logic, facilitating debugging, auditing, and compliance tracing.
[0056] In some embodiments of the present application, the prompt intention label includes value recommendation, content completion, format correction, field explanation, logic verification, example guidance, and historical reference.
[0057] Value Recommendation Definition: When the user fills in the enumerated type or optional value field, the system automatically recommends the most likely candidate value according to the current context.
[0058] Triggering scenario: The field is empty and is a drop-down selection type control; the user is a novice or has a clear historical preference.
[0059] For example, when the user's department is "R&D Department" and the reimbursement reason is "meeting", the system automatically recommends "technical exchange fee" in the "expense type" field.
[0060] The technical implementation is to combine the enumerated value list in the field semantic model and the user role and historical commonly used values in the context semantic model for weighted sorting, and output Top-N recommendations.
[0061] Content Completion Definition: For incomplete or fragmented input, the system intelligently predicts and suggests complete content.
[0062] Triggering scenario: The input text is short but the semantics is identifiable; the user's input pause time is long.
[0063] For example, the user inputs "participate in AI summit" in "reason description", and the system prompts: "Do you want to supplement 'participate in 2025 global artificial intelligence technology summit'?" The technical implementation is to analyze the input keywords based on an NLP model and generate completion suggestions based on historical similar document content.
[0064] Format Correction Definition: When the input content does not conform to the preset format rules, the system points out the error and provides a correct format example.
[0065] Triggering scenario: The input value violates the regular expression, data type, or length limit.
[0066] For example, the user inputs "ABC123" in the "invoice code", and the system prompts: "The invoice code should be 12 digits, please check and correct." The technical implementation is to call the validateRegex rule function in the field semantic model for real-time verification, and if the matching fails, the prompt is triggered.
[0067] Field Explanation Definition: For fields with complex business meaning or unfamiliar to new users, provide a simple and easy-to-understand explanation.
[0068] Triggering scenario: The user first operates the field; the post has low permission; the field is marked as a "policy-sensitive field".
[0069] For example, when the mouse hovers over "budget subject", it displays: "The budget subject is used for cost collection, please select the corresponding subject according to the actual expenditure purpose." The technical implementation is to extract the business explanation text from the field configuration and dynamically adjust the expression depth according to the user role.
[0070] Logical Validation Definition: Detect whether the cross-field logical relationship is established, and prompt the user to correct the path when there is a conflict.
[0071] Triggering scenario: Dependent field is missing, calculation result is abnormal, approval rule is not met.
[0072] For example, the user fills in "travel allowance" but does not fill in "number of business trips", the system prompts: "Please fill in 'number of business trips' first to automatically calculate the allowance amount." The technical implementation is to analyze the dependsOn and calcRule in the field semantic model, build a dependency graph, and verify the consistency in real time.
[0073] Example Guidance Definition: For free text or complex filling items, provide typical filling examples as a reference.
[0074] Triggering scenario: The field is a long text input; involves multiple element combination description.
[0075] For example, prompt the user with the following: “Example: Pay the final installment for the second phase of the XX system development, contract number HT20250301.” The technology is implemented as follows. High-quality filled samples with similar semantics are retrieved from historical approved documents, and are output as examples after desensitization.
[0076] Historical Reference Definition: Based on the user's or similar user's past records, recommend reusable content or remind common problems.
[0077] Triggering scenario: repetitive reimbursement, high-frequency error fields, copying the previous document.
[0078] For example, when the user starts filling out “transportation expenses”, the system prompts: “Did you take a taxi on the same route last month for 120 yuan? Do you want to reference it this time?” The technology is implemented as follows. The historical behavior database is queried to match submitted documents with similar time, location, and cause, and reusable field values are extracted.
[0079] In some embodiments of the present application, according to the prompt task type, a target template structure is matched from a preset template library, and field semantics, rule constraints, context features, and task target are parameterized filled into the template to generate a structured natural language Prompt template, specifically: A Prompt template library containing multiple task types is pre-constructed, each template corresponds to one or more prompt task types, and has a standardized text structure and replaceable variable placeholders. Template types include guiding, completion, correction, explanation, and example; When receiving one or more prompt task types output by the intent recognition module, the system performs matching retrieval in the template library. If there is a single complete matching template, it is directly selected. If there are multiple candidate templates, the optimal template is selected according to the preset priority strategy, or multiple templates are content-fused to generate a composite Prompt structure; Extract the field name, field label, data type, enumeration value list, mandatory status, and associated rule expression in the current field semantic model; Extract the user role, organization information, filling stage, historical behavior features, and scenario classification label in the context semantic model; Map the above field semantics and context features to the corresponding variable key-value pairs in the template, and fill the actual values into the placeholder positions in the template through string replacement or structured injection; During the filling process, determine whether to enable the conditional branch statements in the template according to the field dependency relationship and logical conditions to achieve multi-path semantic generation; After completing variable filling, the generated Prompt text is checked for grammatical integrity and semantic consistency.
[0080] Firstly, the system pre-constructs a multi-task Prompt template library, which stores standardized templates designed for different prompt intents. Each template corresponds to one or more prompt task types (such as value recommendation, format correction, etc.), has a fixed semantic structure, and replaceable variable placeholders. Templates are divided into five categories by function: Guidance templates: used to actively guide users to fill in key fields; Completion templates: provide intelligent continuation suggestions for incomplete input; Correction templates: point out errors and provide correction paths; Explanation templates: explain the business meaning and usage specifications of the field; Example templates: show typical filling examples to assist understanding.
[0081] When the system receives one or more prompt task types output by the intent recognition module, it performs matching retrieval in the template library. If there is a single complete match (such as only triggering "format correction"), it is directly selected; if there are multiple candidate templates (such as triggering "logic verification" and "field explanation" simultaneously), the optimal template is selected according to the pre-set priority strategy (such as: correction > explanation > recommendation), or a content fusion mechanism is used to generate a composite Prompt.
[0082] Subsequently, the system extracts key information from the field semantic model, including: field name (field_label), data type (data_type), whether required (required_status), enumeration value list (allowed_values), associated rule expression (rule_expression), etc.; at the same time, it extracts user role (user_role), organization information (org_dept), current filling stage (fill_stage), historical behavior characteristics (such as frequent_value) and scene classification label (scene_type) from the context semantic model.
[0083] The system maps the above information to the corresponding variable key-value pairs in the template, and completes parameter filling through string replacement or structured injection.
[0084] Finally, the system performs grammatical integrity checks and semantic consistency checks on the generated Prompt text: Grammar check: ensures that all placeholders have been replaced, with no residual {xxx}; Semantic check: verifies whether the generated content is consistent with the original intent Figure 1Avoid contradictory statements, such as saying "non-mandatory" while emphasizing "must fill out"; Format compliance: Remove redundant spaces, punctuation errors, and ensure natural language fluency.
[0085] Through the above process, a structured, semantically accurate, and contextually adapted natural language Prompt template is finally output, serving as the standard input for large language model agents.
[0086] In some embodiments of the present application, the generated Prompt template is passed as input to a large language model agent, driving it to generate intelligent prompt content for users, specifically: The generated structured Prompt template is encapsulated into a standard input format that conforms to the calling interface specifications of the large language model, including the task instruction segment, field context segment, constraint condition segment, output requirement segment, and tone control parameters. The encapsulated Prompt input is sent to the pre-trained large language model agent through the API interface, and the agent performs inference and calculation based on its language understanding and generation capabilities. The natural language response content returned by the large language model is received, and compliance filtering and sensitive information detection are performed to remove expressions that do not conform to enterprise systems or have ambiguities. The validated prompt content is rendered to the corresponding field area of the reimbursement document interface, presented to the user in the form of a floating prompt box, inline suggestion, error annotation, or dialogue guidance. At the same time, the complete interaction log of this Prompt input and model output is recorded.
[0087] The system first encapsulates the structured natural language Prompt template generated in the previous steps into a standard input format that conforms to the API calling specifications of the large language model (LLM). This input format uses a segmented organization structure to ensure that the large model can accurately understand the task context and generation requirements, mainly including the following five components: Task Instruction Segment: Clearly state the core goal of this call, such as "Please generate a format correction prompt for the user regarding field filling."
[0088] Field Context Segment: Provide basic information about the current field, including field name, label, filled content, control type, etc.
[0089] Constraint Condition Segment: List the business rules that must be followed, such as "Invoice code must be 12 digits" and "Travel allowance cannot exceed the standard limit."
[0090] Output Specification: Specifies the language style, length limit, whether to provide examples, whether to use professional terms, etc. for the generated content, such as "use simple and easy-to-understand language, control within 50 words."
[0091] Tone Parameter: Indicates the tone style, such as "neutral explanatory", "suggestion guiding", or "warning prompting", to adapt to the emotional expression needs of different scenarios.
[0092] The above information is organized as a JSON or plain text instruction block, and a pre-trained large language model agent (such as an enterprise-level model fine-tuned based on Tongyi Qianwen, ChatGLM, etc.) is called through HTTPS protocol.
[0093] After receiving the request, the large language model agent performs semantic analysis and content generation based on its powerful language understanding and reasoning capabilities, and outputs a natural and fluent response text. The system receives the response content returned by the large model, and does not directly display it to the user, but first performs compliance filtering and sensitive information detection. This process is completed through a lightweight rule engine or small classification model, focusing on identifying and removing the following problematic content: Expressions that violate enterprise regulations (such as "can report a little expense"); Ambiguous or misleading suggestions (such as recommending a reimbursement policy that has been abolished); Contains privacy or sensitive words (such as "leadership special approval" and "walk the account" high-risk words); Content that deviates significantly from the original Prompt intent.
[0094] Only the prompt content that passes the verification can be allowed to enter the next rendering process.
[0095] Subsequently, the system dynamically renders the legal and compliant intelligent prompt content to the corresponding field area of the reimbursement form interface, and the presentation form is flexibly selected according to the prompt type and user interaction habits: Hover prompt box: displays detailed explanations when the mouse hovers over; Inline suggestion: pre-fills recommended values in light gray text below the input box; Error marking: displays error reasons in red icons and text next to the field; Dialogue guidance: pops up a dialogue bubble in the form of a chat robot, actively asking the user if they need help.
[0096] Finally, the system automatically records the complete log of this interaction, including the original Prompt input, the large model output result, whether the user adopts the prompt, subsequent modification behavior, etc., to form an "input-output-feedback" closed-loop data chain for subsequent prompt effect evaluation, template optimization and model iterative training.
[0097] As shown in Figure 2 The second aspect embodiment of the present application provides a Prompt prompt template automatic construction device for an intelligent reimbursement system, which comprises: A semantic model construction module 110 is adapted to acquire form structure information of a current reimbursement document, extract field attributes, control configurations and business rules in a main table and a sub-table, and construct a field semantic model; An information acquisition module 120 is adapted to acquire context information in a user filling process, including user identity roles, organization dimensions, current operation states and historical behavior data, and generate a context semantic model; An identification module 130 is adapted to identify user intent at a current document filling stage and determine a corresponding prompt task type based on the field semantic model and the context semantic model; A template construction module 140 is adapted to match a target template structure from a preset template library according to the prompt task type, and parameterize field semantics, rule constraints, context features and task targets into the template to generate a structured natural language Prompt prompt template; A result display module 150 is adapted to pass the generated Prompt prompt template as input to a large language model agent to drive it to generate intelligent prompt content for users.
[0098] The Prompt prompt template automatic construction device for an intelligent reimbursement system provided by the second aspect embodiment of the present application can implement the Prompt prompt template automatic construction method for an intelligent reimbursement system in any of the above first aspect embodiments, and thus can implement any of the technical effects of the Prompt prompt template automatic construction method for an intelligent reimbursement system, which will not be described here.
[0099] The third aspect embodiment of the present application provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the Prompt prompt template automatic construction method for an intelligent reimbursement system in any of the above first aspect embodiments when executing the program.
[0100] Figure 3 An example of an entity structure diagram of an electronic device is shown in Figure 3As shown, the electronic device can include a processor 810, a communications interface 820, a memory 830, and a communications bus 840, wherein the processor 810, the communications interface 820, and the memory 830 complete mutual communication through the communications bus 840. The processor 810 can invoke the logical instructions in the memory 830 to execute the method for automatically constructing a Prompt prompt template for an intelligent reimbursement system in any embodiment of the first aspect described above, which includes: Step 100, obtaining form structure information of a current reimbursement document, extracting field attributes, control configurations, and business rules in a main table and a sub-table, and constructing a field semantic model.
[0101] Step 200, collecting context information in a user filling process, including user identity roles, organization dimensions, current operation states, and historical behavior data, and generating a context semantic model.
[0102] Step 300, identifying a user intention in a current filling stage based on the field semantic model and the context semantic model, and determining a corresponding prompt task type.
[0103] Step 400, matching a target template structure from a preset template library according to the prompt task type, and parameterizing field semantics, rule constraints, context features, and task targets into the template to generate a structured natural language Prompt prompt template.
[0104] Step 500, passing the generated Prompt prompt template as input to a large language model agent to drive it to generate intelligent prompt content for users.
[0105] In addition, the logical instructions in the memory 830 described above can be implemented in the form of a software function unit and sold or used as an independent product, which can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the technical solutions that essentially contribute to the prior art or the part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.
[0106] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program being stored on a non-transitory computer-readable storage medium and executable by a processor to enable a computer to perform the Prompt template automatic construction method for an intelligent reimbursement system provided by the above method, the method comprising: Step 100, obtaining form structure information of a current reimbursement form, extracting field attributes, control configurations and business rules in a main table and a sub-table, and constructing a field semantic model.
[0107] Step 200, collecting context information in a user filling process, including user identity roles, organization dimensions, current operation states and historical behavior data, and generating a context semantic model.
[0108] Step 300, identifying user intent in a current filling stage based on the field semantic model and the context semantic model, and determining a corresponding prompt task type.
[0109] Step 400, matching a target template structure from a preset template library according to the prompt task type, and parameterizing field semantics, rule constraints, context features and task targets into the template to generate a structured natural language Prompt template.
[0110] Step 500, passing the generated Prompt template as input to a large language model agent to drive it to generate intelligent prompt content for a user.
[0111] In still another aspect, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, the computer program being executable by a processor to implement the Prompt template automatic construction method for an intelligent reimbursement system provided by the above method, the method comprising: Step 100, obtaining form structure information of a current reimbursement form, extracting field attributes, control configurations and business rules in a main table and a sub-table, and constructing a field semantic model.
[0112] Step 200, collecting context information in a user filling process, including user identity roles, organization dimensions, current operation states and historical behavior data, and generating a context semantic model.
[0113] Step 300, identifying user intent in a current filling stage based on the field semantic model and the context semantic model, and determining a corresponding prompt task type.
[0114] Step 400, according to the prompt task type, match the target template structure from the preset template library, and parameterize the field semantics, rule constraints, context features and task objectives into the template to generate a structured natural language Prompt prompt template.
[0115] Step 500, pass the generated Prompt prompt template as input to the large language model agent to drive it to generate intelligent prompt content for users.
[0116] Finally, the application also provides a non-volatile computer storage medium having computer executable instructions stored thereon, which, when executed by a processor, implement the Prompt prompt template automatic construction method for the intelligent reimbursement system provided by the above method, the method comprising: Step 100, obtain the form structure information of the current reimbursement document, extract the field attributes, control configuration and business rules in the main table and the sub-table, and construct a field semantic model.
[0117] Step 200, collect context information during the user filling process, including user identity role, organization dimension, current operation state and historical behavior data, and generate a context semantic model.
[0118] Step 300, based on the field semantic model and the context semantic model, identify the user's intention at the current filling stage, and determine the corresponding prompt task type.
[0119] Step 400, according to the prompt task type, match the target template structure from the preset template library, and parameterize the field semantics, rule constraints, context features and task objectives into the template to generate a structured natural language Prompt prompt template.
[0120] Step 500, pass the generated Prompt prompt template as input to the large language model agent to drive it to generate intelligent prompt content for users.
[0121] The places not mentioned in the application can be realized by using or referring to the existing technology.
[0122] Each embodiment in the specification is described in a progressive manner, and the same or similar parts between each embodiment can be referred to each other, and each embodiment mainly describes the differences from other embodiments.
[0123] The above only describes the embodiments of the application and is not intended to limit the application. Those skilled in the art can make various changes and modifications to the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the application shall be included in the protection scope of the application.
Claims
1. A Prompt prompt template automatic construction method for an intelligent reimbursement system, characterized in that, The method comprises the following steps: Obtain the form structure information of the current reimbursement document, extract the field attributes, control configuration and business rules in the main table and sub-table, and construct a field semantic model; Collect the context information in the user filling process, including user identity role, organizational dimension, current operation state and historical behavior data, and generate a context semantic model; Based on the field semantic model and the context semantic model, identify the user's intention at the current filling stage, and determine the corresponding prompt task type; According to the prompt task type, match the target template structure from the preset template library, and parameterize the field semantics, rule constraints, context features and task target into the template to generate a structured natural language Prompt prompt template; The generated Prompt prompt template is input into the large language model agent to drive it to generate intelligent prompt content for the user.
2. The method for automatically constructing a Prompt template for an intelligent expense reporting system according to claim 1, wherein, The method comprises the following steps: Call the front-end runtime data interface to obtain the runtime data structure of all main table fields and sub-table fields in the current reimbursement document page, including field identifier, field name, control type, data type, whether it is required, sub-table name and field arrangement order; At the same time, call the front-end view configuration object to obtain the control-level configuration attributes of each field, including whether the field is visible, whether it is hidden, display condition expression, whether it is read-only, whether it participates in formula calculation, calculation expression, verification rule and logical binding relationship; Based on the visibility state of the field, filter out the field set that meets visible==true or the display condition expression is true as the effective prompt candidate field set; Business semantic annotation is performed on the filtered fields, which are marked as "fields to be checked", "dependent fields", "calculation fields", "recommended fields" or "high-frequency error fields"; Divide the fields into main table fields, expense detail sub-table fields, invoice information sub-table fields and payment detail sub-table fields according to the structure to which the fields belong, and establish the hierarchical structure and dependency graph of the fields; Extract the format verification rules, enumeration value constraints and cross-field logical judgment expressions from the field configuration, and formalize them into parseable rule functions or logical expressions to construct a field-level rule set; Integrate the field basic attributes, advanced configuration, logical grouping and rule set to construct a structured field semantic model.
3. The method for automatically constructing a Prompt template for an intelligent expense reporting system of claim 1, wherein, The method comprises the following steps: Obtain the static identity attributes of the user, including user ID, post type, company code, department code, cost center number, reimbursement permission level and approval role; In the user filling process, real-time collection of dynamic operation state information is performed, including the current focused field, field input content, input text length, input keywords, field modification times, filling time consumption, page dwell time and form saving frequency; Identify the current reimbursement process node, document type, submission mode and approval stage; extracting historical filling records, commonly used values, high-frequency error patterns, intelligent prompt adoption rates, and correction behavior sequences of the user or a user group in the same position on the same or similar fields from a historical behavior database; fusing the static identity attributes, dynamic operation states, process contexts, and historical behavior data in multiple dimensions to construct a structured context feature vector; based on a preset context classification rule, identifying a scenario type to which the current context belongs, the scenario type including: first-time form filling, error correction, batch completion, cross-organizational reimbursement, and high-risk field input; generating a context semantic model with semantic representation capability by weighting and abstracting the context feature vector according to the scenario type.
4. The method for automatically constructing a Prompt template for an intelligent expense reporting system of claim 1, wherein, based on the field semantic model and the context semantic model, identifying a user intent in the current form filling stage and determining a corresponding prompt task type, specifically: performing semantic alignment and matching analysis on the field semantic model of the current focused field and the context semantic model generated in real time; judging the filling state of the field, including whether it is empty, whether it is first-time input, whether the input content conforms to the format specification, and whether there is a logic conflict or missing dependent field; combining the business attribute label of the field to identify whether it is a “mandatory field”, a “high-frequency error field”, a “cross-table dependent field”, or a “policy-sensitive field”; based on the user role, historical filling behavior, and current process node in the context semantic model, analyzing the operation target and potential confusion points of the user; mapping the analysis results to standard prompt intent labels according to a preset intent recognition rule matrix.
5. The method for automatically constructing a Prompt template for an intelligent expense reporting system according to claim 4, wherein, The prompt intent labels include value recommendation, content completion, format correction, field explanation, logic verification, example guidance, and historical reference.
6. The method for automatically constructing a Prompt template for an intelligent expense reporting system of claim 1, wherein, based on the prompt task type, matching a target template structure from a preset template library, and parameterizing the field semantics, rule constraints, context features, and task targets into the template to generate a structured natural language Prompt template, specifically: pre-constructing a Prompt template library containing multiple task types, each template corresponding to one or more prompt task types and having a standardized text structure and replaceable variable placeholders, the template types including guidance, completion, correction, explanation, and example; when receiving one or more prompt task types output by the intent recognition module, the system performs matching retrieval in the template library, if there is a single complete matching template, it is directly selected, if there are multiple candidate templates, the optimal template is selected according to a preset priority strategy, or multiple templates are content-fused to generate a composite Prompt structure; extracting the field name, field label, data type, enumerated value list, mandatory status, and associated rule expression in the current field semantic model; extracting the user role, organization information, filling stage, historical behavior features, and scenario classification label in the context semantic model; mapping the field semantics and context features to corresponding variable key-value pairs in the template, and filling the actual values into the placeholder positions in the template through string replacement or structured injection; In the filling process, whether to enable the conditional branch statement in the template is judged according to the field dependency relationship and logical condition, and the multi-path semantic generation is realized; After completing the variable filling, the generated Prompt text is subjected to syntax integrity check and semantic consistency check.
7. The method for automatically constructing a Prompt template for an intelligent expense reporting system of claim 1, wherein, The generated Prompt template is taken as input and delivered to the large language model agent to drive it to generate intelligent prompt content for users, specifically: The generated structured Prompt template is encapsulated into a standard input format conforming to the calling interface specification of the large language model, and the input format includes a task description section, a field context section, a constraint condition section, an output requirement section and a tone control parameter; The encapsulated Prompt input is sent to the pre-trained large language model agent through the API interface, and the agent performs inference calculation based on its language understanding and generation capability; The natural language response content returned by the large language model is received, and compliance filtering and sensitive information detection are performed on it to remove expressions that do not conform to the enterprise system or have ambiguity; The prompt content that passes the check is rendered to the corresponding field area of the reimbursement form interface in the form of a floating prompt box, inline suggestion, error annotation or dialogue guide to present it to the user; At the same time, the complete interaction log of this Prompt input and model output is recorded.
8. A Prompt prompt template automatic construction device for an intelligent reimbursement system, characterized by, It comprises: A semantic model construction module is adapted to obtain form structure information of the current reimbursement form, extract field attributes, control configurations and business rules in the main table and sub-table, and construct a field semantic model; An information acquisition module is adapted to acquire context information in the user filling process, including user identity role, organization dimension, current operation state and historical behavior data, and generate a context semantic model; An identification module is adapted to identify the user's intention at the current filling stage based on the field semantic model and the context semantic model, and determine the corresponding prompt task type; A template construction module is adapted to match the target template structure from the pre-set template library according to the prompt task type, and parameterize the field semantics, rule constraints, context features and task target into the template to generate a structured natural language Prompt template; A result display module is adapted to deliver the generated Prompt template as input to the large language model agent to drive it to generate intelligent prompt content for users.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to realize the Prompt template automatic construction method for the intelligent reimbursement system as claimed in any one of claims 1 to 7.
10. A non-volatile computer storage medium having computer executable instructions stored thereon, characterized in that: The computer executable instructions are executed by the processor to realize the Prompt template automatic construction method for the intelligent reimbursement system as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Financial reimbursement method and device based on artificial intelligence and electronic equipment
CN119722360A
Filling method and system based on artificial intelligence
CN119940315A
Dynamic order making method and device based on multiple rounds of dialogues and electronic equipment
CN120181054A
Enterprise-level schedule planning and knowledge base oriented intelligent collaborative question-answering system and method
CN120296140A
Intelligent machine account report fusion method and system based on large model
CN120409439A
Cited By
Large model Prompt dynamic generation method and device and medium
CN121214462A
Intelligent memorandum task generation method and device, electronic equipment and storage medium
CN121638463A
Cross-system form intention generation and cooperative interaction method based on intelligent agent
CN121659911A
Intelligent agent workflow rapid building method and system based on natural language understanding
CN121683859A
Manuscript generation method and device, equipment and storage medium
CN121960420A