Strategy generation verification optimization method and device, equipment and medium
By semantically vectorizing and clustering the policy set, generating policy templates and instantiating sub-agents, analyzing and fusing policy conflicts, and combining case verification and redundancy detection, the problem of insufficient automation in policy generation and verification in existing technologies is solved, and efficient and reliable policy generation and optimization are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-06
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies lack structure and executability in strategy generation, making it difficult to form a stable and reliable strategy generation system. Furthermore, the verification process lacks an automated mechanism, resulting in insufficient usability and reliability of strategies in high-risk industries such as finance and healthcare.
By semantically vectorizing the initial policy set, policy embedding vectors are generated. Policy clusters are formed based on similarity and common operators are extracted. Sub-agents are instantiated and private memory modules are configured. Semantic similarity and structural conflicts are analyzed and fused to generate a fused policy blueprint. The blueprint is then validated and redundancy detected by combining it with a set of cases. Parameters are optimized to form a new executable policy.
It achieves structured generation and executability of strategies, improves the automation of strategy generation, ensures the reliability and executability of generated strategies, and forms a complete closed loop from strategy extraction, generation, verification to optimization.
Smart Images

Figure CN121860073A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device, and medium for generating, verifying, and optimizing strategies. Background Technology
[0002] In the fintech sector, strategy development and application have become crucial aspects of risk control, investment analysis, and compliance review. Existing data-driven decision-making systems typically rely on large language models or rule engines to generate decision logic, but their output is mostly in natural language form, lacking structured and executable strategy expressions. This makes it difficult to directly translate strategies into machine-executable logical units for practical application. Particularly in scenarios like quantitative investment and intelligent risk control, strategies often involve screening, ranking, threshold judgment, and parameter setting. Existing methods lack the ability to logically decompose and combine these steps, and lack standardized templates at the operator level, making it difficult to form a stable and reliable strategy generation system. Furthermore, existing systems primarily rely on human experience for sample comparison and backtesting in strategy verification, which is inefficient and struggles to guarantee the objectivity and consistency of results.
[0003] In the healthcare field, strategies also play a crucial role in translating medical knowledge into clinical practice. For example, clinical decision support systems need to generate treatment recommendations or medication plans based on patient information. These strategies often involve variable selection, parameter threshold setting, and response rules. However, current technologies, especially large models or knowledge retrieval methods, mostly output unstructured text, lacking the ability to generate and summarize structured strategies, making them difficult for clinicians to use directly. Furthermore, in high-risk medical scenarios, the lack of automated strategy verification mechanisms makes it difficult to form a traceable chain of evidence and a repeatable verification process for the generated strategies. This not only affects the interpretability of medical decisions but also increases potential compliance and security risks.
[0004] In cross-domain applications, while existing decision generation frameworks can accomplish a certain degree of text generation and process orchestration, they still have shortcomings in the engineering processing of "strategies." Firstly, strategy generation lacks stable structural induction capabilities, making it difficult to achieve systematic abstraction from original cases to general templates. Secondly, the strategy verification process lacks a closed-loop mechanism, failing to efficiently complete redundancy detection, parameter optimization, and database updates after generation, resulting in insufficient strategy evolution and governance capabilities. These shortcomings limit the usability and reliability of strategies in high-risk industries such as finance and healthcare. Summary of the Invention
[0005] The main objective of this invention is to provide a method, apparatus, device, and storage medium for generating, verifying, and optimizing strategies. This aims to address the technical problem that existing technologies lack integrated engineering and governance capabilities for structured strategies, and are unable to stably summarize original strategy knowledge into executable templates and complete a closed loop of automatic generation, case retrieval and verification, redundancy detection, and parameter optimization.
[0006] To achieve the above objectives, the present invention provides a method for generating, verifying, and optimizing a strategy, comprising: The initial policy set is semantically vectorized to generate a policy embedding vector for each initial policy in the initial policy set. The initial strategies are clustered based on the similarity between the strategy embedding vectors to generate at least one strategy cluster, and common operators are extracted from each strategy cluster to form a corresponding strategy template. Multiple sub-agents are instantiated based on the strategy template, and a private memory module is configured for each sub-agent; The semantic similarity and structural conflict among the multiple sub-agents are analyzed. Sub-agents that are semantically similar but have structural conflicts are fused and conflict negotiation is carried out to generate a fusion strategy blueprint. A candidate strategy set is formed based on the fusion strategy blueprint and the strategy blueprints corresponding to the sub-agents that did not participate in the fusion process. A new strategy is generated based on the candidate strategy set through combination syntax and instruction guidance mechanism. Retrieve candidate cases that match the new strategy from the case set, and determine the degree of matching between the new strategy and the candidate cases to complete the verification; Redundancy detection is performed on the verified new strategy, and the strategy library is updated based on the detection results. The parameters of the new strategy that passes the redundancy detection are optimized, and the optimized new strategy is output.
[0007] Furthermore, to achieve the above objectives, the present invention provides a strategy generation, verification, and optimization apparatus, comprising: The semantic vectorization module is used to perform semantic vectorization processing on the initial policy set to generate a policy embedding vector corresponding to each initial policy in the initial policy set. The clustering template generation module is used to cluster the initial strategy based on the similarity between the strategy embedding vectors, generate at least one strategy cluster, and extract common operators from each strategy cluster to form a corresponding strategy template. The sub-agent generation module is used to instantiate and generate multiple sub-agents according to the policy template, and configure a private memory module for each sub-agent; The conflict negotiation and fusion module is used to analyze the semantic similarity and structural conflict among the multiple sub-agents, perform fusion and conflict negotiation processing on the sub-agents that are semantically similar and have structural conflicts, and generate a fusion strategy blueprint. The strategy combination generation module is used to construct a candidate strategy set based on the fusion strategy blueprint and the strategy blueprints corresponding to the sub-agents that did not participate in the fusion process, and to generate a new strategy based on the candidate strategy set through combination syntax and instruction guidance mechanism. The case verification module is used to retrieve candidate cases that match the new strategy from the case set and determine the matching degree between the new strategy and the candidate cases to complete the verification. The strategy optimization output module is used to perform redundancy detection on the verified new strategy, update the strategy library based on the detection results, optimize the parameters of the new strategy that passes the redundancy detection, and output the new strategy with optimized parameters.
[0008] Furthermore, to achieve the above objectives, the present invention also provides a computer device, the computer device including a memory, a processor, and a strategy generation, verification, and optimization program stored in the memory and executable on the processor, wherein when the strategy generation, verification, and optimization program is executed by the processor, it implements the steps of the strategy generation, verification, and optimization method as described above.
[0009] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a strategy generation, verification, and optimization program, wherein when the strategy generation, verification, and optimization program is executed by a processor, it implements the steps of the strategy generation, verification, and optimization method described above.
[0010] Beneficial Effects: This invention relates to the field of artificial intelligence technology and can be applied to business scenarios such as fintech and healthcare. It discloses a method, apparatus, device, and medium for generating, verifying, and optimizing strategies, comprising: semantically vectorizing an initial strategy set and generating strategy embedding vectors; clustering based on similarity and extracting common operators to form a strategy template; instantiating sub-agents according to the strategy template and configuring private memory modules; analyzing the semantic similarity and structural conflicts between sub-agents and fusing them to generate a fused strategy blueprint; constructing a candidate strategy set based on the fused strategy blueprint and the sub-agent blueprints that did not participate in the fusion process; generating a new strategy through a combination syntax and instruction guidance mechanism; retrieving matching cases from the case set and determining the matching degree to complete verification; performing redundancy detection on the verified new strategy and updating the strategy library; optimizing the parameters of the new strategy that passed the redundancy detection and outputting the parameter-optimized new strategy. This invention addresses the problem of strategy structuring in existing technologies by constructing strategy templates through semantic vectorization and clustering to extract common operators. It achieves controllability in generating new strategies from the candidate set through conflict negotiation and fusion to generate strategy blueprints. Automated verification is achieved through case matching, avoiding reliance on manual intervention. Dynamic updates and performance improvements are realized through redundancy detection and parameter optimization. This forms a complete closed loop from strategy extraction, generation, verification to optimization, enhancing the reliability and executability of the strategies. Attached Figure Description
[0011] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings: Figure 1 This is a schematic diagram of an application environment for a strategy generation, verification, and optimization method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating an embodiment of the generation, verification, and optimization method for the strategy of the present invention. Figure 3 This is a schematic diagram of the functional modules of a preferred embodiment of the strategy generation, verification, and optimization device of the present invention. Figure 4 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 5 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation
[0012] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0013] The strategy generation, verification, and optimization method provided in this embodiment of the invention can be applied to, for example... Figure 1In this application environment, the client communicates with the server via a network. The server can semantically vectorize the initial policy set through the client and generate policy embedding vectors. It then performs clustering based on similarity and extracts common operators to form policy templates. Sub-agents are instantiated based on the policy templates and configured with private memory modules. Semantic similarity and structural conflicts between sub-agents are analyzed and fused to generate a fused policy blueprint. A candidate policy set is constructed based on the fused policy blueprint and the blueprints of sub-agents that did not participate in the fusion process. New policies are generated through a combination syntax and instruction guidance mechanism. Matching cases are retrieved from the case set, and the matching degree is determined to complete the verification. Redundancy detection is performed on the verified new policies, and the policy library is updated. New policies that pass the redundancy detection are optimized in terms of parameters, and the optimized new policies are output. This invention solves the problem of difficult-to-structure policies in existing technologies by constructing policy templates through semantic vectorization and clustering to extract common operators; it achieves controllability in generating new policies from the candidate set through conflict negotiation and fusion to generate policy blueprints; it completes automated verification by combining case matching, avoiding reliance on manual intervention; and it achieves dynamic updates and performance improvements through redundancy detection and parameter optimization. This forms a complete closed loop from policy extraction, generation, verification to optimization, improving the reliability and executability of the policies. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.
[0014] Please see Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the strategy generation, verification, and optimization method provided by the present invention. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0015] like Figure 2 As shown, the strategy generation, verification, and optimization method proposed in this invention includes the following steps: S10, perform semantic vectorization processing on the initial policy set to generate a policy embedding vector corresponding to each initial policy in the initial policy set; In this embodiment, when performing semantic vectorization on the initial policy set, the initial policy set is a collection of multiple executable logical rules, each of which typically includes conditional judgments, variable calculations, and operation instructions. In semantic vectorization, these logical rules need to be represented as computable high-dimensional vectors for subsequent similarity calculations and clustering operations. Sources of semantic vectorization include word vector models from natural language processing, graph embedding methods, and embedding codes obtained after rule syntax parsing. For example, for policies containing multiple conditional judgments, logical nodes can be extracted first using a syntax tree parser, and then a graph neural network can be used to generate structured vectors; for policies described in natural language, semantic features can be extracted using a pre-trained language model and mapped to vector representations.
[0016] Generating the policy embedding vector for each initial policy in the initial policy set requires processing by a vector encoder, typically a deep learning network. This encoder can be a self-attention-based encoding structure, or a convolutional or recurrent neural network. During implementation, the policy's text fragments, operator symbols, and variable names are transformed into a unified embedding space to ensure that similar structures are closer together in the vector space. The embedding vector must not only contain semantic information but also capture the logical order and constraints of the policies. For example, a policy containing threshold judgments and another policy with similar threshold logic should have high similarity in the embedding space. To ensure vector comparability, the embedding vectors can be normalized to balance the impact of different policy lengths on the results.
[0017] This embodiment semantically vectorizes the initial policy set, transforming logical rules that are difficult to compare directly into a unified vector representation. This provides an operational mathematical foundation for subsequent similarity calculation and clustering. Semantic vectorization enables policies from different sources and with different structures to be compared in the same space, reducing reliance on manual judgment and improving the automation of policy analysis and generation.
[0018] S20, cluster the initial strategies based on the similarity between the strategy embedding vectors to generate at least one strategy cluster, and extract common operators from each strategy cluster to form a corresponding strategy template; In this embodiment, when clustering the initial policies based on the similarity between policy embedding vectors, it is first necessary to clarify the method of similarity calculation. Policy embedding vectors are high-dimensional numerical representations of logical rules, and the core of similarity calculation lies in measuring the semantic and logical structural similarity of different policies. Common implementation methods include cosine similarity, Euclidean distance, or Mahalanobis distance, among which cosine similarity is more effective in measuring the similarity of high-dimensional sparse vectors. After the policy embedding vectors form a similarity matrix, a similarity score can be provided for each pair of policies, thereby establishing the input data for clustering.
[0019] Clustering is a partitioning process based on a similarity matrix, and can employ hierarchical clustering, K-means clustering, or the density-based DBSCAN algorithm. Hierarchical clustering provides a tree-like merging perspective, suitable for multi-level induction among policies; K-means is suitable when the number of clusters is predetermined, iteratively optimizing cluster centers to make policy embedding vectors as close as possible to their corresponding centers; DBSCAN is suitable for large policy sets with noisy policies, discovering high-similarity clusters and excluding outliers through density connections. The choice of different algorithms is closely related to the scale of the scene and the characteristics of the similarity distribution.
[0020] After generating strategy clusters, it is necessary to extract common operators from each cluster. Common operators refer to logical units or operators that appear in most strategies within the cluster. For example, in a financial scenario, multiple investment strategies may all contain "threshold comparison operators" and "yield calculation formulas"; in a medical scenario, different treatment pathways may all contain "physiological indicator screening" and "drug dosage judgment" logic. Extraction methods include frequent itemset mining, syntax tree substructure matching, or statistical weight analysis. By setting frequency thresholds or statistical significance indicators, the set of operators that best represents the strategy cluster can be identified.
[0021] When forming policy templates, the extracted common operators are combined in a logical order, while retaining appropriate parameterization interfaces. For example, frequently occurring conditional judgment structures are abstracted into template nodes, and specific thresholds are set as replaceable parameters. Such templates can support subsequent instantiation into specific policies. The generation of policy templates is not only the result of structural induction but also provides a foundation for the subsequent creation of sub-agents and policy evolution.
[0022] This embodiment uses clustering based on the similarity between policy embedding vectors to automatically discover policy combinations with similar logical structures, reducing the cost of manual induction. Extracting common operators from each policy cluster to form policy templates helps transform scattered empirical rules into a structured, reusable abstract framework. This not only improves the efficiency of policy generation but also provides clear structural support for the subsequent instantiation of sub-agents.
[0023] S30, generate multiple sub-agents by instantiating them according to the strategy template, and configure a private memory module for each sub-agent; In this embodiment, when generating multiple sub-agents based on a policy template, the policy template must first be transformed into executable agent instances. The policy template contains a logical structure formed by combining common operators and parameterizable interfaces. During instantiation, these logical structures need to be mapped to the functional modules of the sub-agents. For example, a policy template containing threshold judgment, variable calculation, and operation response can be mapped to three internal functional units, used for condition judgment, index calculation, and execution scheduling, respectively. Instantiation means quickly generating sub-agents using the structured skeleton provided by the template, without having to build logical rules from scratch.
[0024] During instantiation, each sub-agent needs to be configured with an independent private memory module. The function of this private memory module is to store the policy template, original policy fragments, and structure embedding vectors corresponding to that sub-agent. This ensures that the sub-agent can call upon its own logic and data when executing tasks, without confusion with other agents. The private memory module typically consists of a key-value database or vector repository, supporting fast indexing and retrieval. Its stored content includes not only static template data but also association indexes established with the case set. This index, implemented through hash mapping or vector retrieval, connects the sub-agent with specific case data, ensuring rapid retrieval of relevant cases during subsequent verification and optimization.
[0025] The generation of multiple sub-agents is parallel, with each policy template corresponding to one agent. Due to the logical differences between different policy templates, the generated sub-agents differ in their behavioral patterns, stored data structures, and logical invocation paths. This differentiation among sub-agents allows subsequent analysis, conflict detection, and fusion processing to be built upon clear structural boundaries, avoiding cross-template interference.
[0026] In terms of implementation, a sub-agent can be instantiated for each policy template using an object-oriented programming model. Each sub-agent corresponds to a class instance, and the class attributes include logical units, parameter interfaces, calling interfaces, and memory modules. Private memory modules can be implemented using lightweight databases (such as SQLite), key-value stores (such as LevelDB), or vector databases (such as FAISS and Milvus), supporting fast querying and similarity retrieval. In the financial field, historical trading factors and return series can be embedded into the memory module; in the medical field, patient characteristics and treatment path embedding vectors can be stored to support subsequent similar case matching.
[0027] This embodiment generates multiple sub-agents by instantiating a policy template and configuring a private memory module for each sub-agent. This enables batch generation of agents while maintaining a clear logical structure, significantly reducing the cost of manually constructing complex policies. The configuration of the private memory module ensures that each sub-agent can independently save and retrieve its own policy information and case index, enhancing the system's retrieval efficiency and execution stability in multi-task, multi-case environments. This mechanism makes policy induction and verification scalable and traceable.
[0028] S40, Analyze the semantic similarity and structural conflict among the multiple sub-agents, perform fusion and conflict negotiation processing on the sub-agents that are semantically similar and have structural conflicts, and generate a fusion strategy blueprint; In this embodiment, when performing semantic similarity and structural conflict analysis among multiple sub-agents, it is first necessary to extract the policy vector signature of each sub-agent. The policy vector signature is a compact representation formed by mapping the logical structure and parameter expression of the sub-agent to a high-dimensional vector space; this representation can capture semantic features and logical associations. By calculating the cosine similarity or Mahalanobis distance between these policy vector signatures, semantic similarity results can be obtained, reflecting the degree of semantic proximity between the sub-agents.
[0029] After semantic analysis, the policy abstract syntax tree for each sub-agent needs to be further parsed. An abstract syntax tree is a tree-like structure where nodes represent operators, logical judgments, or actions, and edges represent structural relationships between different nodes. By calculating the edit distance between different abstract syntax trees, the structural differences in policy logic can be quantified. Edit distance includes operations such as operator insertion, deletion, and replacement; a smaller value indicates a closer structural similarity.
[0030] After obtaining semantic similarity results and structural difference measures, the two can be combined to determine which sub-agents are semantically similar but have structural conflicts. Typical conflicts include: the same condition judgment but using different operators; the same operational logic but differences in order or dependency; or the same execution action but inconsistent parameter thresholds.
[0031] For identified pairs of conflicting sub-agents, weighted conflict negotiation is required. This negotiation process can be accomplished by setting priority weights, using voting mechanisms, or constrained solvers. For example, historical case validation results can be used as weights to select and retain the better-performing logical segments, or intermediate solutions can be generated by merging differing parts. The negotiation result outputs a structural adjustment suggestion, which is then used to perform a structural fusion operation. Structural fusion merges semantically similar sub-agent logic into a unified blueprint, retaining the optimal solutions from different structural paths, and generating a fusion strategy blueprint.
[0032] The fusion strategy blueprint contains both the consistent parts of the original logic and the negotiated results of conflicts between different structures, forming a new structural foundation that can be further instantiated or combined. This blueprint will then be used to expand the candidate strategy set, entering the new strategy generation phase.
[0033] In terms of implementation, a vector database can be used to manage policy vector signatures, and semantic similarity can be obtained through batch calculation of cosine similarity. When processing abstract syntax trees, structural difference measurement can be implemented based on the tree edit distance algorithm, or matching speed can be optimized through custom weighted operator replacement rules.
[0034] Conflict negotiation can be achieved in three ways. One way is weight-based priority selection, which prioritizes the best-performing logical path from historical cases. Another way is through an ensemble learning framework, which simultaneously retains multiple conflicting paths and assigns weights, dynamically selecting the best path during subsequent verification. A third way is through constraint optimization, which maps different paths to a constraint solver to calculate a structured compromise solution.
[0035] In the fusion phase, graph merging techniques can be used to integrate the abstract syntax trees of different sub-agents, and node alignment and edge relationships can be used to generate a unified blueprint tree. For large policy sets, parallel processing and distributed graph storage systems can improve fusion efficiency.
[0036] This embodiment analyzes the semantic similarity and structural conflicts between sub-agents and uses a negotiation and fusion mechanism to generate a fusion strategy blueprint. This reduces redundant computation and logical conflicts among sub-agents, avoids discrepancies in the execution of semantically similar strategies, and improves the stability and consistency of the strategy generation process. The fusion strategy blueprint provides a more refined and reasonable structural foundation for the subsequent construction of the candidate strategy set, making the generated new strategy have higher logical integrity and verifiability.
[0037] S50, a candidate strategy set is formed based on the fusion strategy blueprint and the strategy blueprints corresponding to the sub-agents that did not participate in the fusion process. A new strategy is generated based on the candidate strategy set through combination syntax and instruction guidance mechanism. In this embodiment, after the fusion strategy blueprint is generated, it needs to be combined with the strategy blueprints corresponding to the sub-agents that did not participate in the fusion process to form a candidate strategy set. The fusion strategy blueprint is a unified blueprint refined after semantic similarity analysis and structural conflict negotiation, while the sub-agents that did not participate in the fusion process retain their independence and differences. By merging the two, a set containing multiple candidate schemes can be constructed, enabling the subsequently generated new strategies to have higher coverage and diversity. The merging process typically includes calibrating the unified representation format of the strategy blueprints, such as uniformly encoding the abstract syntax tree or logic tree, so that operations and comparisons can be performed within the same set.
[0038] After the candidate strategy set is formed, semantic clustering and structural analysis are needed on the strategy blueprints to generate a set of composable strategy patterns. This step involves extracting highly generalizable and reusable units from the strategy blueprints, called standardized strategy structural units. These structural units may include logical condition judgments, parameter threshold comparisons, calculation formula fragments, or operation sequences. The extracted standardized units are easy to recombine and splice during the combination process.
[0039] When constructing a policy combination space based on combinatorial syntax, it is necessary to define combinatorial constraints. Combinatorial constraints include structural integrity constraints (ensuring logical closure), type matching constraints (ensuring data type compatibility of input and output), and execution priority constraints (ensuring a reasonable order of operations). In the policy combination space, heuristic search algorithms are used to explore possible structural combinations, such as A* search or genetic algorithms, to efficiently discover potentially effective combinations.
[0040] The generated potential effective policy structures need to be transformed into new policy prototypes through an instruction-guided mechanism. The role of this mechanism is to provide dynamic prompts and constraints for the combination process, such as limiting the combination path through natural language prompts, templated instructions, or rule scripts. This reduces the generation of invalid combinations and improves the interpretability and consistency of the generated results.
[0041] After the new strategy prototype is generated, it is further converted into a multi-segment logic tree structure. This representation can fully describe the execution path and logical dependencies of the strategy. The logic tree then undergoes syntactic correctness verification to ensure that its structural symbols and logical expressions conform to preset syntax rules. Finally, the verified logic tree undergoes preliminary structural optimization, such as removing redundant nodes, merging equivalent conditions, or simplifying expressions, to obtain the final new strategy.
[0042] In terms of implementation, a distributed storage system can be used to manage the candidate policy set, and parallel processing can be used to improve the efficiency of policy blueprint merging and clustering. In the policy pattern extraction stage, template matching or neural network parsing models can be used to segment the policy blueprint and extract standardized structural units from it.
[0043] In the implementation of compositional grammars, the strategy composition space can be defined using context-free grammars (CFGs) or DSL-based composition rules. Constraints can be enforced by a logic compiler or rule engine, with legality verified in real time during the composition process. Heuristic search algorithms can choose between depth-first or breadth-first strategies, dynamically adjusting the search depth and breadth based on the size of the candidate set to balance efficiency and result quality.
[0044] In terms of instruction guidance mechanism implementation, interactive rule prompts can guide the direction of the combination process in real time; alternatively, combination prompts generated by a pre-trained language model can control the combination logic, improving flexibility. The logic tree verification stage can rely on a parser for automatic verification, while structural optimization can be achieved through rule rewriting or AST simplification algorithms.
[0045] This embodiment constructs a candidate strategy set by combining the fusion strategy blueprint with the strategy blueprints of the non-fusion sub-agents, and generates new strategies by combining combinatorial syntax and instruction guidance mechanisms. This significantly improves the diversity and rationality of the new strategies. This approach avoids the limitations of a single fusion result, allowing the new strategy to inherit the advantageous logic of the fusion blueprint while incorporating the differentiated characteristics of independent sub-agents. Simultaneously, through combinatorial constraints and search optimization mechanisms, it ensures that the generated results are logically complete and have reasonable execution paths, thereby enhancing the executability and verifiability of the strategies.
[0046] S60, retrieve candidate cases that match the new strategy from the case set, and determine the matching degree between the new strategy and the candidate cases to complete the verification; In this embodiment, after generating a new strategy, its effectiveness and rationality need to be verified through a case set. The case set typically consists of historical data, expert-annotated case samples, or verified business process instances, covering the input and output mapping of the strategy in different scenarios. The retrieval process is divided into two channels: one based on semantic similarity and the other based on tag matching. The semantic similarity channel constructs a vector retrieval model to transform the new strategy into a semantic embedding vector and compares it with the vector of each case in the case set, selecting the closest candidate case. The tag matching channel uses a keyword indexing mechanism to compare the key tag fields in the new strategy with the tags in the case set to find structural matches beyond semantics.
[0047] After completing the retrieval of the two channels, the candidate results of semantic similarity and tag matching need to be merged to form a candidate case set. During the merging process, duplicates need to be removed, and the candidate set is prioritized according to the preset fusion rules to ensure that the final candidate set includes both semantically similar cases and cases that have a direct correspondence in the tag dimension.
[0048] Once the candidate set is determined, the similarity between the new strategy and each case in the set needs to be quantitatively calculated. A common approach is to characterize semantic proximity using semantic embedding similarity scores, such as cosine similarity or vector distance metrics. Simultaneously, a label intersection ratio score needs to be calculated, reflecting the overlap between the new strategy and candidate cases in labels or feature fields. To avoid bias towards a single metric, the system typically employs a weighted evaluation function that integrates semantic embedding similarity and label intersection ratio to generate a comprehensive matching score.
[0049] After obtaining the matching score, supporting explanatory texts for the verification phase need to be generated. These explanatory texts include the core content of the candidate cases, logical units similar to the new strategy, and the composition ratio of the matching score. This process ensures that verification not only has a quantitative score but also provides a traceable chain of evidence, improving the transparency and interpretability of strategy verification.
[0050] In terms of implementation, semantic retrieval can be achieved using a dual-tower vector model or a vectorized model modified from a pre-trained language model. The model input is a logic tree or abstract syntax tree encoding of the new strategy, and the output is a semantic vector. The vector representations of candidate cases can be pre-computed offline and stored in a vector database, such as FAISS or Milvus, to improve retrieval efficiency.
[0051] Keyword indexing mechanisms can employ inverted indexes, creating index tables based on strategy tags, field names, or metadata. During the retrieval phase, Boolean queries can be used to quickly identify cases that share key tags with the new strategy.
[0052] When merging candidate case sets, a priority-based weighted merging strategy can be adopted. For example, different weights can be assigned to semantic similarity results and label matching results, and ranking rules can be used to ensure balanced semantic and label coverage. The implementation of the weighted evaluation function can flexibly adjust parameters. For example, in medical scenarios, more emphasis can be placed on the label intersection ratio, while in financial scenarios, more emphasis can be placed on semantic similarity, in order to adapt to the verification needs of different domains.
[0053] Case-supporting explanatory text can be generated through template-based methods, extracting overlapping logical units between the new strategy and candidate cases, and combining them with the matching degree value to automatically generate explanatory text. Alternatively, a natural language generation model can be used to generate more natural explanations.
[0054] This embodiment utilizes case set retrieval and matching degree calculation to enable the new strategy to be validated with the support of real-world cases. The dual-channel mechanism of semantic similarity and tag matching ensures the comprehensiveness of the validation, capturing both the logical similarity of the strategy and reflecting the consistency of its structure and tag dimensions. The generation of weighted evaluation and explanatory text provides quantitative evidence and traceable proof for the validation results, thereby enhancing the reliability and interpretability of the new strategy.
[0055] S70 performs redundancy detection on the verified new strategy, updates the strategy library based on the detection results, optimizes the parameters of the new strategy that passes the redundancy detection, and outputs the new strategy with optimized parameters.
[0056] In this embodiment, after policy verification, the redundancy detection and parameter optimization phase is required. First, the verified new policy is compared with existing policies in the policy library. The policy library, as a long-term accumulated structured policy collection, includes historical versions and verified policies; therefore, the goal of redundancy detection is to determine whether the new policy is too similar to existing policies. In implementation, the new policy and policies in the policy library can be converted into vector representations. The similarity between the two can be calculated using similarity measurement methods (such as cosine similarity, Euclidean distance, etc.), and the maximum similarity is selected as the result, thereby generating the redundancy detection result.
[0057] After obtaining the redundancy detection results, a judgment needs to be made based on a preset threshold. If the similarity between the new strategy and an existing strategy exceeds the threshold, it is considered redundant, and the system will not include the strategy in the strategy library. If the similarity is below the threshold, it is considered not redundant, and the new strategy will be added to the strategy library, realizing the updating and expansion of strategies. This process ensures the continuous evolution of the strategy library and avoids the accumulation of homogeneous and redundant strategies.
[0058] Once the new strategy passes redundancy detection, it enters the parameter optimization phase. First, a parameter space needs to be defined, which involves setting the search range and resolution for the adjustable parameters in the new strategy, such as thresholds, weights, or ranking rules. Then, a search is performed within the parameter space to find the optimal parameter combination. Search methods can include random search, grid search, or the introduction of Bayesian optimization to find a better-performing combination with fewer trials.
[0059] After identifying the candidate optimal parameter combinations, performance evaluation is required. This evaluation is based on performance response functions derived from historical cases. These functions are trained or constructed from past business samples and can simulate the strategy's performance under different parameter combinations. By calculating the strategy's accuracy, recall, return on investment, or risk metrics in these historical cases, parameter optimization results can be generated.
[0060] The parameter optimization results are not only a set of numerical indicators, but should also be applied to the new strategy to form a new, optimized strategy. During this process, the system updates the strategy parameters to the optimal parameter combination, ultimately resulting in an executable optimized version. Finally, the optimized strategy is output and encapsulated in a preset structured format, such as JSON, DSL, or other domain-specific languages, enabling it to be directly applied to downstream automation systems or auditing processes.
[0061] When implementing redundancy detection, semantic embedding models can be used to encode the policies, which can then be stored and retrieved quickly using a vector database. For example, in the case of a large-scale policy library, approximate nearest neighbor search can be used to accelerate similarity calculation. The threshold can also be adjusted according to business needs; for example, a lower threshold can be used in the healthcare field to avoid policy redundancy leading to duplicate diagnostic rules, while a higher threshold can be used in the financial field to reduce the excessive expansion of the policy library.
[0062] Different search strategies can be employed during parameter optimization. In environments with limited computational resources, random search can be chosen to quickly obtain an acceptable solution; in environments with high accuracy requirements, grid search or hierarchical grid search can be used; when a balance between efficiency and accuracy is needed, more intelligent search methods such as Bayesian optimization or genetic algorithms can be employed. The design of the performance response function can be flexibly adjusted. In the healthcare field, patient recovery rate and recurrence rate can be used as evaluation indicators, while in the financial field, return volatility ratio and Sharpe ratio can be used as indicators.
[0063] During the output phase, different encapsulation formats can be selected based on the different needs of downstream systems. In financial risk control platforms, a unified DSL file can be output for parsing and execution; in medical assistance systems, JSON format can be output, allowing the strategy to be directly embedded into the patient management system.
[0064] This embodiment introduces a redundancy detection mechanism to avoid high duplication between new and existing strategies, ensuring the diversity and effectiveness of the strategy library. The parameter optimization stage verifies the strategies using historical cases, enabling the new strategies to exhibit higher stability and adaptability under optimal parameters. The final structured output ensures that the strategies can be directly invoked by automated systems, thus forming a complete closed loop of verification, optimization, and output, improving the efficiency and reliability from strategy generation to implementation.
[0065] This invention relates to the field of artificial intelligence technology and can be applied to business scenarios such as fintech and healthcare. It discloses a method, apparatus, device, and medium for generating, verifying, and optimizing strategies, comprising: semantically vectorizing an initial set of strategies to generate strategy embedding vectors; clustering based on similarity and extracting common operators to form a strategy template; instantiating sub-agents according to the strategy template and configuring private memory modules; analyzing the semantic similarity and structural conflicts between sub-agents and fusing them to generate a fused strategy blueprint; constructing a candidate strategy set based on the fused strategy blueprint and the sub-agent blueprints that did not participate in the fusion process; generating a new strategy through a combination syntax and instruction guidance mechanism; retrieving matching cases from a case set and determining the matching degree to complete verification; performing redundancy detection on the verified new strategy and updating the strategy library; optimizing the parameters of the new strategy that passed the redundancy detection and outputting the parameter-optimized new strategy. This invention addresses the problem of strategy structuring in existing technologies by constructing strategy templates through semantic vectorization and clustering to extract common operators. It achieves controllability in generating new strategies from the candidate set through conflict negotiation and fusion to generate strategy blueprints. Automated verification is achieved through case matching, avoiding reliance on manual intervention. Dynamic updates and performance improvements are realized through redundancy detection and parameter optimization. This forms a complete closed loop from strategy extraction, generation, verification to optimization, enhancing the reliability and executability of the strategies.
[0066] In one embodiment, step S20 above includes: S201, Based on the policy embedding vector corresponding to each initial policy, determine the similarity between policy embedding vectors and generate a similarity matrix; S202, Based on the similarity matrix, the clustering module is used to cluster the initial strategy to generate multiple strategy groups; S203, Identify an initial set of strategies with similar characteristics from the strategy grouping to form a strategy cluster; S204, Analyze the common features of the initial policies in each policy cluster and extract common operators; S205, Construct a corresponding strategy template based on the common operator.
[0067] In this embodiment, the input is the policy embedding vector of each policy in the initial policy set, and the output is the policy template. The policy embedding vector is derived from the semantic vectorization encoding result and can be jointly constructed by text elements, structural elements, and context elements. The text elements correspond to semantic fragments such as indicator names, labels, and operation verbs; the structural elements correspond to the nodes and edges in the abstract syntax tree for operations such as comparison, filtering, aggregation, sorting, and triggering; and the context elements correspond to the mapping of the domain vocabulary and unit system. To improve the robustness of subsequent similarity measurement, the policy embedding vector is scaled and zero-mean normalized before entering the clustering process, and block standardization is introduced when necessary to adapt to large-scale samples.
[0068] Similarity determination generates a similarity matrix using policy embedding vectors as input. The similarity matrix is a symmetric matrix, with the maximum similarity values on the diagonal. Normalized dot products or angular distance metrics are used during construction to avoid numerical bias caused by high-dimensional sparsity. To suppress noise and outliers, a nearest neighbor graph is first constructed from the policy embedding vectors to constrain the non-zero structure of the similarity matrix. Threshold pruning and row normalization are then performed to ensure the comparability of policy sets of different sizes. The similarity matrix carries the adjacency relationships between policy pairs and serves as direct input for subsequent clustering and density estimation.
[0069] Clustering is based solely on the similarity matrix, without introducing external labels. To avoid the prior assumption of a fixed number of clusters, a graph Laplacian is first constructed on the similarity matrix, followed by spectral decomposition to discover low-dimensional manifold structures. When the sample size is larger, hierarchical aggregation or density peaking methods are used to generate candidate partitions in parallel at different resolutions. Each partition is accompanied by internal and external evaluations: internal evaluation measures intra-cluster compactness and inter-cluster separation, while external evaluation uses nearest neighbor retention and connectivity metrics to verify that the structure of the similarity matrix is fully utilized. The direct result of clustering is strategy grouping, with each strategy group corresponding to a connected substructure in the similarity matrix.
[0070] When identifying initial sets of policies with similar characteristics from policy groups to form policy clusters, it is necessary to use the grouping results in conjunction with structural constraints. Specifically, each policy group is used as a candidate set. Within each group, subgraph density and centrality indices are calculated, marginal samples within the group are removed, and high-density cores are retained. Simultaneously, abstract syntax tree matching is used to verify the structural consistency within each group. If significant structural breaks are found, the group is divided into several policy clusters. Policy clusters thus possess two levels of consistency: semantic consistency derived from the connectivity and density of the similarity matrix, and structural consistency derived from the overlap of the abstract syntax tree in terms of computational nodes and dependency order.
[0071] Common operator extraction is performed within the policy cluster. An operator refers to an independently reusable atomic operation unit, such as comparison, threshold determination, sliding aggregation, weighted combination, and triggering action. The extraction process consists of three steps: First, the abstract syntax tree of each policy is standardized, including unifying synonymous operations, parameter placeholders, and standardizing node identifiers; second, frequent subtree and co-occurrence fragment mining is performed, identifying computational fragments with high support and high confidence within the policy cluster; finally, alignment and merging mechanisms are used to converge on isomorphic substructures to obtain the minimum sufficient set of operators. To ensure cross-domain transferability, operator naming uses domain-independent expressions, and parameter positions are marked with placeholders, without binding to specific financial or medical entity terms. Common operators can include not only single nodes but also ordered links or minimal subgraphs with branches, satisfying the requirement of multiple recurrences within the policy cluster.
[0072] The strategy template is constructed using common operators as a framework for composition and constraint declaration. First, a directed acyclic graph is generated based on the dependency topology of operators within the strategy cluster, determining the order and parallelizability relationships. Then, a parameter interface is generated for each operator, containing the required input type, output type, and set of adjustable parameters. Next, composition constraints are introduced to limit illegal concatenation and type conflicts, providing the minimum coverage of required and optional operators. Finally, the output is a structured template containing the framework, interfaces, and constraints. A one-to-one correspondence is maintained between the strategy template and the strategy cluster, ensuring that subsequent instantiation can stably reproduce the common behavior of the strategy cluster within the template boundaries.
[0073] To ensure the stability and maintainability of large-scale processing, the entire process supports incremental updates and batch merging. When a new initial policy is introduced, only the local similarity between the new sample and the existing policy needs to be calculated, and the sparse blocks of the similarity matrix are updated locally, triggering adjustments to the affected groupings and policy clusters. Common operators refresh support through counters and sliding windows, and policy templates are only generated in new versions when coverage or purity changes significantly. Cross-domain adaptation is achieved through vocabulary mapping and unit mapping: a vocabulary of financial indicators and a unit of measurement mapping are introduced in the fintech business domain, and a vocabulary of physiological indicators and a unit of measurement mapping are introduced in the healthcare business domain. The mapping only affects the embedding construction and normalization process, without changing the overall logic of clustering and template construction.
[0074] This embodiment constructs a similarity matrix using policy embedding vectors as a unified representation and performs unsupervised clustering, enabling the formation of semantically and structurally consistent policy clusters without relying on manual labels. Within each policy cluster, common operators are extracted using a normalized abstract syntax tree, and policy templates are generated based on operator-dependent topology, providing a reusable skeleton and clear interface for subsequent instantiation. This process suppresses noise on the input side through normalization and sparse nearest neighbors, enhances clustering reliability through density and structural constraints in the intermediate layer, and reduces the search complexity of subsequent generation and verification on the output side by compressing the policy space and standardizing combination boundaries through templates. This improves cross-scenario transferability and version governance controllability, providing a stable structural foundation for subsequent sub-agent instantiation, conflict negotiation, and candidate policy combination.
[0075] In one embodiment, step S30 above includes: S301, Create a corresponding sub-agent based on each policy template; S302, allocates an independent private memory module to each sub-agent; S303, store the original policy fragment and structure embedding vector corresponding to the policy template into the private memory module; S304, establish the association between the sub-agent and the case set, generate the association index and store the association index in the private memory module.
[0076] In this embodiment, the goal is to translate the abstract skeleton into an execution unit that can be directly scheduled by subsequent fusion and generation processes, using a policy template as input and a runnable sub-agent and its private memory module as output. The policy template originates from the preceding clustering and common operator extraction stages and contains a computational skeleton, parameter interfaces, and combination constraints. The template's boundaries determine the sub-agent's scope of responsibility, and the input / output interfaces within the template determine how external upstream and downstream processes interact with the sub-agent. During instantiation, a unique identifier and runtime context are first created for each policy template. The runtime context includes the template version, source policy cluster, available parameter set, and dependency resource mapping. Subsequently, the computational skeleton is assembled within the execution container or service process, and the input / output interfaces are registered, completing the creation of the sub-agent. Semantically, the sub-agent corresponds to a concrete manifestation of the policy template; engineering-wise, it corresponds to an independent execution unit that can be invoked.
[0077] Each sub-agent needs to be allocated an independent private memory module to hold data and indexes strongly related to that execution unit. The private memory module adopts a hierarchical storage structure: a hot layer for frequently read / written vector indexes and key-value metadata, a warm layer for raw text and structural fragments, and a cold layer for version snapshots and audit trails. To ensure concurrency and isolation, the private memory module maintains an independent namespace for each sub-agent and restricts cross-instance access through an access control list. To support subsequent structural retrieval and evidence tracing, the private memory module contains at least three types of sub-storage and indexing. The first type is raw policy fragment storage, which saves text expressions, abstract syntax tree fragments, and parameter placeholders reconstructed from the policy template, maintaining a dual-view representation of semantic and structural granularity, providing immutable version tags and source signatures, and supporting differential merging and rollback. The second type is structural embedding vector storage, which saves multi-view vectors generated by the preceding semantic vectorization and structural encoding stages, including semantic views, structural views, and domain vocabulary mapping views, using a unified dimensional alignment and normalization standard, and a nearest neighbor search index to accelerate similar sample retrieval. The third type is associated index storage, which maintains a bidirectional mapping between sub-agents and case sets, recording the linked case identifier, matching source, similarity metric, tag coverage, and timestamp.
[0078] The writing of the original policy fragments follows immediately after the sub-agents are created. The write path performs template normalization, unifying synonymous operation names and parameter placeholders, and merging and topologically sorting the nodes of the abstract syntax tree to form an alignable baseline structure. The baseline structure and its corresponding text representation are stored together in the original policy fragment storage, and a hash signature is generated for version verification. The writing of the structure embedding vectors takes the baseline structure and text representation as input, obtains vector representations through a semantic encoder and a structure encoder, performs scale alignment and zero-mean normalization, and then writes them to the structure embedding vector storage. To improve recall accuracy, a local nearest neighbor graph can be generated during writing and persisted as a sparse index for rapid similarity retrieval within the private memory module.
[0079] The association index is built using the current content of the sub-agent as the retrieval query, executing semantic and tag channels in parallel on the case set. The semantic channel uses structural embedding vectors and a vector retrieval engine to return a list of highly similar cases, while the tag channel uses key phrases, domain entities, and enumerated fields from the policy fragment to return a list of tag-matching cases on the inverted index. The results from both channels are deduplicated, weighted, and sorted within a private memory module to generate a candidate case set. Links that meet the coverage and confidence criteria are then selected and written to the association index storage. The association index uses a traceable format, recording the encoding version, similarity source, and scoring composition at the time of link generation, ensuring that subsequent verification, redundancy detection, and optimization can be directly referenced without requiring data migration across modules.
[0080] To ensure lifecycle management and maintainability, an event flow is established between the sub-agent and the private memory module. A recoding event is triggered when the template version is updated or the original policy fragment changes, incrementally refreshing the structure embedding vector and local nearest neighbor index. A relink event is triggered when the case set is updated, incrementally updating the associated index and retaining the old version snapshot. A configuration event is triggered when the access policy or resource mapping changes, promptly synchronizing access control and resource handles. Event handling employs an idempotent mechanism and version thresholds to avoid duplicate writes and read / write contention. To ensure consistency, all writes are accompanied by atomic commits and pre-write logs; during anomaly recovery, log replay restores the system to the previous consistent state.
[0081] Anonymization and security boundaries are part of the private memory module design. To meet compliance requirements, identifiable information in the original policy fragments undergoes de-identification mapping before writing, structure embedding vectors are stored in segments with encryption, associated indexes use indirect references for case identifiers, and access paths are controlled through a least privilege policy. In terms of performance, hot-layer vector indexes and inverted indexes reside in memory, warm-layer files and objects are stored using block partitioning and compression, and cold-layer version snapshots are archived to low-cost storage, with a tiered reclamation strategy to maintain stable overall resource usage.
[0082] This embodiment creates a corresponding sub-agent for each policy template and equips it with a private memory module. The association between the original policy fragment, the structural embedding vector, and the case set is implemented within the same responsibility domain, forming a directly searchable, directly verifiable, and directly reusable operational unit. Instantiation gives the abstract template a callable interface and a stable execution environment. The private memory module integrates semantic representation, structural representation, and evidence linking into a low-latency storage and indexing system. Event-based updates and versioned snapshots ensure consistency and traceability even under multi-source changes. This reduces data movement and redundant coding in subsequent fusion and generation stages, shortens the retrieval and verification path, and improves reusability and controllability during cross-scenario migration. It provides an immediately usable structural and evidential foundation for subsequent conflict negotiation, candidate set construction, matching degree verification, and parameter optimization.
[0083] In one embodiment, step S40 above includes: S401, determine the similarity of policy vector signatures among multiple sub-agents and generate semantic similarity results; S402, parse the policy abstract syntax tree for each sub-agent; S403, determine the edit distance between the policy abstract syntax trees and generate a structural difference metric; S404, Based on the semantic similarity results and the structural difference measure, identify sub-agent pairs that are semantically similar and have structural conflicts; S405, perform weighted conflict negotiation on the identified sub-agent pairs to generate a negotiation solution; S406, Based on the negotiation solution, perform structural fusion processing on semantically similar sub-agent pairs that have structural conflicts to generate a fusion strategy blueprint.
[0084] In this embodiment, semantic similarity evaluation uses the policy vector signature of each sub-agent as input. The vector signature originates from the joint encoding of pre-sequence semantics and structure, including textual semantic dimensions, structural semantic dimensions, and domain terminology mapping dimensions. All vectors are first scale-aligned and zero-mean normalized to avoid dimensional shifts caused by different sources. A similarity matrix is generated for each pair of sub-agents, with matrix elements being complementary measures of normalized dot products or angular distances, yielding the semantic similarity result. To suppress noise, only the first few nearest neighbors of each row are retained and row normalization is performed, making subsequent selection more stable.
[0085] Structural alignment uses policy abstract syntax trees as the carrier. The abstract syntax tree for each sub-agent undergoes preprocessing through operator normalization, parameter placeholders, and node type unification to maintain a consistent representation of equivalent operations. Subsequently, tree editing metrics are performed on any two abstract syntax trees, allowing atomic operations such as node replacement, insertion, and deletion, with adjustable weights assigned to different types of operations to obtain a structural difference metric. To improve efficiency, coarse alignment is first performed at high-level nodes, followed by fine-grained comparison at the hit branches, significantly reducing overall complexity.
[0086] A dual-channel approach, combining semantic and structural similarity, is used to jointly select candidate sub-agent pairs. The specific process is as follows: First, nearest neighbor pairs exceeding a threshold are selected from the semantic similarity results. Then, structural difference metrics are examined on these nearest neighbor pairs. Only sub-agent pairs whose difference metrics exceed a set threshold are marked as "semantically similar but structurally conflicting." The threshold is adaptively extracted from historical distributions using a data-driven approach and supports domain-specific configuration, ensuring consistent and controllable selection criteria across different business contexts.
[0087] Weighted conflict negotiation is performed item by item on candidate pairs. Input includes the alignment mapping of two abstract syntax trees, the influence weights of each node, semantic constraints, and execution constraints. The negotiation process revolves around three types of conflicts: operation order conflicts, threshold and parameter conflicts, and side branch conflicts. Operation order conflicts select a better order through topological consistency checks and minimum rearrangement cost evaluation; threshold and parameter conflicts are weighted and compromised or range-based based on influence weights and source credibility; side branch conflicts are selected based on support and coverage metrics to retain, merge, or mask. Each decision records the source, metric, and selection criteria, forming a traceable negotiation solution.
[0088] The structural fusion process generates a fusion strategy blueprint solely based on the negotiated solution. During the fusion phase, successfully aligned common substructures are directly retained; reconciled substructures are replaced or connected in parallel according to the negotiation results; low-impact substructures that cannot be resolved are mounted as optional branches without disrupting dependencies. The fusion result is then verified through both semantic and structural consistency: semantically, the distance between the fusion blueprint and the original sub-agent vector signatures is checked to ensure they are within a reasonable range; structurally, the directed acyclic nature of dependencies and the consistency of input / output types are checked. After verification, the blueprint version is written, and mapping relationships and negotiation logs are recorded to ensure a basis for subsequent tracking and rollback.
[0089] To adapt to large-scale operation, the above process supports both batch processing and incremental paths. Batch processing performs vector signature refresh, similarity generation, tree alignment, and negotiation on the full quantum agent within a fixed window. The incremental path, when triggered by new or changed events, only completes filtering, negotiation, and fusion within the affected nearest neighbor subset, keeping the overall computational load and latency within a controllable range. All intermediate products are uniformly stored in versioned format: semantic similarity results, structural difference measurements, negotiation solutions, and fusion strategy blueprints are all timestamped and have source fingerprints, allowing the source and decision trajectory to be located at any subsequent stage.
[0090] This embodiment, through the dual-channel combination of semantic vector signature and abstract syntax tree, can accurately locate structural conflict targets without sacrificing semantic consistency, limiting the fusion objects to the most valuable sub-agent pairs and avoiding structural degradation and noise diffusion caused by blind full merging. The weighted conflict negotiation processes the three types of conflicts—sequence, parameters, and branches—in a hierarchical manner and solidifies the selection criteria with traceable logs. The fusion output is transformed into a structured fusion strategy blueprint, which retains high-frequency common substructures while isolating low-impact difference branches, thereby providing a stable, interpretable, and rollbackable structural baseline for the subsequent construction and combination of candidate sets.
[0091] In one embodiment, step S50 above includes: S501, merge the fusion strategy blueprint with the strategy blueprint corresponding to the sub-agent that did not participate in the fusion process to generate a candidate strategy set; S502, perform semantic clustering analysis on the strategy blueprints in the candidate strategy set to generate a set of composable strategy patterns; S503, Extract standardized strategy structure units from the strategy blueprints in the set of composable strategy patterns; S504, Construct a strategy combination space based on the combination syntax, and define the combination constraints of the standardized strategy structure units in the strategy combination space; S505, Perform heuristic search processing in the strategy combination space based on the combination constraints to generate potentially effective strategy structure combinations; S506, Based on the potentially effective strategy structure combination, a new strategy prototype is generated through an instruction guidance mechanism, and the generation process of the new strategy prototype is optimized by combining prompting engineering. S507, the new strategy prototype is converted into a multi-segment logic tree structure representation, and the syntax correctness of the multi-segment logic tree structure is verified. S508 performs preliminary structural optimization on the prototype of the new strategy that has passed the grammatical correctness verification to obtain the final new strategy.
[0092] In this embodiment, the policy blueprints for fusion and those for sub-agents that did not participate in the fusion process are first merged to form a broader policy resource pool while retaining reliable sources. This is achieved by unifying version identifiers and source tags for both types of blueprints, establishing a deduplication mechanism and a source tracing index. Deduplication is based on structural equivalence, employing three alignment steps: abstract syntax tree normalization, parameter placeholder unification, and node type unification. A hash comparison is then performed using structural signatures to retain the blueprint with higher information content. The source tracing index records the source blueprint, generation time, dependency fingerprint, and applicable context, allowing for retrospective lookup of any subsequent generation and verification. After merging, a candidate policy set is obtained, and semantic vectors and structural vectors are generated for each blueprint in the set, unifying dimensions and scales for subsequent processing.
[0093] The candidate strategy set enters semantic clustering analysis to obtain a set of composable strategy patterns. Semantically, similar connections are constructed using a vector nearest neighbor graph; structurally, operation sequences and dependencies are used for constraint filtering. Cross-validation on both sides avoids the inclusion of samples that are semantically similar but structurally incompatible. Multi-resolution slicing is employed during clustering: first, the main functional skeleton (filtering, sorting, execution, backtracking, etc.) is distinguished at a coarse-grained level; then, substructures such as triggering conditions, threshold placeholders, and windowed aggregation are distinguished at a fine-grained level. Finally, a set of patterns is output, with each pattern's blueprint exhibiting high consistency in both semantic intent and structural skeleton. Within each pattern, a central blueprint and coverage index are also calculated to provide a reference for subsequent unit extraction and combination scoring.
[0094] The goal of extracting standardized strategy structure units from a set of composable strategy patterns is to distill recurring structural fragments into reusable components. This process involves three steps: syntax tree fragment mining, alignment, and naming. Fragment mining uses high support and high confidence as filtering criteria to uncover frequently occurring atomic or small directed subgraphs such as comparisons, thresholding, sliding aggregation, weighted fusion, and action triggering. The alignment stage unifies the parameter positions and types of equivalent operations into placeholder descriptions and eliminates word order differences. The naming stage employs domain-independent naming and binds input / output types, adjustable parameter lists, and constraint labels (mutually exclusive, dependent, required, optional) to form a readily usable unit library. To facilitate cross-domain reuse, the unit library records the mapping relationship between measurement units and entities, but does not embed specific industry entities into the names.
[0095] A strategy combination space is constructed based on combination grammar. Combinatorial grammar uses non-terminal symbols to represent functional levels (e.g., filtering chains, sorting chains, execution chains) and production rules to describe the expansion relationship from the hierarchy to specific structural units. Combinatorial constraints are declared and enforced within the combination space. Constraint categories include type matching (the output type of a unit must satisfy the input type of the downstream unit), dependency order (upstream products must be consumed before downstream products), mutual exclusion and inclusion (mutually exclusive units at the same level cannot coexist, and required units must cover each other), resource consumption (concurrency limits on the same resource channel), and security whitelisting (only units that pass auditing are allowed to enter the combination). The combination space and constraints together define the explorable structural boundaries, avoiding semantic idling or structural mismatches in candidates.
[0096] Heuristic search processing is performed in the strategy combination space based on combination constraints to generate potentially effective strategy structure combinations. The search uses a pair of states, "currently spliced unit sequences and residual constraints," with the expansion operator being "select a unit that satisfies the current boundary conditions and connect it to the specified position." The pruning strategy covers three types of signals: feasibility (immediate pruning if constraints are violated prematurely), redundancy (weakening branches that highly overlap with existing structures), and estimated value (pruning if the combination score based on pattern center similarity, unit novelty, and dependency cost is too low). The search is carried out in parallel on multiple temperature trajectories, retaining a set of structure combinations with leading scores and high dissimilarity, forming a set of potentially effective strategy structure combinations.
[0097] Based on potentially effective strategy structure combinations, a new strategy prototype is generated through an instruction-guided mechanism. This mechanism maps structural combinations to generation prompt sequences and control tags, using the structural skeleton as the main thread and unit parameter interfaces as slots, injecting domain vocabulary mappings and boundary terms to drive the generation engine to output structured expressions. Hint engineering improves generation stability through small-sample alignment, error example alignment, and explicit constraint: small-sample alignment provides positive example skeletons, error example alignment explicitly prohibits splicing patterns, and explicit constraint embedding types and dependencies with control tags. The generated results undergo consistency self-checks within the same round; if inconsistencies with the composition space are found, it falls back to the nearest valid node and adjusts the hints.
[0098] The new strategy prototype is converted into a multi-segment logic tree structure representation. The converter restores the linearly generated structured expression to a hierarchical tree, with segments connected by control flow and data flow. Each node corresponds to a standardized strategy structure unit or an aggregation branch. Syntax correctness verification is performed through two checks: first, a parsing check based on compositional syntax to confirm the absence of illegal generation and unclosed non-terminal symbols; second, a static check based on the type system to confirm that all input and output types match, dependency closures are complete, and mutual exclusion and mandatory constraints are satisfied. The verified prototype enters preliminary structural optimization processing. Optimization actions include redundant unit elimination (removing predecessor units covered by successor units), merging shared sub-expressions (promoting duplicate branches to shared nodes), merging parameter placeholders (unifying the naming of duplicate placeholders and binding them to the same source), and fine-tuning the execution order (advancing lower-cost decisions without changing semantics). After optimization, the final new strategy is output, and the source tracing record is updated to fully record the mapping link from the fusion strategy blueprint and the strategy blueprints corresponding to the sub-agents that did not participate in the fusion processing, to the candidate strategy set, and then to the new strategy prototype and the final new strategy.
[0099] This embodiment merges the fusion strategy blueprint with the strategy blueprints corresponding to the sub-agents that did not participate in the fusion process into a candidate strategy set, and obtains a set of composable strategy patterns through semantic clustering analysis. It can stably extract standardized strategy structure units under a unified representation. It constructs a controlled strategy combination space based on combinatorial syntax and combinatorial constraints, and then obtains potentially effective strategy structure combinations through heuristic search. With the help of instruction guidance mechanism and prompting engineering, the structure combination is reliably transformed into a new strategy prototype. Finally, the new strategy is obtained through multi-segment logic tree structure and syntax correctness verification and preliminary structure optimization.
[0100] In one embodiment, step S60 above includes: S601, Constructing a vector retrieval model and keyword index based on a case set; S602, using the vector retrieval model to retrieve candidate cases semantically similar to the new strategy from the case set; S603, using the keyword index, retrieve candidate cases from the case set that match the new strategy label; S604, merge candidate cases that are semantically similar to the new strategy and candidate cases that match the new strategy label to generate a candidate case set; S605, determine the semantic embedding similarity score between the new strategy and each candidate case in the candidate case set; S606, determine the percentage score of the label intersection between the new strategy and each candidate case in the candidate case set; S607, Based on the weighted evaluation function, the semantic embedding similarity score and the tag intersection ratio score are combined to generate a matching score; S608, Generate supporting explanatory text for the case based on the matching score to complete the verification process.
[0101] In this embodiment, semantic retrieval and tag retrieval operate collaboratively within the same data domain. The input consists of a case set and a structured and semantic representation of the new strategy, while the output is the matching score and explanatory text. When constructing the vector retrieval model, semantic embedding vectors and structural embedding vectors are first generated for the case set and the new strategy. Semantic embeddings originate from joint text and structure encoding, while structural embeddings originate from graph representation encoding of abstract syntax trees or operation sequences. Both types of vectors are scaled and mean-zeroed on a unified dimension to eliminate biases introduced by differences in source. For fast nearest neighbor retrieval, a graph-based nearest neighbor index and a segmented inverted cluster are established. The former is responsible for generating approximate nearest neighbor candidates, while the latter is used for local re-sorting and denoising. The index construction records timestamps and encoded versions to achieve incremental updates and backtracking.
[0102] Keyword indexing serves the tag channel, taking as input tag fields from the case set and the tag set of the new strategy. The tag set can be obtained through structured field extraction, domain thesaurus mapping, and trigger predicate analysis. The indexing layer employs a combination of partitioned inverted index and Bloom filtering. Partitions are based on business domain and time window, and the filtering component quickly excludes impossible-to-hit entries. To ensure cross-domain portability, an equivalent mapping table is established between tag items and domain synonyms, and normalization is performed during the write phase to avoid recall instability caused by synonym splitting.
[0103] Semantic and tag-based retrieval are performed in parallel. The semantic channel uses the semantic embedding vector of the new strategy as the query, first generating candidates in the nearest neighbor index, then performing local re-ranking using precise similarity metrics to obtain a list of semantically similar candidates. The tag-based channel uses the tag set of the new strategy as the query, returning a list of tag-matching candidates in the inverted index, and performing a local scoring based on tag coverage and weight. The two outputs are merged on the same set using deduplication and priority re-ranking strategies. Deduplication is based on case identifiers and structural signature hashes, while priority re-ranking considers source reliability, time freshness, and coverage to obtain a candidate case set. The candidate set includes source tags to distinguish between semantic recall, tag recall, and the intersection of the two paths, facilitating reference during subsequent interpretation and generation.
[0104] Matching degree calculation is performed line by line on the candidate set. First, semantic embedding similarity scores are calculated, using complementary representations of angular similarity or Mahalanobis distance in the metric space to ensure scale insensitivity, while introducing soft threshold intervals to improve stability for boundary samples. Next, the label intersection ratio score is calculated, with inputs being the new strategy label set and the label set of a single candidate case, and output being the normalized overlap ratio, incorporating weight mapping to reflect the different importance of labels in terms of business. Both scores are fed into a weighted evaluation function. The weights are not fixed constants but rather a set of parameters that can be adaptively adjusted according to domain, time window, and sample density. The function includes both consistency penalties and novelty rewards. The consistency penalty is used to reduce matches with high semantic similarity but insufficient label coverage, while the novelty reward is used to improve matches consistent with the innovative points of the new strategy structure. The evaluation function returns the matching degree score and generates a detailed score composition for use in the interpretation phase.
[0105] The explanatory text is generated from three types of evidence. The first type is vector alignment evidence, showing the semantic alignment of the new strategy and candidate cases on key segments. This can be generated from attention alignment maps or phrase alignment pairs, along with similarity values. The second type is label coverage evidence, listing the simultaneously matched labels and their weights, explaining the contribution of the label signals. The third type is structural mapping evidence, based on the minimum edit path of an abstract syntax tree or operation sequence, indicating structural differences and common segments, clarifying the reasons for similarity and the boundaries of differences. Explanatory text generation follows traceability requirements; all values and entries can be traced back to the aforementioned score composition details and index source records. The explanatory text, along with the matching score, is written to the verification result storage, along with a timestamp, encoded version, and indexed version, ensuring that subsequent redundant detection and parameter optimization are read within a unified context.
[0106] The overall process supports both full and incremental execution modes. Full execution performs a comprehensive alignment and recalculation of the new strategy and case set within the batch processing window, suitable for large-scale updates to the strategy system. Incremental execution, triggered by a change in the case set or a new strategy event, incrementally merges only the vector index and inverted index of the affected partition, and recalculates the matching degree and interpretation of candidate cases on the hit path, reducing computational overhead and shortening verification latency. Anomaly recovery relies on pre-write logs and idempotent writes; repeated execution does not introduce conflict entries. When index versions are inconsistent, a version threshold is used to roll back to the most recent consistent point before recalculation.
[0107] This embodiment achieves parallel retrieval and merging of candidate sets within the same semantic and label spaces. Semantic recall ensures no potentially relevant cases are overlooked, while label recall constrains key business points and compliance boundaries. Matching score is generated by a weighted evaluation of semantic and label overlap scores, coupled with consistency penalties and novelty rewards, ensuring high-scoring results simultaneously satisfy semantic proximity and label coverage, avoiding business misalignment despite semantic similarity. Explanatory text originates from three types of evidence: vector alignment, label coverage, and structural mapping. All judgments can be traced back to verifiable quantitative details, forming a verifiable closed loop. This enhances the recall and accuracy capabilities of the verification process, shortens the manual review path, strengthens audit visibility, and provides stable input and traceable evidence for subsequent redundant detection and parameter optimization.
[0108] In one embodiment, step S70 above includes: S701, Determine the maximum similarity between the verified new strategy and the existing strategies in the strategy library, and generate redundancy detection results; S702, Based on the redundancy detection results, determine whether the verified new strategy is redundant; S703, if it is determined that there is no redundancy, the verified new strategy is added to the strategy library to complete the strategy library update; S704 performs a parameter space search on the new strategy for redundancy detection to find the optimal parameter combination; S705, Based on the performance response function of historical cases, analyze the performance of the new strategy under the optimal parameter combination and generate parameter optimization results; S706, Apply the parameter optimization results to the new strategy to generate a new strategy with optimized parameters; S707, the new strategy after parameter optimization is output in a preset structured format.
[0109] In this embodiment, when the verified new strategy enters the redundancy detection process, it first extracts two representations: semantic signature and structural signature. The semantic signature originates from the semantic encoding of the strategy text and operator description, while the structural signature originates from the normalized encoding of the abstract syntax tree or directed execution graph. Both are scale-aligned and unit-merged to generate a unified representation for similarity calculation. Existing strategies in the strategy library are maintained with corresponding signatures and version fingerprints to ensure that the comparison is in a consistent representation space. The determination of the maximum similarity is performed in two stages: full-library candidate screening and precise comparison. First, semantic candidates are screened within the vector nearest neighbor index. Then, a joint metric of semantic similarity and structural matching is calculated on the candidate set. The joint metric uses semantic similarity as the main score and structural editing cost as the penalty term, outputting a single maximum value along with the identifier and composition details of the matched entries, forming the redundancy detection result.
[0110] Redundancy detection results are used to determine whether a sample is redundant. The determination logic introduces a dual-threshold interval and a grayscale band: when the maximum similarity exceeds the upper threshold and the structural editing cost is lower than the synchronization threshold, it is marked as redundant; when the maximum similarity is lower than the lower threshold or the structural editing cost is higher than the synchronization threshold, it is marked as non-redundant. When a sample falls into the grayscale band, supplementary verification is triggered, including key operator coverage comparison and parameter placeholder consistency check, to reduce misjudgments of boundary samples. The determination conclusion is written into the audit log, which includes the comparison object, metric value, threshold configuration, and trigger path, ensuring that subsequent tracking has a basis.
[0111] When a strategy is deemed non-redundant, a strategy library update is performed. The update process consists of three parts: writing new entries, index maintenance, and lineage registration. Writing new entries uses the verified new strategy as the main body, carrying the source chain, verification digest, and signature snapshot. Index maintenance refreshes the semantic nearest neighbor graph and structural inverted index, enabling subsequent comparisons to immediately detect new content. Lineage registration links the verified new strategy to the evidence chain of the source blueprint and candidate cases, recording the generation time, applicable context, and dependent external resource mappings, providing a stable reference for subsequent parameter optimization and rollback. All writes employ an idempotent strategy, ensuring that duplicate submissions do not generate duplicate entries.
[0112] A novel strategy involving redundancy detection enters the parameter space search phase, aiming to find the optimal parameter combination. The parameter space consists of adjustable terms in the strategy, including threshold placeholders, window length, weight allocation, and triggering conditions. The space boundary is derived from the empirical interval of the validation set and the compliance whitelist. The search process alternates between candidate generation and performance evaluation: candidate generation samples parameter vectors within the feasible region, adhering to dependency and mutual exclusion constraints to avoid unexecutable configurations; performance evaluation invokes the performance response function of historical cases. The performance response function receives the new strategy and parameter vectors, returns aggregated scores for indicators such as coverage, accuracy, latency impact, resource consumption, and stability, and provides individual results for each indicator. To improve search efficiency, a scheduling approach combining multi-armed exploration and local refinement can be introduced to maintain a balance between exploration breadth and convergence speed. The search terminates under given stopping conditions, outputting the parameter vector with the leading score and satisfactory stability, defined as the optimal parameter combination, while retaining several complementary solutions as alternatives.
[0113] The performance response function is used to analyze the performance of a new strategy under optimal parameter combinations and generate parameter optimization results. The analysis process uses a multi-dimensional indicator panel to verify the coverage distribution, boundary sample behavior, and robustness to abnormal scenarios; redistribution checks are performed on time slices and domain slices to confirm the absence of accidental peaks driven by extreme samples; consistency constraints are used to compare and validate the indicator shifts from the training window to prevent overfitting and incorrect parameter selection. The parameter optimization results consist of three parts: the optimal parameter combination, an indicator overview report, and a risk warning list, which together describe the effectiveness boundaries and applicability of the configuration.
[0114] The parameter optimization results are applied to generate a new strategy with optimized parameters. The application actions include parameter injection, dependency refresh, and consistency verification: parameter injection maps the optimal parameter combination to parameter placeholders in the strategy structure; dependency refresh synchronously updates the cell order and aggregation window that may be affected by the parameters; consistency verification re-executes static verification and simulation sampling to confirm that type matching, constraint satisfaction, and performance regression are normal. The generated new strategy with optimized parameters, along with the summary information of the parameter optimization results, is attached to the lineage tree, forming a continuous trajectory from validation, deduplication, optimization to finalization.
[0115] The final output is encapsulated in a preset structured format, supporting five blocks: structural skeleton, parameter list, dependency declaration, version fingerprint, and audit fragment. The structural skeleton contains a parsable representation of the abstract syntax tree or execution graph; the parameter list lists all adjustable items and their final values, indicating their source as parameter optimization results; the dependency declaration explicitly specifies external data tables, feature views, and permission requirements; the version fingerprint provides hashes and timestamps; and the audit fragment references redundancy detection results and core details of the performance response function. The encapsulated result supports validation and differential display, facilitating consistency checks and rollbacks before and after deployment.
[0116] This embodiment, through maximum similarity-driven redundancy detection and dual-threshold interval determination, can simultaneously constrain duplication risks at both the semantic and structural levels, reducing meaningless database writes and version expansion. By linking parameter space search with performance response functions, it forms an optimization closed loop based on feasible domains, dependency constraints, and multi-indicator scoring, making parameter selection interpretable and verifiable. Through the practical application and structured encapsulation of parameter optimization results, it achieves stable migration from the validated new strategy to the parameter-optimized new strategy, with accompanying version fingerprinting and lineage registration to ensure a complete chain of evidence for subsequent operation, maintenance, auditing, and rollback.
[0117] In one embodiment, a strategy generation, verification, and optimization apparatus is provided, which corresponds one-to-one with the strategy generation, verification, and optimization methods described in the above embodiments. (Refer to...) Figure 3 , Figure 3 This is a schematic diagram of the functional modules of a preferred embodiment of the strategy generation, verification, and optimization device of the present invention. The modules include a semantic vectorization module 10, a clustering template generation module 20, a sub-agent generation module 30, a conflict negotiation and fusion module 40, a strategy combination generation module 50, a case verification module 60, and a strategy optimization output module 70. Detailed descriptions of each functional module are as follows: The semantic vectorization module 10 is used to perform semantic vectorization processing on the initial policy set to generate a policy embedding vector corresponding to each initial policy in the initial policy set. The clustering template generation module 20 is used to cluster the initial strategy based on the similarity between the strategy embedding vectors, generate at least one strategy cluster, and extract common operators from each strategy cluster to form a corresponding strategy template. The sub-agent generation module 30 is used to instantiate and generate multiple sub-agents according to the policy template, and configure a private memory module for each sub-agent; The conflict negotiation and fusion module 40 is used to analyze the semantic similarity and structural conflict among the multiple sub-agents, perform fusion and conflict negotiation processing on the sub-agents that are semantically similar and have structural conflicts, and generate a fusion strategy blueprint. The strategy combination generation module 50 is used to construct a candidate strategy set based on the fusion strategy blueprint and the strategy blueprints corresponding to the sub-agents that did not participate in the fusion process, and to generate a new strategy based on the candidate strategy set through combination syntax and instruction guidance mechanism. The case verification module 60 is used to retrieve candidate cases that match the new strategy from the case set, and determine the matching degree between the new strategy and the candidate cases to complete the verification. The strategy optimization output module 70 is used to perform redundancy detection on the verified new strategy, update the strategy library according to the detection results, optimize the parameters of the new strategy that passes the redundancy detection, and output the new strategy with optimized parameters.
[0118] Specific limitations regarding the strategy generation, verification, and optimization apparatus can be found in the aforementioned limitations regarding the strategy generation, verification, and optimization method, and will not be repeated here. Each module in the aforementioned strategy generation, verification, and optimization apparatus can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0119] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides determination and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When executed by the processor, the computer program implements the server-side functions or steps of a strategy generation, verification, and optimization method.
[0120] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides determination 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 in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements client-side functions or steps of a strategy generation, verification, and optimization method.
[0121] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: The initial policy set is semantically vectorized to generate a policy embedding vector for each initial policy in the initial policy set. The initial strategies are clustered based on the similarity between the strategy embedding vectors to generate at least one strategy cluster, and common operators are extracted from each strategy cluster to form a corresponding strategy template. Multiple sub-agents are instantiated based on the strategy template, and a private memory module is configured for each sub-agent; The semantic similarity and structural conflict among the multiple sub-agents are analyzed. Sub-agents that are semantically similar but have structural conflicts are fused and conflict negotiation is carried out to generate a fusion strategy blueprint. A candidate strategy set is formed based on the fusion strategy blueprint and the strategy blueprints corresponding to the sub-agents that did not participate in the fusion process. A new strategy is generated based on the candidate strategy set through combination syntax and instruction guidance mechanism. Retrieve candidate cases that match the new strategy from the case set, and determine the degree of matching between the new strategy and the candidate cases to complete the verification; Redundancy detection is performed on the verified new strategy, and the strategy library is updated based on the detection results. The parameters of the new strategy that passes the redundancy detection are optimized, and the optimized new strategy is output.
[0122] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: The initial policy set is semantically vectorized to generate a policy embedding vector for each initial policy in the initial policy set. The initial strategies are clustered based on the similarity between the strategy embedding vectors to generate at least one strategy cluster, and common operators are extracted from each strategy cluster to form a corresponding strategy template. Multiple sub-agents are instantiated based on the strategy template, and a private memory module is configured for each sub-agent; The semantic similarity and structural conflict among the multiple sub-agents are analyzed. Sub-agents that are semantically similar but have structural conflicts are fused and conflict negotiation is carried out to generate a fusion strategy blueprint. A candidate strategy set is formed based on the fusion strategy blueprint and the strategy blueprints corresponding to the sub-agents that did not participate in the fusion process. A new strategy is generated based on the candidate strategy set through combination syntax and instruction guidance mechanism. Retrieve candidate cases that match the new strategy from the case set, and determine the degree of matching between the new strategy and the candidate cases to complete the verification; Redundancy detection is performed on the verified new strategy, and the strategy library is updated based on the detection results. The parameters of the new strategy that passes the redundancy detection are optimized, and the optimized new strategy is output.
[0123] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0124] 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, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0125] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0126] It should be noted that if any software tools or components not belonging to this company appear in the embodiments of this application, they are merely illustrative examples and do not represent actual use. The embodiments described above are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention. The user personal information involved in the embodiments of this application is all authorized (knowing and agreeing) by the relevant parties or fully authorized by all parties, and the executing entity can obtain it through various public, legal and compliant means. The collection, storage, use, processing, transmission, provision and disclosure of the information, data and signals involved all comply with the relevant laws and regulations of the relevant countries and regions, and do not violate public order and good morals.
Claims
1. A method for generating, verifying, and optimizing a strategy, characterized in that, Includes the following steps: The initial policy set is semantically vectorized to generate a policy embedding vector for each initial policy in the initial policy set. The initial strategies are clustered based on the similarity between the strategy embedding vectors to generate at least one strategy cluster, and common operators are extracted from each strategy cluster to form a corresponding strategy template. Multiple sub-agents are instantiated based on the strategy template, and a private memory module is configured for each sub-agent; The semantic similarity and structural conflict among the multiple sub-agents are analyzed. Sub-agents that are semantically similar but have structural conflicts are fused and conflict negotiation is carried out to generate a fusion strategy blueprint. A candidate strategy set is formed based on the fusion strategy blueprint and the strategy blueprints corresponding to the sub-agents that did not participate in the fusion process. A new strategy is generated based on the candidate strategy set through combination syntax and instruction guidance mechanism. Retrieve candidate cases that match the new strategy from the case set, and determine the degree of matching between the new strategy and the candidate cases to complete the verification; Redundancy detection is performed on the verified new strategy, and the strategy library is updated based on the detection results. The parameters of the new strategy that passes the redundancy detection are optimized, and the optimized new strategy is output.
2. The method for generating, verifying, and optimizing the strategy as described in claim 1, characterized in that, The initial policies are clustered based on the similarity between the policy embedding vectors to generate at least one policy cluster, and common operators are extracted from each policy cluster to form a corresponding policy template, including: Based on the policy embedding vector corresponding to each initial policy, the similarity between policy embedding vectors is determined, and a similarity matrix is generated; Based on the similarity matrix, the initial strategy is clustered using a clustering module to generate multiple strategy groups. From the policy groups, an initial set of policies with similar characteristics is identified to form a policy cluster; Analyze the common features of the initial policies in each policy cluster and extract common operators; Construct corresponding strategy templates based on the common operators.
3. The method for generating, verifying, and optimizing the strategy as described in claim 1, characterized in that, Multiple sub-agents are instantiated based on the policy template, and a private memory module is configured for each sub-agent, including: Create a corresponding sub-agent based on each policy template; Each sub-agent is assigned an independent private memory module; The original policy fragment and structure embedding vector corresponding to the policy template are stored in the private memory module; Establish the association between the sub-agent and the case set, generate the association index, and store the association index in the private memory module.
4. The method for generating, verifying, and optimizing the strategy as described in claim 1, characterized in that, Analyze the semantic similarity and structural conflicts among the multiple sub-agents, perform fusion and conflict negotiation on sub-agents that are semantically similar but have structural conflicts, and generate a fusion strategy blueprint, including: Determine the similarity of policy vector signatures among multiple sub-agents and generate semantic similarity results; Parse the policy abstract syntax tree for each sub-agent; Determine the edit distance between the policy abstract syntax trees and generate a structural difference metric; Based on the semantic similarity results and the structural difference measure, identify sub-agent pairs that are semantically similar and have structural conflicts; Weighted conflict negotiation is performed on the identified sub-agent pairs to generate a negotiation solution; Based on the negotiation solution, structural fusion processing is performed on semantically similar sub-agent pairs that have structural conflicts to generate a fusion strategy blueprint.
5. The method for generating, verifying, and optimizing the strategy as described in claim 1, characterized in that, A candidate policy set is constructed based on the fusion policy blueprint and the policy blueprints corresponding to the sub-agents that did not participate in the fusion process. Based on this candidate policy set, a new policy is generated through a combination syntax and instruction guidance mechanism, including: The fusion strategy blueprint is merged with the strategy blueprints corresponding to the sub-agents that did not participate in the fusion process to generate a candidate strategy set; Semantic clustering analysis is performed on the strategy blueprints in the candidate strategy set to generate a set of composable strategy patterns; Standardized strategy structure units are extracted from strategy blueprints in the set of composable strategy patterns; A strategy combination space is constructed based on the combination syntax, and the combination constraints of the standardized strategy structural units are defined in the strategy combination space. Heuristic search processing is performed in the strategy combination space based on the combination constraints to generate potentially effective strategy structure combinations; Based on the aforementioned potentially effective strategy structure combinations, a new strategy prototype is generated through an instruction guidance mechanism, and the generation process of the new strategy prototype is optimized by combining prompting engineering. The new strategy prototype is converted into a multi-segment logic tree structure representation, and the syntax correctness of the multi-segment logic tree structure is verified. The prototype of the new strategy, which has passed the grammatical correctness verification, undergoes preliminary structural optimization to obtain the final new strategy.
6. The method for generating, verifying, and optimizing the strategy as described in claim 1, characterized in that, Retrieving candidate cases from the case set that match the new strategy, and determining the matching degree between the new strategy and the candidate cases to complete the verification, includes: A vector retrieval model and keyword index are built based on a set of cases; The vector retrieval model is used to retrieve candidate cases that are semantically similar to the new strategy from the case set; The keyword index is used to retrieve candidate cases from the case set that match the new strategy label; Merge candidate cases that are semantically similar to the new strategy and candidate cases that match the new strategy label to generate a candidate case set; Determine the semantic embedding similarity score between the new strategy and each candidate case in the candidate case set; Determine the percentage score of the overlap between the new strategy and the label of each candidate case in the candidate case set; A matching score is generated by combining the semantic embedding similarity score and the tag intersection ratio score using a weighted evaluation function. Based on the matching score, supporting explanatory text for the case is generated to complete the verification process.
7. The method for generating, verifying, and optimizing the strategy as described in claim 1, characterized in that, Redundancy checks are performed on the validated new strategies, and the strategy library is updated based on the check results. Parameter optimization is then performed on the new strategies that pass the redundancy check, and the optimized strategies are output, including: Determine the maximum similarity between the validated new strategy and existing strategies in the strategy library, and generate redundancy detection results; Based on the redundancy detection results, determine whether the verified new strategy is redundant; If it is determined that there is no redundancy, the verified new strategy is added to the strategy library to complete the strategy library update. A parameter space search is performed on the new strategy for redundancy detection to find the optimal parameter combination; Based on the performance response function of historical cases, the performance of the new strategy under the optimal parameter combination is analyzed, and parameter optimization results are generated. The parameter optimization results are applied to the new strategy to generate a new strategy with optimized parameters. The new strategy after parameter optimization is output in a preset structured format.
8. A strategy generation, verification, and optimization apparatus, characterized in that, The strategy generation, verification, and optimization apparatus includes: The semantic vectorization module is used to perform semantic vectorization processing on the initial policy set to generate a policy embedding vector corresponding to each initial policy in the initial policy set. The clustering template generation module is used to cluster the initial strategy based on the similarity between the strategy embedding vectors, generate at least one strategy cluster, and extract common operators from each strategy cluster to form a corresponding strategy template. The sub-agent generation module is used to instantiate and generate multiple sub-agents according to the policy template, and configure a private memory module for each sub-agent; The conflict negotiation and fusion module is used to analyze the semantic similarity and structural conflict among the multiple sub-agents, perform fusion and conflict negotiation processing on the sub-agents that are semantically similar and have structural conflicts, and generate a fusion strategy blueprint. The strategy combination generation module is used to construct a candidate strategy set based on the fusion strategy blueprint and the strategy blueprints corresponding to the sub-agents that did not participate in the fusion process, and to generate a new strategy based on the candidate strategy set through combination syntax and instruction guidance mechanism. The case verification module is used to retrieve candidate cases that match the new strategy from the case set and determine the matching degree between the new strategy and the candidate cases to complete the verification. The strategy optimization output module is used to perform redundancy detection on the verified new strategy, update the strategy library based on the detection results, optimize the parameters of the new strategy that passes the redundancy detection, and output the new strategy with optimized parameters.
9. A computer device, characterized in that, The computer device includes a memory, a processor, and a strategy generation, verification, and optimization program stored in the memory and executable on the processor. When executed by the processor, the strategy generation, verification, and optimization program implements the steps of the strategy generation, verification, and optimization method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a strategy generation, verification, and optimization program, which, when executed by a processor, implements the steps of the strategy generation, verification, and optimization method as described in any one of claims 1-7.