A rule migration method and system for a rule engine

By performing multi-grained analysis of the project source files of the rules engine and building a regular mesh structure diagram, combined with small sample learning and cluster analysis, the problem of low rule migration efficiency and accuracy is solved, and the efficient and accurate migration and execution of rules in the target system is achieved.

CN120316529BActive Publication Date: 2025-08-19SHENZHEN AIRONG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510805114.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-08-19
Estimated Expiration
2045-06-17

AI Technical Summary

Technical Problem

In the prior art, the rule migration efficiency of the rule engine is low and the accuracy is low. Especially in large systems or complex rule engines, manual rewriting rules is prone to errors and workload, and compatibility problems are present.

Method used

By obtaining the engineering source files of the rule engine for multi-grain analysis, building a rule mesh structure diagram, performing rule mapping and small sample learning, using target rule features for clustering analysis and migration effect analysis, generating adjustment strategies or directly using update mapping rules as the final migration rules.

Benefits of technology

It significantly improves the efficiency and accuracy of rule migration, ensures that rules are efficient and accurate in the target system, reduces manual intervention and errors, and enhances the scalability and intelligent management capabilities of the rule engine in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120316529B_ABST
    Figure CN120316529B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence technology, and discloses a rule migration method and system for a rule engine. The method comprises: obtaining a project source file of the rule engine, performing multi-granularity rule parsing on the project source file, and constructing a rule network structure diagram using the parsing results, performing rule mapping on the rule engine to obtain a mapping result, obtaining target rule features of the rule engine, performing small sample learning on the mapping result to obtain rule update features, performing cluster analysis on the mapping result to obtain an updated mapping rule, performing migration effect analysis on the updated mapping rule to obtain a migration effect score, and if the score is less than or equal to a preset score threshold, generating an adjustment strategy based on the migration effect score, and adjusting the updated mapping rule using the adjustment strategy to obtain a final migration rule, and if the score is greater than the preset score threshold, using the updated mapping rule as the final migration rule. The present invention effectively improves the rule migration efficiency and accuracy of the rule engine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a rule migration method and system for a rule engine. Background Art

[0002] A rule engine is a component used to execute rule-based decision systems, helping enterprises and systems automate decision-making. Rule migration refers to the process of migrating rules between different environments or systems, typically during system upgrades, migrations, integrations, or changes. With the increasing popularity of cloud computing, many rule engines have gradually migrated to the cloud. Cloud-based rule engines offer greater scalability and flexibility. The migration process typically involves migrating local rule engine configuration files, rule bases, and decision logic to cloud services to ensure system reliability and high availability.

[0003] However, traditional rule migration requires manual rewriting and porting of rules to the new system, which is error-prone and labor-intensive, especially when the number of rules is large. Different rule engines may use different rule languages, rule expressions, or execution models. Rule migration can lead to compatibility issues, such as inability to fully match the original system's rule expressions or differences in syntax and semantics. For large systems or complex rule engines, rule migration often involves a large number of rules and requires a high level of precision. The migration process can be cumbersome, especially without robust support tools.

[0004] Therefore, the existing technology has the problem of low efficiency and low accuracy in rule migration of the rule engine. Summary of the Invention

[0005] The present invention provides a rule migration method for a rule engine, the main purpose of which is to solve the problems of low efficiency and low accuracy of rule migration for the rule engine.

[0006] In a first aspect, to achieve the above-mentioned objectives, the present invention provides a rule migration method for a rule engine, comprising:

[0007] Obtaining a project source file of a rule engine, performing multi-granularity rule parsing on the project source file, and constructing a rule network structure diagram using the parsing results;

[0008] Perform rule mapping on the rule engine according to the rule network structure diagram to obtain a mapping result;

[0009] Obtaining target rule features of the rule engine, and performing small sample learning on the mapping result using the target rule features to obtain rule update features;

[0010] Performing cluster analysis on the mapping results using the rule update feature to obtain updated mapping rules;

[0011] Performing migration effect analysis on the updated mapping rule to obtain a migration effect score;

[0012] If the migration effect score is less than or equal to a preset score threshold, generating an adjustment strategy according to the migration effect score, and adjusting the update mapping rule using the adjustment strategy to obtain a final migration rule;

[0013] If the migration effect score is greater than a preset score threshold, the updated mapping rule is used as the final migration rule.

[0014] In a second aspect, the present invention further provides a rule migration system for a rule engine, the system comprising:

[0015] A rule parsing module is used to obtain the project source file of the rule engine, perform multi-granularity rule parsing on the project source file, and construct a rule network structure diagram using the parsing results;

[0016] A rule mapping module, configured to perform rule mapping on the rule engine according to the rule network structure diagram to obtain a mapping result;

[0017] A rule updating module is used to obtain target rule features of the rule engine, and perform small sample learning on the mapping results using the target rule features to obtain rule update features;

[0018] A cluster analysis module, configured to perform cluster analysis on the mapping results using the rule update feature to obtain updated mapping rules;

[0019] An effect analysis module, configured to analyze the migration effect of the update mapping rule to obtain a migration effect score;

[0020] a rule adjustment module, configured to generate an adjustment strategy based on the migration effect score if the migration effect score is less than or equal to a preset score threshold, and adjust the update mapping rule using the adjustment strategy to obtain a final migration rule;

[0021] A rule confirmation module is configured to use the updated mapping rule as a final migration rule if the migration effect score is greater than a preset score threshold.

[0022] The present invention obtains the engineering source file of the rule engine, performs multi-granularity rule parsing on the engineering source file, and uses the parsing results to construct a rule network structure diagram, which can comprehensively capture the multi-dimensional features of the rules at the grammatical layer, semantic layer and dependency layer, not only improving the accuracy of rule understanding, but also clearly revealing the logical associations and business dependencies between rules. According to the rule network structure diagram, the rule engine is mapped to obtain the mapping result, and the target rule feature of the rule engine is obtained. The mapping result is subjected to small sample learning using the target rule feature to obtain the rule update feature. The potential similarity between the mapping features is explored through the small sample learning model, and similar features are mined. The updated rule feature ensures that the rule migration and optimization can effectively adapt to the needs of the target system. The rule update feature is used to perform cluster analysis on the mapping results to obtain updated mapping rules. The rule update feature is used to uniformly update the rules in each target cluster, which can significantly improve the consistency, logic and executability of the migration rules. The migration effect of the updated mapping rules is analyzed to obtain a migration effect score. If the migration effect score is less than or equal to the preset score threshold, an adjustment strategy is generated according to the migration effect score, and the updated mapping rules are adjusted using the adjustment strategy to obtain the final migration rule. If the migration effect score is greater than the preset score threshold, the updated mapping rule is used as the final migration rule and as the formal rule version for subsequent rule deployment, integration or online launch, which effectively solves the problems of low rule migration efficiency and low accuracy for the rule engine. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0024] Figure 1 A schematic diagram of a flow chart of a rule migration method for a rule engine provided in one embodiment of the present invention;

[0025] Figure 2 A schematic diagram of a module of a rule migration system of a rule engine provided by one embodiment of the present invention;

[0026] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, and to fully understand and implement how the present disclosure applies technical means to solve technical problems and achieve the corresponding technical effects, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. The embodiments of the present disclosure and the various features in the embodiments can be combined with each other without conflict, and the technical solutions formed are all within the scope of protection of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present disclosure.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] An embodiment of the present application provides a rule migration method for a rule engine, which can be executed by software or hardware installed on a terminal device or a server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0030] Reference Figure 1 FIG. 1 is a flow chart of a rule migration method for a rule engine according to an embodiment of the present invention. In this embodiment, the rule migration method for a rule engine includes:

[0031] S1. Obtain the engineering source file of the rule engine, perform multi-granularity rule parsing on the engineering source file, and construct a rule network structure diagram using the parsing results.

[0032] In an embodiment of the present invention, the engineering source files of the rule engine include: rule definition files and the business object models and vocabulary files they depend on. The rule content in the engineering source files is disassembled and analyzed step by step from the grammatical layer, semantic layer and logical dependency layer, and semantic fields, business objects, rule actions, rule conditions and their dependencies are extracted. A rule network structure diagram that reflects the grammatical structure, semantic structure and dependency relationships between rules is further constructed to provide a structural basis for subsequent rule migration.

[0033] Specifically, the multi-granularity rule parsing of the project source file and the construction of a rule network structure diagram using the parsing results include:

[0034] Performing grammatical analysis on the project source file to obtain grammatical structure units;

[0035] Extracting semantic fields and business objects from the project source file;

[0036] Identifying a semantic mapping relationship between the semantic field and the business object;

[0037] Extracting rule actions and corresponding rule conditions from the project source file;

[0038] Performing dependency analysis on the coupling logic of the rule action and the rule condition to obtain a dependency relationship structure unit;

[0039] Obtaining file rules of the project source files, and using the file rules as mesh structure nodes;

[0040] The grammatical structure unit, the semantic mapping relationship and the dependency relationship structure unit are used as mesh structure edges;

[0041] The mesh structure nodes and the corresponding mesh structure edges are connected to obtain a regular mesh structure graph.

[0042] Specifically, the source code files of the rule engine are programmatically analyzed, and syntax analysis tools (such as ANTLR, JavaCC, or custom parsers) are used to identify and extract the grammatical structures in the code, such as rule definitions, conditional judgments, execution actions, dependencies, etc., and then these contents are broken down into grammatical structure units to provide basic semantic unit support for subsequent rule modeling and mapping.

[0043] On the basis of completing the grammatical parsing, we further identify keywords or identifiers with actual business meanings in the rules (such as variable names, field names, function names, etc.), and determine the business objects to which they belong (such as users, orders, equipment and other entities) in combination with the context, thereby mapping the abstract code in the rules into structured information with business semantics, providing semantic support for the understanding, modeling and migration of rules.

[0044] After extracting the semantic fields and business objects, by analyzing the naming, data type, scope of the semantic fields and their contextual usage in the rules, we determine which business object's attributes or behaviors each semantic field corresponds to, thereby constructing a correspondence map between the semantic fields and business objects, providing a semantic basis for subsequent rule abstract modeling and cross-system mapping.

[0045] In an embodiment of the present invention, performing dependency analysis on the coupling logic of the rule action and the rule condition to obtain a dependency relationship structure unit includes:

[0046] Generate an action-condition coupling relationship for each file rule in the project source file according to the rule action and the rule condition;

[0047] Constructing a dependency graph based on the action condition coupling relationship;

[0048] Marking the dependency type of each file rule according to the dependency graph to obtain an action condition dependency type;

[0049] A dependency relationship structure unit corresponding to each of the file rules is generated according to the action condition dependency type.

[0050] In detail, by analyzing the components of each rule in the project source file, we can identify the logical coupling relationship between the conditions on which the rule triggering depends (such as variable judgment, state determination, etc.) and its corresponding execution actions (such as assignment, call, output, etc.), and clarify which actions will be triggered under what conditions.

[0051] Based on the coupling relationship between actions and conditions in each extracted rule, the action-condition coupling relationship is further converted into a graph structure representation, in which each condition and action in the rule is regarded as a node in the graph, and the dependency path between the nodes is regarded as an edge. The direction of the edge represents the logical order in which the condition drives the action or the action depends on a specific condition, thus forming a visual dependency graph.

[0052] Analyze each edge in the dependency graph and mark the dependency type of each file rule in the project source file based on the association characteristics between conditions and actions, such as identifying it as data dependency, control dependency, or timing dependency, so as to clarify the role of different dependency paths in rule execution. Structure the information marked with dependency types and generate the dependency structure unit corresponding to each rule to accurately describe the condition triggering mechanism and action execution logic within the rule.

[0053] In detail, all file-level rule definitions are extracted from the project source files, and each rule is used as a node in the graph. The grammatical structure units, semantic mapping relationships, and dependency structure units of action conditions obtained in the previous analysis are used as edges in the graph to describe the associations and dependencies between rules or between parts within rules. Based on these nodes and edges, a complete rule network structure graph is constructed. The graph comprehensively reflects the structural relationships, semantic associations, and execution logic between rules, which helps to achieve global modeling and migration analysis of rules.

[0054] By performing multi-granular rule parsing on engineering source files and constructing a rule network structure diagram, we can comprehensively capture the multi-dimensional characteristics of rules at the grammatical layer, semantic layer, and dependency layer. This not only improves the accuracy of rule understanding, but also clearly reveals the logical connections and business dependencies between rules, thereby providing a solid data foundation and structural support for rule migration, optimization, conflict detection, and intelligent recommendation, significantly enhancing the scalability and intelligent management capabilities of the rule engine in complex business environments.

[0055] S2. Perform rule mapping on the rule engine according to the rule network structure diagram to obtain a mapping result.

[0056] In an embodiment of the present invention, a structured analysis is performed on each rule node and its dependency relationship in the rule network structure diagram, and a rule mapping strategy is generated using the obtained rule mapping target. The rule network structure diagram is mapped and converted one by one, keeping the original logical association unchanged, and finally generating a mapping result that conforms to the syntax format of the rule engine.

[0057] In detail, the rule engine is mapped according to the rule network structure diagram to obtain a mapping result, including:

[0058] Obtaining a rule mapping target, and generating a rule mapping strategy according to the rule mapping target;

[0059] Performing rule structure conversion on the rule network structure diagram according to the rule mapping strategy to obtain a rule update structure diagram;

[0060] generating a rule execution priority in the rule update structure diagram according to the rule mapping strategy;

[0061] Adjusting the execution order of the rule update structure diagram according to the rule execution priority to obtain a rule sequence structure diagram;

[0062] The file rules in the rule sequence structure diagram are mapped to the rule engine one by one to obtain mapping results.

[0063] In detail, the target of rule mapping is determined according to the specific requirements of business needs, such as the rule specifications of different rule engines, systems or platforms. According to the characteristics, rule language and execution mechanism of the target rule engine, the rule mapping strategy is designed and generated to ensure that the source rules can be correctly converted and adapted to the rule engine. The rule mapping strategy includes the conversion of rule structure, adjustment of execution order, etc., to achieve accurate execution and efficient operation of rules in the new environment.

[0064] In an embodiment of the present invention, performing rule structure conversion on the rule network structure diagram according to the rule mapping strategy to obtain a rule update structure diagram includes:

[0065] generating a rule conversion operation according to the rule mapping strategy;

[0066] Constructing a dependency update relationship of the rule network structure graph according to the rule conversion operation;

[0067] The rule network structure diagram is reconstructed using the dependency update relationship to obtain a rule update structure diagram.

[0068] Specifically, the transformation operations for executing specific rules are generated based on the designed rule mapping strategy. These transformation operations include rule reconstruction and re-establishing dependencies, ensuring that the rules can be correctly parsed and executed in the target environment and produce the expected results. The syntax, semantics, and dependencies of the source rules are converted one by one according to the transformation operations to ensure that the rules comply with the rules engine's specifications and execution mechanism.

[0069] The rule transformation operation may require rearranging the dependency order between rules, modifying the connection method between conditions and actions, etc., so the attributes of each node and edge in the dependency graph will be updated to obtain the dependency update relationship, which shows the dependencies and interactions between the rules and between the rules and conditions / actions in the new rule system.

[0070] Based on the transformed dependencies, the layout and dependency paths of the rule nodes in the graph are adjusted, redefining the relationships and interactions between rules. By updating the connection method, order, and execution logic between rules, the rule structure in the graph can better adapt to the execution environment and requirements of the target platform. The result is a reconstructed rule update structure diagram that accurately reflects the dependencies and execution order between the rules in the new rule system.

[0071] Specifically, by analyzing the dependencies and triggering order between rules, we determine which rules need to be executed first and which rules can be executed later or in parallel, thereby establishing a priority order for rule execution. This process takes into account factors such as rule urgency, dependencies, and execution efficiency to ensure that rules can be executed efficiently and orderly in the target system.

[0072] By rearranging the execution order of rule nodes, high-priority rules are executed first, followed by lower-priority rules, either sequentially or in parallel. The adjusted structure diagram reflects the execution order and dependency sequence of each rule, ensuring efficient execution in an optimized order within the target environment, avoiding conflicts and redundancies, and improving overall system performance and responsiveness.

[0073] By mapping each rule in the rule sequence structure diagram to the rule engine one by one, mapping the conditions, actions, dependencies, etc. of each rule to the format of the target rule engine one by one, and ensuring that the rules can be correctly parsed, executed and produce expected results in the new environment, the mapping results of each rule in the target engine are obtained.

[0074] This process systematically migrates rules to the rule engine, ensuring efficient and accurate rule execution in the new execution environment. Rule mapping strategies provide clear guidance for rule conversion, enabling each rule to be adapted and optimized to the requirements of the target system. Adjusting rule execution priorities and execution order further improves system execution efficiency, ensuring that critical rules are prioritized and reducing execution conflicts and redundancy. By mapping rules one by one and generating mapping results, we ensure the integrity of the migrated rules and the correctness of the business logic.

[0075] S3. Obtain target rule features of the rule engine, and use the target rule features to perform small sample learning on the mapping results to obtain rule update features.

[0076] In an embodiment of the present invention, target rule features are extracted from the rule engine, including key feature parameters such as rule semantic expression, trigger mechanism, execution process and context dependency, and a rule feature vector representation is constructed. Combined with the target rule features, a small sample learning algorithm is used to mine potential similar features in the mapping results, and ultimately, enhanced rule update features are output to provide a basis for subsequent rule fusion and adaptation optimization.

[0077] In detail, the step of obtaining target rule features of the rule engine and performing small sample learning on the mapping results using the target rule features to obtain rule update features includes:

[0078] Converting the target rule feature into a rule feature vector;

[0079] Optimizing a preset learning model using the rule feature vector to obtain a small sample learning model;

[0080] Converting the mapping result into a mapping feature vector;

[0081] mining potential similarities of the mapping feature vectors using the small sample learning model to obtain similar features between the mapping feature vectors;

[0082] Generate a rule update feature based on the mapping result corresponding to the similar feature according to the similar feature.

[0083] Specifically, each characteristic of the target rule (such as the complexity of the rule, dependency strength, priority, etc.) will be converted into a numerical form and constitute a feature vector according to certain rules and dimensions. This feature vector can accurately reflect the behavior pattern and execution characteristics of the target rule in the rule engine.

[0084] By using rule feature vectors as input, the learning model is trained to better adapt to the rule execution logic and business needs. By training on small sample datasets, the learning model can optimize its predictive capabilities within a limited sample size, identifying the underlying patterns and characteristics of the rules, thereby building a small-sample learning model. This model maintains high accuracy and robustness even in the face of sample scarcity, providing intelligent support for rule migration, adjustment, and execution.

[0085] The mapping results (including rule execution order, dependencies, and transitions between conditions and actions) are quantified into a mapping feature vector. This mapping feature vector contains numerical representations of key attributes of the mapped rules in the target engine, such as execution efficiency, priority, and the strength of inter-rule dependencies. This conversion simplifies the complex mapping results into a vector form that is easier to process and analyze.

[0086] In an embodiment of the present invention, mining potential similarities of the mapping feature vectors using the small sample learning model to obtain similar features between the mapping feature vectors includes:

[0087] Converting the mapping feature vector into a mapping embedding vector using the small sample learning model;

[0088] Performing data augmentation on the mapping embedding vector to obtain a mapping augmentation vector;

[0089] Calculating the mapping vector similarity between each of the mapping enhancement vectors;

[0090] Performing a similar vector query on the neighborhood of each of the mapping enhancement vectors according to the mapping vector similarity to obtain a similar target vector;

[0091] Similar features between the similar target vector and the corresponding mapping enhancement vector are extracted.

[0092] Specifically, based on a small-sample learning model, the mapping feature vector is used as input for model training and optimization, resulting in a low-dimensional embedding vector. This embedding vector contains the core information of the mapping result and captures key characteristics of the rules in the target rule engine, such as similarity between rules, execution order relationships, and potential dependency patterns. Through this transformation, the complex information in the mapping feature vector is compressed into a more compact representation.

[0093] By adding noise, adjusting parameters, performing random transformations, or interpolating mapping embedding vectors, more diverse mapping enhancement vectors can be generated, which can increase the diversity of model training samples and improve the generalization ability of the model.

[0094] Calculating the mapping vector similarity between each mapping enhancement vector is to evaluate the similarity between different mapping enhancement vectors to determine their proximity in the feature space. The calculation formula is as follows: in, and represents the mapping enhancement vector, and Represent the mapping enhancement vectors and The value of similarity is between -1 and 1, where the closer the value is to 1, the more similar the two mapping enhancement vectors are.

[0095] By calculating the similarity between the mapping enhancement vectors, the neighborhood range of each vector in the feature space is determined. In these neighborhoods, vectors with high similarity are selected for similar vector queries. These similar vectors are regarded as similar target vectors with similar characteristics or behaviors, which can provide valuable information for further rule migration, optimization or clustering analysis.

[0096] By analyzing the common attributes and relationships between similar vectors, we can identify their similarities in the feature space. By identifying the differences and similarities between similar target vectors and mapping enhancement vectors, we can extract their shared features, such as similar execution logic, conditional triggering patterns, or action execution methods.

[0097] In detail, by combining the similar features extracted from similar target vectors and mapping enhancement vectors with the mapping results of the original rules, the features of rule updates are derived, which helps to capture and summarize the common changes that occur in the execution process of similar rules, and then determine how to update the structure, conditions or execution logic of existing rules to better adapt to the target system or optimize the performance of the rules.

[0098] The target rule features are converted into feature vectors and trained using an optimized learning model to maintain efficient and accurate learning even with small sample data. The mapping results are then converted to mapping feature vectors, and the small sample learning model is used to discover potential similarities between the mapping features. By mining similar features, updated rule features can be generated, ensuring that rule migration and optimization can effectively adapt to the needs of the target system. This improves the accuracy and efficiency of rule migration and provides strong support for cross-platform applications, rule reconstruction, and system optimization.

[0099] S4. Perform cluster analysis on the mapping results using the rule update feature to obtain updated mapping rules.

[0100] In an embodiment of the present invention, the mapping results are mapped into a certain space or dimension, and a clustering algorithm is applied to group these mapping results to identify potential similar features in the mapping results. The features are updated according to the clustering results and rules, and the mapping rules are adjusted or optimized so that the mapped data can better reflect its inherent classification or distribution characteristics.

[0101] In detail, the cluster analysis of the mapping results using the rule update feature to obtain the updated mapping rules includes:

[0102] Counting the number of mapping points in the neighborhood of each mapping result according to the mapping vector similarity;

[0103] Determining whether the number of mapping points is greater than a preset threshold of the number of neighbor points;

[0104] If the number of mapping points is greater than the threshold number of neighbor points, the mapping results corresponding to the number of mapping points greater than the threshold number of neighbor points are used as core points;

[0105] The mapping results in the neighborhood of the core point are used as neighbor points;

[0106] Aggregating the core points and the neighbor points into a target cluster;

[0107] If the number of mapping points is less than or equal to the threshold number of neighboring points, determining whether there is a core point in the neighborhood of the mapping result corresponding to the number of mapping points less than or equal to the threshold number of neighboring points;

[0108] When there is no core point in the neighborhood of the mapping result corresponding to the number of mapping points less than or equal to the neighbor point number threshold, the mapping result corresponding to the number of mapping points less than or equal to the neighbor point number threshold is regarded as a noise point and the noise point is deleted;

[0109] When a core point exists in the neighborhood of the mapping result corresponding to the number of mapping points less than or equal to the threshold value of the number of neighboring points, the mapping result corresponding to the number of mapping points less than or equal to the threshold value of the number of neighboring points is used as a boundary point;

[0110] Aggregate the boundary points and the core points in the neighborhood into a target cluster;

[0111] The rule update feature is used to update the rules of each target cluster to obtain an updated mapping rule.

[0112] In detail, the number of mapping points in the neighborhood of each mapping result is counted according to the mapping vector similarity. The neighborhood range of each mapping result in the feature space is determined by the mapping vector similarity. A similarity threshold is set, and vectors with mapping vector similarity greater than the similarity threshold are regarded as neighborhood points of the current mapping result. By counting these vectors that meet the conditions, the number of mapping points in the neighborhood of the mapping result can be obtained.

[0113] Determine whether the number of mapped points in the neighborhood of each mapping result exceeds a preset threshold for the number of neighboring points. If so, the point is deemed to have sufficient similarity density in the feature space and is marked as a core point. With the core point as the center, all mapping results within its neighborhood are identified and considered its neighboring points. The core point and its neighboring points are aggregated together to form a target cluster, which is a clustering unit consisting of mapping results with similar features.

[0114] If the number of mapping points in the neighborhood of a mapping result is less than or equal to the preset threshold of the number of neighboring points, it will continue to determine whether there are identified core points in its neighborhood: if there are no core points, it means that the mapping result is isolated in the feature space and cannot be attributed to any high-density area, so it is regarded as a noise point and deleted; if there are core points, it is considered that although the mapping result itself has insufficient density, it is adjacent to a high-density area and can exist as a boundary point. The boundary point will be included in a target cluster together with the core points in its neighborhood to form a complete regular mapping clustering unit.

[0115] The rule update features mined through small-sample learning are applied to each cluster of similar rules, and consistency adjustments are made to the rule structure, conditions, actions, or execution logic based on their common features. This process optimizes and corrects any inconsistencies, redundancies, or areas that are incompatible with the target engine by combining the feature information of the core and boundary points of each target cluster's rules, thereby generating a set of updated mapping rules that are more adaptable, logically reasonable, and efficient.

[0116] By analyzing the similarity of mapping vectors, we can not only extract high-density core rule clusters, but also eliminate isolated and invalid noise points and rationally address the attribution of boundary points, forming rule clusters with clear structure and close semantics. This allows for efficient identification and integration of similar structures in rule mapping results. By utilizing the rule update feature to uniformly update the rules in each target cluster, we can significantly improve the consistency, logic, and enforceability of the migrated rules, thereby enhancing the rule engine's adaptability and artificial intelligence capabilities in new environments.

[0117] S5. Perform migration effect analysis on the updated mapping rule to obtain a migration effect score.

[0118] In an embodiment of the present invention, after the generation of the update mapping rules is completed, a migration effect evaluation mechanism is constructed, and the simulated operation performance of the update mapping rules in the rule engine is quantitatively analyzed based on the migration effect analysis model. The data of various effect evaluation indicators are collected, and the migration effect score is obtained by combining the weight calculation to measure the accuracy and effectiveness of the rules after migration, and provide a criterion for whether to adopt the rules in the future.

[0119] Specifically, the migration effect analysis of the updated mapping rule to obtain a migration effect score includes:

[0120] Acquire a plurality of effect evaluation indicators and an indicator weight of each of the effect evaluation indicators, and construct a migration effect analysis model based on the effect evaluation indicators and the indicator weight;

[0121] simulating the execution of the update mapping rule in the rule engine, and collecting rule operation data during the simulation;

[0122] Normalizing the rule operation data to obtain standard operation data;

[0123] The migration effect analysis model is used to calculate the migration effect score of the standard operation data.

[0124] Specifically, we extract multiple core indicators that can measure the migration quality from the actual operation of the rule engine, such as the rule hit rate. , execution success rate , execution delay , resource utilization and business adaptability Etc. Assign indicator weights to each of the effect evaluation indicators , a weighted evaluation function is constructed based on the importance of the indicators to form a migration effect analysis model for comprehensively evaluating the effect of rule migration. The model formula is as follows: in, Indicates the The weight of each effect evaluation indicator, Indicates the An effect evaluation indicator, Indicates the total number of effect evaluation indicators.

[0125] Without interfering with actual business operations, the updated mapping rules are deployed in the rule engine's test environment. Triggered by preset or real business input data, the rule engine executes, simulating the execution of the updated mapping rules in a real-world application scenario. During this simulated execution, the system automatically collects operational data for each rule, including but not limited to metrics such as rule hit rate, execution success rate, execution latency, resource utilization, and business adaptability. This provides a realistic and quantifiable operational foundation for subsequent migration effectiveness evaluation and facilitates a comprehensive analysis of the adaptability and execution performance of the updated rules in the target engine.

[0126] For the rule operation data of different dimensions and distributions collected during the simulation, such as execution time, hit rate, resource occupancy rate, etc., a unified mathematical transformation method is used to convert them into the same numerical range, usually the [0,1] range, eliminating the evaluation bias caused by dimensional and scale differences between indicators, thereby providing a unified standard operation data basis for the migration effect analysis model.

[0127] The normalized standard operating data is used as input and substituted into the migration effect analysis model. Various indicators are comprehensively evaluated through weighted summation. The performance of multiple dimensions such as rule hit rate, execution success rate, execution delay, resource utilization rate and business adaptability is comprehensively considered to generate a quantitative score reflecting the overall migration quality, namely the migration effect score.

[0128] By introducing multi-dimensional effect evaluation indicators and their weights, a refined migration effect analysis model is constructed, which can scientifically evaluate the actual operating performance after rule migration. By simulating the execution of updated mapping rules and collecting real operating data, representative performance samples can be obtained without affecting the stability of the business system. The normalized standard operating data ensures the comparability between different indicators. Finally, the migration effect score calculated by the migration effect analysis model can objectively quantify the quality of rule migration, thereby providing an accurate basis for automatically screening the optimal migration rules, significantly improving the adaptability of the rule engine in multiple environments and the accuracy of intelligent migration.

[0129] S6. Determine whether the migration effect score is greater than a preset score threshold.

[0130] If the migration effect score is less than or equal to the preset score threshold, then S7 , an adjustment strategy is generated according to the migration effect score, and the update mapping rule is adjusted using the adjustment strategy to obtain a final migration rule.

[0131] In this embodiment of the present invention, if the migration effectiveness score is less than or equal to a preset score threshold, it indicates that the effectiveness of the current migration rule has not met the expected standard or goal. Therefore, adjustments are required to improve the effectiveness. First, based on the current migration effectiveness score, an adjustment strategy is generated. This strategy may include modifying rule parameters, optimizing mapping methods, or adjusting other relevant factors. Then, these adjustment strategies are used to optimize and adjust the existing update mapping rules to improve the accuracy and adaptability of the rules.

[0132] In detail, the migration effect score comprehensively considers multiple dimensions such as rule hit rate, execution success rate, execution delay, resource utilization, and business adaptability. Adjustment strategies are generated based on the comprehensively considered dimensions, including: parameter optimization, modifying the structure of mapping rules, adding constraints, etc. Among them, parameter optimization: adjusting the parameters in the mapping rules, such as weights and thresholds, to improve the hit rate of migration rules; modifying the structure of mapping rules: adjusting the formula or algorithm of mapping rules to improve the adaptability and accuracy of the rules; adding constraints: introducing new restrictions in the rules to ensure a higher match or reduce errors to improve the success rate of migration execution. Apply these adjustment strategies to modify the updated mapping rules and optimize their accuracy and adaptability. After adjustment, the final migration rules obtained should be able to better adapt to the target environment and improve the migration effect.

[0133] If the migration effect score is greater than a preset score threshold, then S8 , the updated mapping rule is used as the final migration rule.

[0134] In an embodiment of the present invention, when the migration effect score is greater than the score threshold, it indicates that the current updated mapping rule has met the performance requirements of the rule engine in terms of semantic preservation, logical execution and system compatibility. The system determines that the rule migration has reached a stable and effective state, and confirms the current updated mapping rule as the final migration rule, which is used as the official rule version for subsequent rule deployment, integration or launch, thereby improving the rule migration efficiency and accuracy of the rule engine.

[0135] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0136] like Figure 2 FIG. 1 is a functional module diagram of a rule migration system of a rule engine provided by an embodiment of the present invention.

[0137] In an embodiment of the present disclosure, a rule migration system for a rule engine is provided, which corresponds one-to-one to the rule migration method for a rule engine in the above embodiment. Figure 2As shown, the rule migration system 100 of the rule engine includes a rule parsing module 101, a rule mapping module 102, a rule updating module 103, a clustering analysis module 104, an effect analysis module 105, a rule adjustment module 106, and a rule confirmation module 107. The functional modules are described in detail as follows:

[0138] The rule parsing module 101 is used to obtain the project source file of the rule engine, perform multi-granularity rule parsing on the project source file, and construct a rule network structure diagram using the parsing results;

[0139] A rule mapping module 102 is configured to perform rule mapping on the rule engine according to the rule network structure diagram to obtain a mapping result;

[0140] A rule updating module 103 is configured to obtain target rule features of the rule engine, and perform small sample learning on the mapping result using the target rule features to obtain rule update features;

[0141] A cluster analysis module 104 is configured to perform cluster analysis on the mapping results using the rule update feature to obtain updated mapping rules;

[0142] An effect analysis module 105 is configured to perform a migration effect analysis on the updated mapping rule to obtain a migration effect score;

[0143] A rule adjustment module 106 is configured to generate an adjustment strategy based on the migration effect score if the migration effect score is less than or equal to a preset score threshold, and adjust the update mapping rule using the adjustment strategy to obtain a final migration rule;

[0144] The rule confirmation module 107 is configured to use the updated mapping rule as the final migration rule if the migration effect score is greater than a preset score threshold.

[0145] In one embodiment, the rule parsing module 101 performs multi-granularity rule parsing on the project source file and constructs a rule network structure diagram using the parsing results, which is used to:

[0146] Performing grammatical analysis on the project source file to obtain grammatical structure units;

[0147] Extracting semantic fields and business objects from the project source file;

[0148] Identifying a semantic mapping relationship between the semantic field and the business object;

[0149] Extracting rule actions and corresponding rule conditions from the project source file;

[0150] Performing dependency analysis on the coupling logic of the rule action and the rule condition to obtain a dependency relationship structure unit;

[0151] Obtaining file rules of the project source files, and using the file rules as mesh structure nodes;

[0152] The grammatical structure unit, the semantic mapping relationship and the dependency relationship structure unit are used as mesh structure edges;

[0153] The mesh structure nodes and the corresponding mesh structure edges are connected to obtain a regular mesh structure graph.

[0154] In one embodiment, the rule parsing module 101 performs dependency analysis on the coupling logic of the rule action and the rule condition to obtain a dependency relationship structure unit, which is used to:

[0155] Generate an action-condition coupling relationship for each file rule in the project source file according to the rule action and the rule condition;

[0156] Constructing a dependency graph based on the action condition coupling relationship;

[0157] Marking the dependency type of each file rule according to the dependency graph to obtain an action condition dependency type;

[0158] A dependency relationship structure unit corresponding to each of the file rules is generated according to the action condition dependency type.

[0159] In one embodiment, the rule mapping module 102 performs rule mapping on the rule engine according to the rule network structure diagram to obtain a mapping result for:

[0160] Obtaining a rule mapping target, and generating a rule mapping strategy according to the rule mapping target;

[0161] Performing rule structure conversion on the rule network structure diagram according to the rule mapping strategy to obtain a rule update structure diagram;

[0162] generating a rule execution priority in the rule update structure diagram according to the rule mapping strategy;

[0163] Adjusting the execution order of the rule update structure diagram according to the rule execution priority to obtain a rule sequence structure diagram;

[0164] The file rules in the rule sequence structure diagram are mapped to the rule engine one by one to obtain mapping results.

[0165] In one embodiment, the rule mapping module 102 performs rule structure conversion on the rule network structure diagram according to the rule mapping strategy to obtain a rule update structure diagram for:

[0166] generating a rule conversion operation according to the rule mapping strategy;

[0167] Constructing a dependency update relationship of the rule network structure graph according to the rule conversion operation;

[0168] The rule network structure diagram is reconstructed using the dependency update relationship to obtain a rule update structure diagram.

[0169] In one embodiment, the rule updating module 103 obtains target rule features of the rule engine, performs small sample learning on the mapping result using the target rule features, and obtains rule update features for:

[0170] Converting the target rule feature into a rule feature vector;

[0171] Optimizing a preset learning model using the rule feature vector to obtain a small sample learning model;

[0172] Converting the mapping result into a mapping feature vector;

[0173] mining potential similarities of the mapping feature vectors using the small sample learning model to obtain similar features between the mapping feature vectors;

[0174] Generate a rule update feature based on the mapping result corresponding to the similar feature according to the similar feature.

[0175] In one embodiment, the rule updating module 103 performs potential similarity mining on the mapping feature vectors using the small sample learning model to obtain similar features between the mapping feature vectors, which are used to:

[0176] Converting the mapping feature vector into a mapping embedding vector using the small sample learning model;

[0177] Performing data augmentation on the mapping embedding vector to obtain a mapping augmentation vector;

[0178] Calculating the mapping vector similarity between each of the mapping enhancement vectors;

[0179] Performing a similar vector query on the neighborhood of each of the mapping enhancement vectors according to the mapping vector similarity to obtain a similar target vector;

[0180] Similar features between the similar target vector and the corresponding mapping enhancement vector are extracted.

[0181] In one embodiment, the cluster analysis module 104 performs cluster analysis on the mapping results using the rule update feature to obtain updated mapping rules for:

[0182] Counting the number of mapping points in the neighborhood of each mapping result according to the mapping vector similarity;

[0183] Determining whether the number of mapping points is greater than a preset threshold of the number of neighbor points;

[0184] If the number of mapping points is greater than the threshold number of neighbor points, the mapping results corresponding to the number of mapping points greater than the threshold number of neighbor points are used as core points;

[0185] The mapping results in the neighborhood of the core point are used as neighbor points;

[0186] Aggregating the core points and the neighbor points into a target cluster;

[0187] If the number of mapping points is less than or equal to the threshold number of neighboring points, determining whether there is a core point in the neighborhood of the mapping result corresponding to the number of mapping points less than or equal to the threshold number of neighboring points;

[0188] When there is no core point in the neighborhood of the mapping result corresponding to the number of mapping points less than or equal to the neighbor point number threshold, the mapping result corresponding to the number of mapping points less than or equal to the neighbor point number threshold is regarded as a noise point and the noise point is deleted;

[0189] When a core point exists in the neighborhood of the mapping result corresponding to the number of mapping points less than or equal to the threshold value of the number of neighboring points, the mapping result corresponding to the number of mapping points less than or equal to the threshold value of the number of neighboring points is used as a boundary point;

[0190] Aggregate the boundary points and the core points in the neighborhood into a target cluster;

[0191] The rule update feature is used to update the rules of each target cluster to obtain an updated mapping rule.

[0192] In one embodiment, the effect analysis module 105 performs migration effect analysis on the update mapping rule to obtain a migration effect score for:

[0193] Acquire a plurality of effect evaluation indicators and an indicator weight of each of the effect evaluation indicators, and construct a migration effect analysis model based on the effect evaluation indicators and the indicator weight;

[0194] simulating the execution of the update mapping rule in the rule engine, and collecting rule operation data during the simulation;

[0195] Normalizing the rule operation data to obtain standard operation data;

[0196] The migration effect analysis model is used to calculate the migration effect score of the standard operation data.

[0197] In the present invention, a rule migration method for a rule engine is provided. By obtaining the engineering source file of the rule engine, multi-granularity rule parsing is performed on the engineering source file, and a rule network structure diagram is constructed using the parsing results. The multi-dimensional features of the rules at the grammatical layer, semantic layer and dependency layer can be fully captured, which not only improves the accuracy of rule understanding, but also clearly reveals the logical associations and business dependencies between the rules. The rule engine is mapped according to the rule network structure diagram to obtain a mapping result, and the target rule feature of the rule engine is obtained. The mapping result is subjected to small sample learning using the target rule feature to obtain a rule update feature. The potential similarities between the mapping features are explored through a small sample learning model, and similar features are mined. The updated rule features ensure that the target rule can be effectively adapted during rule migration and optimization. In accordance with the requirements of the system, cluster analysis is performed on the mapping results using the rule update feature to obtain updated mapping rules, and the rules in each target cluster are uniformly updated using the rule update feature, which can significantly improve the consistency, logic and executability of the migration rules. The migration effect analysis is performed on the updated mapping rules to obtain a migration effect score. If the migration effect score is less than or equal to the preset score threshold, an adjustment strategy is generated based on the migration effect score, and the updated mapping rules are adjusted using the adjustment strategy to obtain the final migration rule. If the migration effect score is greater than the preset score threshold, the updated mapping rule is used as the final migration rule, as the formal rule version for subsequent rule deployment, integration or online launch, which effectively solves the problem of low efficiency and low accuracy of rule migration for the rule engine. For the specific definition of a rule migration system for a rule engine, please refer to the definition of a rule migration method for a rule engine above, which will not be repeated here. Each module in the rule migration system of the above-mentioned rule engine can be fully or partially implemented by software, hardware and a combination thereof. The above modules may be embedded in or independent of the processor in the computer device in the form of hardware, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0198] In the embodiments provided by the present invention, it should be understood that the disclosed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the module division is only a logical function division, and other division methods may be used in actual implementation.

[0199] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional modules.

[0200] Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the claims are intended to be embraced therein. Any reference to a figure in a claim should not be construed as limiting the claim to which it relates.

[0201] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0202] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double 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.

[0203] Those skilled in the art will clearly understand that for the sake of convenience and brevity in description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.

[0204] In the embodiments provided in the present disclosure, it should be understood that the disclosed systems and methods can also be implemented in other ways. The system embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the systems, methods, and computer program products according to the various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a portion of code, and the above-mentioned module, program segment, or a portion of code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the boxes can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified functions or actions, or can be implemented using a combination of dedicated hardware and computer instructions.

[0205] It should be noted that, in this disclosure, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element limited by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0206] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A rule migration method for a rule engine, characterized in that: The method comprises: Obtaining a project source file of a rule engine, performing syntax analysis on the project source file to obtain a syntax structure unit; extracting semantic fields and business objects of the project source file; identifying semantic mapping relationships between the semantic fields and the business objects; extracting rule actions and corresponding rule conditions of the project source file; performing dependency analysis on the coupling logic of the rule actions and the rule conditions to obtain a dependency structure unit; obtaining file rules of the project source file, and using the file rules as mesh structure nodes; using the syntax structure units, the semantic mapping relationships, and the dependency structure units as mesh structure edges; connecting the mesh structure nodes and the corresponding mesh structure edges to obtain a rule mesh structure diagram; Perform rule mapping on the rule engine according to the rule network structure diagram to obtain a mapping result; Obtain target rule features of the rule engine, convert the target rule features into rule feature vectors; optimize a preset learning model using the rule feature vectors to obtain a small sample learning model; convert the mapping results into mapping feature vectors; mine potential similarities on the mapping feature vectors using the small sample learning model to obtain similar features between the mapping feature vectors; and generate rule update features based on the mapping results corresponding to the similar features according to the similar features; Performing cluster analysis on the mapping results using the rule update feature to obtain updated mapping rules; Performing migration effect analysis on the updated mapping rule to obtain a migration effect score; If the migration effect score is less than or equal to a preset score threshold, generating an adjustment strategy according to the migration effect score, and adjusting the update mapping rule using the adjustment strategy to obtain a final migration rule; If the migration effect score is greater than a preset score threshold, the updated mapping rule is used as the final migration rule.

2. The rule migration method of the rule engine according to claim 1, characterized in that: The dependency analysis of the coupling logic of the rule action and the rule condition is performed to obtain a dependency relationship structure unit, including: Generate an action-condition coupling relationship for each file rule in the project source file according to the rule action and the rule condition; Constructing a dependency graph based on the action condition coupling relationship; Marking the dependency type of each file rule according to the dependency graph to obtain an action condition dependency type; A dependency relationship structure unit corresponding to each of the file rules is generated according to the action condition dependency type.

3. The rule migration method of the rule engine according to claim 1, characterized in that: The step of performing rule mapping on the rule engine according to the rule network structure diagram to obtain a mapping result includes: Obtaining a rule mapping target, and generating a rule mapping strategy according to the rule mapping target; Performing rule structure conversion on the rule network structure diagram according to the rule mapping strategy to obtain a rule update structure diagram; generating a rule execution priority in the rule update structure diagram according to the rule mapping strategy; Adjusting the execution order of the rule update structure diagram according to the rule execution priority to obtain a rule sequence structure diagram; The file rules in the rule sequence structure diagram are mapped to the rule engine one by one to obtain mapping results.

4. The rule migration method of the rule engine according to claim 3, characterized in that: The step of performing rule structure conversion on the rule network structure diagram according to the rule mapping strategy to obtain a rule update structure diagram includes: generating a rule conversion operation according to the rule mapping strategy; Constructing a dependency update relationship of the rule network structure graph according to the rule conversion operation; The rule network structure diagram is reconstructed using the dependency update relationship to obtain a rule update structure diagram.

5. The rule migration method of the rule engine according to claim 1, characterized in that: The mining of potential similarities of the mapping feature vectors using the small sample learning model to obtain similar features between the mapping feature vectors includes: Converting the mapping feature vector into a mapping embedding vector using the small sample learning model; Performing data augmentation on the mapping embedding vector to obtain a mapping augmentation vector; Calculating the mapping vector similarity between each of the mapping enhancement vectors; Performing a similar vector query on the neighborhood of each of the mapping enhancement vectors according to the mapping vector similarity to obtain a similar target vector; Similar features between the similar target vector and the corresponding mapping enhancement vector are extracted.

6. The rule migration method of the rule engine according to claim 5, characterized in that: The cluster analysis of the mapping results using the rule update feature to obtain updated mapping rules includes: Counting the number of mapping points in the neighborhood of each mapping result according to the mapping vector similarity; Determining whether the number of mapping points is greater than a preset threshold of the number of neighbor points; If the number of mapping points is greater than the threshold number of neighbor points, the mapping results corresponding to the number of mapping points greater than the threshold number of neighbor points are used as core points; The mapping results in the neighborhood of the core point are used as neighbor points; Aggregating the core points and the neighbor points into a target cluster; If the number of mapping points is less than or equal to the threshold number of neighboring points, determining whether there is a core point in the neighborhood of the mapping result corresponding to the number of mapping points less than or equal to the threshold number of neighboring points; When there is no core point in the neighborhood of the mapping result corresponding to the number of mapping points less than or equal to the neighbor point number threshold, the mapping result corresponding to the number of mapping points less than or equal to the neighbor point number threshold is regarded as a noise point and the noise point is deleted; When a core point exists in the neighborhood of the mapping result corresponding to the number of mapping points less than or equal to the threshold value of the number of neighboring points, the mapping result corresponding to the number of mapping points less than or equal to the threshold value of the number of neighboring points is used as a boundary point; Aggregate the boundary points and the core points in the neighborhood into a target cluster; The rule update feature is used to update the rules of each target cluster to obtain an updated mapping rule.

7. The rule migration method of a rule engine according to claim 1, wherein: The performing migration effect analysis on the updated mapping rule to obtain a migration effect score includes: Acquire a plurality of effect evaluation indicators and an indicator weight of each of the effect evaluation indicators, and construct a migration effect analysis model based on the effect evaluation indicators and the indicator weight; simulating the execution of the update mapping rule in the rule engine, and collecting rule operation data during the simulation; Normalizing the rule operation data to obtain standard operation data; The migration effect analysis model is used to calculate the migration effect score of the standard operation data.

8. A rule migration system for a rule engine, characterized in that A rule migration method for a rule engine according to any one of claims 1 to 7 is implemented, wherein the system comprises: A rule parsing module is used to obtain the project source file of the rule engine, perform multi-granularity rule parsing on the project source file, and construct a rule network structure diagram using the parsing results; A rule mapping module, configured to perform rule mapping on the rule engine according to the rule network structure diagram to obtain a mapping result; A rule updating module is used to obtain target rule features of the rule engine, and perform small sample learning on the mapping results using the target rule features to obtain rule update features; A cluster analysis module, configured to perform cluster analysis on the mapping results using the rule update feature to obtain updated mapping rules; An effect analysis module, configured to analyze the migration effect of the update mapping rule to obtain a migration effect score; a rule adjustment module, configured to generate an adjustment strategy based on the migration effect score if the migration effect score is less than or equal to a preset score threshold, and adjust the update mapping rule using the adjustment strategy to obtain a final migration rule; A rule confirmation module is configured to use the updated mapping rule as a final migration rule if the migration effect score is greater than a preset score threshold.

Citation Information

Patent Citations

  • Integrated analysis platform for integrated network management system of information system

    CN107046481A

  • Rule generation method and device based on Drools rule engine, and chip

    CN114610684A