Rule engine configuration method and device for early warning, equipment and storage medium

CN119599121APending Publication Date: 2025-03-11CISDI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411684751.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In the existing early warning system, it is difficult to adapt to changes in business needs in a timely manner, resulting in a decrease in the accuracy and timeliness of the early warning system, and the cumbersome rule configuration, which limits the flexibility and scalability of the system.

Method used

By configuring the project's data source, generating data objects, and calling the rule engine to create a rule set. The rule set includes multiple rules, input and output as data objects, and associated with predefined callback actions. Configure early warning tasks and knowledge packages, build a mapping relationship between early warning tasks and knowledge packages, and realize the automated execution and notification of rules.

Benefits of technology

It realizes the efficiency and flexibility of rule configuration, improves the accuracy and timeliness of the early warning system, meets the needs of complex business scenarios, and enhances the flexibility and scalability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119599121A_ABST
    Figure CN119599121A_ABST
Patent Text Reader

Abstract

The invention provides a rule engine configuration method, device and equipment for early warning and a storage medium. The method comprises the steps that data sources of projects are configured, and data of different projects are mutually isolated; mapping a table structure of the data source to generate a data object; calling a rule engine to create a rule set of the project, the rule set comprising a plurality of rules, the input and output of the rules being data objects, and associating predefined callback actions; an early warning task is configured, a mapping relation between the early warning task and a knowledge packet is constructed, and the knowledge packet is formed by combining a plurality of rule sets; and executing the rules associated with the early warning task based on the rule engine, and if any rule triggers the early warning event, calling a callback action to send the early warning event for notification. Thus, the rule engine is more efficient and flexible in rule configuration, the method is suitable for an early warning system, and the timeliness of early warning is improved by calling the callback action.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of rule engines, and in particular to a rule engine configuration method, apparatus, device and storage medium for early warning. Background Art

[0002] With the development of information technology, early warning systems are increasingly used in various fields, such as meteorological disasters, financial risks, production safety, public health and other fields. They are mainly used to predict and warn of specific events or conditions in advance, which can help business platforms to promptly discover and respond to potential risks and threats, and ensure the stable operation of the platform. The early warning system is implemented based on rules. It is necessary to apply the rule engine to configure the rules related to the early warning according to business needs. The rules set the rule conditions for triggering the early warning. When the rule engine detects that the data meets the rule conditions, the early warning will be triggered. In related technologies, conventional early warning systems usually rely on fixed rules for decision-making and early warning. These rule sets are often pre-set and embedded in the early warning system.

[0003] However, due to the complexity and variability of business needs, it is difficult for fixed rule sets to adapt to these changes in a timely manner, resulting in a significant reduction in the accuracy and timeliness of the early warning system. The rules need to be reconfigured, but the cumbersome rule configuration makes it difficult for business personnel to quickly adjust and associate rules, limiting the flexibility and scalability of the early warning system. Therefore, in complex business scenarios, how the rule engine can flexibly and efficiently configure rules is an urgent problem to be solved. Summary of the invention

[0004] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0005] In view of the above-mentioned shortcomings of the prior art, the present application discloses a rule engine configuration method, device, equipment and storage medium for early warning to solve at least one of the above-mentioned technical problems.

[0006] In the first aspect, the present application provides a rule engine configuration method for early warning, the method comprising: configuring the data source of the project, isolating the data between different projects from each other; mapping the table structure of the data source to generate a data object; calling the rule engine to create a rule set for the project, the rule set comprising multiple rules, the input and output of the rules being the data objects, and associated with a predefined callback action; configuring an early warning task, and constructing a mapping relationship between the early warning task and a knowledge package, the knowledge package being formed by a combination of multiple rule sets; executing the rules associated with the early warning task based on the rule engine, and if any rule triggers an early warning event, calling the callback action to send the early warning event for notification.

[0007] In one embodiment of the present application, the data source of the configuration project includes: creating a new project in a wizard page, each project generating a unique project primary key; configuring the data source of the project, the data source including the database name, type, address and account information.

[0008] In one embodiment of the present application, the calling of the rule engine to create the rule set of the project includes: configuring the rules through the rule engine in a wizard-style page, wherein the configuration of the rules at least includes configuring the attribute information of the rules, the data objects input and output by the rules, the execution conditions and execution actions of the rules, and the callback actions associated with the rules, wherein if one of the rules is triggered, the callback actions associated with the same rule are synchronously called; combining multiple rules to form the rule set, and customizing the attribute information of the rule set, as well as the rule chains and priorities between the rules in the rule set.

[0009] In one embodiment of the present application, before constructing the mapping relationship between the early warning task and the knowledge package, it also includes: configuring the basic information of the knowledge package and the bound rule set through a wizard interface, the basic information of the knowledge package includes an input field for defining the format of the data received by the knowledge package, and an output field for defining the format of the output data after the rule set in the knowledge package is executed; testing the configured knowledge package, and displaying the execution status and execution results of the rule set in the knowledge package during the test in real time, so as to optimize the configuration of the knowledge package according to the execution results.

[0010] In one embodiment of the present application, the configuration of the warning task includes: constructing the warning task through a wizard interface, each of the warning tasks having a unique task identifier; configuring the input and output of the warning task, configuring the input of the warning task includes configuring the input data source and an input field for defining the format of data received by the warning task, and configuring the output of the warning task includes configuring the output data source and a data table in the data source, as well as the operation type of outputting data to the data table.

[0011] In one embodiment of the present application, after any rule triggers a warning event, it includes: if the callback action that defines a trigger callback interface is called, a workflow instance is synchronously started, and the workflow instance is used to review the processing flow of the warning event, and the workflow instance includes multiple nodes; the processing results of each node in the workflow instance are recorded until all nodes in the workflow instance are processed, and the status of the warning event is set to processed.

[0012] In one embodiment of the present application, the rules associated with the warning task are executed, including: triggering the trigger frequency and execution time of the warning task through a wizard interface to trigger the execution of the warning task regularly or periodically; if the warning task is triggered, the knowledge package associated with the warning task is automatically loaded to execute the rule set in the knowledge package.

[0013] In the second aspect, the present application provides a rule engine configuration device for early warning, the device comprising: a project configuration module, used to configure the data source of the project, and the data between different projects are isolated from each other; an object generation module, used to map the table structure of the data source and generate data objects; a rule set creation module, used to call the rule engine to create a rule set for the project, the rule set includes multiple rules, the input and output of the rules are the data objects, and are associated with predefined callback actions; a task configuration module, used to configure early warning tasks, and construct a mapping relationship between early warning tasks and knowledge packages, the knowledge packages are formed by a combination of multiple rule sets; a task execution module, used to execute the rules associated with the early warning tasks based on the rule engine, if any rule triggers an early warning event, the callback action is called to send the early warning event for notification.

[0014] In the third aspect, the present application also provides an electronic device, comprising: a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the rule engine configuration method for early warning as described in the above embodiments.

[0015] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer executes the rule engine configuration method for early warning as described in the above embodiments.

[0016] Beneficial effects of the present application: The present application proposes a rule engine configuration method, device, equipment and storage medium for early warning. First, the data source of the project is configured first, and the data between different projects are isolated from each other; the table structure of the data source is mapped to generate a data object; the rule engine is called to create a rule set for the project, and the rule set includes multiple rules, the input and output of the rule are data objects, and the pre-defined callback action is associated. In this way, the data object can be automatically generated as the basis for the rule engine to configure the rule set, and the rules in the rule set can be associated with the callback action when configured, which will be called synchronously when the rule is triggered, making the rule configuration more efficient and flexible. Second, the early warning task is configured, and the mapping relationship between the early warning task and the knowledge package is constructed. The knowledge package is formed by a combination of multiple rule sets; based on the rules associated with the early warning task executed by the rule engine, if any rule triggers an early warning event, the callback action is called to send the early warning event for notification. In this way, the rules are associated with the early warning task in the form of a knowledge package, and an automated early warning mechanism is realized. When the rule triggers an early warning event, the corresponding callback action can be synchronously called for automatic notification, so that the early warning system can respond quickly and improve the timeliness of the early warning. Third, by separating the configuration of data objects, rule sets, and warning tasks, the complexity of configuration is reduced, and it can be quickly adjusted according to different business scenarios to meet the needs of business changes.

[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0019] Figure 1 is a flow chart of a rule engine configuration method for early warning shown in an exemplary embodiment of the present application;

[0020] Figure 2 is a block diagram of a rule engine configuration device for early warning shown in an exemplary embodiment of the present application;

[0021] Figure 3It is a structural diagram of a computer system suitable for implementing the electronic device of the present application, shown as an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0022] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.

[0023] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the form, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0024] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0025] See also Figure 1 , is a flowchart of a method for configuring a rule engine for early warning, which is shown as an exemplary embodiment of the present application. The method for configuring a rule engine for early warning can be executed by a computer device, such as Figure 1 As shown, in an exemplary embodiment, the rule engine configuration method for early warning includes at least steps S110 to S150, which are described in detail as follows:

[0026] Step S110, configuring the data source of the project, and isolating the data between different projects.

[0027] Specifically, a new project is created in the wizard page, and each project generates a unique project primary key; the data source of the project is configured, and the data source comes from the early warning system, and the data source includes the configuration database name, type, address and account information.

[0028] In one embodiment of the present application, in order to make it easier for users to complete the rule set configuration, a wizard interface is used to guide users to step by step complete the rule set configuration. First, a new project is created in the wizard interface, and basic information is configured, including the project name, project primary key, number, and description. The project primary key is used to avoid data contamination between different projects, such as subsequent data objects, rules, and other business data.

[0029] In one embodiment of the present application, the data source of the project is configured in a wizard-style page. The data source is a database. The data source is identified and referenced by the database name. The type of database (such as MySQL, PostgreSQL) determines the interaction mode of the data source. The data source is accessed through the address of the data source, and the access rights are obtained through the account information. In addition, the data source is essentially derived from the early warning system outside the rule engine.

[0030] In one embodiment of the present application, the wizard interface also provides a data source connection test function, which is convenient for testing the connection status of the data source during the configuration process to ensure that the data of the data source can be accessed smoothly.

[0031] Step S120, mapping the table structure of the data source to generate a data object.

[0032] In one embodiment of the present application, the data source includes multiple data tables, and the table structure is a data table structure. By automatically mapping the table structure of the data source, a corresponding data object can be quickly created for each data table. In this way, the creation process of the data object is simplified and the accuracy between the data object and the data source is ensured.

[0033] In one embodiment of the present application, the mapping of the table structure can be implemented using the Hibernate (object-relational mapping) framework, mapping the table structure to a Java persistent class (ie, a JPA entity) as a data object.

[0034] In an embodiment of the present application, a custom configuration data object may also be used, and the data object will be referenced in a subsequently created rule set as a rule input or output.

[0035] Step S130, calling the rule engine to create a rule set for the project, the rule set includes multiple rules, the input and output of the rules are data objects, and are associated with predefined callback actions.

[0036] In one embodiment of the present application, before constructing a rule set, a callback action needs to be constructed first, including: in a wizard interface, a new callback action is created and its attribute information is configured, the attribute information at least includes a callback instance name, a request address, and an authentication TOKEN (i.e., an authorization token). The callback action can realize real-time interaction with an external early warning system to meet business needs. Among them, the callback instance name is the unique name of the callback action, which is used to identify and distinguish different callback actions; the request address is the Uniform Resource Locator (URL) of the external API (Application Programming Interface), that is, the target address to be accessed when the callback action is executed; the authentication TOKEN is a security token used to verify the legitimacy of the callback request.

[0037] In one embodiment of the present application, the creation of the callback action supports OAuth authentication (open authorization) and HyperText Transfer Protocol (HTTP) methods.

[0038] In one embodiment of the present application, the asynchronous execution of callback actions is processed by a message queue. In this way, when a subsequent rule triggers a callback action, the callback action will be sent to the RabbitMQ message queue for processing, which can ensure that the callback action can be executed in an orderly and reliable manner even in high concurrency. In addition, the message queue also provides a retry mechanism to deal with possible network failures or external system unavailability.

[0039] Specifically, in the wizard page, the rules are configured through the rule engine. The rule configuration includes at least configuring the attribute information of the rules, the data objects of the rule input and output, the execution conditions and execution actions of the rules, and the callback actions associated with the rules. If a rule is triggered, the callback actions associated with the same rule are called synchronously; multiple rules are combined to form a rule set, and the attribute information of the rule set is customized, as well as the rule chain and priority between the rules in the rule set.

[0040] In one embodiment of the present application, there is a mapping relationship between the data object of the rule and the execution conditions and actions to ensure the accuracy and consistency of the data when the rule is executed. The execution action of the rule can be configured to execute a callback action to associate the rule with the callback action, or it can be configured as an assignment operation and print logs according to actual business needs. A rule may include multiple execution actions. In addition, by configuring the callback action in the rule, the rule engine can seamlessly connect with the external early warning system to achieve rapid application of the rule.

[0041] In one embodiment of the present application, the rule engine provides a visual interface, such as a drag-and-drop graphical user interface (Drag-and-Drop GUI), in which the attribute information of the rule can be configured more intuitively and simply, for example, defining expressions of multi-level execution conditions, including logical operators such as AND, OR, and NOT, so as to configure complex business logic in the rules without writing code, which is applicable to various complex business scenarios. In addition, through the wizard interface, users can be guided to quickly configure the rule set and its attribute information. The attribute information of the rule set includes the rule set name, description, version, etc. This information is persistently stored in the back end and supports version control functions to ensure that the historical versions of the rule set are traceable and manageable.

[0042] In one embodiment of the present application, data objects serve as input and output of rules and can also be configured together when constructing a rule set. The rule set and data objects are bound to uniformly configure the data objects of all rules included in the rule set.

[0043] In one embodiment of the present application, the configuration of the rule chain and priority between the rules in the rule set can be flexibly adjusted according to actual business needs. The specific logic of each execution condition in the rule set is matched and executed by the back end through the Rete algorithm (rule matching algorithm), which can significantly improve the performance and efficiency of the rule engine.

[0044] In one embodiment of the present application, the rule engine may be URule (a business rule management system).

[0045] Through the above method, combined with the wizard-style interface and rule engine configuration rule set, the technical threshold for rule configuration is greatly reduced, allowing users to efficiently and flexibly configure and manage complex rule sets without having a deep technical background.

[0046] In one embodiment of the present application, in order to ensure the accuracy of the rule set configuration and the stability of the operation, after the rule set configuration is completed, Mock data (simulation data) and real-time data are provided. Mock data is used to simulate data in real scenarios, while real-time data is directly obtained from the operating environment. The rules are tested according to the Mock data or real-time data, and the test results are displayed through the front-end visualization component. In combination with the rule engine, the test results can also display in detail the passing status of each execution condition judgment and the corresponding execution action, so that the user can accurately debug the configuration of the rule set in a timely manner according to the test results.

[0047] In one embodiment of the present application, after the rule set is published, the following is also included: publishing the rule set; marking the published rule set as a new version and assigning a version number to facilitate subsequent version management; storing each published rule set in a preset database to facilitate viewing or rolling back to a historical version at any time. In addition, the published rule set takes effect immediately in the production environment, and the dynamic loading mechanism of the rule engine ensures that the new version of the rule set can seamlessly replace the old version without affecting normal operation.

[0048] Step S140, configuring the warning task and constructing a mapping relationship between the warning task and the knowledge package, where the knowledge package is formed by combining multiple rule sets.

[0049] Specifically, before configuring the warning task, you also need to configure the knowledge package, including: configuring the basic information of the knowledge package and the bound rule set through a wizard interface, the basic information of the knowledge package includes input fields for defining the format of the data received by the knowledge package, and output fields for defining the format of the output data after the rule set in the knowledge package is executed; testing the configured knowledge package, and displaying the execution status and results of the rule set in the knowledge package during the test in real time, so as to optimize the configuration of the knowledge package according to the execution results.

[0050] In one embodiment of the present application, in order to simplify the configuration process of the knowledge package, multiple input fields and multiple output fields can be intuitively configured for the knowledge package through a wizard interface according to actual needs. Each input field or output field can specify its data type, such as a string, a number, a JSON (JavaScript Object Notation) object, etc., and the input field and the output field are format-checked so that the knowledge package can correctly receive and output data, ensuring the accuracy and consistency of data transmission.

[0051] In one embodiment of the present application, a rule set bound to a knowledge package is configured, that is, multiple rule sets are combined into one knowledge package. In this way, the knowledge package is used as a unified external entrance and exit to receive external data, execute the internal rule set of the knowledge package, and output the processing results. In addition, the knowledge package also supports import and export functions, which enables users to share and migrate knowledge packages between different environments in a privatization scenario. Through the import and export functions, knowledge packages can be easily migrated from one system to another, or shared between different systems.

[0052] In one embodiment of the present application, the output file of the knowledge package, as a bridge for data transmission between the knowledge package and the external early warning system, needs to be standardized to ensure a unified format and complete content, so as to facilitate direct import and use by the external system. Therefore, it is necessary to configure a unified output file for each knowledge package, and the configuration of the output file includes the format configuration and standardized processing of the output file, wherein the format of the output file is based on JSON or XML, and the specific choice depends on business needs. The JSON format is suitable for lightweight data transmission due to its conciseness and ease of parsing, while the XML format is suitable for the representation and transmission of complex data due to its strong structure and good scalability. The standardized processing of the output file includes defining a unified data structure, naming conventions, and encoding methods, etc., to ensure the accuracy and consistency of the data, and facilitate the access and applicability of the external early warning system.

[0053] The output file also needs to be verified to ensure that it meets the expected format and content requirements. The output file at least includes the execution log and execution results of the rule set in the knowledge package. The execution log records the key events and exception information of the rule set during the execution process, which helps users or external early warning systems to quickly locate and solve problems; the execution results include key information such as the execution status (such as success, failure or warning), execution time, and execution order of each rule set, which is crucial for external early warning systems to understand the operating status and performance of the knowledge package.

[0054] In one embodiment of the present application, after the knowledge package is configured, the rule engine is relied upon to use simulated data or real data in actual business as the input and output fields of the knowledge package, and the execution logic of the rule set in the knowledge package is quickly tested to verify the logical correctness of the rule set in the knowledge package and that the execution results are in line with expectations. The test results of the knowledge package include the judgment basis of each execution condition, the triggered execution actions and their sequence, and the final output results. The test results of the knowledge package are visualized to improve the transparency of the test and help users quickly locate and solve potential problems. Furthermore, the input and output fields of the knowledge package are adjusted according to the test results, or the configuration of the rule set in the knowledge package is optimized to ensure the stability and correctness of the knowledge package in the actual production environment.

[0055] In one embodiment of the present application, priorities may be set for multiple rule sets within a knowledge package according to actual business needs, ensuring that complex business logic can be flexibly adjusted through the configuration of the knowledge package.

[0056] Specifically, configuring the warning task includes: building the warning task through a wizard interface, each warning task has a unique task identifier; configuring the input and output of the warning task, configuring the input of the warning task includes configuring the input data source and the input field for defining the format of the data received by the warning task, and configuring the output of the warning task includes configuring the output data source and the data table in the data source, as well as the operation type of outputting data to the data table.

[0057] In one embodiment of the present application, constructing an early warning task includes creating a name and a task identifier for the early warning task, where the name is used to identify the specific business of the early warning task, and the task identifier is used to ensure that each early warning task is managed independently.

[0058] In one embodiment of the present application, the input and output of the early warning task are related to the knowledge package associated with it. The data source input in the input configuration of the early warning task is the data source of the above-mentioned project. The input field of the knowledge package is closely related to the input field configured in the associated knowledge package, which will serve as the "interface" for the early warning task to receive data, and its format and type must be consistent with the data in the data source. The input of the knowledge package can query the data source through the structured query language (Structured Query Language, SQL) or the query language for API (Graph Query Language, GraphQL), and a connection can be established with the data source through Spring Data JPA. In the output configuration of the pre-task, the output data source is the same as the input data source, and the output data table is screened from multiple data tables in the data source. The output operation type includes adding (Insert) or updating (Update). Adding will insert a new record in the data table, while updating will update the existing records.

[0059] In one embodiment of the present application, during the output configuration stage of the early warning task, the fields of the rule set execution results can also be mapped to the corresponding fields in the data table through a graphical interface, that is, for each output field, its mapping field in the database table is specified to ensure that the data output after the early warning task is executed can be accurately written into the corresponding data table.

[0060] Step S150: Execute the rules associated with the warning task based on the rule engine. If any rule triggers a warning event, call the callback action to send the warning event for notification.

[0061] In one embodiment of the present invention, a rule is set as "if the processor usage exceeds 80%, an alarm is triggered" as an example. At this time, "the processor usage exceeds 80%" is the execution condition of the rule, and "triggering an alarm" is the callback action associated with the rule. That is to say, when the processor usage exceeds 80%, the rule triggers an early warning event, and the callback action of "triggering an alarm" needs to be called synchronously. The callback interface is triggered through the request address in the callback action, and the early warning event is sent to the external early warning system for notification.

[0062] Specifically, if a callback action that triggers a callback interface is called, a workflow instance is started synchronously. The workflow instance is used to review the processing flow of the warning event. The workflow instance includes multiple nodes. The processing results of each node in the workflow instance are recorded until all nodes in the workflow instance are processed, and the status of the warning event is set to processed.

[0063] In one embodiment of the present application, the start of a workflow instance marks that the early warning event has officially entered the review and management process. In this process, the early warning event will be reviewed and processed in turn through multiple preset nodes. Each node represents a specific processing step or review stage, which is executed manually or automatically. In addition, the processing results of each node are recorded in real time, which helps to track the entire processing process of the early warning event. In this way, the workflow instance is started through a callback action and integrated with an external early warning system to achieve efficient and full-process tracking and management of early warning events, thereby improving the automation level of the early warning system and the timeliness of response.

[0064] Specifically, the trigger frequency and execution time of the warning task are controlled through a wizard interface to trigger the execution of the warning task regularly or periodically; if the warning task is triggered, the knowledge package associated with the warning task is automatically loaded and the rule set in the knowledge package is executed.

[0065] In one embodiment of the present application, the accuracy of the execution of the warning task is improved by setting the trigger frequency and execution time of the warning task. Among them, the trigger frequency of the warning task can be configured through the Cron expression, which is a time setting tool that allows the user to control the trigger time of the task with extremely high precision. It can be set based on multiple time units such as seconds, minutes, hours, days, weeks, and months to meet various complex scheduling requirements; the execution time can be configured based on the task scheduling library (such as Quartz Scheduler) to ensure that the warning task is triggered at the correct execution time according to the configured trigger frequency. After the warning task is triggered and executed, the task scheduling library can also monitor the execution status of the warning task in real time, and intervene or adjust it when necessary.

[0066] The rule engine configuration method for early warning provided in the present application has the following advantages: First, it can automatically generate data objects as the basis for configuring the rule set of the rule engine, and the rules in the rule set can be associated with callback actions when configured, which will be called synchronously when the rules are triggered, making the rule configuration more efficient and flexible. Second, the rules are associated with the early warning tasks in the form of knowledge packages to realize an automated early warning mechanism. When the rules trigger an early warning event, the corresponding callback actions can be called synchronously for automatic notification, so that the early warning system can respond quickly, thereby improving the timeliness of the early warning. Third, by separating the configuration of data objects, rule sets, and early warning tasks, the complexity of the configuration is reduced, and it can be quickly adjusted according to different business scenarios to meet the needs of business changes, thereby improving the flexibility and scalability of the early warning system.

[0067] See also Figure 2 , is a block diagram of a rule engine configuration device for early warning shown in an exemplary embodiment of the present application. Figure 2 As shown, in an exemplary embodiment, the rule engine configuration device for early warning includes at least a project configuration module 210, an object generation module 220, a rule set creation module 230, a task configuration module 240 and a task execution module 250, which are described in detail as follows:

[0068] The project configuration module 210 is used to configure the data source of the project, and the data between different projects are isolated from each other;

[0069] The object generation module 220 is used to map the table structure of the data source and generate data objects;

[0070] A rule set creation module 230 is used to call a rule engine to create a rule set for a project. The rule set includes multiple rules. The input and output of the rule are data objects and are associated with predefined callback actions.

[0071] The task configuration module 240 is used to configure the warning task and build a mapping relationship between the warning task and the knowledge package, where the knowledge package is formed by combining multiple rule sets;

[0072] The task execution module 250 is used to execute the rules associated with the warning task based on the rule engine. If any rule triggers a warning event, a callback action is called to send the warning event for notification.

[0073] It should be noted that the rule engine configuration device for early warning provided in the above embodiment and the rule engine configuration method for early warning provided in the above embodiment belong to the same concept, and the content of the operations performed by each module has been described in detail in the method embodiment and will not be repeated here.

[0074] The present application also provides an electronic device, comprising: a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement a rule engine configuration method for early warning as in the above-mentioned embodiment.

[0075] See also Figure 3 , shows a schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application. It should be noted that, Figure 3 The computer system 300 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0076] like Figure 3 As shown, the computer system 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method in the above embodiment. In the RAM 303, various programs and data required for system operation are also stored. The CPU 301, ROM 302 and RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0077] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 309 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.

[0078] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 309, and / or installed from a removable medium 311. When the computer program is executed by a central processing unit (CPU) 301, various functions defined in the system of the present application are executed.

[0079] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the rule engine configuration method for early warning as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0080] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, system or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, system or device. A computer program contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0081] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession 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 or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0082] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0083] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A rule engine configuration method for early warning, characterized in that: The method comprises: Configure the data source of the project, and isolate the data between different projects; Mapping the table structure of the data source to generate a data object; Calling a rule engine to create a rule set for the project, the rule set including a plurality of rules, the input and output of the rule being the data object, and being associated with a predefined callback action; configuring an early warning task, and constructing a mapping relationship between the early warning task and a knowledge package, wherein the knowledge package is formed by combining a plurality of the rule sets; The rules associated with the warning task are executed based on the rule engine. If any rule triggers a warning event, the callback action is called to send the warning event for notification.

2. The rule engine configuration method for early warning according to claim 1, characterized in that: The data source of the configuration item includes: Create a new project in the wizard page, and generate a unique project primary key for each project; The data source of the project is configured, wherein the data source includes database name, type, address and account information.

3. The rule engine configuration method for early warning according to claim 1, characterized in that: The calling of the rule engine to create the rule set of the project includes: In the wizard page, the rule is configured through the rule engine, and the rule configuration at least includes configuring the attribute information of the rule, the data objects input and output by the rule, the execution condition and execution action of the rule, and the callback action associated with the rule, wherein if a rule is triggered, the callback action associated with the same rule is synchronously called; A plurality of the rules are combined to form the rule set, and the attribute information of the rule set, as well as the rule chain and priority between the rules in the rule set are customized.

4. The rule engine configuration method for early warning according to claim 1, characterized in that: Before constructing the mapping relationship between the warning task and the knowledge package, it also includes: The basic information of the knowledge package and the bound rule set are configured through a wizard interface, wherein the basic information of the knowledge package includes an input field for defining a format of data received by the knowledge package and an output field for defining a format of data output after the rule set in the knowledge package is executed; The configured knowledge package is tested, and the execution status and execution results of the rule set in the knowledge package during the test are displayed in real time, so as to optimize the configuration of the knowledge package according to the execution results.

5. The rule engine configuration method for early warning according to claim 1, characterized in that: The configuration warning task includes: Constructing the warning task through a wizard interface, each warning task having a unique task identifier; The input and output of the early warning task are configured. Configuring the input of the early warning task includes configuring the input data source and an input field for defining the format of data received by the early warning task. Configuring the output of the early warning task includes configuring the output data source and a data table in the data source, as well as the operation type of outputting data to the data table.

6. The rule engine configuration method for early warning according to any one of claims 1 to 5, characterized in that: After any rule triggers a warning event, the following steps are performed: If the callback action with a trigger callback interface defined therein is called, a workflow instance is synchronously started, the workflow instance is used to review the processing flow of the warning event, and the workflow instance includes multiple nodes; The processing result of each node in the workflow instance is recorded until all nodes in the workflow instance are processed, and the status of the warning event is set to processed.

7. The rule engine configuration method for early warning according to any one of claims 1 to 5, characterized in that: The rules associated with executing the warning task include: The triggering frequency and execution time of the warning task are controlled through a wizard interface to trigger the execution of the warning task regularly or periodically; If the early warning task is triggered, the knowledge package associated with the early warning task is automatically loaded and the rule set in the knowledge package is executed.

8. A rule engine configuration system for early warning, characterized in that: The device comprises: The project configuration module is used to configure the data source of the project, and the data between different projects are isolated from each other; An object generation module, used to map the table structure of the data source and generate a data object; A rule set creation module, used for calling a rule engine to create a rule set for the project, wherein the rule set includes a plurality of rules, the input and output of the rule are the data objects, and are associated with predefined callback actions; A task configuration module, used to configure the warning task and construct a mapping relationship between the warning task and the knowledge package, wherein the knowledge package is formed by combining multiple rule sets; The task execution module is used to execute the rules associated with the warning task based on the rule engine. If any rule triggers a warning event, the callback action is called to send the warning event for notification.

9. An electronic device, characterized in that: include: processor, memory, and communications bus; The communication bus is used to connect the processor and the memory; The processor is configured to execute the computer program stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is used to make a computer execute the method according to any one of claims 1 to 7.