Rule orchestration execution, rule orchestration method, device and system
The rule orchestration and execution system enables rapid adjustment and updating of business rules in the anomaly detection and classification system, solving the problems of slow response to user-specific needs and high maintenance costs of multi-version systems, and improving the system's flexibility and maintainability.
Patent Information
- Application Number
- CN202411849125.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2044-12-13
AI Technical Summary
Existing anomaly detection and classification systems cannot respond quickly to users' personalized needs and suffer from high maintenance costs associated with maintaining multiple versions of the system.
The rule orchestration and execution system enables rapid adjustment and updating of business rules through configuration services, message middleware, and local caching. Rule configuration is separated from application code, supporting dynamic management in both server-side and client-side modes.
It enables rapid response to user needs in the anomaly detection and classification system, simplifies the rapid adjustment of business rules, improves the system's flexibility and maintainability, reduces development and testing requirements, and reduces system complexity.
Smart Images

Figure CN119806958B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic information technology, specifically to a rule arrangement and execution method, apparatus, and system. Background Technology
[0002] During the implementation of the Fault Detection and Classification (FDC) system, users frequently raise customized business requirements. To meet these requirements, developers need to perform secondary development of business rules on top of the original system, thus increasing the overall project implementation cycle and cost. If user requirements change subsequently, further development and testing manpower is required. As the number of users increases, the number of system versions to be maintained also increases, requiring more manpower to maintain these customized versions and hindering unified product planning.
[0003] Therefore, the current implementation of anomaly detection and classification systems has the problem of being unable to quickly meet the personalized needs of users, and also suffers from the high cost of maintaining multiple versions of the system. Summary of the Invention
[0004] This application provides a rule orchestration and execution scheme that enables rapid adjustment of business rules during the implementation of an anomaly detection and classification system, thereby efficiently meeting users' personalized needs. Furthermore, the business rules are separated from the application code, making them easy to maintain and update, effectively avoiding the high cost of maintaining multiple version systems.
[0005] The embodiments of this application provide the following technical solutions:
[0006] According to one embodiment of this application, a rule orchestration execution method includes: a server applied to a rule orchestration service, the rule orchestration service further including a configuration service, the method including: fetching logical rule configurations from a predetermined database at startup, saving the logical rule configurations to a local cache on the server, and listening through a message middleware; if a first rule change notification sent by the configuration service when a rule change occurs is detected through the message middleware, then obtaining a first changed rule configuration from a first interface provided by the configuration service; updating the logical rule configurations in the local cache on the server using the first changed rule configuration; if a notification message sent by a client to the message middleware is detected, querying the target logical rule triggered by the notification message from the logical rule configurations in the local cache on the server and executing it, wherein the client is an anomaly detection and classification system application that incorporates the client toolkit of the rule orchestration service.
[0007] In some embodiments of this application, if the message middleware detects a first rule change notification sent by the configuration service when a rule change occurs, then obtaining the first changed rule configuration from the first interface provided by the configuration service includes: parsing the first rule change notification to obtain a first rule identifier; and obtaining the first changed rule configuration corresponding to the first rule identifier from the first interface provided by the configuration service.
[0008] In some embodiments of this application, after querying the target logical rule triggered by the notification message from the logical rule configuration in the server's local cache and executing it, the method further includes: collecting a first component runtime log during the execution of the target logical rule; and recording the first component runtime log into the predetermined database.
[0009] In some embodiments of this application, after the target logical rule triggered by the notification message is queried from the logical rule configuration in the server-side local cache and executed, the method further includes: if the notification message is an alarm message, accumulating the number of alarm messages in the server-side local cache; if the number exceeds a predetermined threshold, performing an escalation alarm operation and clearing the accumulated number of notification messages in the server-side local cache.
[0010] In some embodiments of this application, after querying the target logical rule triggered by the notification message from the logical rule configuration in the server's local cache and executing it, the method further includes: if the notification message is an event message, determining whether to enable or disable preventive maintenance of the device based on the event content in the event message; if preventive maintenance is enabled, setting the detection instance of the target device to an inactive state by calling the detection instance update interface provided by the anomaly detection and classification system application; if preventive maintenance is disabled, setting the detection instance of the target device to an active state by calling the detection instance update interface provided by the anomaly detection and classification system application.
[0011] According to one embodiment of this application, a rule orchestration execution method is applied to a client of the rule orchestration service described in any of the foregoing embodiments. The method includes: upon startup, calling a second interface provided by a configuration service to obtain logical rule configurations from a predetermined database and saving the logical rule configurations to a local cache on the client; and listening through a message middleware; if a second rule change notification sent by the configuration service when a rule change occurs is detected through the message middleware, obtaining a second changed rule configuration from the second interface provided by the configuration service; updating the logical rule configurations in the local cache on the client using the second changed rule configurations; and when executing a rule node in the application logic, searching for and executing a specific logical rule matching the rule node from the logical rule configurations in the local cache on the client.
[0012] In some embodiments of this application, if a second rule change notification is detected by the message middleware when a rule change occurs, then obtaining the second changed rule configuration from the second interface provided by the configuration service includes: parsing the second rule change notification to obtain a second rule identifier; and obtaining the second changed rule configuration corresponding to the second rule identifier from the second interface provided by the configuration service.
[0013] In some embodiments of this application, after the specific logical rule matching the rule node is found in the logical rule configuration in the client's local cache and executed, the method further includes: collecting a second component runtime log during the execution of the specific logical rule; and recording the second component runtime log into the predetermined database through the log recording interface provided by the configuration service.
[0014] According to one embodiment of this application, a rule orchestration method is provided, the method comprising: displaying a rule orchestration interface corresponding to any of the aforementioned rule orchestration services, the rule orchestration interface including a variety of rule orchestration components; and obtaining user-constructed rules based on orchestration operations performed on the rule orchestration interface using the rule orchestration components.
[0015] According to one embodiment of this application, a rule orchestration execution apparatus is applied to the server side of a rule orchestration service, the rule orchestration service further including a configuration service. The apparatus includes: a server-side configuration module, configured to: retrieve logical rule configurations from a predetermined database at startup, save the logical rule configurations to a local server cache, and listen for them through a message middleware; a server-side acquisition module, configured to: if a first rule change notification is detected by the message middleware when a rule change occurs, obtain a first changed rule configuration from a first interface provided by the configuration service; a server-side update module, configured to: update the logical rule configurations in the local server cache using the first changed rule configurations; and a server-side execution module, configured to: if a notification message sent by a client to the message middleware is detected, query the target logical rule triggered by the notification message from the logical rule configurations in the local server cache and execute it, wherein the client is an anomaly detection and classification system application that incorporates the client toolkit of the rule orchestration service.
[0016] According to one embodiment of this application, a rule orchestration execution apparatus is applied to a client of a rule orchestration service. The apparatus includes: a client configuration module, configured to: upon startup, call a second interface provided by the configuration service to obtain logical rule configurations from a predetermined database, save the logical rule configurations to a local cache on the client, and listen through the message middleware; a client acquisition module, configured to: if a second rule change notification sent by the configuration service when a rule change occurs is detected through the message middleware, obtain a second changed rule configuration from the second interface provided by the configuration service; a client update module, configured to: update the logical rule configurations in the local cache on the client using the second changed rule configurations; and a client execution module, configured to: when executing a rule node in application logic, search for a specific logical rule matching the rule node in the logical rule configurations in the local cache on the client and execute it.
[0017] According to one embodiment of this application, a rule orchestration and execution system is provided. The system includes a rule orchestration service, a client, and a message middleware. The client is an anomaly detection and classification system application that incorporates a client toolkit of the rule orchestration service. The rule orchestration service includes a configuration service and a server. The configuration service is used to: send a first rule change notification or a second rule change notification to the message middleware when a rule change occurs. The server is used to: retrieve logical rule configurations from a predetermined database upon startup and save the logical rule configurations to a local server cache; and update the server's cache when the first rule change notification is detected through the message middleware. The server-side local cache contains logical rule configurations; and when a notification message sent by the client is detected through the message middleware, the server-side local cache retrieves the target logical rule triggered by the notification message and executes it; the client is configured to: retrieve logical rule configurations from a predetermined database at startup and save the logical rule configurations to the client-side local cache; update the logical rule configurations in the client-side local cache when a second rule change notification is detected through the message middleware; and when executing a rule node in the application logic, retrieve the specific logical rule matched by the rule node from the logical rule configurations in the server-side local cache and execute it.
[0018] According to another embodiment of this application, a storage medium stores a computer program thereon, which, when executed by a computer's processor, causes the computer to perform the methods described in the embodiments of this application.
[0019] According to another embodiment of this application, an electronic device may include: a memory storing a computer program; and a processor reading the computer program stored in the memory to execute the methods described in the embodiments of this application.
[0020] According to another embodiment of this application, a computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described in the embodiments of this application.
[0021] In this embodiment, a rule orchestration service is provided, comprising a server and a configuration service. The server can perform the following actions: upon startup, it retrieves logical rule configurations from a predetermined database and saves them to a local server cache, and listens for them via a message middleware; if the message middleware detects a first rule change notification sent by the configuration service when a rule change occurs, it obtains a first changed rule configuration from a first interface provided by the configuration service; it updates the logical rule configuration in the local server cache using the first changed rule configuration; if a notification message sent by a client to the message middleware is detected, it queries the logical rule configuration in the local server cache that triggers the notification message and executes it. The client is an anomaly detection and classification system application that incorporates the client toolkit of the rule orchestration service.
[0022] In this way, during the implementation of the anomaly detection and classification system, business rules can be quickly adjusted to efficiently meet users' personalized needs. Moreover, the business rules are separated from the application code, making them easy to maintain and update, effectively avoiding the high cost of maintaining multiple version systems. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 An architecture diagram of a rule orchestration and execution system according to an embodiment of this application is shown.
[0025] Figure 2 A flowchart illustrating a rule orchestration execution method under a service mode according to an embodiment of this application is shown schematically.
[0026] Figure 3 A flowchart illustrating a rule orchestration execution method in client mode according to an embodiment of this application is shown schematically.
[0027] Figure 4 A rule arrangement interface diagram according to an embodiment of this application is shown.
[0028] Figure 5 A block diagram of a rule orchestration execution apparatus according to an embodiment of this application is shown.
[0029] Figure 6 A block diagram of a rule orchestration execution apparatus according to an embodiment of this application is shown.
[0030] Figure 7 A block diagram of a rule arrangement apparatus according to another embodiment of this application is shown. Detailed Implementation
[0031] The present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments provided herein are merely illustrative of the present disclosure and are not intended to limit the present disclosure. Furthermore, the embodiments provided below are some embodiments for implementing the present disclosure, and not all embodiments for implementing the present disclosure. Unless otherwise specified, the technical solutions described in the embodiments of the present disclosure can be implemented in any combination.
[0032] It should be noted that, in the embodiments of this disclosure, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a method or apparatus that includes a list of elements includes not only the elements expressly described, but also other elements not expressly listed, or elements inherent to implementing the method or apparatus. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other related elements (e.g., steps in the method or units in the apparatus, such as portions of circuitry, processors, programs, or software, etc.) in the method or apparatus that includes that element.
[0033] For example, the rule orchestration and execution method provided in this disclosure includes a series of steps, but the rule orchestration and execution method provided in this disclosure is not limited to the steps described. Similarly, the rule orchestration and execution apparatus provided in this disclosure includes a series of units, but the apparatus provided in this disclosure is not limited to the units explicitly described, and may also include units that need to be set up for obtaining relevant information or processing based on information.
[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of this disclosure.
[0035] It is understood that in the specific implementation of this application, relevant data is involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0036] During the implementation of the Fault Detection and Classification (FDC) system, users frequently raise customized business requirements. To meet these requirements, developers need to perform secondary development of business rules on top of the original system, thus increasing the overall project implementation cycle and cost. If user requirements change subsequently, further development and testing manpower is required. As the number of users increases, the number of system versions to be maintained also increases, requiring more manpower to maintain these customized versions and hindering unified product planning.
[0037] To address this technical problem, this application provides the following technical solution. The solution described in the embodiments of this application can be used in the implementation of the anomaly detection and classification system. By adopting the architecture of the rule orchestration and execution system, business rules can be quickly adjusted to efficiently meet users' personalized needs. Moreover, the business rules are separated from the application code, making them easy to maintain and update, and effectively avoiding the high cost of maintaining multiple version systems.
[0038] Specifically, Figure 1 The diagram schematically illustrates the architecture of a rule orchestration and execution system according to one embodiment of this application. Figure 1 As shown, the architecture of the rule orchestration execution system may include a rule orchestration service 110, a client 120, a message middleware 130, a predefined database 140, a server-side local cache 150, and a client-side local cache 160. The rule orchestration service includes a server 111 and a configuration service 112. The client is an anomaly detection and classification system application (FDC application) that incorporates the client toolkit (client jar package) of the rule orchestration service. The anomaly detection and classification system (FDC) is a system used to detect, analyze, and classify anomalies during device operation.
[0039] Workflow services are services that can complete a specific business process according to certain rules or steps. This usually involves multiple steps or stages, and there may be dependencies or conditional judgments between the steps. Workflow services can help reduce human error, improve efficiency, and ensure that the business process proceeds smoothly according to the predetermined process.
[0040] The pre-defined database 140 can be a relational database (such as MySQL) or other databases. The pre-defined database 140 can be used to store logical rule configurations and component operation logs (such as the first component operation log and the second component operation log).
[0041] The server-side local cache 150 and the client-side local cache 160 can be Redis caching systems. The server-side local cache 150 and the client-side local cache 160 can be used to store cached data during the rule execution process and logical rule configurations pulled from a predefined database.
[0042] The message middleware 130 can be Kafka or other middleware. Message middleware is used to transmit messages between various systems; messages can include notification messages or rule change notifications.
[0043] Configuration service 112 is used for orchestration rules (Logic). The configuration service also provides an interface for remotely obtaining logic rule configurations or saving component runtime logs.
[0044] Server 111 can be used to execute the target logic rules triggered by notification messages.
[0045] Client 120 is an anomaly detection and classification system application (FDC application) that introduces the client toolkit (client jar package) of the rule orchestration service. Any anomaly detection and classification system application (FDC application) that needs to access the rule orchestration service needs to introduce the client toolkit (client jar package) of the rule orchestration service. Through the client, the client can execute specific logical rules matched by the rule nodes.
[0046] When implementing the anomaly detection and classification system, the architecture of this rule orchestration and execution system is adopted. The configuration service can be used to: send a first rule change notification or a second rule change notification to the message middleware when a rule change occurs; the server can be used to: pull logical rule configurations from a predetermined database at startup and save the logical rule configurations to the server's local cache; update the logical rule configurations in the server's local cache when the first rule change notification is detected through the message middleware; and retrieve the target logical rule triggered by the notification message from the server's local cache and execute it when the client sends a notification message through the message middleware; the client can be used to: pull logical rule configurations from a predetermined database at startup and save the logical rule configurations to the client's local cache; update the logical rule configurations in the client's local cache when the second rule change notification is detected through the message middleware; and retrieve the specific logical rule matched by the rule node from the logical rule configurations in the server's local cache and execute it when executing a rule node in the application logic.
[0047] Based on this rule orchestration service (Workflow service), such as Figure 1The rule orchestration and execution system shown has the following advantages: (1) Automated decision-making: It can make decisions automatically according to predefined rules, reduce human intervention, and achieve rapid response. It also reduces errors and biases in human decision-making, ensuring the consistency and accuracy of decisions. (2) Easy maintenance and updates: It separates complex business logic from application code, so that business rules can be configured, managed and maintained on a centralized management platform. When business needs change, rules can be quickly adjusted without modifying the underlying code, thereby reducing development and testing time. (3) Enhanced business flexibility: It can handle complex business logic and trigger different business processes according to conditions, enabling enterprises to flexibly respond to changing market demands. By configuring different rules, enterprises can adjust their strategies in real time according to changes in customers, markets or environments, achieving highly customized decision-making. (4) Improved efficiency and productivity: It automatically executes repetitive tasks, reduces the need for manual operation, and improves work efficiency. Developers can focus more on core business logic rather than repeatedly adjusting and writing rule code, thereby accelerating the development cycle. (5) Promotes business personnel participation: Business personnel can directly participate in the definition and management of rules, reducing dependence on technical personnel and promoting close cooperation between business and technology.
[0048] In summary, when implementing an anomaly detection and classification system, adopting the architecture of this rule orchestration and execution system can enable rapid adjustment of business rules to efficiently meet users' personalized needs. Furthermore, the separation of business rules from application code makes them easy to maintain and update, effectively avoiding the high cost of maintaining multiple version systems.
[0049] Based on the architecture of the rule orchestration and execution system described above, this application can provide two execution methods for logical rules: server-side mode and client-side mode.
[0050] In server-side mode, the execution entity of the rule orchestration and execution method can be, for example, Figure 1 The server-side, such as Figure 2 A flowchart illustrating a rule orchestration and execution method in server mode according to an embodiment of this application is shown schematically. The rule orchestration and execution method may include steps S210 to S240.
[0051] Step S210: At startup, retrieve the logical rule configuration from the predetermined database, save the logical rule configuration to the local cache on the server, and listen for it through the message middleware;
[0052] Step S220: If the first rule change notification sent by the configuration service when a rule change occurs is detected through the message middleware, then the first changed rule configuration is obtained from the first interface provided by the configuration service.
[0053] Step S230: Update the logical rule configuration in the server's local cache using the first change rule configuration;
[0054] Step S240: If a notification message sent by the client to the message middleware is detected, the target logical rule triggered by the notification message is queried from the logical rule configuration in the local cache of the server and executed. The client is an anomaly detection and classification system application that has introduced the client toolkit of the rule orchestration service.
[0055] In server-side mode, the server can retrieve the full set of logical rule configurations from a predefined database upon startup and save the retrieved logical rule configurations to the server's local cache. It can also listen for messages and notifications through a message middleware. The logical rule configurations can include the configuration of multiple logical rules.
[0056] The configuration service can be used to orchestrate rules. Relevant users orchestrate rules through the configuration service. The configuration service can determine whether a rule change has occurred (such as adding or adjusting a rule). When a rule change is determined to have occurred, the configuration service sends the first rule change notification to the message middleware.
[0057] When the server detects the first rule change notification sent by the configuration service when a rule change occurs through the message middleware, it can obtain the corresponding first changed rule configuration from the first interface provided by the configuration service (such as the Dubbo interface). Furthermore, the server can use this first changed rule configuration to update the cached logical rule configuration in its local cache.
[0058] When the predetermined triggering conditions are met, the client can send a notification message to the message middleware. This notification message can be an event message or an alarm message. When the server listens for the notification message sent by the client to the message middleware, it can query the logical rule triggered by the notification message from the logical rule configuration in the server's local cache as the target logical rule and execute the target logical rule.
[0059] Therefore, in the server-side mode, when the anomaly detection and classification system is implemented, the server queries the corresponding logical rules from the local cache based on the notification messages from the anomaly detection and classification system application and executes them. The configuration of the logical rules in the local cache is dynamically updated with the notification from the configuration service, which allows for quick adjustment of business rules to efficiently meet users' personalized needs. The business rules are separated from the application code, making them easy to maintain and update, and effectively avoiding the high cost of maintaining multi-version systems.
[0060] Furthermore, in one embodiment, if the message middleware detects a first rule change notification sent by the configuration service when a rule change occurs, then obtaining the first changed rule configuration from the first interface provided by the configuration service may specifically include: parsing the first rule change notification to obtain a first rule identifier; and obtaining the first changed rule configuration corresponding to the first rule identifier from the first interface provided by the configuration service.
[0061] The configuration service can carry the first rule identifier (LogicId) of the changed rule in the first rule change notification. Thus, the server can parse the first rule change notification to obtain the first rule identifier. Then, the server can accurately obtain the first changed rule configuration corresponding to the first rule identifier from the first interface provided by the configuration service.
[0062] Furthermore, in one embodiment, after querying the target logical rule triggered by the notification message from the logical rule configuration in the server's local cache and executing it, the method may further include: collecting a first component runtime log during the execution of the target logical rule; and recording the first component runtime log into the predetermined database.
[0063] During the execution of the target logic rules, the server can collect the component execution logs of each component within those rules, thus obtaining the first component execution log. The server can then record this first component execution log into the predetermined database. Therefore, in server-side mode, it is easier to track and audit the rule execution process, ensuring the transparency and auditability of the decision-making process.
[0064] Furthermore, in one embodiment, after querying and executing the target logical rule triggered by the notification message from the logical rule configuration in the server-side local cache, the method may further include: if the notification message is an alarm message, accumulating the number of alarm messages in the server-side local cache; if the number exceeds a predetermined threshold, performing an escalation alarm operation and clearing the accumulated number of notification messages in the server-side local cache.
[0065] For example, the server can accumulate the number of identical alarm messages in the server's local cache (i.e., increment the count by 1 each time an alarm message is detected in the server's local cache). If the accumulated count exceeds a predetermined threshold (e.g., 3), the server will perform an escalation alarm operation (e.g., execute the corresponding alarm notification or out-of-control action plan) and clear the accumulated count of the notification message in the server's local cache.
[0066] Furthermore, in one embodiment, after executing the specific logical rule matching the rule node found in the logical rule configuration in the client's local cache, the method may further include: if the notification message is an event message, determining whether to enable or disable preventive maintenance based on the event content in the event message; if enabling preventive maintenance, setting the detection instance of the target device to an inactive state by calling the detection instance update interface provided by the anomaly detection and classification system application; if disabling preventive maintenance, setting the detection instance of the target device to an active state by calling the detection instance update interface provided by the anomaly detection and classification system application.
[0067] Therefore, after a target device (e.g., several semiconductor processing units) begins preventive maintenance (PM), event messages generated by the anomaly detection and classification system application can be used to notify the initiation of preventive maintenance. Then, by calling the detection instance update interface provided by the anomaly detection and classification system application, all detection instances of the target device can be set to an inactive state. This prevents detection of the target device through detection instances (detection instances of the anomaly detection and classification system) after preventive maintenance begins. Only after the preventive maintenance is completed can event messages generated by the anomaly detection and classification system application be used to notify the cancellation of preventive maintenance. Then, by calling the detection instance update interface provided by the anomaly detection and classification system application, the detection instances can be reactivated. Thus, false alarms are avoided during PM, and detection can resume after PM ends.
[0068] In client mode, the execution entity of the rule orchestration and execution method can be, for example, Figure 1 The client, such as Figure 3 A flowchart illustrating a rule orchestration execution method in client mode according to an embodiment of this application is shown schematically. The rule orchestration execution method may include steps S310 to S340.
[0069] Step S310: At startup, the second interface provided by the configuration service is called to obtain the logical rule configuration in the predetermined database, and the logical rule configuration is saved to the local cache of the client. Also, the message middleware is used for listening.
[0070] Step S320: If the second rule change notification sent by the configuration service when a rule change occurs is detected through the message middleware, then the second changed rule configuration is obtained from the second interface provided by the configuration service.
[0071] Step S330: Update the logical rule configuration in the client's local cache using the second change rule configuration;
[0072] Step S340: When executing a rule node in the application logic, the specific logical rule matching the rule node is searched for in the logical rule configuration in the local cache of the client and executed.
[0073] In client mode, upon startup, the client can call a second interface (such as an HTTP interface) provided by the configuration service to retrieve the full set of logical rule configurations from the predefined database. The retrieved logical rule configurations are then saved to the server's local cache, and messages and notifications can be listened for through a message middleware. The logical rule configurations can include rule configurations for multiple logical rules.
[0074] The configuration service can be used to orchestrate rules. Relevant users orchestrate rules through the configuration service. The configuration service can determine whether rule changes have occurred (such as adding or adjusting rules). When a rule change is determined to have occurred, the configuration service sends a second rule change notification to the message middleware.
[0075] When a client receives a second rule change notification from the configuration service via the message middleware, indicating a rule change, it can retrieve the corresponding second rule configuration from the second interface (e.g., an HTTP interface) provided by the configuration service. Furthermore, the client can use this second rule configuration to update the cached logical rule configuration in its local cache.
[0076] The client can execute specified application logic. When executing a rule node in the application logic, the client can find the logical rule that matches the rule node from the logical rule configuration in the client's local cache as a specific logical rule and execute that specific logical rule.
[0077] Therefore, in client mode, when the anomaly detection and classification system is implemented, the client queries the corresponding logical rules from the client's local cache according to the execution requirements and executes them. The configuration of logical rules in the client's local cache is dynamically updated with the notification from the configuration service, so that business rules can be quickly adjusted to efficiently meet the personalized needs of users. Business rules are separated from application code, making them easy to maintain and update, and effectively avoiding the high cost of maintaining multi-version systems.
[0078] Furthermore, in one embodiment, if the message middleware detects a second rule change notification sent by the configuration service when a rule change occurs, obtaining the second changed rule configuration from the second interface provided by the configuration service may specifically include: parsing the second rule change notification to obtain a second rule identifier; and obtaining the second changed rule configuration corresponding to the second rule identifier from the second interface provided by the configuration service.
[0079] The configuration service can carry the second rule identifier (LogicId) of the changed rule in the second rule change notification. Thus, the client can parse the second rule change notification to obtain the second rule identifier. Then, the server can accurately obtain the second changed rule configuration corresponding to the second rule identifier from the second interface provided by the configuration service.
[0080] Furthermore, in one embodiment, after the specific logical rule matching the rule node is found in the logical rule configuration in the client's local cache and executed, the method may further include: collecting a second component runtime log during the execution of the specific logical rule; and recording the second component runtime log into the predetermined database through the log recording interface provided by the configuration service.
[0081] During the execution of specific logical rules, the client can collect the component execution logs of each component within those rules, thus obtaining the second component execution logs. The client can then record these second component execution logs to a predefined database via the logging interface provided by the configuration service. Therefore, in client-side mode, it is easier to track and audit the rule execution process, ensuring the transparency and auditability of the decision-making process.
[0082] This application also provides a rule orchestration method, the method comprising: displaying a rule orchestration interface corresponding to any of the aforementioned rule orchestration services, the rule orchestration interface including a variety of rule orchestration components; and obtaining user-constructed rules based on the orchestration operations of the rule orchestration components in the rule orchestration interface.
[0083] Relevant users can open the rule orchestration interface corresponding to the rule orchestration service through the interface. The rule orchestration interface includes a variety of rule orchestration components. Through the visual rule orchestration interface, users can easily orchestrate logical rules of arbitrary complexity by performing orchestration operations based on the rule orchestration components according to their needs (such as dragging and dropping components, connecting components, and configuring components). As a result, the configuration service can obtain the logical rules orchestrated by the user (i.e., user-built rules). In other words, the configuration service can obtain the relevant configurations of the logical rules that have changed (such as logical rules added or adjusted by the user). These relevant configurations can include the logical rule itself, the triggering conditions of the rule, the rule identifier, etc.
[0084] For example, a rule orchestration interface such as Figure 4 As shown, the rule arrangement interface 400 may include a component display area 410, an arrangement area 420, and an information input area 430. The component display area 410 can display various rule arrangement components. In the arrangement area 420, users can drag components from the component display area 410 to the arrangement area 420 and perform operations such as connecting and dragging within the arrangement area 420. Meanwhile, in the information input area 430, users can input information such as trigger conditions and rule identifiers through input boxes and other controls.
[0085] The various rule orchestration components displayed in component display area 410 may include, but are not limited to: Start: A process start component with configurable rule trigger conditions; End: A process end component; If-Else: A judgment component that supports multiple conditions being met, either all or any; Switch: A selection component that supports multiple cases and default; Loop: A loop with a configurable maximum number of loop iterations; While Loop: Supports multiple condition judgments, either all or any; Iteration Loop: Allows traversal of each element in a list of data; Variable: Supports variable definition and assignment; Sub-process: Allows the introduction of nested logic to participate in the execution of the current logic. Features include: Support for mainstream scripting languages such as Python, JavaScript, Groovy, Java, and Lua; Data reading: Reading data from a specified business data table; Data storage: Writing data to a specified business data table; Format conversion: Supporting mutual conversion between different data formats; Data filtering: Supporting multi-condition filtering, and extracting data by row number and column name; Mathematical calculation: Supporting basic mathematical operations such as addition, subtraction, multiplication, and division; Function calculation: Supporting 24 functions, including SUM, MIN, etc.; Timer: Allowing setting of waiting time; OCAP execution: Supporting calling third-party system interfaces to execute OCAP; Alarm notification: Sending alarm email notifications.
[0086] To facilitate better implementation of the rule orchestration and execution method provided in this application, this application also provides a rule orchestration and execution apparatus based on the above-described rule orchestration and execution method. The meanings of the terms used are the same as in the rule orchestration and execution method described above, and specific implementation details can be found in the descriptions within the method embodiments.
[0087] Figure 5 A block diagram of a rule orchestration execution apparatus according to an embodiment of this application is shown. Figure 5The rule orchestration execution device 500 shown can be applied to the server side of a rule orchestration service, which also includes a configuration service. The rule orchestration execution device 500 includes: a server-side configuration module 510, which can be used to: pull logical rule configurations from a predetermined database at startup, save the logical rule configurations to a local server cache, and listen through a message middleware; a server-side acquisition module 520, which can be used to: if a first rule change notification sent by the configuration service when a rule change occurs is detected through the message middleware, obtain a first changed rule configuration from a first interface provided by the configuration service; a server-side update module 530, which can be used to: update the logical rule configuration in the local server cache using the first changed rule configuration; and a server-side execution module 540, which can be used to: if a notification message sent by a client to the message middleware is detected, query the target logical rule triggered by the notification message from the logical rule configuration in the local server cache and execute it. The client is an anomaly detection and classification system application that incorporates the client toolkit of the rule orchestration service.
[0088] In some embodiments of this application, the server-side acquisition module 520 can be used to: parse the first rule change notification to obtain a first rule identifier; and obtain the first change rule configuration corresponding to the first rule identifier from the first interface provided by the configuration service.
[0089] In some embodiments of this application, after the target logical rule triggered by the notification message is queried from the logical rule configuration in the server's local cache and executed, the device may further include a log recording module for: collecting a first component running log during the execution of the target logical rule; and recording the first component running log into the predetermined database.
[0090] In some embodiments of this application, after the target logical rule triggered by the notification message is queried from the logical rule configuration in the server-side local cache and executed, the device may further include an alarm escalation module, configured to: if the notification message is an alarm message, accumulate the number of alarm messages in the server-side local cache; if the number exceeds a predetermined threshold, perform an alarm escalation operation and clear the accumulated number of notification messages in the server-side local cache.
[0091] In some embodiments of this application, after the target logical rule triggered by the notification message is queried from the logical rule configuration in the server's local cache and executed, the device may further include an activation processing module, configured to: if the notification message is an event message, determine whether to enable or disable preventive maintenance of the device based on the event content in the event message; if preventive maintenance of the device is enabled, set the detection instance of the target device to an inactive state by calling the detection instance update interface provided by the anomaly detection and classification system application; if preventive maintenance of the device is disabled, set the detection instance of the target device to an active state by calling the detection instance update interface provided by the anomaly detection and classification system application.
[0092] Figure 6 A block diagram of a rule orchestration execution apparatus according to another embodiment of this application is shown. Figure 6 The rule orchestration execution device 600 shown can be applied to a client of a rule orchestration service. The rule orchestration execution device 600 includes: a client configuration module 610, which can be used to: call a second interface provided by the configuration service at startup to obtain logical rule configurations from the predetermined database, save the logical rule configurations to the client's local cache, and listen through the message middleware; a client acquisition module 620, which can be used to: if a second rule change notification sent by the configuration service when a rule change occurs is heard through the message middleware, obtain a second changed rule configuration from the second interface provided by the configuration service; a client update module 630, which can be used to: update the logical rule configurations in the client's local cache using the second changed rule configurations; and a client execution module 640, which can be used to: when executing a rule node in the application logic, search for a specific logical rule matching the rule node in the logical rule configurations in the client's local cache and execute it.
[0093] In some embodiments of this application, the client acquisition module 620 can be used to: parse the second rule change notification to obtain a second rule identifier; and obtain the second change rule configuration corresponding to the second rule identifier from the second interface provided by the configuration service.
[0094] In some embodiments of this application, after the specific logical rule matching the rule node is found in the logical rule configuration in the client's local cache and executed, the device may further include a log processing module for: collecting a second component runtime log during the execution of the specific logical rule; and recording the second component runtime log into the predetermined database through the log recording interface provided by the configuration service.
[0095] Figure 7A block diagram of a rule orchestration apparatus according to another embodiment of this application is shown. Figure 7 The rule arrangement device 700 shown may include: a display module 710 for displaying a rule arrangement interface corresponding to any of the aforementioned rule arrangement services, wherein the rule arrangement interface includes a variety of rule arrangement components; and a generation module 720 for obtaining user-built rules based on the arrangement operations of the rule arrangement components in the rule arrangement interface.
[0096] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0097] Furthermore, this application also provides an electronic device or server. Specifically, in this embodiment, the processor in the electronic device or server loads the executable files corresponding to the processes of one or more programs into the memory, and the processor runs the programs stored in the memory, thereby realizing the various functions described in the foregoing embodiments of this application.
[0098] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0099] Therefore, embodiments of this application also provide a storage medium storing a computer program that can be loaded by a processor to execute the steps of any of the methods provided in embodiments of this application. The storage medium may be a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0100] Since the computer program stored in the storage medium can execute the steps of any of the methods provided in the embodiments of this application, the beneficial effects that the methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0101] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0102] It should be understood that this application is not limited to the embodiments described above and shown in the accompanying drawings, but various modifications and changes can be made without departing from its scope.
Claims
1. A rule orchestration execution method, characterized by, The method applied to a server of a rule arrangement service, the rule arrangement service further comprising a configuration service, the method comprising: pulling a logical rule configuration in a predetermined database at startup, and saving the logical rule configuration to a local cache of the server, and listening through a message middleware; if a first rule change notification sent by the configuration service when a rule change occurs is listened through the message middleware, obtaining a first changed rule configuration from a first interface provided by the configuration service; updating the logical rule configuration in the local cache of the server with the first changed rule configuration; if a notification message sent by a client to the message middleware is listened, the server queries a target logical rule triggered by the notification message from the logical rule configuration in the local cache of the server, and the server executes the target logical rule, wherein the client is an exception detection and classification system application of a client toolkit introducing the rule arrangement service.
2. The method of claim 1, wherein, The method further comprises: parsing the first rule change notification to obtain a first rule identifier; obtaining the first changed rule configuration corresponding to the first rule identifier from the first interface provided by the configuration service.
3. The method of claim 1, wherein, After the target logical rule triggered by the notification message is queried from the logical rule configuration in the local cache of the server and executed, the method further comprises: collecting a first component running log in a process of executing the target logical rule; recording the first component running log to the predetermined database.
4. The method of claim 1, wherein, After the target logical rule triggered by the notification message is queried from the logical rule configuration in the local cache of the server and executed, the method further comprises: if the notification message is an alarm message, accumulating a number of the alarm message in the local cache of the server; if the number exceeds a predetermined threshold, performing an escalation alarm operation, and clearing the number of the notification message accumulated in the local cache of the server.
5. The method of claim 1, wherein, After the target logical rule triggered by the notification message is queried from the logical rule configuration in the local cache of the server and executed, the method further comprises: if the notification message is an event message, determining whether to start or release device preventive maintenance according to event content in the event message; if the device preventive maintenance is started, setting a detection instance of a target device to an inactive state through a detection instance update interface provided by the exception detection and classification system application; if the device preventive maintenance is released, setting the detection instance of the target device to an active state through the detection instance update interface provided by the exception detection and classification system application.
6. A rule orchestration execution method, characterized by, The method applied to a client of the rule arrangement service of any one of claims 1 to 5, the method comprising: A second interface provided by the configuration service is called at startup to obtain the logical rule configuration in the predetermined database, and the logical rule configuration is saved to the client local cache, and the message middleware is listened to; If a second rule change notification sent by the configuration service when a rule change occurs is listened to through the message middleware, a second changed rule configuration is obtained from the second interface provided by the configuration service; The second changed rule configuration is used to update the logical rule configuration in the client local cache; When a rule node in the application logic is executed, the client searches for a specific logical rule matched by the rule node from the logical rule configuration in the client local cache, and the client executes the specific logical rule.
7. The method of claim 6, wherein, The second rule change notification sent by the configuration service when a rule change occurs is listened to through the message middleware, and a second changed rule configuration is obtained from the second interface provided by the configuration service, including: The second rule change notification is parsed to obtain a second rule identifier; The second changed rule configuration corresponding to the second rule identifier is obtained from the second interface provided by the configuration service.
8. The method of claim 6, wherein, After the specific logical rule matched by the rule node is searched from the logical rule configuration in the client local cache and executed, the method further includes: Second component running logs in the process of executing the specific logical rule are collected; The second component running logs are recorded in the predetermined database through a log recording interface provided by the configuration service.
9. A rule orchestration method, characterized by, The method includes: A rule arrangement interface corresponding to the rule arrangement service of any one of claims 1 to 8 is displayed, and the rule arrangement interface includes a plurality of rule arrangement components; A user constructed rule is obtained based on arrangement operations of the rule arrangement components in the rule arrangement interface.
10. A rule orchestration execution apparatus, characterized by, The server side of the rule arrangement service includes a configuration service, and the device includes: A server side configuration module configured to: pull a logical rule configuration in a predetermined database at startup, save the logical rule configuration to a server side local cache, and listen through a message middleware; A server side obtaining module configured to: if a first rule change notification sent by the configuration service when a rule change occurs is listened to through the message middleware, obtain a first changed rule configuration from a first interface provided by the configuration service; A server side updating module configured to: use the first changed rule configuration to update the logical rule configuration in the server side local cache; A server side execution module configured to: if a notification message sent by a client to the message middleware is listened to, the server side queries a target logical rule triggered by the notification message from the logical rule configuration in the server side local cache, and the server side executes the target logical rule, wherein the client is an exception detection and classification system application of a client tool kit introduced by the rule arrangement service.
11. A rule orchestration execution apparatus, characterized by, The client of the rule arrangement service of claim 10 includes The client configuration module is configured to: call a second interface provided by the configuration service to obtain the logical rule configuration in the predetermined database at startup, and save the logical rule configuration in a client local cache; and listen through the message middleware. The client obtaining module is configured to: if a second rule change notification sent by the configuration service when a rule change occurs is listened through the message middleware, obtain a second changed rule configuration from the second interface provided by the configuration service. The client updating module is configured to: update the logical rule configuration in the client local cache with the second changed rule configuration. The client executing module is configured to: when a rule node in application logic is executed, the client searches for a specific logical rule matched by the rule node from the logical rule configuration in the client local cache, and executes the specific logical rule.
12. A rule orchestration execution system, comprising: The rule arrangement execution system comprises a rule arrangement service, a client, and a message middleware. The client is an abnormality detection and classification system application of a client toolkit introduced with the rule arrangement service. The rule arrangement service comprises a configuration service and a server. The configuration service is configured to: send a first rule change notification or a second rule change notification to the message middleware when a rule change occurs. The server is configured to: pull a logical rule configuration in a predetermined database at startup, and save the logical rule configuration in a server local cache; and update the logical rule configuration in the server local cache when the first rule change notification is listened through the message middleware. When a notification message sent by the client is listened through the message middleware, the server searches for a target logical rule triggered by the notification message from the server local cache, and executes the target logical rule. The client is configured to: pull a logical rule configuration in a predetermined database at startup, and save the logical rule configuration in a client local cache. When the second rule change notification is listened through the message middleware, the client updates the logical rule configuration in the client local cache. When a rule node in application logic is executed, the client searches for a specific logical rule matched by the rule node from the logical rule configuration in the client local cache, and executes the specific logical rule.
Citation Information
Patent Citations
Configuration information updating method and device under micro-service architecture and electronic equipment
CN112882738A
Visual business rule arrangement method and configurator
CN115291857A