Rule generation method and device, computer equipment, readable storage medium and program product
By combining a large language model and a tag filtering sub-model, a target tag set matching the target user profile is generated, which solves the problem of insufficient accuracy of target rules in traditional methods and achieves higher precision rule generation.
Patent Information
- Application Number
- CN202511696257.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-03-03
AI Technical Summary
In traditional methods, the accuracy of target rules formed by the target tag set of user profiles is poor, mainly because the subjective nature of analysts manually selecting target tags.
Reasoning and analysis are performed using a large language model and a pre-set knowledge base. Candidate tags are filtered using a tag filtering sub-model to generate a target tag set that matches the target user profile and to construct target rules.
It improves the precision of target tag sets and the accuracy of generated target rules, dynamically generates target tag sets that match the target user profile, and enhances the accuracy of rule generation.
Smart Images

Figure CN121597794A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a rule generation method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Technology
[0002] As the business and user composition in the financial sector become increasingly complex, the requirements for user profiling are becoming more and more demanding.
[0003] In traditional techniques, for a target user profile, analysts manually select multiple target tags that match the target user profile based on their own business experience, and use the tag set formed by these target tags as the target rules for user data analysis of the target user profile.
[0004] However, in traditional methods, the accuracy of target rules formed by the set of target labels is poor because the way analysts manually select target labels is subjective. Summary of the Invention
[0005] Therefore, it is necessary to provide a rule generation method, apparatus, computer device, computer-readable storage medium, and computer program product to address the aforementioned technical problems.
[0006] Firstly, this application provides a rule generation method, including:
[0007] Retrieve the target user profile contained in the user command;
[0008] Based on the large language model and the preset knowledge base, the target user profile is inferred and analyzed to determine the target intent and candidate tags corresponding to the target user profile;
[0009] The candidate tags and the target intent are compared and analyzed based on the tag filtering sub-model, and the candidate tags are filtered according to the comparison and analysis results to obtain a target tag set that matches the target user profile;
[0010] Target rules are constructed based on the target tag sets described above.
[0011] In one embodiment, the preset knowledge base includes a tag knowledge base and a customer group knowledge base; the step of performing reasoning analysis on the target user profile based on the large language model and the preset knowledge base to determine the target intent and candidate tags corresponding to the target user profile includes:
[0012] Based on the intent recognition sub-model, preliminary intent recognition is performed on the target user profile to determine the initial intent corresponding to the target user profile;
[0013] Based on the large language model, a comprehensive intent analysis is performed on the target user profile and the initial intent to determine the target intent corresponding to the target user profile;
[0014] Based on the large language model, the tag knowledge base, and the customer group knowledge base, the target intent is inferred and analyzed to generate candidate tags corresponding to the target user profile.
[0015] In one embodiment, the tag-based filtering sub-model compares and analyzes the candidate tags and the target intent, and filters the candidate tags based on the comparison and analysis results to obtain a target tag set matching the target user profile, including:
[0016] Based on the tag-filtering sub-model, the matching score between the target intent and each candidate tag is calculated in a preset knowledge base;
[0017] Based on the matching score and the preset filtering strategy, the candidate tags are filtered to determine the target tag set that matches the target user profile.
[0018] In one embodiment, constructing target rules based on each of the target tag sets includes:
[0019] Based on the large language model, semantic parsing is performed on the target user profile and the target tag set to generate an initial rule description;
[0020] The initial rule description is subjected to syntactic structure analysis based on the format analysis sub-model to extract rule elements;
[0021] Based on the rule elements, a tree-structured target rule is generated; the target rule nodes in the tree structure include logical operators, target label names, and value conditions corresponding to the target label names.
[0022] In one embodiment, after constructing target rules based on each of the target tag sets, the method further includes:
[0023] Obtain the attribute type information of each target tag in the target tag set;
[0024] Based on the large language model, the attribute type information and the tag semantics of each target tag are comprehensively analyzed to generate a set of candidate visualization methods;
[0025] Based on the visualization decision sub-model, the set of candidate visualization methods is evaluated to determine the target visualization method that matches each of the target labels.
[0026] In one embodiment, after constructing target rules based on each of the target tag sets, the method further includes:
[0027] Acquire new commands and contextual dialogue data; the contextual dialogue data includes historical commands and historical rules.
[0028] The contextual dialogue data is analyzed based on the context-aware sub-model to determine the rule sub-units that need to be changed.
[0029] Based on the large language model and the rule sub-unit, the historical rules are locally updated to generate the updated target rules.
[0030] Secondly, this application also provides a rule generation apparatus, comprising:
[0031] The first acquisition module is used to acquire the target user profile contained in the user command;
[0032] The reasoning and analysis module is used to perform reasoning and analysis on the target user profile based on the large language model and the preset knowledge base, and to determine the target intent and candidate tags corresponding to the target user profile.
[0033] The comparison analysis module is used to compare and analyze the candidate tags and the target intent based on the tag filtering sub-model, and to filter the candidate tags according to the comparison analysis results to obtain a target tag set that matches the target user profile;
[0034] The building module is used to construct target rules based on each of the target tag sets.
[0035] In one embodiment, the preset knowledge base includes a tag knowledge base and a customer group knowledge base; the reasoning and analysis module is specifically used to perform preliminary intent recognition on the target user profile based on the intent recognition sub-model, and determine the initial intent corresponding to the target user profile;
[0036] Based on the large language model, a comprehensive intent analysis is performed on the target user profile and the initial intent to determine the target intent corresponding to the target user profile;
[0037] Based on the large language model, the tag knowledge base, and the customer group knowledge base, the target intent is inferred and analyzed to generate candidate tags corresponding to the target user profile.
[0038] In one embodiment, the comparison analysis module is specifically used to calculate the matching score between the target intent and each of the candidate tags in a preset knowledge base based on the tag filtering sub-model;
[0039] Based on the matching score and the preset filtering strategy, the candidate tags are filtered to determine the target tag set that matches the target user profile.
[0040] In one embodiment, the construction module is specifically used to perform semantic parsing on the target user profile and the target tag set based on the large language model to generate an initial rule description;
[0041] The initial rule description is subjected to syntactic structure analysis based on the format analysis sub-model to extract rule elements;
[0042] Based on the rule elements, a tree-structured target rule is generated; the target rule nodes in the tree structure include logical operators, target label names, and value conditions corresponding to the target label names.
[0043] In one embodiment, the device further includes:
[0044] The second acquisition module is used to acquire the attribute type information of each target tag in the target tag set;
[0045] The comprehensive analysis module is used to perform comprehensive analysis on the attribute type information and the tag semantics of each target tag based on the large language model, and generate a set of candidate visualization methods;
[0046] The evaluation module is used to evaluate the set of candidate visualization methods based on the visualization decision sub-model and determine the target visualization method that matches each of the target labels.
[0047] In one embodiment, the device further includes:
[0048] The third acquisition module is used to acquire new instructions and contextual dialogue data; the contextual dialogue data includes historical instructions and historical rules.
[0049] The association analysis module is used to perform context association analysis on the context dialogue data based on the context-aware sub-model to determine the rule sub-units that need to be changed;
[0050] The update module is used to locally update the historical rules based on the large language model and the rule sub-units, and generate the update target rules.
[0051] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0052] Retrieve the target user profile contained in the user command;
[0053] Based on the large language model and the preset knowledge base, the target user profile is inferred and analyzed to determine the target intent and candidate tags corresponding to the target user profile;
[0054] The candidate tags and the target intent are compared and analyzed based on the tag filtering sub-model, and the candidate tags are filtered according to the comparison and analysis results to obtain a target tag set that matches the target user profile;
[0055] Target rules are constructed based on the target tag sets described above.
[0056] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0057] Retrieve the target user profile contained in the user command;
[0058] Based on the large language model and the preset knowledge base, the target user profile is inferred and analyzed to determine the target intent and candidate tags corresponding to the target user profile;
[0059] The candidate tags and the target intent are compared and analyzed based on the tag filtering sub-model, and the candidate tags are filtered according to the comparison and analysis results to obtain a target tag set that matches the target user profile;
[0060] Target rules are constructed based on the target tag sets described above.
[0061] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0062] Retrieve the target user profile contained in the user command;
[0063] Based on the large language model and the preset knowledge base, the target user profile is inferred and analyzed to determine the target intent and candidate tags corresponding to the target user profile;
[0064] The candidate tags and the target intent are compared and analyzed based on the tag filtering sub-model, and the candidate tags are filtered according to the comparison and analysis results to obtain a target tag set that matches the target user profile;
[0065] Target rules are constructed based on the target tag sets described above.
[0066] The aforementioned rule generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product acquire a target user profile contained in user instructions; perform reasoning analysis on the target user profile based on a large language model and a preset knowledge base to determine the target intent and candidate tags corresponding to the target user profile; perform comparative analysis on the candidate tags and target intent based on a tag filtering sub-model, and filter the candidate tags according to the comparative analysis results to obtain a target tag set matching the target user profile. This method combines a large language model with a tag filtering sub-model to recall a target tag set matching the target user profile from a preset knowledge base. Furthermore, the tag filtering sub-model first optimizes the candidate tags determined by the large language model, dynamically generating a target tag set adapted to the target user profile, improving the accuracy of the target tag set. Finally, by constructing target rules from the target tag set, the accuracy of generated target rules can be improved. Attached Figure Description
[0067] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0068] Figure 1 This is a flowchart illustrating a rule generation method in one embodiment;
[0069] Figure 2 This is a schematic diagram illustrating the process of combining an intent recognition sub-model and a large language model to generate candidate labels in one embodiment;
[0070] Figure 3 This is a flowchart illustrating the process of determining the target tag set based on a tag filtering sub-model in one embodiment.
[0071] Figure 4 This is a flowchart illustrating the process of generating tree-structured target rules based on a format analysis sub-model and a large language model in one embodiment.
[0072] Figure 5 This is a flowchart illustrating the process of determining the target visualization method based on a visualization decision sub-model in one embodiment.
[0073] Figure 6 This is a schematic diagram of the process of updating the incoming rules based on the context-aware sub-model and generating the updated target rules in one embodiment;
[0074] Figure 7 This is a structural block diagram of a rule generation device in one embodiment;
[0075] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0076] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0077] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0078] In one embodiment, such as Figure 1 As shown, a rule generation method is provided. This embodiment illustrates the method's application to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0079] Step 102: Obtain the target user profile contained in the user instruction.
[0080] In this embodiment, the terminal obtains user instructions through a preset data interface, parses the user instructions, and determines the target user profile contained in the user instructions. The target user profile represents the customer group to which the user needs to generate rules. This user profile can be edited by the user in the user instructions, or it can be a specific predefined customer group selected by the user from a candidate customer group list provided by the business system. For example, the user can input "I want to understand the investment preferences of young customers" into the large language model. Then, the terminal parses the user instructions through the large language model and obtains the target user profile as "young customers".
[0081] Step 104: Based on the large language model and the preset knowledge base, perform reasoning analysis on the target user profile to determine the target intent and candidate tags corresponding to the target user profile.
[0082] In this embodiment, the terminal first analyzes the target user profile based on a Large Language Model (LLM) to determine the target intent of the target user profile in the user command. This target intent is a structured expression containing high-dimensional semantics. For example, for the user command "I want to understand the investment preferences of young customers", the Large Language Model can determine that the target intent is "behavioral preference analysis for a specific customer group" targeting "young customers".
[0083] Then, based on the target intent, the terminal retrieves information about the target user profile from a pre-set knowledge base to determine candidate tags that match the target user profile. For example, the terminal uses RAG (Retrieval-augmented Generation) technology to perform precise searches in the pre-set knowledge base and recall candidate tags that match the target user profile. Specifically, the terminal uses the RAG mechanism to semantically align the target intent with the tag metadata in the knowledge base. For example, when the target intent is "analyze investment preferences," the terminal uses vector similarity matching, which involves vectorizing the intent and tag descriptions and calculating the cosine similarity. This is combined with keyword weighting, business domain filtering, and other strategies to improve recall accuracy, prioritizing the recall of tags semantically related to "investment behavior," "risk preference," and "asset allocation," such as "customer risk rating," "number of fund subscriptions in the past year," and "diversity of portfolio product types."
[0084] Finally, the terminal will output the tags that are highly relevant to the target user profile and target intent retrieved from the preset knowledge base as the initial recommendation tags, thus obtaining preliminary candidate tags.
[0085] Optionally, the terminal can also combine semantic understanding and knowledge base information to perform cluster analysis on recommended tags using a tag recommendation optimization sub-model based on cluster analysis. Based on user needs and customer characteristics, similar tags are grouped and recommended according to priority. For example, targeting "health protection needs of elderly customers," the tag recommendation optimization sub-model can reasonably group and recommend tags such as "medical insurance purchase status," "health product consumption amount," and "physical examination frequency," improving the efficiency of the large language model in tag selection based on target user profiles.
[0086] Step 106: Based on the tag filtering sub-model, compare and analyze the candidate tags and target intent, and filter the candidate tags according to the comparison and analysis results to obtain a target tag set that matches the target user profile.
[0087] In this embodiment, the tag filtering sub-model is a tag relevance model based on deep learning or a tag recommendation optimization model based on clustering analysis. It can calculate the relevance between tags and user intent, or group similar tags and recommend them according to priority based on user needs and customer characteristics. Among the candidate tags initially screened by the large language model, some are only semantically similar to the target user profile and do not meet the processing requirements of the target intent. Therefore, the terminal needs to further quantify the semantic relevance and business suitability between each candidate tag and the current user's target intent. Thus, the terminal calls the tag filtering sub-model to perform a refined comparative analysis of each candidate tag and the current user's target intent, and filters out the target tag set most suitable for the target user profile based on the comparison results of each candidate tag and the target intent.
[0088] Specifically, the tag filtering sub-model utilizes historical user interaction logs for supervised learning during the training phase. Tags ultimately selected by real users are used as positive samples, while excluded tags are treated as negative samples. By combining user commands and user profiles, the initial tag filtering sub-model's ability to discriminate target tags for different target intentions is optimized. The input to the tag filtering sub-model includes the semantic vector identifier of the target intention and the structured feature vectors of candidate tags. Through an attention mechanism learned during training, the tag filtering sub-model calculates the relevance score between the semantic vector of the target intention and the structured feature vectors of each candidate tag, obtaining the relevance score between each candidate tag and the target intention. Then, based on a pre-set relevance score threshold, redundant tags with low relevance are eliminated to obtain the target tag set. For example, when the objective is to "analyze the investment preferences of young customers", the label screening sub-model determines the relevance scores of each candidate label as follows: "risk preference level" score is 0.92, "frequency of fund transactions in the past 6 months" score is 0.88, "percentage of equity assets held" score is 0.85, and "city where the customer is located" score is 0.31. The label screening sub-model will then remove the candidate label "city where the customer is located" and retain "risk preference level", "frequency of fund transactions in the past 6 months", and "percentage of equity assets held" as the target label set.
[0089] Step 108: Construct target rules based on each target label set.
[0090] In this embodiment, the terminal determines the logical structure of the rules through a large language model, converting the target tags in the target tag set into structured and executable target rules for processing user behavior data or users for filtering and analysis. Specifically, the terminal first automatically infers the logical framework of the rules based on the type of target intent. For example, if the target intent is "screening high-potential customers," the terminal uses conjunction logic (AND) to require multiple tag conditions to be met simultaneously; if the target intent is "covering as many young investors as possible," disjunction logic (OR) may be used to relax the combination of conditions; if the target intent is "excluding people with excessively high risk," a negation condition (NOT) is introduced. Then, for each tag in the target tag set, the terminal extracts its definition, data type, and default threshold from a preset knowledge base. Finally, the terminal generates structured target rules based on the logical framework, the target tag set, and the data types and default thresholds corresponding to each target tag.
[0091] Furthermore, structured target rules are used to query the business database to obtain the corresponding business data. For example, if a user command is to query the investment preferences of a target user profile of "young customers," the terminal can query the business database according to the target rules and obtain multiple products that young customers are inclined to invest in. The terminal's business database can be built based on multi-source data access, meaning the terminal integrates business data from various heterogeneous business systems to provide a comprehensive and unified data foundation for subsequent customer profile analysis. Specifically, the terminal can not only process common structured data such as customer basic information tables and transaction record databases, but also has the ability to process unstructured data, such as customer service and customer communication texts and customer feedback documents. Structured data provides clear quantitative information for analysis, while unstructured data, after mining, adds depth and breadth to the customer profile. Regarding access modes, the terminal supports both real-time and batch access methods. Real-time access ensures data timeliness; for example, new customer transaction data can be immediately captured for analysis, allowing the customer profile to reflect the latest behavior. Batch access is suitable for periodic data updates; for example, data can be extracted daily or weekly from various business systems to comprehensively refresh the customer profile. Simultaneously, during data access, the terminal can utilize a deep learning-based data cleaning sub-model for data cleaning, verification, and transformation. For structured data, the data cleaning sub-model checks format specifications and field integrity; for unstructured data, it performs noise filtering and text standardization. Furthermore, data lineage technology records the data source and processing flow to ensure data accuracy and reliability.
[0092] In the above rule generation method, a large language model and a tag filtering sub-model are combined to recall a target tag set that matches the target user profile from a preset knowledge base. The tag filtering sub-model first optimizes the candidate tags determined by the large language model and dynamically generates a target tag set that matches the target user profile, thereby improving the accuracy of the target tag set. Then, the target rules are constructed through the target tag set, which can improve the accuracy of generating target rules.
[0093] In one exemplary embodiment, the preset knowledge base includes a tag knowledge base and a customer group knowledge base; such as Figure 2 As shown, step 104 includes steps 202 to 206. Wherein:
[0094] Step 202: Perform preliminary intent recognition on the target user profile based on the intent recognition sub-model to determine the initial intent corresponding to the target user profile.
[0095] In this embodiment, after acquiring user instructions and parsing the target user profile, the terminal calls an intent recognition sub-model to perform preliminary intent recognition on the target user profile and the original user instructions, determining the initial intent corresponding to the target user profile. The initial intent is used to narrow the analysis scope of the large language model for intent recognition, improving the efficiency and accuracy of intent parsing. For example, the intent recognition sub-model initially determines whether the current target user profile is related to customer characteristic analysis or business trend query, etc. This intent recognition sub-model is a lightweight deep learning classification model, such as a multi-class intent classifier based on convolutional neural networks (CNNs), outputting predefined high-level intent categories. For example, the training samples for the intent recognition sub-model are user input instructions, and the instruction intent of the input instructions is used as sample labels for supervised training, thereby obtaining the trained intent recognition sub-model.
[0096] Specifically, in the inference phase of the intent recognition sub-model, the user input text is first encoded into a semantic vector, and the probability distribution of each intent category is output. For example, for the input "I want to understand the investment preferences of young customers", the intent recognition sub-model determines that the probability of the current instruction intent is "customer characteristic analysis" is higher than that of other categories. Therefore, the intent recognition sub-model can determine that the initial intent is "customer characteristic analysis".
[0097] Step 204: Perform comprehensive intent analysis on the target user profile and initial intent based on the large language model to determine the target intent corresponding to the target user profile.
[0098] In this embodiment, the terminal uses the initial intent as a supplement to the target user profile for comprehensive intent recognition. Specifically, the terminal inputs the target user profile, the original user command, and the initial intent together as context into the large language model. Under the constraint of the initial intent, the large language model performs comprehensive intent parsing, further refining the processing requirements of the current target user profile, determining the target intent corresponding to the target user profile, and using this as the initial strategy for subsequent processing flows of the large language model. For example, the target intent of the target user profile may include processing strategies such as understanding the risk preference distribution of young customer groups, analyzing the asset allocation structure of young customer groups, and identifying the high-frequency trading behavior characteristics of young customer groups.
[0099] Ultimately, the large language model obtains a structured target intent. By introducing the initial intent as a prior constraint, the reasoning process of the large language model becomes more focused, reducing the probability of misjudgment of intent caused by ambiguity or vague expression in natural language, and improving the accuracy of the parsing reasoning path.
[0100] Step 206: Based on the large language model, tag knowledge base and customer group knowledge base, perform reasoning analysis on the target intent to generate candidate tags corresponding to the target user profile.
[0101] In this embodiment, the large language model first transforms the target intent into a structured query statement (SQL statement). Then, it uses the SQL statement to perform parallel searches in the tag knowledge base and the customer group knowledge base to generate candidate tags corresponding to the target user profile. For example, in the tag knowledge base, the large language model recalls relevant tags (e.g., "risk preference level", "number of funds held", "average monthly investment amount") as candidate tags based on the semantic similarity between the intent keywords and the tag definitions or uses. Simultaneously, if a preset customer group matching the target user profile exists in the customer group knowledge base, the large language model can recall the target customer group with a similarity greater than a preset threshold, and then use the tags corresponding to the target customer group as candidate tags. Furthermore, by explicitly requiring the tag names and thresholds generated by the large language model to strictly match the entries in the knowledge base in the prompts, ambiguity or invalid tags caused by arbitrary generation can be effectively avoided.
[0102] The tag knowledge base contains tag attribute information such as tag name, definition, purpose, threshold, and metadata; the customer group knowledge base contains customer group tags built for commonly used customer groups. The construction of both the tag knowledge base and the customer group knowledge base adopts a combination of structured and semantic methods. The tag knowledge base contains standardized fields for each tag, such as: tag name "risk preference level"; natural language definition "assessing a user's risk tolerance based on their historical investment behavior"; business purpose "used for customer segmentation and product recommendation"; value type "enumerated" (including conservative, moderate, and aggressive); threshold rule "equity assets accounting for >50% in the past 6 months is considered aggressive"; and corresponding metadata for the tag, such as data source, update frequency, and responsible person. All text fields in the standardized fields corresponding to the labels are encoded into high-dimensional vectors through a unified embedding model, and then further input into a lightweight text vector optimization model based on an attention mechanism. This optimization model learns the real business relationships between labels, dynamically adjusts the weights of each dimension of the vector, enhances the semantic similarity of labels, such as the clustering of "average monthly consumption amount" and "consumption capacity level" in the vector space, and at the same time increases the distance between unrelated labels.
[0103] The customer knowledge base is built based on historical operational experience. For high-frequency business scenarios, such as "New Generation Z Customers" and "High-Net-Worth Customers with Churn Warnings," predefined typical customer profiles are provided. Each customer group entry includes a description of its core characteristics, applicable business scenarios, industry characteristics, and related tag combinations. For example, the related tags for "New Generation Z Customers" are: age ∈ [18, 28], first transaction less than 90 days ago, preference for mobile devices, etc. The text description is also processed with embedding and vector optimization to facilitate efficient matching with target intent during the inference stage.
[0104] Optionally, for the management of the tag knowledge base, the terminal can optimize the index structure of the tag knowledge base through a machine learning-based index optimization sub-model, such as an inverted index, to improve retrieval efficiency. When analyzing the target user profile of "high-net-worth clients," the tag filtering sub-model can more quickly and accurately recall relevant information from massive tag knowledge, providing strong knowledge support for the analysis. Simultaneously, the large language model achieves zero-shot learning through knowledge base-driven processing; when adding a new tag, only the knowledge base entries need to be updated. The data generation sub-model (e.g., a generative adversarial network model) assists in generating simulated data related to the new tag, verifying the large language model's adaptation effect to the new tag. Furthermore, through strong consistency constraints on threshold names, the value field is forced to be completely consistent with the "threshold name" in the tag knowledge base, avoiding semantic ambiguity.
[0105] In this embodiment, the initial intent is generated by pre-identifying the target user profile through the intent recognition sub-model, which can narrow the reasoning scope of the large language model and improve its processing efficiency. Furthermore, the generation of the large language model is constrained by matching candidate tags through the tag knowledge base and the customer group knowledge base, which can further improve the compliance of the generated candidate tags and thus improve the accuracy of the target tags.
[0106] In one exemplary embodiment, such as Figure 3 As shown, step 106 includes steps 302 to 304. Wherein:
[0107] Step 302: The tag-based filtering sub-model calculates the matching score between the target intent and each candidate tag in the preset knowledge base.
[0108] In this embodiment of the application, after the terminal generates a set of candidate tags and determines the target intent, it calls the tag filtering sub-model to calculate the matching score between the target intent and each candidate tag in a preset knowledge base composed of the tag knowledge base and the customer group knowledge base.
[0109] Specifically, the tag filtering sub-model first encodes the natural language description of the target intent into an intent semantic vector using a unified embedding model. Simultaneously, it extracts the structured text attributes of each candidate tag from a pre-defined knowledge base, including tag name, definition, purpose, and target audience, and concatenates these attributes, also encoding them into a tag semantic vector using the embedding model. Optionally, to further improve semantic alignment accuracy, the terminal uses an attention-based vector optimization sub-model to interactively reweight the intent vector and tag vector, highlighting key semantic dimensions and suppressing noise dimensions. Then, the terminal calculates the matching score between the target intent and each candidate tag using the tag filtering sub-model.
[0110] Alternatively, the terminal can transmit the semantic vector of the target intent to the tag knowledge base and the customer group knowledge base. By performing matching degree calculation within the tag knowledge base and the customer group knowledge base, the tag filtering sub-model performs score mapping through cross-attention, calculates the correlation between the intent and each candidate tag, and outputs a normalized matching degree score.
[0111] Step 304: Based on the matching score and the preset filtering strategy, filter from the candidate tags to determine the target tag set that matches the target user profile.
[0112] In this embodiment, the preset filtering strategy can be a filtering strategy based on a matching degree threshold, or it can be a Top-K based tag filtering strategy, etc. The terminal can determine candidate tags with matching degree scores greater than the preset matching degree threshold as target tags, forming a target tag set. Alternatively, the terminal can sort the candidate tags according to their matching degree scores, and then determine the K highest-ranking candidate tags as the target tag set. Furthermore, the terminal can also remove redundancy from tags with highly overlapping semantics. For example, if the candidate tags "average monthly investment amount" and "total investment amount in the past 30 days" have a high similarity, the terminal can perform redundancy removal processing on the candidate tags using clustering algorithms or similarity calculations to obtain the target tag set.
[0113] In one exemplary embodiment, leveraging RAG technology, the terminal rapidly recalls tags related to "consumer behavior" from the tag knowledge base, such as "average monthly spending," "spending channel preference," and "spending time distribution." Simultaneously, the large language model can intelligently expand the recalled tags based on its understanding of customer attributes and user needs. For example, considering the consumption characteristics of "high-net-worth female customers," it might additionally recommend extended tags such as "overseas high-end spending" and "frequency of online exclusive platform spending." The candidate tags are further supplemented based on these extended tags. These extended tags are based on the large language model's deep understanding of the customer structure in the customer knowledge base and the business knowledge in the tag knowledge base, ensuring that the final target tag set is highly relevant to user needs.
[0114] In this embodiment, by using the target intent as the basis for filtering target tags, the dimensions of tag filtering can be enriched. In multi-dimensional tag filtering, the accuracy of target tag filtering can be improved, the accuracy of target tags and the business adaptability of target user profiles can be improved, and thus the accuracy of constructing target rules can be improved.
[0115] In one exemplary embodiment, such as Figure 4 As shown, step 108 includes steps 402 to 406. Wherein:
[0116] Step 402: Perform semantic parsing on the target user profile and target tag set based on the large language model to generate initial rule descriptions.
[0117] In this embodiment, the terminal performs step-by-step reasoning analysis on the target tag set based on the target intent corresponding to the target user profile using a large language model. Semantic parsing is performed on the target tags for different processing requirements within the target intent. Each processing requirement in the target intent is mapped to the original information such as the hierarchical structure, value type, and business definition of the target tags into a semantically complete natural language rule description, which serves as the initial rule description. For example, the initial rule description in natural language format is "The customer is between 18 and 35 years old, has more than 30% of their assets in stocks, and has a conservative risk appetite."
[0118] Step 404: Perform syntactic structure analysis on the initial rule description based on the format analysis sub-model to extract rule elements.
[0119] In this embodiment, since the initial rule description in natural language format cannot be directly processed by the business system, the terminal needs to further analyze the syntax of the initial rule description through a format analysis sub-model to extract the rule elements contained in the initial rule description. The format analysis sub-model maps natural language to JSON (JavaScript Object Notation) rule strings. This sub-model can be a deep learning-based syntax analysis model, trained with natural language as training samples and the corresponding JSON rule strings as labels. For example, the format analysis sub-model performs lexical and syntactic parsing on the natural language rules, identifying logical connectors, label names, and corresponding value conditions. Logical connectors include "AND," "OR," and "NOT," while label names include "age range," and value conditions include "18 to 35 years old," "greater than 30%," and "equal to robust."
[0120] Step 406: Generate a tree-structured target rule based on rule elements.
[0121] The target rules are in a tree structure, and each target rule node includes a logical operator, a target tag name, and the value conditions corresponding to the target tag name.
[0122] In this embodiment, the terminal uses logical operators as root nodes or internal nodes, combines each label name with its corresponding value condition into leaf nodes, and constructs a hierarchical rule tree according to logical relationships. For example, for a rule that states "age between 18 and 35 years old, equity assets > 30%, risk preference level = conservative" and the three conditions are related by "AND", the terminal can construct a tree structure with AND as the root node and the three label conditions as child nodes. If there is nested logic in the rule, such as "(A and B) or (C and not D)", then multiple subtrees are generated accordingly. The final generated target rule is stored in a tree data structure, and each node explicitly contains a logical operator, target label name, or value condition.
[0123] In an optional embodiment, the terminal also includes a rule validation sub-model. This sub-model can be a conditional random field-based rule validation model, used to generate target rules for format and semantic verification, ensuring that the tags in the target rules are consistent with the target knowledge base definition and that the logical relationships are reasonable. For example, after converting the user requirement "find young clients who invest more than 30% in stocks and prefer stable funds" into a JSON rule string, the sub-model checks whether the rule format is correct and whether the semantics conform to the business logic.
[0124] In an optional embodiment, the terminal uses a Large Language Model (LLM) to generate a compliant JSON rule string by combining the target tag set retrieved from RAG with prompt words. After obtaining the target rule, a rule optimization sub-model based on reinforcement learning can be used to further optimize the target rule. Through continuous trial and error and learning, the rule optimization sub-model adjusts the target tag combination, logical relationships, and condition settings in the target rule, making the target rule more accurate and effective. For example, if the prompt words require the LLM to generate rules for "analysis of the consumption behavior of high-net-worth female customers," the rule optimization sub-model evaluates and optimizes the generated rules to ensure that the rules accurately reflect business needs.
[0125] In this embodiment, the initial rule description of natural language is extracted by the format analysis sub-model, and the target rule is generated based on the rule elements. This can completely and accurately express the user's original intent and can be directly used by the subsequent rule execution engine for parsing and matching, which significantly improves the executability of the rule and enhances the accuracy of target rule generation in complex scenarios.
[0126] In one exemplary embodiment, such as Figure 5 As shown, after step 108, the method further includes steps 502 to 506. Wherein:
[0127] Step 502: Obtain the attribute type information of each target tag in the target tag set.
[0128] In this embodiment, for each target tag in the target tag set, the terminal obtains the attribute type information of each target tag in the target tag set from the tag knowledge base, which serves as the basic input for subsequent visualization method selection. The attribute type information of the target tag includes attribute type, value range, data granularity, update frequency, and business classification. For example, "average monthly consumption amount" is a numerical tag with continuous value characteristics, ranging from 0 to positive infinity; "risk preference level" is an enumerated tag with values including conservative, stable, and aggressive fixed types.
[0129] Step 504: Based on the large language model, perform a comprehensive analysis of the attribute type information and the tag semantics of each target tag to generate a set of candidate visualization methods.
[0130] In this embodiment, the terminal comprehensively analyzes attribute type information and the semantics of each target label based on a large language model, generating a set of candidate visualization methods for different target labels or combinations of different target labels. The large language model, based on its understanding of general principles of data visualization and combined with the specific semantics of the target labels, infers multiple potential visualization methods applicable to each target label, generating a set of candidate visualization methods. For example, regarding general principles of data visualization, numerical data is suitable for bar charts and line charts, enumerated data is suitable for pie charts and bar graphs, and time series is suitable for line charts, etc.; regarding the semantics of the target labels, "consumption amount" reflects distribution, "preference" reflects proportion, and "change trend" reflects time-series evolution.
[0131] In a specific implementation, for "average monthly spending", the model may output a candidate set: a bar chart (to show the distribution of intervals), a box plot (to show the degree of dispersion), and a density plot (to show dense data areas); for "spending channel preference", the candidate set may include pie charts, donut charts, horizontal bar charts, etc.
[0132] Step 506: Based on the visualization decision sub-model, evaluate the set of candidate visualization methods and determine the target visualization method that matches each target label.
[0133] In this embodiment, the terminal evaluates and optimizes a set of candidate visualization methods based on a visualization decision sub-model to determine the target visualization method that matches each target label. The visualization decision sub-model can be a generative adversarial network-based model. Its inputs include candidate chart types, label data distribution characteristics, and the target customer sample size. It also reads information such as display device size to construct complete contextual information and outputs a matching score for each visualization method. The visualization decision sub-model assists in selecting the most suitable visualization method based on historical user preference data and visualization cognition principles, and enhances the visualization graphics by adjusting color schemes and font styles to make the customer characteristics display more intuitive and clear. For example, when business data is large, a bar chart is preferred over a pie chart; when emphasizing percentage comparison, a donut chart is chosen and color contrast is optimized.
[0134] After determining the target visualization method, the terminal binds the target visualization method with the target tag, and integrates and renders the data based on the actual business data values of the target tag within the target customer group using the visualization engine. This generates intuitive distribution charts, such as using a bar chart to show the distribution of people in different ranges of "average monthly spending," and a pie chart to show the proportion of each channel in "consumption channel preference." Ultimately, the terminal applies the target rules, reads business data according to the target rules, and displays the data in charts according to the target visualization method. For example, the terminal can call the visualization profiling engine to generate data distribution maps of the customer group across various tag dimensions. At this point, the terminal can also optimize user interactions with the business data charts based on the chart optimization sub-model (which can be an interaction optimization model based on deep reinforcement learning). For example, when users perform operations such as zooming, filtering, and comparing, the chart optimization sub-model adjusts the visualization effect in real time, providing a more accurate and detailed display of customer group characteristics, helping users to deeply analyze customer group characteristics.
[0135] In an optional embodiment, based on the generated visualization charts, the terminal can further leverage its text generation capabilities based on a large language model to parse keywords from the target tags. Combining the analysis results of customer groups across various tag dimensions with the visualization charts, it can automatically assemble and generate a richly illustrated analysis report. This report not only provides a detailed interpretation of the data but also offers relevant business recommendations based on the analysis results. For example, based on the analysis of the consumption behavior and credit performance of "high-net-worth female customers," it could recommend launching exclusive high-end credit products and developing precise marketing strategies for different consumption channels. The automated generation of the graphic report significantly improves analysis efficiency and the practicality of the results.
[0136] In this embodiment, by combining the large language model and the visualization decision sub-model, a target visualization method that matches the target label can be selected. Displaying data according to this target visualization method can avoid errors in manually selecting chart types and improve the accuracy of customer characteristic display.
[0137] In one exemplary embodiment, such as Figure 6 As shown, after step 108, the method further includes steps 602 to 606. Wherein:
[0138] Step 602: Obtain the new command and context dialogue data.
[0139] The contextual dialogue data includes historical instructions and historical rules.
[0140] In this embodiment, the terminal acquires the user's current input instruction and complete contextual dialogue data as the input basis for multi-round interaction rule adjustments. The new instruction is expressed in natural language, such as "exclude first-tier cities" or "only retain customers under 30 years old"; the contextual dialogue data includes historical instructions from all previous rounds, as well as historical rules gradually built based on historical instructions. The terminal caches historical instructions and historical rules to ensure that the large language model and each sub-model can accurately understand the semantic state and rule evolution path of the current dialogue, providing complete contextual support for subsequent context-aware analysis and local rule updates.
[0141] Step 604: Perform context association analysis on the contextual dialogue data based on the context-aware sub-model to determine the rule sub-units that need to be changed.
[0142] In this embodiment, the terminal invokes a context-aware sub-model to perform deep correlation analysis on the contextual dialogue data to identify the scope of rule changes corresponding to changes in user intent and accurately locate the rule sub-units that need adjustment. The model architecture of this context-aware sub-model can be a recurrent neural network or similar architecture, and the context-aware sub-model can be a context-aware model in deep learning. The context-aware sub-model is used to perform semantic alignment and difference detection between historical instructions and newly added instructions, determining whether the newly added instruction introduces new conditions, modifies existing conditions, or has a logical conflict with existing rules. For example, when a historical rule already includes "city level = first-tier cities," and the newly added instruction is "exclude first-tier cities," the context-aware sub-model identifies a direct contradiction between the newly added instruction and existing rules, and locates the rule sub-unit corresponding to the "city level" label as the node that needs to be changed. If the newly added instruction is "age < 30," and there are no age-related conditions in the historical rules, the context-aware sub-model determines that a new rule sub-unit needs to be added. Furthermore, the terminal not only identifies the location of the target rule change but also outputs the change type (including addition, modification, and deletion) and potential conflict prompts through a conflict detection sub-model, providing precise guidance for rule updates.
[0143] Step 606: Based on the large language model and rule sub-units, locally update the historical rules to generate the updated target rules.
[0144] In this embodiment, the terminal collaboratively invokes a large language model and rule sub-units to partially update historical rules and generate updated target rules. Specifically, based on the semantics of the new instructions and the change guidance provided by the context-aware sub-model, the large language model rewrites or replaces only the affected rule sub-units without re-parsing all historical instructions. For example, if "city level = first-tier city" needs to be changed to "city level ≠ first-tier city", the large language model generates a new condition expression that conforms to the knowledge base definition and embeds it into the corresponding position in the original rule tree; if a "age < 30" condition needs to be added, a new label condition node is inserted under the root logical node. During the update process, the terminal synchronously invokes a conflict detection sub-model to verify the logical consistency of the new rules (e.g., avoiding simultaneous requirements of "age < 30" and "age > 40"), ensuring that the generated updated target rules faithfully reflect the user's latest intent while maintaining internal logical consistency. The final output rules are still a complete tree structure, which can be directly used for subsequent customer group screening or visualization analysis, achieving efficient, accurate, and low-redundancy multi-round interactive rule evolution.
[0145] In this embodiment, the context-aware sub-model assists the large language model in making precise local adjustments based on existing rules, which can improve the efficiency of rule updates and achieve more flexible rule adjustments.
[0146] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0147] Based on the same inventive concept, this application also provides a rule generation apparatus for implementing the rule generation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more rule generation apparatus embodiments provided below can be found in the limitations of the rule generation method described above, and will not be repeated here.
[0148] In one exemplary embodiment, such as Figure 7 As shown, a rule generation device 700 is provided, including: a first acquisition module 701, a reasoning analysis module 702, a comparison analysis module 703, and a construction module 704, wherein:
[0149] The first acquisition module 701 is used to acquire the target user profile contained in the user instruction;
[0150] The reasoning and analysis module 702 is used to perform reasoning and analysis on the target user profile based on the large language model and the preset knowledge base, and to determine the target intent and candidate tags corresponding to the target user profile.
[0151] The comparison analysis module 703 is used to compare and analyze candidate tags and target intent based on the tag filtering sub-model, and to filter candidate tags according to the comparison analysis results to obtain a target tag set that matches the target user profile;
[0152] Module 704 is used to build target rules based on each target tag set.
[0153] In one embodiment, the preset knowledge base includes a tag knowledge base and a customer group knowledge base; the reasoning analysis module 702 is specifically used to perform preliminary intent recognition on the target user profile based on the intent recognition sub-model, and determine the initial intent corresponding to the target user profile.
[0154] Based on the large language model, a comprehensive intent analysis is performed on the target user profile and initial intent to determine the target intent corresponding to the target user profile.
[0155] Based on the large language model, tag knowledge base, and customer group knowledge base, reasoning analysis is performed on the target intent to generate candidate tags corresponding to the target user profile.
[0156] In one embodiment, the comparison analysis module 703 is specifically used to calculate the matching score between the target intent and each candidate tag in a preset knowledge base based on the tag filtering sub-model;
[0157] Based on the matching score and the preset filtering strategy, the candidate tags are filtered to determine the target tag set that matches the target user profile.
[0158] In one embodiment, the construction module 704 is specifically used to perform semantic parsing on the target user profile and target tag set based on the large language model to generate an initial rule description;
[0159] Based on the format analysis sub-model, the initial rule description is subjected to syntactic structure analysis to extract rule elements;
[0160] The target rules are generated in a tree structure based on rule elements; the nodes of the target rules in the tree structure include logical operators, target label names, and the value conditions corresponding to the target label names.
[0161] In one embodiment, the device 700 further includes:
[0162] The second acquisition module is used to acquire the attribute type information of each target tag in the target tag set;
[0163] The comprehensive analysis module is used to perform comprehensive analysis of attribute type information and tag semantics of each target tag based on the large language model, and generate a set of candidate visualization methods;
[0164] The evaluation module is used to evaluate the set of candidate visualization methods based on the visualization decision sub-model and determine the target visualization method that matches each target label.
[0165] In one embodiment, the device 700 further includes:
[0166] The third acquisition module is used to acquire new commands and contextual dialogue data; the contextual dialogue data includes historical commands and historical rules.
[0167] The association analysis module is used to perform context association analysis on contextual dialogue data based on the context-aware sub-model to determine the rule sub-units that need to be changed;
[0168] The update module is used to perform partial updates on historical rules based on the large language model and rule sub-units, and generate the target rules for the update.
[0169] Each module in the aforementioned rule generation 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, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0170] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational 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 input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a rule generation method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0171] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0172] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0173] Retrieve the target user profile contained in the user command;
[0174] Based on the large language model and the pre-set knowledge base, reasoning analysis is performed on the target user profile to determine the target intent and candidate tags corresponding to the target user profile;
[0175] The tag filtering sub-model compares and analyzes candidate tags and target intents, and filters candidate tags based on the comparison and analysis results to obtain a set of target tags that match the target user profile.
[0176] Target rules are constructed based on each target label set.
[0177] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0178] Based on the intent recognition sub-model, preliminary intent recognition is performed on the target user profile to determine the initial intent corresponding to the target user profile;
[0179] Based on the large language model, a comprehensive intent analysis is performed on the target user profile and initial intent to determine the target intent corresponding to the target user profile.
[0180] Based on the large language model, tag knowledge base, and customer group knowledge base, reasoning analysis is performed on the target intent to generate candidate tags corresponding to the target user profile.
[0181] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0182] The tag-based filtering sub-model calculates the matching score between the target intent and each candidate tag in a pre-set knowledge base;
[0183] Based on the matching score and the preset filtering strategy, the candidate tags are filtered to determine the target tag set that matches the target user profile.
[0184] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0185] Based on the large language model, semantic parsing is performed on the target user profile and target tag set to generate initial rule descriptions;
[0186] Based on the format analysis sub-model, the initial rule description is subjected to syntactic structure analysis to extract rule elements;
[0187] The target rules are generated in a tree structure based on rule elements; the nodes of the target rules in the tree structure include logical operators, target label names, and the value conditions corresponding to the target label names.
[0188] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0189] Obtain the attribute type information of each target tag in the target tag set;
[0190] Based on the large language model, the attribute type information and the tag semantics of each target tag are comprehensively analyzed to generate a set of candidate visualization methods;
[0191] Based on the visualization decision sub-model, the set of candidate visualization methods is evaluated to determine the target visualization method that matches each target label.
[0192] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0193] Retrieve new commands and contextual dialogue data; contextual dialogue data includes historical commands and historical rules.
[0194] Contextual association analysis is performed on the contextual dialogue data based on the context-aware sub-model to determine the rule sub-units that need to be changed;
[0195] Based on a large language model and rule sub-units, historical rules are locally updated to generate target rules for updating.
[0196] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0197] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0198] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0199] 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, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0200] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0201] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A rule generation method, characterized in that, The method includes: Retrieve the target user profile contained in the user command; Based on the large language model and the preset knowledge base, the target user profile is inferred and analyzed to determine the target intent and candidate tags corresponding to the target user profile; The candidate tags and the target intent are compared and analyzed based on the tag filtering sub-model, and the candidate tags are filtered according to the comparison and analysis results to obtain a target tag set that matches the target user profile; Target rules are constructed based on the target tag sets described above.
2. The method according to claim 1, characterized in that, The preset knowledge base includes a tag knowledge base and a customer group knowledge base; the step of performing reasoning analysis on the target user profile based on the large language model and the preset knowledge base to determine the target intent and candidate tags corresponding to the target user profile includes: Based on the intent recognition sub-model, preliminary intent recognition is performed on the target user profile to determine the initial intent corresponding to the target user profile; Based on the large language model, a comprehensive intent analysis is performed on the target user profile and the initial intent to determine the target intent corresponding to the target user profile; Based on the large language model, the tag knowledge base, and the customer group knowledge base, the target intent is inferred and analyzed to generate candidate tags corresponding to the target user profile.
3. The method according to claim 1, characterized in that, The tag-based filtering sub-model compares and analyzes the candidate tags and the target intent, and filters the candidate tags based on the comparison and analysis results to obtain a target tag set that matches the target user profile, including: Based on the tag-filtering sub-model, the matching score between the target intent and each candidate tag is calculated in a preset knowledge base; Based on the matching score and the preset filtering strategy, the candidate tags are filtered to determine the target tag set that matches the target user profile.
4. The method according to claim 1, characterized in that, The construction of target rules based on each of the target tag sets includes: Based on the large language model, semantic parsing is performed on the target user profile and the target tag set to generate an initial rule description; The initial rule description is subjected to syntactic structure analysis based on the format analysis sub-model to extract rule elements; Based on the rule elements, a tree-structured target rule is generated; the target rule nodes in the tree structure include logical operators, target label names, and value conditions corresponding to the target label names.
5. The method according to claim 1, characterized in that, After constructing target rules based on each of the target label sets, the method further includes: Obtain the attribute type information of each target tag in the target tag set; Based on the large language model, the attribute type information and the tag semantics of each target tag are comprehensively analyzed to generate a set of candidate visualization methods; Based on the visualization decision sub-model, the set of candidate visualization methods is evaluated to determine the target visualization method that matches each of the target labels.
6. The method according to claim 1, characterized in that, After constructing target rules based on each of the target label sets, the method further includes: Acquire new commands and contextual dialogue data; the contextual dialogue data includes historical commands and historical rules. The contextual dialogue data is analyzed based on the context-aware sub-model to determine the rule sub-units that need to be changed. Based on the large language model and the rule sub-unit, the historical rules are locally updated to generate the updated target rules.
7. A rule generation device, characterized in that, The device includes: The first acquisition module is used to acquire the target user profile contained in the user command; The reasoning and analysis module is used to perform reasoning and analysis on the target user profile based on the large language model and the preset knowledge base, and to determine the target intent and candidate tags corresponding to the target user profile. The comparison analysis module is used to compare and analyze the candidate tags and the target intent based on the tag filtering sub-model, and to filter the candidate tags according to the comparison analysis results to obtain a target tag set that matches the target user profile; The building module is used to construct target rules based on each of the target tag sets.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. 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 steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.