Liteflow-based rule engine rapid construction method

By constructing state-adaptive components and resilient rule graphs, and combining environmental monitoring and intelligent scheduling, the stability problem of the rule engine's decision system in edge computing environments under highly dynamic communication links and limited resources is solved, achieving core business continuity and reliability under extreme conditions.

CN121387245APending Publication Date: 2026-01-23BOZHI NETWORK SECURITY (NANJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511261725.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-05
Publication Date
2026-01-23

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
Patent Text Reader

Abstract

The invention relates to the technical field of computer software, and provides a rule engine rapid construction method based on liteflow. The liteflow-based rule engine rapid construction method comprises the following steps: S1, a state adaptive component modeling step: defining a logic component comprising at least two operation states; according to the liteflow-based rule engine rapid construction method provided by the invention, an environment monitoring agent can actively sense a thought of link quality reduction or computing resource shortage in real time, and then a core scheduler can intelligently switch an execution path to a standby degradation link within a millisecond level according to a preset graph in a rule storage library, so that the execution efficiency is improved. According to the technical scheme of the invention, the state self-adaptive component is used as a control component, and the degradation logic of the state self-adaptive component is called, so that life-critical core services such as anti-collision early warning and traffic signal lamp control can be ensured to obtain the most basic continuous guarantee under the worst condition, and the safety redundancy, reliability and deployment feasibility of the system in various marginal environments are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer software, and particularly relates to a rule engine rapid construction method based on liteflow. BACKGROUND

[0002] As a key technology for separating business logic and application code, rule engines have been widely used. Modern open source rule engines such as LiteFlow have significantly improved development efficiency and maintainability through componentization and flexible DSL orchestration. However, existing applications are mostly oriented towards cloud or data center environments with stable networks and abundant resources.

[0003] With the rise of the Internet of Things and edge computing, rule engines are being pushed to more severe operating frontlines. The vehicle-road cooperative system of intelligent transportation is a typical extreme application scenario. In this scenario, edge computing units deployed on the roadside bear the core decision-making tasks for traffic safety and efficiency. They must continuously exchange data with high-speed moving vehicles, pedestrians, and cloud control centers with low latency. However, in reality, due to the Doppler effect caused by high-speed moving vehicles, signal obstruction caused by high-rise buildings in cities, adverse weather, and congested wireless channels, the communication link between edge computing units and the outside world exhibits high dynamics, high uncertainty, and frequent instantaneous outages. For roadside edge computing units, any decision system stall or failure caused by waiting timeouts or data errors can have catastrophic consequences, such as failure to issue collision warnings in time or causing traffic signal control logic to malfunction, leading to congestion or even accidents at intersections. At the same time, as edge devices, they have limited computing and storage resources and cannot handle sudden computing surges like the cloud by expanding indefinitely.

[0004] Therefore, it is necessary to provide a new rule engine rapid construction method based on liteflow to solve the above technical problems. SUMMARY

[0005] To solve the above technical problems, the present application provides a rule engine rapid construction method based on liteflow.

[0006] The rule engine rapid construction method based on liteflow provided by the present application comprises the following steps: S1. State adaptive component modeling step: define a logical component containing at least two operating states, including a regular state for complete function execution using real-time and high-quality data, and a degraded state for basic function execution using historical data, prediction models, or simplified core logic when real-time data is missing or resources are limited. S2. Resilience rule graph construction step: using a domain-specific language that supports componentized logic orchestration, the state-adaptive components are orchestrated into a resilience rule graph containing a primary execution link and at least one backup degraded link, the activation condition of the degraded link is associated with one or more components entering a degraded state; S3. Runtime environment dynamic perception step: deploy an environment monitoring agent to collect system resource indicators of the host environment where the rule engine is located and communication quality indicators of external data sources in real time; S4. Intelligent scheduling and execution switching step: according to the indicators collected by the environment monitoring agent, a dynamic decision model is used for judgment, when the indicators trigger the preset degraded condition, the execution path of the rule graph is actively switched from the primary execution link to the backup degraded link, to ensure the continuity of the core function.

[0007] Preferably, the state-adaptive component also includes an isolation state, when a component has persistent failure or serious timeout, the scheduler will put it into isolation state, and the subsequent business process will bypass the component according to the preset strategy.

[0008] Preferably, the communication quality indicators include at least: network connection delay, packet loss rate and data freshness timestamp.

[0009] Preferably, the dynamic decision model is based on a preset rule or a machine learning model, which is used to comprehensively evaluate system resource indicators and communication quality indicators to determine the best execution link.

[0010] Preferably, the method further includes a rule and data presetting step: the resilience rule graph and the static data or prediction model relied on by the degraded link of the execution are cached locally in advance to realize offline autonomous operation when the network of the central server is interrupted.

[0011] Preferably, the local cache adopts a version control mechanism, and when the network connection is restored, it performs differential synchronization with the central server to ensure the eventual consistency of the rules and data.

[0012] A high-resilience rule engine system, comprising: One or more state-adaptive components; A rule repository for persistently storing resilience rule graphs; An environment monitoring agent for collecting system resource and communication quality indicators; A core scheduler with a built-in dynamic decision model, responsible for parsing the rule graph and dynamically selecting the execution link according to the data of the environment monitoring agent.

[0013] Preferably, the system is deployed in a vehicle-infrastructure integrated edge computing unit, and the state adaptive component includes a vehicle data fusion component, a traffic flow prediction component, and a signal control decision component.

[0014] Preferably, the system ensures traffic safety and efficiency by switching the signal control decision component from a regular state of adaptive timing relying on real-time traffic flow to a degraded state of fixed cycle timing relying on historical traffic flow data when the real-time communication quality between the roadside edge computing unit and the vehicle decreases, thereby avoiding signal control logic failure caused by data interruption.

[0015] Compared with the related art, the liteflow-based rule engine rapid construction method provided by the application has the following beneficial effects: The liteflow-based rule engine rapid construction method provided by the application no longer passively waits for network timeout or crashes due to data errors, but actively and real-timely senses the premonition of link quality decrease or computing resource shortage by the environment monitoring agent, and then intelligently switches the execution path to a backup degraded link and calls the degraded logic of the state adaptive component within milliseconds according to the preset atlas in the rule repository by the core scheduler, so that the core capability of fast failure and graceful degradation ensures the basic continuity of core services such as collision avoidance warning and traffic signal control in the worst case, thereby greatly improving the safety redundancy, reliability and deployment feasibility in various edge environments, and transforming the rule engine from a passive logic executor to a tough decision system that can actively adapt to the environment. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 The state adaptive component running state conversion flowchart in the application is shown in FIG. 1. Figure 2 The resilience rule atlas dynamic switching flowchart in the application is shown in FIG. 2. DETAILED DESCRIPTION

[0017] The application will be further described below in combination with the drawings and embodiments.

[0018] Please refer to Figure 1 and Figure 2 , wherein, Figure 1 The state adaptive component running state conversion flowchart in the application is shown in FIG. 1. Figure 2 The resilience rule atlas dynamic switching flowchart in the application is shown in FIG. 2.

[0019] The liteflow-based rule engine rapid construction method includes the following steps: S1. State adaptive component modeling step: define a logical component containing at least two operating states, including: a normal state that performs full functions using real-time, high-quality data; and a degraded state that performs basic functions using historical data, prediction models or simplified core logic when real-time data is missing or resources are limited; S2. Resilience rule graph construction step: use a domain-specific language that supports componentized logic orchestration to orchestrate the state adaptive component into a resilience rule graph containing a main execution link and at least one backup degraded link, the activation condition of the degraded link being associated with one or more components entering a degraded state; S3. Runtime environment dynamic perception step: deploy an environment monitoring agent to collect system resource indicators and communication quality indicators of the rule engine host environment in real time; S4. Intelligent scheduling and execution switching step: according to the indicators collected by the environment monitoring agent, determine through a dynamic decision model, when the indicators trigger the preset degraded condition, actively switch the execution path of the rule graph from the main execution link to the backup degraded link, to ensure the continuity of the core function.

[0020] The state adaptive component also includes an isolated state, when a component has persistent failure or serious timeout, the scheduler will put it into the isolated state, and the subsequent business process will bypass the component according to the preset strategy.

[0021] The communication quality indicators include at least: network connection delay, packet loss rate and data freshness timestamp.

[0022] The dynamic decision model is based on a preset rule or a machine learning model, which is used to comprehensively evaluate system resource indicators and communication quality indicators to determine the best execution link.

[0023] The method further includes a rule and data presetting step: cache the resilience rule graph and the static data or prediction models relied on by the degraded link of the resilience rule graph in the local execution node in advance, to realize offline autonomous operation when the central server network is interrupted.

[0024] The local cache uses a version control mechanism, and when the network connection is restored, it performs differential synchronization with the central server to ensure the eventual consistency of the rules and data.

[0025] A high-resilience rule engine system, comprising: One or more state adaptive components; A rule repository for persistently storing resilience rule graphs; An environment monitoring agent for collecting system resource and communication quality indicators; A core scheduler, which has a built-in dynamic decision model, is responsible for parsing the rule atlas and dynamically selecting the execution link according to the data monitored by the environmental monitoring agent.

[0026] The system is deployed in a vehicle-road cooperative edge computing unit, and the state adaptive component includes a vehicle data fusion component, a traffic flow prediction component and a signal lamp control decision component.

[0027] The system ensures traffic safety and efficiency by switching the signal lamp control decision component from the adaptive timing routine state relying on real-time traffic flow to the fixed cycle timing degradation state relying on historical traffic flow data when the real-time communication quality of the roadside edge computing unit and the vehicle decreases, thereby avoiding signal lamp control logic failure caused by data interruption.

[0028] The core idea of the present application is that after receiving a service request, it can actively perceive the health status of the running environment like a smart organism through the cooperative work of internal components, and dynamically adjust its processing flow according to the pre-planned strategy, so as to ensure the stable operation of the core function in extreme environment. The whole working process, i.e. the method of the present application, is completed by the cooperation of various components in the system, and the implementation of these components and processes deeply integrates the core capabilities of LiteFlow framework, which is as follows: Step 1: Complete the logic modeling with survival awareness by the state adaptive component To solve the problem of "data error or waiting timeout" caused by high uncertainty of communication link, the starting point of the method is completed by the basic execution unit of the system, multiple state adaptive components. We use the componentization capability of LiteFlow to encapsulate each decision logic (such as collision warning, signal timing) deployed in the roadside edge computing unit into such a component; taking the collision warning component as an example, it encapsulates two sets of logic, which is the structure of the state adaptive component, and also completes the logic modeling step of the method. When it can receive real-time data of vehicles through stable communication link, it executes the regular logic of precise calculation, and once the communication link with a specific vehicle is disconnected due to signal obstruction, the component will not be stuck or failed, but will immediately execute its degradation logic and use local camera or radar sensing data for risk area prediction, which directly solves the catastrophic problem of complete failure of decision system due to data interruption.

[0029] Step 2: Solidify the resilience atlas for coping with logic failure by rule repository To solve the problem of logical failure of the entire business process due to the failure of a certain link, the system includes a rule repository. In terms of method, we arrange the above components into a resilient rule graph containing complete plans through the declarative rule language of LiteFlow, and solidify them in this rule repository. Taking the traffic signal control process as an example, its main execution link depends on real-time traffic data. We also define a backup degradation link that executes a fixed period plan based on historical data. When the real-time traffic data fusion component in the main link enters a degraded state due to network congestion, the entire process is automatically switched to the backup link, ensuring that the traffic signal operates in a reliable and guaranteed mode. The graph containing the main and backup links is the core asset stored in the rule repository, which completes the plan arrangement step of the method and solves the problem of traffic control paralysis caused by the failure of a single link.

[0030] Step 3: Real-time perception of dynamic environment and limited resources by environment monitoring agent To solve the contradiction between the need for edge computing units to respond to high dynamic and high uncertainty network changes in real time and the limited computing resources of the units themselves, the system is equipped with an environment monitoring agent. As the nerve ending of the system, the agent performs the runtime environment dynamic perception step of the method. It not only monitors whether the central processing unit and memory of the edge computing unit are close to the usage limit, but more importantly, it continuously monitors the communication link quality. When it detects a sharp increase in communication delay due to the Doppler effect or a high occupation of computing resources due to a surge in computing load, it immediately writes these specific environment deterioration indicators into the execution context of LiteFlow, providing accurate and real-time inputs for subsequent decision-making.

[0031] Step 4: Intelligent and fast switching to avoid decision timeout by core scheduler To solve the core pain point that any decision failure due to timeout may be disastrous, the brain of the system, the core scheduler, is started to perform the intelligent scheduling and execution switching step, which is the most critical step of the method. The role of the core scheduler is assumed by the process executor of LiteFlow. After loading the graph from the rule repository, it immediately reads the environment indicators in the context. It does not need to wait for a long network connection timeout. As soon as the environment monitoring agent reports a decrease in communication quality, the core scheduler can make a decision within milliseconds through the pre-set condition components in the graph, abandon the dependence on the data source, and switch to the degradation link. This mechanism of fast failure and switching to a plan ensures the real-time nature of the decision, while actively avoiding the forced execution of complex logic when resources are scarce, thereby preventing the collapse of limited edge devices due to computing flood.

[0032] To sum up, by virtue of the unique system architecture and operation method, the application is no longer passively waiting for network timeout or collapse due to data errors, but actively and real-timely senses the premonition of link quality decline or computing resource shortage by the environment monitoring agent, and then intelligently switches the execution path to the standby degraded link and calls the degraded logic of the state adaptive component within milliseconds according to the preset atlas in the rule repository by the core scheduler, so that the core capability of fast failure and graceful degradation ensures that the most basic continuity of the core business such as anti-collision warning and traffic signal control is guaranteed in the worst case, thereby greatly improving the safety redundancy, reliability and deployment feasibility in various edge environments of the system, and changing the rule engine from a passive logic executor to a tough decision system capable of actively adapting to the environment.

[0033] The above description is only an embodiment of the application, and does not limit the patent scope of the application, and any equivalent structure or equivalent process transformation using the content of the specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the application.

Claims

1. A method for rapidly constructing a rule engine based on Liteflow, characterized in that, Includes the following steps: S1. State Adaptive Component Modeling Steps: Define a logical component that includes at least two operating states, namely: a normal state in which full functionality is executed using real-time, high-quality data; and a degraded state in which basic functions are executed using historical data, predictive models, or simplified core logic when real-time data is missing or resources are limited. S2. Resilience Rule Graph Construction Steps: Using a domain-specific language that supports component-based logic orchestration, the state-adaptive components are orchestrated into a resilience rule graph containing a main execution link and at least one backup degradation link, wherein the activation condition of the degradation link is associated with one or more components entering a degradation state. S3. Runtime Environment Dynamic Awareness Steps: Deploy an environment monitoring agent to collect system resource metrics of the host environment where the rule engine is located and communication quality metrics with external data sources in real time; S4. Intelligent scheduling and execution switching steps: Based on the indicators collected by the environmental monitoring agent, a dynamic decision model is used to make a judgment. When the indicator triggers the preset degradation condition, the execution path of the rule graph is actively switched from the main execution link to the backup degradation link to ensure the continuity of core functions.

2. The method for rapidly constructing a rule engine based on Liteflow according to claim 1, characterized in that, The state adaptive component also includes an isolation state. When a component experiences a persistent failure or a severe timeout, the scheduler places it in an isolation state, and subsequent business processes will bypass the component according to a preset strategy.

3. The method for rapidly constructing a rule engine based on Liteflow according to claim 1, characterized in that, The communication quality indicators include at least: network connection latency, packet loss rate, and data freshness timestamp.

4. The method for rapidly constructing a rule engine based on Liteflow according to claim 1, characterized in that, The dynamic decision-making model, based on preset rules or machine learning models, is used to comprehensively evaluate system resource indicators and communication quality indicators to determine the optimal execution path.

5. The method for rapidly constructing a rule engine based on Liteflow according to claim 1, characterized in that, The method also includes a rule and data pre-setting step: the resilience rule map and the static data or prediction model on which the execution degradation link depends are cached in advance on the execution node to enable offline autonomous operation when the network with the central server is interrupted.

6. The method for rapidly constructing a rule engine based on Liteflow according to claim 1, characterized in that, The local cache employs a version control mechanism, and upon network connection recovery, it performs differential synchronization with the central server to ensure eventual consistency of rules and data.

7. A highly resilient rule engine system, characterized in that, include: One or more state-adaptive components as defined in claim 1; A rules repository for persistently storing resilient rule graphs; An environmental monitoring agent is used to collect system resource and communication quality indicators; A core scheduler with a built-in dynamic decision model is responsible for parsing the rule graph and dynamically selecting the execution path based on data from the environmental monitoring agent.

8. The high-resilience rule engine system according to claim 7, characterized in that, The system is deployed in a vehicle-road cooperative edge computing unit, and the state adaptive component includes a vehicle data fusion component, a traffic flow prediction component, and a traffic light control decision component.

9. The high-resilience rule engine system according to claim 8, characterized in that, The system ensures traffic safety and efficiency in the following way: when the real-time communication quality between the roadside edge computing unit and the vehicle deteriorates, the scheduler switches the traffic light control decision component from the adaptive timing regular state that relies on real-time traffic flow to the fixed-period timing degraded state that relies on historical traffic flow data, thereby avoiding the failure of traffic light control logic due to data interruption.