Rule engine dynamic optimization method and system based on real-time service requirements

By monitoring and analyzing dynamic changes in business in real time within the rules engine and generating optimization strategies, the problem of the rules engine's slow perception of dynamic changes in business has been solved, improving the accuracy and efficiency of rule execution and enhancing the enterprise's competitiveness in digital transformation.

CN120410303BActive Publication Date: 2026-03-24BEIJING GOVERNMENT AFFAIRS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing rule engines lack the ability to perceive and adapt to dynamic changes in business in real time, which greatly reduces the accuracy and efficiency of rule execution, leading to problems such as misjudgment of risks or delays in transaction processing.

Method used

By acquiring initial business metrics, constructing a test parameter set, and continuously monitoring dynamic factors within a preset time window, a second test parameter set is generated. Difference quantification analysis is performed, and an engine anomaly score is generated using the rule engine anomaly analysis model. Combined with the continuous runtime of the current rule engine, optimization strategies are generated, including dynamic orchestration of rule execution order based on reinforcement learning, hot update of rule weights based on event triggering, and elastic scaling strategy of parallel computing nodes based on resource consumption prediction.

Benefits of technology

It enables real-time perception and adaptation of business scenarios, improves the accuracy and efficiency of rule execution, reduces the lag and errors of manual intervention, enhances the company's operational efficiency and customer experience, and strengthens its competitiveness in the wave of digital transformation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120410303B_ABST
    Figure CN120410303B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of business management, in particular to a rule engine dynamic optimization method and system based on real-time business demand, which comprises the following steps: acquiring initial business indexes under a business scene, constructing a first test parameter set according to the initial business indexes, running a test and collecting first running data; continuously monitoring the initial business indexes in a preset time window, integrating dynamic factors in the continuous monitoring process into the first test parameter set to generate a second test parameter set, running the test again and collecting second running data; performing difference quantitative analysis on the first running data and the second running data to obtain a rule running deviation vector; inputting the rule running deviation vector into a preset rule engine abnormality analysis model to obtain an engine abnormality score; in response to the engine abnormality score exceeding a preset abnormality threshold, acquiring a continuous running length of a current rule engine, and inputting the continuous running length and the engine abnormality score into a rule engine optimization model to obtain a rule engine optimization strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of business management, and in particular to a method and system for dynamic optimization of a rule engine based on real-time business needs. Background Technology

[0002] In the wave of digital transformation, business scenarios in various industries are becoming increasingly complex and rapidly changing. Real-time business needs have become a key factor in driving enterprise development and enhancing competitiveness. As a core tool for automating business logic processing, rule engines have been widely used in many fields, such as financial risk control, e-commerce marketing, and intelligent manufacturing.

[0003] Most existing rule engines operate based on static business metrics and fixed rule configurations, lacking the ability to perceive and adapt to dynamic changes in business conditions in real time. In actual business scenarios, the initial business metrics are difficult to fully adapt to constantly changing business scenarios. For example, in financial transaction scenarios, initial business metrics such as transaction size, frequency, and risk characteristics of trading entities can change rapidly with market fluctuations, policy adjustments, and other factors. Existing rule engines cannot adjust their operating mechanisms in a timely manner according to these changes, resulting in a significant reduction in the accuracy and efficiency of rule execution, leading to problems such as misjudgment of risks or delays in transaction processing, which affects the sound operation of financial institutions and customer experience.

[0004] Therefore, there is an urgent need for a dynamic optimization method for rule engines that can perceive business changes in real time, accurately analyze the rule operation status, and achieve automated optimization. Summary of the Invention

[0005] This invention provides a method and system for dynamic optimization of a rule engine based on real-time business needs, which can quickly and effectively optimize the rule engine and improve the accuracy and efficiency of rule execution, and can effectively solve the problems in the background art.

[0006] To achieve the above objectives, in a first aspect, the present invention provides a method for dynamically optimizing a rule engine based on real-time business requirements, comprising:

[0007] Obtain initial business metrics under the business scenario, construct a first test parameter set based on the initial business metrics, run the test and collect the first running data;

[0008] Within a preset time window, the initial business metrics are continuously monitored, and dynamic factors during the continuous monitoring process are incorporated into the first test parameter set to generate a second test parameter set. The test is then run again and the second running data is collected.

[0009] Perform a difference quantification analysis on the first running data and the second running data to obtain the rule running deviation vector; and input it into the preset rule engine anomaly analysis model to obtain the engine anomaly score;

[0010] In response to the engine's abnormal score exceeding a preset abnormal threshold, the continuous runtime of the current rule engine is obtained, and it, along with the engine's abnormal score, is input into the rule engine optimization model to obtain a rule engine optimization strategy.

[0011] In conjunction with the first aspect, in one possible design, the initial business metrics include basic rule configuration information, basic constraints, and initial system environment parameters.

[0012] In conjunction with the first aspect, in one possible design, the first operational data includes rule execution time data, rule matching result data, and resource consumption data during rule execution.

[0013] In conjunction with the first aspect, in one possible design, the dynamic factors include at least one of the following: market fluctuation data, timestamps and content summaries of policy adjustment events, and time-series data of user behavior.

[0014] In conjunction with the first aspect, in one possible design, the rule execution deviation vector includes the rule execution time data difference value, the rule matching result data difference value, and the resource consumption data difference value during the rule execution process.

[0015] In conjunction with the first aspect, in one possible design, the rule engine anomaly analysis model comprises a three-layer structure:

[0016] The input layer uses an attention mechanism to assign feature weights to the deviation vectors from the rule operation.

[0017] Hidden layers extract temporal anomaly features through a bidirectional long short-term memory network;

[0018] The output layer generates anomaly type probability distributions through activation functions, and the engine anomaly score is obtained by calculating the probability of each anomaly type.

[0019] In conjunction with the first aspect, in one possible design, the rule engine optimization strategy includes at least two collaborative optimization schemes among the following: a dynamic orchestration strategy for rule execution order based on reinforcement learning, a hot update strategy for rule weights based on event triggering, and an elastic scaling strategy for parallel computing nodes based on resource consumption prediction.

[0020] Secondly, the present invention also provides a rule engine dynamic optimization system based on real-time business requirements, comprising:

[0021] The initial data acquisition module acquires the initial business metrics under the business scenario, constructs a first test parameter set based on the initial business metrics, runs the test and collects the first running data.

[0022] The dynamic data monitoring module continuously monitors the initial business indicators within a preset time window, incorporates the dynamic factors during the continuous monitoring process into the first test parameter set to generate a second test parameter set, runs the test again, and collects the second running data.

[0023] The data difference analysis module performs a quantitative analysis of the differences between the first running data and the second running data to obtain the rule running deviation vector; and inputs it into the preset rule engine anomaly analysis model to obtain the engine anomaly score.

[0024] The optimization strategy generation module, in response to the engine's abnormal score exceeding a preset abnormal threshold, obtains the continuous runtime of the current rule engine and inputs it along with the engine's abnormal score into the rule engine optimization model to obtain the rule engine optimization strategy.

[0025] In conjunction with the second aspect, in one possible design, the integration of dynamic factors during continuous monitoring into the first test parameter set to generate the second test parameter set specifically includes:

[0026] Identify and collect dynamic factors that affect changes in business metrics;

[0027] The extracted dynamic factor data is cleaned to remove duplicate, erroneous, and incomplete data;

[0028] The preprocessed dynamic factors are incorporated into the first test parameter set to generate the second test parameter set.

[0029] Verify the accuracy and completeness of the second set of test parameters, and make adjustments based on the test results.

[0030] In conjunction with the second aspect, in one possible design, the step of performing difference quantification analysis on the first running data and the second running data to obtain the rule running deviation vector specifically includes:

[0031] Calculate the difference in rule execution time data, which is the rule execution time in the second running data minus the rule execution time in the first running data;

[0032] Calculate the difference value of the rule matching results data, and calculate the absolute difference value based on the number of successful matches and the number of failed matches of the rule in the two sets of data;

[0033] The difference in resource consumption data during the execution of the calculation rules is used. For resource consumption indicators, the absolute value difference is used to represent the change in resource consumption.

[0034] The calculated differences in rule execution time, rule matching results, and resource consumption during rule execution are combined to form a rule execution deviation vector.

[0035] The technical solution of this invention can achieve the following technical effects:

[0036] By continuously monitoring initial business metrics within a preset time window, the method can quickly capture dynamic changes in business scenarios. Taking financial transaction scenarios as an example, when market fluctuations or policy adjustments lead to changes in transaction size, frequency, and risk characteristics of trading entities, these dynamic factors can be promptly integrated into the second test parameter set. This solves the problem of traditional rule engines being slow to perceive dynamic changes in business, ensuring that business metrics always align with actual scenarios. Continuously integrating new dynamic factors into the test parameter set avoids deviations in rule execution due to a disconnect between initial business metrics and changing business scenarios, thus ensuring the rules continue to function effectively in complex and ever-changing business environments. Furthermore, by performing differential quantitative analysis on the first and second running data from multiple dimensions such as rule execution time, matching results, and resource consumption, a rule operation deviation vector is formed, enabling a more accurate assessment of the rule's operational status and providing comprehensive evaluation. This method identifies anomalies during rule execution; it inputs the rule deviation vector into a pre-defined rule engine anomaly analysis model to generate an engine anomaly score; this not only makes the analysis process more scientific and objective but also greatly improves evaluation efficiency, enabling the rapid detection of potential operational problems in the rule engine; when the engine anomaly score exceeds a preset threshold, the method automatically obtains the rule engine's continuous runtime and inputs it along with the anomaly score into the optimization model to generate an optimization strategy. This allows for rapid response when rule engine anomalies occur, timely adjustment of the operating mechanism, and a significant improvement in the accuracy and efficiency of rule execution; the automated optimization process reduces the workload of manual rule checking and adjustment, minimizing errors and delays caused by human factors; it not only improves the operational efficiency and reduces operating costs for financial institutions and other enterprises but also enhances customer experience and strengthens their competitiveness in the wave of digital transformation.

[0037] By acquiring initial business metrics and continuously monitoring them within a preset time window, dynamic factors are integrated into the test parameter set. This allows the method to capture changes in business scenarios in real time. Whether it's market fluctuations, policy adjustments, or changes in business metrics caused by other factors, these can be considered promptly. This frees the rule engine from being limited by static business metrics and fixed rule configurations, giving it real-time perception and adaptive capabilities to dynamic changes. Difference quantitative analysis of operational data collected at different stages yields rule execution deviation vectors, which are then input into an anomaly analysis model to obtain an engine anomaly score. This accurately assesses the rule engine's operational status in the face of business changes, accurately identifies potential problems during rule execution, and provides precise evidence for subsequent optimization. When the engine anomaly score exceeds a preset threshold, an optimization strategy is generated through the rule engine optimization model, based on the current continuous runtime of the rule engine. This automates the process from problem discovery to optimization strategy generation. It not only avoids the lag and subjectivity of manual intervention but also enables rapid and effective optimization of the rule engine, improving the accuracy and efficiency of rule execution, reducing risk misjudgment and transaction processing delays, and enhancing operational efficiency and customer experience. This allows the enterprise to better cope with complex and ever-changing business scenarios in the wave of digital transformation, thereby enhancing its competitiveness. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 A flowchart illustrating the dynamic optimization method for the rule engine based on real-time business requirements;

[0040] Figure 2 The structure diagram of the rule engine dynamically optimizing system based on real-time business needs; Detailed Implementation

[0041] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0042] This application will now be described with reference to the accompanying drawings.

[0043] like Figure 1 As shown, the rule engine dynamic optimization method based on real-time business needs of the present invention specifically includes the following steps:

[0044] Obtain initial business metrics under the business scenario, construct a first test parameter set based on the initial business metrics, run the test and collect the first running data;

[0045] Within a preset time window, the initial business metrics are continuously monitored, and dynamic factors during the continuous monitoring process are incorporated into the first test parameter set to generate a second test parameter set. The test is then run again and the second running data is collected.

[0046] Perform a difference quantification analysis on the first running data and the second running data to obtain the rule running deviation vector; and input it into the preset rule engine anomaly analysis model to obtain the engine anomaly score;

[0047] In response to the engine's abnormal score exceeding a preset abnormal threshold, the continuous runtime of the current rule engine is obtained, and it, along with the engine's abnormal score, is input into the rule engine optimization model to obtain a rule engine optimization strategy.

[0048] In this embodiment, by continuously monitoring initial business indicators within a preset time window, the method can quickly capture dynamic changes in the business scenario. Taking a financial transaction scenario as an example, when market fluctuations or policy adjustments cause changes in transaction size, frequency, and risk characteristics of transaction entities, these dynamic factors can be promptly integrated into the second test parameter set. This solves the problem of traditional rule engines being slow to perceive dynamic changes in the business, ensuring that business indicators always align with the actual scenario. Continuously integrating new dynamic factors into the test parameter set avoids deviations in rule execution due to the initial business indicators being out of sync with the changing business scenario, thus ensuring that the rules continue to function effectively in complex and ever-changing business environments. Furthermore, by performing differential quantitative analysis on the first and second running data from multiple dimensions such as rule execution time, matching results, and resource consumption, a rule operation deviation vector is formed, enabling a more accurate assessment of the rule's operational status. This system comprehensively identifies anomalies during rule execution; it inputs rule deviation vectors into a pre-defined rule engine anomaly analysis model to generate an engine anomaly score; this not only makes the analysis process more scientific and objective but also significantly improves evaluation efficiency, enabling the rapid detection of potential operational problems in the rule engine; when the engine anomaly score exceeds a preset threshold, the method automatically obtains the rule engine's continuous runtime and inputs it along with the anomaly score into the optimization model to generate an optimization strategy. This allows for rapid response when rule engine anomalies occur, timely adjustment of the operating mechanism, and a significant improvement in the accuracy and efficiency of rule execution; the automated optimization process reduces the workload of manual rule checking and adjustment, minimizing errors and delays caused by human factors; it not only improves the operational efficiency and reduces operating costs for financial institutions and other enterprises but also enhances customer experience and strengthens their competitiveness in the wave of digital transformation.

[0049] By acquiring initial business metrics and continuously monitoring them within a preset time window, dynamic factors are integrated into the test parameter set. This allows the method to capture changes in business scenarios in real time. Whether it's market fluctuations, policy adjustments, or changes in business metrics caused by other factors, these can be considered promptly. This frees the rule engine from being limited by static business metrics and fixed rule configurations, giving it real-time perception and adaptive capabilities to dynamic changes. Difference quantitative analysis of operational data collected at different stages yields rule execution deviation vectors, which are then input into an anomaly analysis model to obtain an engine anomaly score. This accurately assesses the rule engine's operational status in the face of business changes, accurately identifies potential problems during rule execution, and provides precise evidence for subsequent optimization. When the engine anomaly score exceeds a preset threshold, an optimization strategy is generated through the rule engine optimization model, based on the current continuous runtime of the rule engine. This automates the process from problem discovery to optimization strategy generation. It not only avoids the lag and subjectivity of manual intervention but also enables rapid and effective optimization of the rule engine, improving the accuracy and efficiency of rule execution, reducing risk misjudgment and transaction processing delays, and enhancing operational efficiency and customer experience. This allows the enterprise to better cope with complex and ever-changing business scenarios in the wave of digital transformation, thereby enhancing its competitiveness.

[0050] In some embodiments of the present invention, regarding step S1,

[0051] The initial business metrics include basic rule configuration information, basic constraints, and initial system environment parameters;

[0052] Basic rule configuration information is the fundamental basis for the rule engine to execute tasks. It defines the processing logic of business data and determines the actions the system should take under specific conditions. It is obtained through communication with business departments, reviewing document records, and extracting information from existing systems. Business operation manuals, internal rules and regulations, compliance documents, etc. are collected, and the parts related to business rules are extracted. Existing rule configuration information is extracted from the enterprise's existing business system database with the help of data mining tools.

[0053] The basic constraints define the boundaries of the rule engine's operation, ensuring that business operations are conducted within legal, compliant, and resource-capable limits. These constraints are obtained through researching business processes, analyzing industry standards, and assessing resource limitations. Business analysts conduct on-site inspections of business operation processes and record the constraints encountered during execution. Standards and specifications issued by industry associations, as well as relevant national policies and regulations, are collected to obtain the constraints on business operations. Communication with the IT operations department is used to understand the performance parameters and usage limitations of hardware resources such as servers, network bandwidth, and storage devices. During major e-commerce promotions, the system's concurrent access capacity is determined based on server processing power and network bandwidth.

[0054] The initial system environment parameters describe the technical environment in which the rule engine runs. These parameters directly affect the performance and stability of the rule engine. They are obtained by collecting server information, testing the network environment, and evaluating system dependencies. Server management software is used to obtain hardware configuration information such as CPU model, number of cores, clock speed, memory capacity, bandwidth, disk capacity, and read / write speed. Simultaneously, the server's operating system type, version number, and installed middleware, database management system, and other software information are recorded. Network testing tools are used to test the bandwidth, latency, packet loss rate, and other indicators of the internal and external networks to obtain real-time network environment data. Other systems or services that the rule engine depends on are reviewed to understand their interface specifications, service availability, and other information.

[0055] Based on the acquired initial business metrics, they are transformed into parameter combinations that the rule engine can recognize and use; basic rule configuration information is transformed into scripts or code snippets for the rule engine, and corresponding parameter values ​​are set; basic constraints are transformed into parameter value ranges or condition judgment statements; and the initial system environment parameters are configured into the rule engine's runtime environment.

[0056] The first set of operational data includes rule execution time data, rule matching result data, and resource consumption data during rule execution.

[0057] Rule execution time data reflects the efficiency of the rule engine in processing business logic. By analyzing this data, rules with long execution times can be identified, thereby optimizing the rule algorithm or system configuration. In the rule engine code, a timestamp function is used to record the time at the start and end of rule execution, and the difference between the two is the rule execution time. The time data of each rule execution is saved to a database or log file through logging.

[0058] The rule matching results are used to verify whether the rule engine's judgment of business logic is accurate. Statistical analysis of the matching results can be used to evaluate the effectiveness and adaptability of the rules. During the execution of the rule engine, identifier variables are set to record the rule matching results.

[0059] Resource consumption data during rule execution can help operations and maintenance personnel understand the rule engine's demand for system resources, providing a basis for the reasonable allocation and optimization of system resources. By using server monitoring tools, resource consumption data such as CPU utilization, memory usage, and disk I / O read / write counts of the server can be collected in real time during the rule engine's operation. This data can then be correlated with the rule execution process and recorded in the database.

[0060] In this embodiment, close communication with business departments, review of documentation, and extraction from existing systems ensured the accuracy of the fundamental basis for the rule engine's task execution. Transforming business rules into scripts or code snippets recognizable and usable by the rule engine improved its automation capabilities and execution efficiency. By investigating business processes, analyzing industry standards, and assessing resource constraints, clear boundaries were defined for the rule engine's operation, ensuring the legality, compliance, and resource affordability of business operations. Transforming basic constraints into parameter value ranges or conditional statements enhanced the rule engine's flexibility and adaptability, enabling it to better adapt to constantly changing business scenarios. Collecting server information, testing network environments, and evaluating system dependencies provided the rule engine with a stable and efficient technical framework. The system's initial environment parameters are configured within the rule engine's runtime environment, ensuring its performance and stability and reducing operational risks caused by environmental differences. By collecting rule execution time data, rule matching result data, and resource consumption data during rule execution, strong data support is provided for the rule engine's performance evaluation, optimization, and adjustment. Analysis of rule execution time data helps identify rules with long execution times, thereby optimizing rule algorithms or system configurations and improving processing efficiency. Statistical analysis of rule matching result data can evaluate the effectiveness and adaptability of rules, ensuring the rule engine's judgment of business logic is accurate. The collection and analysis of resource consumption data helps operations personnel understand the rule engine's resource requirements, providing a basis for the rational allocation and optimization of system resources.

[0061] In some embodiments of the present invention, regarding step S2,

[0062] Identify and collect dynamic factors affecting changes in business indicators; collect market fluctuation data such as market indices, stock prices, and exchange rates in real time or on a regular basis through financial data APIs, news sources, or professional data analysis platforms; obtain the timestamps and content summaries of policy adjustment events in a timely manner by monitoring the official websites, bulletin boards, or news release channels of government agencies or industry associations; collect user behavior time-series data such as user visits, clicks, purchases, and comments in real time using user behavior tracking systems or data analysis tools, and organize them according to time series.

[0063] The extracted data is cleaned to remove duplicate, erroneous, and incomplete data; data cleaning tools are used to filter and correct abnormal data by setting rules such as data format and range; dynamic factor data with different formats and units are converted into a unified format to facilitate subsequent processing.

[0064] The preprocessed dynamic factors are integrated into the first test parameter set to generate the second test parameter set; a mapping relationship is established between the dynamic factors and the first test parameter set; according to the mapping relationship, the values ​​of the dynamic factors are updated to the corresponding parameter positions in the first test parameter set; after the integration of all dynamic factors is completed, a second test parameter set containing the latest business status information is generated.

[0065] Verify the accuracy and completeness of the second test parameter set and adjust it as needed; verify the rule logic of the generated second test parameter set to ensure that the business logic of the rule engine remains correct after parameter adjustment; simulate different business scenarios by writing unit test cases to verify whether the output results of the rule engine under the new parameter set meet expectations; in the financial risk control scenario, verify whether the new risk assessment parameters can accurately identify high-risk transactions; check the data integrity of the second test parameter set to ensure that all relevant dynamic factors have been correctly integrated; establish a data audit checklist to check the integration of each dynamic factor and avoid missing important information; organize business experts and technical personnel to manually review the second test parameter set to evaluate the rationality of parameter adjustment from a business and technical perspective; in the e-commerce marketing scenario, invite the marketing team and the technical team to jointly review the new promotional rule parameters to ensure that the activity meets market demands and can be implemented smoothly from a technical standpoint.

[0066] Using the second set of test parameters as input, run the rule engine again to test; collect rule execution time data, rule matching result data, and resource consumption data during rule execution as the second run data; ensure that the test environment and conditions are consistent with the first test in order to accurately compare the differences between the results of the two tests.

[0067] In this embodiment, a multi-channel data collection mechanism is employed to collect market fluctuation data, policy adjustment events, and user behavior time-series data in real time or at regular intervals. This allows the rule engine to promptly obtain the latest dynamics of the business scenario, avoiding a disconnect between rule execution and actual business due to information lag. Taking financial risk control as an example, timely market data can help the rule engine make accurate judgments on transaction risks and reduce potential risks caused by sudden market changes. Through data cleaning and format conversion, duplicates, errors, and incomplete parts in the data are removed, and the data format is unified, effectively ensuring the accuracy and consistency of the data. High-quality data serves as the foundation for the rule engine's operation, helping to improve the accuracy of rule execution and avoiding misjudgments caused by data quality issues. A mapping relationship between dynamic factors and the first test parameter set is established, and based on... This parameter update enables the rule engine to quickly adapt to changes in the business environment, allowing it to adjust promotional rules in a timely manner based on market dynamics and user behavior, thereby improving the effectiveness of marketing campaigns. From rule logic verification and data integrity checks to manual review, a multi-dimensional verification mechanism ensures the accuracy and completeness of the second test parameter set. This not only guarantees the correctness of the rule engine's business logic under the new parameter set but also improves system stability and reduces the risk of system failures due to parameter errors. Running the rule engine again using the second test parameter set, while ensuring the test environment and conditions are consistent with the first test, provides a reliable basis for comparing the results of the two tests. Through comparison, a clear understanding of the rule engine's performance in different business scenarios can be achieved, providing strong data support for subsequent rule optimization.

[0068] In some embodiments of the present invention, regarding step S3,

[0069] The rule execution deviation vector includes the difference in rule execution time data, the difference in rule matching result data, and the difference in resource consumption data during rule execution.

[0070] For each rule, calculate the difference in execution time between the first and second running data, which is the second running time minus the first running time; the relative rate of change of execution time can also be calculated to reflect the degree of change in execution efficiency; by calculating the difference, it is possible to intuitively determine whether the rule execution speed is faster or slower; if it is positive, it indicates that the rule execution time is longer and the efficiency is reduced; if it is negative, it means that the execution efficiency is improved.

[0071] Compare the matching results of the rules in the two sets of data, such as the number of successful matches and the number of failed matches; calculate the absolute difference or relative difference rate of the matching results to assess the change in the accuracy of the rules; the difference in the rule matching results can reflect the impact of dynamic changes in business on fraud transaction identification; if the change rate is positive and the value is large, it indicates that changes in the business scenario have reduced the accuracy of the fraud transaction identification rules, and timely adjustments are needed;

[0072] For resource consumption metrics such as CPU utilization and memory usage, calculate the difference between the two sets of data; use absolute or relative differences to represent changes in resource consumption.

[0073] The calculated differences in rule execution time data, rule matching result data, and resource consumption data during rule execution are combined into a vector in a predetermined order to obtain the rule execution deviation vector.

[0074] The rule engine anomaly analysis model structure includes:

[0075] Input layer: An attention mechanism is used to assign feature weights to the rule execution deviation vector. The attention mechanism calculates the weight of each element in the rule execution deviation vector to highlight the features that have a greater impact on the running state of the rule engine. In the financial transaction scenario, the attention mechanism model is used to assign different weights to the difference values ​​of rule execution time data, rule matching result data, and resource consumption data during rule execution based on historical data and business experience.

[0076] Hidden layer: Includes a bidirectional long short-term memory network to extract temporal anomaly features; the bidirectional long short-term memory network can process both forward and reverse temporal data simultaneously, effectively extracting temporal anomaly features from the rule operation deviation vector; in e-commerce business scenarios, the bidirectional long short-term memory network model is used to analyze the changes in the rule operation deviation vector over a period of time, capture the dynamic change trend of the rule engine's running status, and identify potential anomaly patterns.

[0077] Output layer: Anomaly type probability distribution is generated through activation function, and the engine anomaly score is obtained by calculating the probability of each anomaly type; the output layer maps the features extracted from the hidden layer to the probability distribution of different anomaly types through activation function; in the financial field, anomaly types may include risk misjudgment, transaction processing delay, resource overload, etc.; based on the probability of each anomaly type, the engine anomaly score is calculated, which serves as an important basis for judging whether the rule engine needs to be optimized.

[0078] In this embodiment, by calculating the differences in rule execution time, matching results, and resource consumption data, the operational status of the rule engine before and after dynamic business changes is presented in a quantitative manner. In the financial anti-fraud scenario, calculating the difference value of rule matching result data can intuitively reflect the impact of changes in business scenarios on the accuracy of fraud transaction identification, helping enterprises to promptly identify problems that occur during the operation of the rule engine and providing clear data basis for subsequent optimization. An attention mechanism is applied to the input layer of the rule engine anomaly analysis model, assigning weights to each element of the rule operation deviation vector based on historical data and business experience, highlighting features that have a significant impact on the rule engine's operational status. In the financial transaction scenario, transaction processing delays can have a significant impact on the operation of financial institutions. By increasing the weight of the difference value of rule execution time data, the model pays more attention to changes in transaction processing efficiency, thereby improving... Accurately assess the operational status of the rule engine; the hidden layer employs a bidirectional long short-term memory network, capable of simultaneously processing forward and reverse time-series data, effectively extracting temporal anomaly features from the rule operation deviation vector; in e-commerce scenarios, by analyzing the rule operation deviation vector over a period of time, it captures the dynamic changing trend of the rule engine's operational status, proactively identifying potential anomaly patterns and supporting enterprises in taking preventative measures; the output layer generates anomaly type probability distributions through activation functions and calculates engine anomaly scores, providing scientific quantitative indicators for determining whether the rule engine needs optimization; in the financial sector, anomaly types such as risk misjudgment, transaction processing delays, and resource overload are incorporated into the evaluation system, and anomaly scores are calculated by comprehensively considering the probabilities of each anomaly type. Based on the scoring results, enterprises can formulate targeted rule engine optimization strategies to improve the adaptability and accuracy of the rule engine and reduce operational risks.

[0079] In some embodiments of the present invention, regarding step S4,

[0080] When the engine's anomaly score exceeds the preset anomaly threshold, it indicates that there is a problem with the operation of the rule engine and optimization is needed. At this time, the continuous runtime of the current rule engine is obtained. Obtaining the continuous runtime of the rule engine is to assess its current working status, stability, and potential fatigue.

[0081] By checking the system logs, the startup time record of the rule engine can be found, and its continuous runtime can be calculated; system monitoring tools can track and record the service's runtime in real time; this information can be obtained through API or data query interface; the runtime of the rule engine can also be determined by checking the configuration and execution records of scheduled tasks.

[0082] The model uses the acquired engine anomaly scores and the continuous runtime of the current rule engine as input features. The model first performs preprocessing operations such as standardization or normalization on these input data to ensure comparability and appropriate numerical ranges across different dimensions. Then, based on the model's internal algorithms and structure, it extracts and analyzes features from the input data. For engine anomaly scores, the model focuses on their specific numerical magnitude, trends, and comparisons with historical data. Based on the analysis of the input data, the rule engine optimization model generates corresponding rule engine optimization strategies according to its trained parameters and algorithms.

[0083] The rule engine optimization strategy includes at least two collaborative optimization schemes from the following: a dynamic orchestration strategy for rule execution order based on reinforcement learning, a hot update strategy for rule weights based on event triggering, and an elastic scaling strategy for parallel computing nodes based on resource consumption prediction.

[0084] A dynamic orchestration strategy for rule execution order based on reinforcement learning: Reinforcement learning is a method that uses an agent to interact with the environment and learn optimal behavioral strategies based on reward signals. In a rule engine, the execution order of different rules affects the overall execution efficiency and result accuracy. Through reinforcement learning algorithms, the execution order of rules can be dynamically adjusted based on the performance of the rules in actual operation and business objectives.

[0085] Event-triggered rule weight hot update strategy: During business operations, various events will occur, such as market fluctuations and policy adjustments; these events will cause changes in the importance of certain rules; the event-triggered rule weight hot update strategy is to adjust the weight of rules in a timely manner when relevant events are detected.

[0086] The elastic scaling strategy for parallel computing nodes based on resource consumption prediction: The number of parallel computing nodes is dynamically adjusted according to the prediction of the rule engine's resource consumption. If the predicted resource consumption is about to exceed the threshold, it means that the current computing resources may not be able to meet the business needs. At this time, parallel computing nodes are added to improve computing power and ensure that the rule engine can run efficiently. Conversely, if the resource consumption is low, the number of parallel computing nodes can be reduced appropriately to save resource costs.

[0087] In this embodiment, by setting a preset anomaly threshold, it is possible to clearly determine whether the rule engine needs optimization. When the engine anomaly score exceeds this threshold, the optimization process for the rule engine is triggered, ensuring that optimization is only performed when actual problems arise in the rule engine's operation. This avoids unnecessary resource waste and system overhead, improving the targeting and accuracy of the optimization. The continuous runtime of the current rule engine is obtained and used together with the engine anomaly score as input, enabling the rule engine optimization model to comprehensively consider the rule engine's operating status and work history to generate optimization strategies. The continuous runtime reflects the engine's stability and potential fatigue level. Combining it with the anomaly score allows for a more comprehensive assessment of the engine's overall condition, thereby formulating optimization schemes that are more in line with the actual situation and improving the effectiveness of the optimization strategies. The rule engine optimization strategy includes multiple collaborative optimization schemes. These strategies optimize the rule engine from different perspectives. This system can adapt to complex and ever-changing business scenarios. Through the synergistic effect of multiple strategies, it comprehensively improves the performance and adaptability of the rule engine. By dynamically adjusting the rule execution order, updating rule weights in a timely manner, and reasonably scaling parallel computing nodes, the rule engine can better adapt to the dynamic changes in business scenarios, improve the accuracy and efficiency of rule execution, reduce issues such as risk misjudgment and transaction processing delays, thereby improving the performance and stability of the entire system, enhancing the enterprise's competitiveness in the wave of digital transformation, better meeting real-time business needs, and improving customer experience. The elastic scaling strategy of parallel computing nodes based on resource consumption prediction can dynamically adjust computing resources according to actual resource needs, avoiding over-configuration or under-configuration of resources. When resource consumption is low, the number of nodes is reduced, saving hardware resource costs; when resource demand is high, nodes are added to ensure that system performance is not affected, achieving efficient resource utilization and reducing the enterprise's operating costs.

[0088] In some solutions, multiple embodiments of this application can be combined, and the combined solution can be implemented. Optionally, some operations in the processes of each method embodiment may be combined, and / or the order of some operations may be changed. Furthermore, the execution order between the steps of each process is merely exemplary and does not constitute a limitation on the execution order between steps; other execution orders are also possible. It is not intended to indicate that the execution order is the only possible order in which these operations can be performed. Those skilled in the art will conceive of various ways to reorder the operations described herein. In addition, it should be noted that the process details involved in one embodiment of this document are similarly applicable to other embodiments, or different embodiments may be combined.

[0089] Furthermore, some steps in the method embodiments can be equivalently replaced with other possible steps. Alternatively, some steps in the method embodiments may be optional and can be deleted in certain use cases. Or, other possible steps may be added to the method embodiments. Moreover, the various method embodiments can be implemented individually or in combination.

[0090] like Figure 2 As shown, the present invention also provides a rule engine dynamic optimization system based on real-time business needs, which specifically includes the following modules;

[0091] The initial data acquisition module acquires the initial business metrics under the business scenario, constructs a first test parameter set based on the initial business metrics, runs the test and collects the first running data.

[0092] The dynamic data monitoring module continuously monitors the initial business indicators within a preset time window, incorporates the dynamic factors during the continuous monitoring process into the first test parameter set to generate a second test parameter set, runs the test again, and collects the second running data.

[0093] The data difference analysis module performs a quantitative analysis of the differences between the first running data and the second running data to obtain the rule running deviation vector; and inputs it into the preset rule engine anomaly analysis model to obtain the engine anomaly score.

[0094] The optimization strategy generation module, in response to the engine's abnormal score exceeding a preset abnormal threshold, obtains the continuous runtime of the current rule engine and inputs it along with the engine's abnormal score into the rule engine optimization model to obtain the rule engine optimization strategy.

[0095] In this embodiment, the system's dynamic data monitoring module can continuously monitor initial business indicators within a preset time window. In financial transaction scenarios, it can promptly capture changes in transaction size, frequency, and risk characteristics of trading entities due to market fluctuations, policy adjustments, and other factors. These dynamic factors are integrated into the test parameter set, thereby achieving real-time perception of dynamic business changes and compensating for the lack of real-time perception capabilities in traditional rule engines. By perceiving business changes in real time and integrating new data, it ensures that the business indicators used by the system always match the actual business scenario, avoiding rule execution deviations caused by the disconnect between initial business indicator settings and constantly changing business scenarios.

[0096] The data difference analysis module performs quantitative analysis on the collected first and second running data from multiple dimensions such as rule execution time, matching results, and resource consumption, forming a rule running deviation vector. This provides comprehensive and objective data support for accurately assessing the rule running status, and compared with traditional methods, it can more accurately detect anomalies in the rule running process. The rule running deviation vector is input into a pre-set rule engine anomaly analysis model to obtain an engine anomaly score. Compared with manual judgment, the model-based analysis method is not only more scientific and objective, but also can quickly and accurately assess the running status of the rule engine and promptly detect potential problems.

[0097] When the engine anomaly score exceeds a preset anomaly threshold, the optimization strategy generation module automatically obtains the continuous runtime of the current rule engine and inputs it along with the engine anomaly score into the rule engine optimization model to generate a rule engine optimization strategy. This trigger-based automated optimization mechanism can respond quickly when the rule engine encounters anomalies, adjust the rule engine's operating mechanism in a timely manner, and improve the accuracy and efficiency of rule execution. It reduces the workload of manual rule checking and adjustment, reduces errors and delays caused by human factors, improves the operational efficiency of financial institutions and other enterprises, enhances customer experience, and strengthens the enterprise's competitiveness in the wave of digital transformation.

[0098] Through the collaborative operation of multiple modules, the system forms a complete closed-loop management system from data collection and monitoring analysis to optimization decision-making; it can comprehensively improve the scientific nature, accuracy and automation level of business management, and effectively cope with the complex and ever-changing business scenarios of various industries.

[0099] In a specific implementation, as one example, the step of incorporating dynamic factors during continuous monitoring into the first test parameter set to generate the second test parameter set specifically includes:

[0100] Identify and collect dynamic factors that affect changes in business metrics;

[0101] The extracted dynamic factor data is cleaned to remove duplicate, erroneous, and incomplete data;

[0102] The preprocessed dynamic factors are incorporated into the first test parameter set to generate the second test parameter set.

[0103] Verify the accuracy and completeness of the second set of test parameters, and make adjustments based on the test results.

[0104] After collecting dynamic factor data, a cleaning process removes duplicate, erroneous, and incomplete data, filtering out interfering data to ensure that the data entering the rule engine is authentic and accurate. Data preprocessing ensures it meets the rule engine's processing requirements; a unified data format and structure reduces data conversion time and resource consumption, allowing the rule engine to quickly identify and process data, improving overall operational efficiency. The preprocessed dynamic factors are integrated into the first test parameter set to generate a second test parameter set, enabling the rule engine to respond promptly to changes in business scenarios. The accuracy and completeness of the second test parameter set are verified, and adjustments are made based on the test results to prevent rule engine malfunctions due to parameter errors or missing parameters, ensuring stable and efficient operation. The integration of dynamic factors allows the rule engine to better simulate and adapt to actual business scenarios, providing more accurate and timely support for business decisions. In intelligent manufacturing scenarios, the rule engine can optimize production plans and scheduling based on dynamic factors such as raw material supply and production equipment status, improving production efficiency and product quality. By enhancing the rule engine's adaptability to business changes, resource waste and business losses caused by rule mismatches are reduced, helping enterprises lower operating costs and improve economic efficiency.

[0105] In a specific implementation, as one example, the step of performing difference quantification analysis on the first running data and the second running data to obtain the rule running deviation vector specifically includes:

[0106] Calculate the difference in rule execution time data, which is the rule execution time in the second running data minus the rule execution time in the first running data;

[0107] Calculate the difference value of the rule matching results data, and calculate the absolute difference value based on the number of successful matches and the number of failed matches of the rule in the two sets of data;

[0108] The difference in resource consumption data during the execution of the calculation rules is used. For resource consumption indicators, the absolute value difference is used to represent the change in resource consumption.

[0109] The calculated differences in rule execution time, rule matching results, and resource consumption during rule execution are combined to form a rule execution deviation vector.

[0110] By calculating the differences in data such as rule execution time, matching results, and resource consumption, the state changes of the rule engine during two runs are quantified. This makes changes that were previously difficult to perceive intuitively visible in concrete numerical form. The difference in rule execution time data clearly shows whether the rule engine's execution efficiency improves or decreases when processing a large number of promotional rules. Integrating different types of data differences into a rule execution deviation vector provides a unified dimension for comprehensively evaluating the rule engine's operation, facilitating a comprehensive analysis of the rule engine's overall performance. The difference in rule execution time data directly reflects whether the rule engine has any execution efficiency issues; if the value is positive and large, it indicates that the rule... Slower execution speeds can be analyzed to determine whether the issue stems from complex rule logic or insufficient system resources leading to performance bottlenecks. The difference in rule matching results helps determine if the accuracy of the rule engine's matching of business rules has changed. Large absolute differences indicate significant changes in rule matching, suggesting that the rules are not adapting to business changes. In risk control scenarios, this allows for timely adjustments to risk identification rules to avoid misjudgments. Differences in resource consumption during rule execution can monitor for abnormal changes in resource consumption. In smart manufacturing scenarios, where stable resource consumption is crucial, this difference can help detect abnormal resource usage and prevent production interruptions due to resource issues.

[0111] This embodiment divides functional modules according to the method example described above. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0112] The various variations and specific embodiments of the rule engine dynamic optimization method based on real-time business needs in the aforementioned Embodiment 1 are also applicable to the rule engine dynamic optimization system based on real-time business needs in this embodiment. Through the foregoing detailed description of the rule engine dynamic optimization method based on real-time business needs, those skilled in the art can clearly understand the implementation method of the rule engine dynamic optimization system based on real-time business needs in this embodiment. Therefore, for the sake of brevity, it will not be described in detail here.

[0113] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for dynamically optimizing a rule engine based on real-time business requirements, characterized in that, include: Obtain initial business metrics under the business scenario, construct a first test parameter set based on the initial business metrics, run the test and collect the first running data; Within a preset time window, the initial business metrics are continuously monitored, and dynamic factors during the continuous monitoring process are incorporated into the first test parameter set to generate a second test parameter set. The test is then run again and the second running data is collected. Perform a difference quantification analysis on the first running data and the second running data to obtain the rule running deviation vector; and input it into the preset rule engine anomaly analysis model to obtain the engine anomaly score; In response to the engine's abnormal score exceeding a preset abnormal threshold, the continuous runtime of the current rule engine is obtained, and it is input into the rule engine optimization model along with the engine's abnormal score to obtain a rule engine optimization strategy. The rule engine anomaly analysis model includes a three-layer structure: In the input layer, an attention mechanism is used to assign feature weights to the rule execution deviation vector. The attention mechanism assigns different weights to the rule execution time data difference value, the rule matching result data difference value, and the resource consumption data difference value based on the degree of influence of each element in the rule execution deviation vector on the rule engine's running state. The hidden layer extracts the temporal anomaly features of the rule operation deviation vector through a bidirectional long short-term memory network, which is used to capture the dynamic change trend of the rule engine's running state and identify potential anomaly patterns. The output layer maps the features extracted from the hidden layer to probability distributions of different anomaly types through an activation function. The anomaly types include at least one of risk misjudgment, transaction processing delay, and resource overload. The engine anomaly score is obtained by calculating based on the probability distribution of each anomaly type.

2. The method for dynamic optimization of a rule engine based on real-time business requirements according to claim 1, characterized in that, The initial business metrics include basic rule configuration information, basic constraints, and initial system environment parameters.

3. The method for dynamic optimization of a rule engine based on real-time business requirements according to claim 1, characterized in that, The first set of operational data includes rule execution time data, rule matching result data, and resource consumption data during rule execution.

4. The method for dynamic optimization of a rule engine based on real-time business requirements according to claim 1, characterized in that, The dynamic factors include at least one of the following: market fluctuation data, timestamps and content summaries of policy adjustment events, and time-series data of user behavior.

5. The method for dynamic optimization of a rule engine based on real-time business requirements according to claim 1, characterized in that, The rule execution deviation vector includes the difference in rule execution time data, the difference in rule matching result data, and the difference in resource consumption data during rule execution.

6. The method for dynamic optimization of a rule engine based on real-time business requirements according to claim 1, characterized in that, The rule engine optimization strategy includes at least two collaborative optimization schemes from the following: a dynamic orchestration strategy for rule execution order based on reinforcement learning, a hot update strategy for rule weights based on event triggering, and an elastic scaling strategy for parallel computing nodes based on resource consumption prediction.

7. A rule engine dynamic optimization system based on real-time business requirements, wherein the system is applied to the rule engine dynamic optimization method based on real-time business requirements as described in claim 1, characterized in that, The system includes: The initial data acquisition module acquires the initial business metrics under the business scenario, constructs a first test parameter set based on the initial business metrics, runs the test and collects the first running data. The dynamic data monitoring module continuously monitors the initial business indicators within a preset time window, incorporates the dynamic factors during the continuous monitoring process into the first test parameter set to generate a second test parameter set, runs the test again, and collects the second running data. The data difference analysis module performs a quantitative analysis of the differences between the first running data and the second running data to obtain the rule running deviation vector; and inputs it into the preset rule engine anomaly analysis model to obtain the engine anomaly score. The optimization strategy generation module, in response to the engine's abnormal score exceeding a preset abnormal threshold, obtains the continuous runtime of the current rule engine and inputs it along with the engine's abnormal score into the rule engine optimization model to obtain the rule engine optimization strategy.

8. The rule engine dynamic optimization system based on real-time business needs according to claim 7, characterized in that, The step of incorporating dynamic factors from the continuous monitoring process into the first test parameter set to generate the second test parameter set specifically includes: Identify and collect dynamic factors that affect changes in business metrics; The extracted dynamic factor data is cleaned to remove duplicate, erroneous, and incomplete data; The preprocessed dynamic factors are incorporated into the first test parameter set to generate the second test parameter set. Verify the accuracy and completeness of the second set of test parameters, and make adjustments based on the test results.

9. The rule engine dynamic optimization system based on real-time business needs according to claim 7, characterized in that, The step of performing a difference quantification analysis on the first running data and the second running data to obtain the rule running deviation vector specifically includes: Calculate the difference in rule execution time data, which is the rule execution time in the second running data minus the rule execution time in the first running data; Calculate the difference value of the rule matching results data, and calculate the absolute difference value based on the number of successful matches and the number of failed matches of the rule in the two sets of data; The difference in resource consumption data during the execution of the calculation rules is used. For resource consumption indicators, the absolute value difference is used to represent the change in resource consumption. The calculated differences in rule execution time, rule matching results, and resource consumption during rule execution are combined to form a rule execution deviation vector.

Citation Information

Patent Citations

  • Business processing method and system, medium and electronic equipment

    CN118799091A

  • A method and system for dynamic supervision of business information based on big data

    CN119740869A