Multi-rule, policy engine system and implementation method applied to embedded terminal

Through a modularly designed multi-rule, policy engine system, embedded devices can operate efficiently in environments without a network, solving the problem of hardware resource limitations and ensuring the continuity of production operations and system stability.

CN119759323BActive Publication Date: 2026-03-20重庆玖奇科技有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Embedded devices are limited by hardware resources and cannot efficiently run multiple complex business and logic rules in a network-free environment, resulting in discontinuous production operations and high resource consumption.

Method used

The modular multi-rule and policy engine system includes a server interaction module, an engine core module, a business requirement pool, a terminal interaction module, an event-driven module, and a data storage module. It utilizes an embedded RTOS or Linux operating system to achieve local storage and logical reasoning, and supports the execution and management of multiple rules and policies.

Benefits of technology

It ensures the continuity of production operations, reduces network resource consumption, improves response speed and system stability, supports distributed processing and management of business logic, and adapts to rapid response in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759323B_ABST
    Figure CN119759323B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of software development, and discloses a multi-rule and strategy engine system applied to an embedded terminal, which comprises the following: a server interaction module, which is used for data exchange with other systems under a network environment and pre-processing of received data; an engine core module, which is used for driving the core components of the whole system operation, including an inference machine, a state machine, a compiler, a matcher, an executor and an interpreter; a business demand pool, which is used for storing and managing current business demands to be processed and coordinating the whole business process; an event driving module, which is used for collecting data from external devices to judge the triggering of engine operation; a terminal interaction module, which is used for connecting local devices to realize data input and output; and a data storage module, which is used for locally storing data required by engine operation; and the technical problem that the prior art is highly dependent on a network environment and cannot perform production operation under a network-free environment is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of software development, in particular to a multi-rule and policy engine system applied to an embedded terminal and an implementation method thereof. BACKGROUND

[0002] With the wide application of embedded devices in the fields of Internet of Things (IoT), automation control, big data, digital meta-universe, etc., these devices have become a key component of modern intelligent systems. However, embedded devices are limited by their hardware resources, such as processing power, storage space, and power supply, making it a great challenge to efficiently run multiple complex businesses and logic rules on these devices.

[0003] Traditional rule engines, although very powerful in terms of functionality, are often bulky and resource-intensive. These rule engines usually run on upper-layer platforms and rely on centralized management, resulting in a significant increase in resource costs. More importantly, this centralized management approach requires devices to be connected to the network environment at all times, and once the network environment is unstable or the device is disconnected from the network, the rule engine will not be able to directly guide the terminal to perform production operations, which is unacceptable for many embedded applications that rely on real-time response and local decision-making. SUMMARY

[0004] The present application aims to provide a multi-rule and policy engine system applied to an embedded terminal and an implementation method thereof, to solve the technical problem that the prior art highly depends on the network environment and cannot perform production operations in a network-free environment.

[0005] To achieve the above-mentioned purpose, the present application adopts the following technical solution: a multi-rule and policy engine system applied to an embedded terminal, comprising:

[0006] a server interaction module for exchanging data with other systems in a network environment and pre-processing received data;

[0007] an engine core module including an inference engine, a state machine, a compiler, a matcher, an interpreter, and an executor; the inference engine performs logical inference according to preset rules to coordinate the work and operation of the engine core module, and the state machine tracks and manages the state changes of each module in the system and feeds back the response state of each module to the inference engine to assist the inference engine in working;

[0008] The compiler converts the expression of the rule or strategy from a text description or a data format into an intermediate expression, the matcher is responsible for matching the business requirement with the rule or strategy when the event occurs, the interpreter reads the intermediate representation generated by the compiler and interprets and executes it piece by piece, the executor executes the underlying task passed by the interpreter, and the terminal interface controls the operation of the external device; the executor is also used for feeding back the execution result, and the interpreter further adjusts and optimizes according to the execution result fed back by the executor;

[0009] The business requirement pool is used for storing and managing the current business requirements to be processed, and coordinating the business process.

[0010] The terminal interaction module is used for providing an interface to connect external devices, collecting and inputting the running data of the external devices, and outputting instructions to control the operation of the external devices.

[0011] The event-driven module is used for judging whether the input data of the terminal interaction module triggers an event, and when the event is triggered, the event information is transmitted to the engine core module.

[0012] The data storage module is used for locally storing the data required by the engine during operation, including a basic rule library for storing rule data, a basic strategy library for storing strategy data, an archive library for storing archive data, and a task library for storing task data; and an application database for storing the data received by the event-driven module and the terminal interaction module.

[0013] The principle and advantages of the scheme are that an embedded real-time RTOS or a time-sharing Linux operating system is selected as the kernel, a lightweight engine is adopted, the engine core module, the business requirement pool, the event-driven module, the terminal interaction module and the data storage module are used, so that the system can independently run on the embedded terminal without relying on the central server, and the execution and management of multiple rules and strategies are supported, and the distributed processing and management of the business are realized.

[0014] The system stores the rule and strategy data (including the basic rule library, the basic strategy library, etc.) and the application database on the embedded terminal through the data storage module, and formats the data of the remote control, the remote signaling, the remote adjustment and the remote measurement of the external sensors or the third-party devices in the form of database for storage. When the network environment is unstable or the device is disconnected from the network, the engine core module can read the rules and strategies from the local storage, perform logical reasoning and execution, thereby ensuring the continuity of the production operation.

[0015] The system directly executes complex business logic on the embedded terminal through the engine core module. This avoids delays and bandwidth consumption in data transmission, as data can be processed without being transmitted over the network, and reduces the occupation of network resources and bandwidth consumption. The real-time feedback mechanism ensures that the system can quickly respond to external changes. The executor feeds the execution results back to the interpreter in real time, and the interpreter can immediately adjust and optimize the strategy or rule based on these results, thereby improving the response speed and accuracy of the entire system. This closed-loop operation reduces system instability and performance degradation caused by delays or errors. Real-time feedback and optimization help reduce unnecessary resource consumption. For example, when the executor finds that a task is no longer needed, it can immediately feed back to the interpreter, which can stop the execution of the task accordingly, thereby saving processor time and energy. Through closed-loop operation, the system can more effectively manage its resources and ensure their most reasonable use.

[0016] The system adopts a modular design, allowing individual components to be updated and maintained independently. This facilitates the updating of rules and strategies, the extension and optimization of business logic, and the integration with other systems or devices, thereby supporting a wider range of application scenarios and business needs.

[0017] The embedded terminal autonomously executes rules and strategies through the engine core module, enabling the device to achieve autonomous management and improving the stability and reliability of the system. When a specific event is detected, the module triggers the engine core module to run the corresponding rules and strategies. The engine core module performs logical reasoning and execution based on the data provided by the event-driven module and the rules / strategies, achieving real-time processing and response of data, which ensures the system's rapid response capability in complex environments.

[0018] Preferably, as an improvement, it further includes a resource management module for managing system resources or hardware resources according to resource management strategies; a LOG management for recording system logs, a memory management for managing memory resources of the system, an external storage management for managing resources on external storage devices, an on-chip resource management for managing on-chip resources on the embedded terminal, and an off-chip extended resource management for managing extended external resources.

[0019] The improvement has the beneficial effect that the resource management module can reasonably allocate and release system resources, ensuring that the rule engine runs stably under limited memory and computing resources. Through effective resource management strategies, resource competition and leakage problems can be avoided, improving the stability and reliability of the system.

[0020] Preferably, as an improvement, the server interaction module includes a service input unit, a service output unit, and a processing unit; the service input unit receives profile data, task data, rule data, and policy data sent by the central server, the service output unit sends terminal execution status, current terminal state, and other session information to the central server; the processing unit processes the received data and converts it into rule object models and policy object models.

[0021] The improvement has the beneficial effect that through detailed module design, data from the central server can be more effectively processed and converted into rule object models and policy object models recognizable by the system. The separation of the service input and service output units makes data reception and transmission clearer and more efficient, improving the communication efficiency of the system.

[0022] Preferably, as an improvement, the event-driven module includes an event-driven interface and an event driver; the event-driven interface constructs an interface support according to the business demand pool and connects the sensors of external devices by the terminal interaction module to collect monitoring data in real time, and the event driver transmits relevant monitoring data to the engine core module when the monitoring data meets the event trigger condition.

[0023] The improvement has the beneficial effect that the system can respond to changes in monitoring data of external devices in real time, improving the real-time performance and response speed of the system. The event-driven mechanism only transmits data to the engine core module when the trigger condition is met, avoiding unnecessary resource consumption.

[0024] Preferably, as an improvement, the business demand pool triggers the engine core module according to business demand and stores new data received by the event-driven module in the data storage module, and when the business demand changes, the data transmitted in the business demand pool is updated in time.

[0025] The improvement has the beneficial effect that through dynamic updating of data in the business demand pool, it can be ensured that the system always uses the latest business demand data for reasoning and decision-making. The dynamic updating mechanism of the business demand pool makes the system more flexible in adapting to changes in business demand.

[0026] Preferably, as an improvement, the inference engine obtains new data or instructions through chain reasoning and applies rules to derive results; the state machine is used to track and manage state transitions and state behaviors of the system and works in coordination with the inference engine.

[0027] The improved beneficial effect is that the state machine and the inference machine work together to manage the state of the system. The inference machine is responsible for inferring the current state of the system according to rules and events, while the state machine is responsible for executing corresponding actions or transitioning to a new state according to the current state and transition conditions. The state machine can also pass state transition information to the executor to execute corresponding actions.

[0028] Also disclosed is a multi-rule, policy engine implementation method applied to embedded terminals, which adopts the engine system described above, comprising:

[0029] S1: The server interaction module receives business requirements from the central server, processes these business requirements, and stores them in the local data storage module; the business requirement pool transmits business requirement related data to the engine core module according to changes in business requirements;

[0030] S2: The engine core module receives data or instructions, compiles and matches them in combination with the stored rule object model and policy object model, and transmits the matching results to the interpreter, which executes the intermediate expression instructions one by one and transmits the underlying tasks to the executor for further execution. The executor controls the operation of external devices through the terminal interaction module and feeds back the execution results of the external devices to the interpreter, which further adjusts and optimizes the execution results based on the feedback from the executor, and outputs the execution situation through the server interaction module;

[0031] S3: The terminal interaction module connects the sensors of external devices through the terminal input interface, collects the running data of external devices in real time, and transmits the collected data to the event-driven module. When the event-driven module determines that the current collected data meets the event trigger condition, it transmits the relevant monitoring data that meets the event trigger condition to the engine core module, which calls the relevant business data in the data storage module of the business requirement pool through the inference machine and the state machine according to the rule requirements, performs reasoning and decision-making, and executes corresponding actions or instructions according to the results of reasoning and decision-making;

[0032] S4: The resource management module manages each resource according to the resource management strategy and releases unnecessary resources.

[0033] The improved beneficial effect is that through this method, business requirements can be automatically received locally, data can be processed, and corresponding actions and instructions can be executed, improving the level of automatic management of the system. Each embedded terminal can independently execute rules and policies and manage its own data and state. Multiple embedded terminals can form a cluster to jointly undertake business logic execution and data processing tasks, improving the computing power of the system and enabling the system to handle more complex business scenarios and data volumes.

[0034] Preferably, as an improvement, in step S3, after the engine core module is triggered by the event-driven module, the inference engine and state machine call the business requirement pool to transfer relevant business data in the data storage module according to the data and instructions, perform inference and decision-making, and the system updates the corresponding state information or data storage according to the execution results.

[0035] The benefits of this improvement are: by calling data from the business demand pool for reasoning and decision-making, the accuracy and consistency of the data can be ensured; the system can dynamically update status information or data storage based on the execution results, improving the system's flexibility and adaptability.

[0036] Preferably, as an improvement, in step S4, the resource management module manages system logs, memory resources, external storage resources, on-chip resources, and off-chip extended resources.

[0037] The benefits of this improvement are that the resource management module can comprehensively manage various system resources, ensuring their rational allocation and effective utilization. Effective resource management can improve system reliability and stability, and prevent problems such as resource contention and leakage. Attached Figure Description

[0038] Figure 1 This is a system framework diagram of an embodiment of the present invention.

[0039] Figure 2 This is a flowchart of a method according to an embodiment of the present invention. Detailed Implementation

[0040] The following detailed description illustrates the specific implementation method:

[0041] Example

[0042] The basics are as follows: Figure 1 As shown, a multi-rule and policy engine system and implementation method for embedded terminals are disclosed. An embedded real-time RTOS or Linux time-sharing operating system is selected as the kernel of the engine system to complete business requirements. The multi-rule and policy engine system for embedded terminals includes: a server interaction module, an event-driven module, a terminal interaction module, an engine core module, a data storage module, a business requirement pool, and a resource management module.

[0043] The server interaction module is used to exchange data with other systems in a network environment; the server interaction module includes a service input unit, a service output unit, and a processing unit.

[0044] The service input unit is used for receiving the archive data, task data, rule data and policy data sent by the center server, and transmitting the input data to the processing unit for processing. The archive data is static and historical information, which is used to describe the basic attributes and historical records of the entity, and contains the necessary configuration information required by the external device; the task data is dynamic and related to specific tasks or operations, which usually includes task requests, execution status, results, etc.; the rule data is a defined instruction or logic used to guide the terminal system to perform operations according to specific conditions, which contains the configuration information of the rules and strategies required by the terminal runtime service; the policy data is a user-defined higher-level logic or plan, which usually contains multiple rules and logics, and is used to achieve complex business goals.

[0045] The service output unit is used for sending the terminal execution status, current terminal state and other session information to the center server. The terminal execution status is the specific performance and data of the terminal when performing specific tasks or operations, such as task completion degree, execution time, error log, etc.; the current terminal state is the real-time state information of the terminal, such as online / offline state, resource usage, network condition, etc.; the other session information is the user-terminal session related data, such as session ID, user information, session activity record, etc.

[0046] The processing unit is used for parsing, cleaning, sorting, converting, encrypting, etc. the received archive data and task data, and converting the rule data and policy data into rule object model and policy object model, i.e. scale expression and policy expression, so that the system can process complex rule and policy logic in a consistent and predictable manner, and the object model can be continuously updated; the processing unit further processes, verifies, optimizes and integrates the rule object model and policy object model with the business logic.

[0047] The terminal interaction module is used for connecting the terminal local device to realize the input and output of data. The terminal interaction module includes a terminal input unit for external device running data collection and a terminal output unit for controlling external device running; the terminal input unit includes a soft event interface API and a hard drive interface, and the hard drive interface includes an analog input interface AI, an analog output interface AO, a digital input interface DI, a digital output interface DO and other interfaces for connecting external devices.

[0048] The event-driven module is used for judging whether the input data of the terminal interaction module triggers an event, and when the event is triggered, the event information is transmitted to the engine core module; the event-driven module includes an event-driven interface and an event driver; the event-driven interface constructs an interface support according to the business demand pool, and is connected to the sensors of the external device by the terminal interaction module to collect monitoring data in real time, and the event driver transmits the related monitoring data to the engine core module when the monitoring data meets the event triggering condition.

[0049] a data storage module for storing data required by the engine core module during runtime, including a basic rule library for storing rule data, a basic strategy library for storing strategy data, an application database for storing data received by the event-driven module and the terminal interaction module, a task library for storing task data, and an archive library for storing archive data.

[0050] a business requirement pool for storing and managing current business requirements to be processed and coordinating the overall business process; the business requirement pool collects, organizes, and manages business requirements, which include various rules, strategies, tasks, archives, or data processing requirements, etc. The business requirement pool is also responsible for implementing and coordinating the overall business process between the functional modules, ensuring that the data flow between the modules is correct, the processing order is reasonable, and the collaborative work is smooth. The business requirement pool triggers the engine core module according to the business requirements. The business requirement pool is used to store the new data received by the event-driven module or the terminal interaction module in the data storage module, and to update the data transmitted in the business requirement pool in a timely manner when the business requirements change, to ensure the accuracy and reliability of the system.

[0051] an engine core module for processing changes in business requirements and adding, deleting, searching, and modifying rules and strategies of current tasks to be processed. The engine core module includes an inference engine, a state machine, a compiler, a matcher, an executor, and an interpreter; the inference engine is used to coordinate the compilation, matching, interpretation, execution, etc. of rules and strategies according to business requirements, responsible for basic business logic reasoning, and realizes chain reasoning through forward reasoning and backward reasoning to obtain new data or instructions; the inference engine obtains results through forward reasoning and traces purposes through backward reasoning to apply rules and derive results. The state machine is used to track and manage the state transition and state behavior of the system.

[0052] The state machine and the inference engine work together to manage the state of the system. The inference engine is responsible for inferring the current state of the system according to the rules and events, while the state machine is responsible for executing corresponding actions or transitioning to a new state according to the current state and transition conditions. The state machine can also pass the state transition information to the executor to execute the corresponding actions.

[0053] The compiler converts the expression of rules or strategies from text description or data format to intermediate expression, the matcher is responsible for matching business requirements with rules or strategies when events occur, the interpreter reads the intermediate representation generated by the compiler and executes it one by one, and the executor executes the underlying tasks passed by the interpreter and controls the work of external devices by the terminal interface; the executor is also used to feedback the execution results, and the interpreter further adjusts and optimizes according to the execution results feedback by the executor.

[0054] The compiler, matcher, interpreter, and executor of the engine core module are specifically:

[0055] Compiler is used to convert the rule and policy from text description or data format state to more efficient or easy to execute intermediate expression, to improve the efficiency of matching and execution, and to pass the compiled results to the matcher. The compiler has strong syntax parsing ability and can understand different formats of rule expression. Using lexical analysis and syntax analysis techniques, the rule is decomposed into basic elements such as operators, operands, etc., and then the corresponding execution logic tree is constructed.

[0056] Syntax analysis in rule parsing process: syntax analysis is performed on the rule using syntax analysis tools or algorithms. For text-based rules, a syntax description method similar to the Backus-Naur Form (BNF) is used to decompose the rule into a series of syntax units. For example, taking "if sensor_data>threshold then execute_action" as an example, syntax analysis can decompose it into the keyword "if", the comparison expression "sensor_data>threshold", and the action expression "execute_action".

[0057] Semantic understanding process: based on syntax analysis, the semantics of the rule is further understood. The functions and data structures of the interpreter part of the embedded terminal are combined. For example, for the "execute_action" part, it needs to be clear which hardware device or software module the action is operated on, and what the operation parameters are. Through semantic understanding, the rule is converted into an internal representation form that can be directly executed by the policy execution module, such as function call or instruction sequence.

[0058] Matcher is used to match business requirements with rules in the basic rule library or strategies in the basic strategy library, and to pass the matching results to the inference engine. Specifically, after receiving the correct information from the compiler, the matcher matches the current core task with the existing rule and strategy base library. First, identify what operation type, record according to the operation type, and after processing is completed, send the result to the inference engine, which further controls the transmission of the matching machine's processing results to the interpreter.

[0059] The inference machine transmits it to the interpreter for reading and interpretation, and the interpreter performs the lowest level of execution, such as interacting with specific hardware or software modules to perform tasks. The executor is used to execute the actions and instructions generated by the inference machine or state machine according to the rules and strategies, such as the underlying tasks passed by the interpreter. The executor executes the corresponding operations according to the parsed rule logic in sequence. During the execution process, necessary resources such as device handles and memory space need to be obtained. For example, when executing the strategy of controlling the peripheral device, the executor needs to obtain the interface and parameters of the controlled peripheral device program through the terminal interaction module, and then control the peripheral device through the driver program.

[0060] During the execution process, the executor obtains the inference word and state word description from the inference machine and state machine, evaluates the condition part of each rule, determines which rules are applicable, and then maintains and updates the basic rule library and strategy library. After the processing is completed, the results are sent to the inference machine.

[0061] The feedback mechanism of the executor: according to the execution logic generated by the parser, the corresponding strategy is actually executed on the terminal according to the rule library. For example, when executing the device control rule, the executor will control the state of the hardware device through the corresponding device driver program. In order to ensure the reliability of the strategy execution, the executor has an error handling mechanism. After the strategy is executed, the system needs to be fed back with the execution result. If the execution is successful, the relevant information of the execution is recorded, such as the execution time, the execution parameter, etc. When an error occurs during the execution of the strategy, such as device failure or resource shortage, the error information can be recorded in time, and the feedback processing can be carried out according to the pre-set strategy (such as retry, skip or warning) and other ways. The whole runtime engine core module is in a closed loop state.

[0062] The interpreter adjusts and optimizes according to the feedback result of the executor. The adjustment and optimization content includes: fine-tuning of rules or strategies, such as adjusting threshold, time interval, retry number, etc., to better adapt to the current system state or business demand; the interpreter can analyze the success or failure cases in the execution result, identify the logical loopholes or redundant parts in the rules or strategies, and make corresponding optimization; optimization of the interpreter internal mechanism, the interpreter can cache frequently executed instructions or intermediate results to reduce repeated calculation and parsing overhead, improve execution efficiency, for rules or strategies containing conditional branches, the interpreter can use branch prediction technology to optimize the execution path and reduce the performance loss caused by branch errors, the interpreter can optimize memory access mode, such as through memory alignment, batch operation, etc. to reduce memory access overhead; interaction optimization between the executor and the interpreter, the interpreter can dynamically adjust the task allocation strategy according to the load of the executor, resource utilization, etc. to ensure that tasks can be efficiently and evenly distributed to each executor, error handling mechanism: the interpreter can optimize the error handling mechanism, such as increasing the retry mechanism, error classification processing, early warning notification, etc. to improve the fault tolerance and response speed of the system, etc.

[0063] The resource management module is used for managing the system itself or hardware resources according to a resource management strategy, including LOG management for recording system logs, memory management for managing memory resources of the system, external storage management for managing resources on an external storage device, on-chip resource management for managing on-chip resources on the embedded terminal, and off-chip extended resource management for managing extended external resources.

[0064] As shown in the accompanying drawings, Figure 2 A method for implementing a multi-rule, strategy engine system applied to an embedded terminal, i.e., a multi-rule, strategy engine implementation method applied to an embedded terminal, includes:

[0065] S1, when the server interaction module receives business demand from the center server, the business demand includes archive data, task data, rule data and strategy data, processes these business demands and stores them to the local data storage module; the business demand pool transmits the business demand related data to the engine core module according to the change of the business demand, to drive it to perform corresponding processing.

[0066] S2, when the engine core module accepts data or instructions, compiles, matches in combination with the stored rule object model and strategy object model, and transmits the matching result to the interpreter, the interpreter interprets and executes the intermediate expression instructions one by one, and transmits the underlying task to the executor for further execution, the executor controls the external device to work through the terminal interaction module, and feeds back the execution result of the external device to the interpreter, the interpreter further adjusts and optimizes according to the execution result fed back by the executor, and the server interaction module outputs the execution situation;

[0067] S3, the terminal interaction module connects to the sensors of external devices through the terminal input interface, collects the operating data of the external devices in real time, and transmits the collected data to the event-driven module. When the event-driven module determines that the current collected data meets the event triggering conditions, it transmits the relevant monitoring data that meets the event triggering conditions to the engine core module. The inference engine and state machine, according to the rule requirements, call the business requirement pool to transmit the relevant business data in the data storage module, perform inference and decision-making, and execute the corresponding actions or instructions based on the results of the inference and decision-making. The system updates the corresponding status information or data storage based on the execution results.

[0068] S4. The resource management module will manage each resource according to the resource management strategy and release unnecessary resources.

[0069] To illustrate the implementation method, let's take an example of deploying this engine system in industrial automation control:

[0070] Industrial production bases involve order input, which includes detailed information on production equipment types and product configurations. Archive data includes the type and configuration of production equipment, product type and configuration details, factory layout and production line configuration, and relationships between equipment. Task data includes production time, location (production line), quantity, product type, production line start instructions, pause instructions, and stop instructions. Rule data includes production time rules, such as "orders must start production at the specified time," production line selection rules, such as "select the corresponding production line based on product type," and quantity check rules, such as "production quantity must match order quantity." Strategy data includes production planning strategies, such as "produce type A equipment from Monday to Wednesday, and type B equipment from Thursday to Sunday," and resource management strategies, such as "release unnecessary resources when the production line is idle."

[0071] The system receives files, tasks, rules, and policies from the service interaction interface. After receiving the necessary data, the system adaptively adapts the current rule expression and necessary business policies, implements the current main business based on the inference engine, binds the state machine state and the confirmation and interpretation of production actions, and can construct a complete business process based on the basic data provided by the acquisition terminal.

[0072] When the terminal system is running, the engine core module is mainly responsible for compiling, matching and executing the rules and strategies issued by the user, and obtaining a series of production factor data from the inference machine: for example, from the time dimension, the order 2024-8-1 10:00 enters the production operation on time; from the location dimension, the order is directed to the automated production industrial assembly line of the factory; from the quantity dimension, the order is directed to the determination of the production quantity of the assembly line of the factory; from the product type dimension, the order is directed to the determination of the product type of the assembly line of the factory, and so on.

[0073] After determination, the state machine is bound to the system, and the system checks the execution state of each module and gives feedback, and drives the interface to complete the preparation. After each module enters the standby state, the last event drive is triggered, and the automated assembly line of the factory starts running.

[0074] During the operation, the terminal collects the key data of the assembly line in real time, fuses the working state of the current assembly line, and manages the resources of the system to effectively release unnecessary resources, thereby improving the response speed and stability of the system. Finally, the industrial automated assembly line completes the automated production operation according to the user's specification.

[0075] The application can be applied to multiple scenarios, such as smart home, industrial automation, environmental monitoring and other fields, to realize fast, safe and reliable communication between devices. For example, in smart home, it can be used to handle temperature control, lighting adjustment and other business logic; in industrial automation, it can be used to monitor device status, control production process, etc. With the rapid growth of the embedded device market, the application has broad application prospects and market potential in smart home, smart city, industrial internet and other fields.

[0076] In addition to the above basic production business, multiple strategies can also be set and identified, for example, the user can specify a wider time dimension and issue a strategy binding, specify that the assembly line produces a certain type of device from week 1 to week 3 at a certain time period, and produces a certain type of device from week 4 to week 3 at a certain time period. The system can reflect the importance and efficiency of the multi-rule and multi-strategy engine system.

[0077] In addition, the engine system of the intelligent manufacturing base also supports the setting and identification of multiple rules and strategies. Users can set more extensive time dimensions, device priorities, production sequences and other rules and strategies according to actual needs, and bind them to the corresponding production lines. In this way, the engine system can automatically adjust the operation mode of the production line according to different production needs and conditions, achieving more flexible and efficient production.

[0078] The above is only an embodiment of the present application, and the specific technical solutions and / or common knowledge of the scheme are not described in detail. It should be pointed out that for those skilled in the art, without departing from the technical solutions of the present application, a number of modifications and improvements can be made, which should also be considered as the protection scope of the present application, which will not affect the effect and practicality of the patent. The protection scope claimed in this application should be subject to the content of its claims, and the specific implementation mode and the like recorded in the specification can be used to explain the content of the claims.

Claims

1. A multi-rule, policy engine system applied to embedded terminals, characterized in that, Choose an embedded real-time RTOS or time-sharing Linux operating system as the kernel, and use a lightweight engine, including: The server interaction module is used to exchange data with other systems in a network environment and to preprocess the received data. The core engine modules include the inference engine, state machine, compiler, matcher, interpreter, and executor; The inference engine is used to coordinate the compilation, matching, interpretation, and execution of rules and strategies according to business needs. It is responsible for basic business logic reasoning and infers the current state of the system based on rules and events. The state machine is responsible for executing corresponding actions or transitioning to a new state based on the current state and transition conditions. The state machine feeds back the response status of each module to the inference engine to assist the inference engine in its work, and transmits state transition information to the actuator. The compiler converts the expression of the rule or strategy from a text description or data format into an intermediate expression and passes the compilation result to the matcher; The matcher is responsible for matching business requirements with rules or policies when an event occurs, and passing the matching results to the inference engine, which then transmits the matching results to the interpreter. The interpreter reads the intermediate representation generated by the compiler, interprets and executes it line by line, and then passes it to the executor; The executor executes the underlying tasks passed by the interpreter, controls the operation of external devices through the terminal interface, and provides real-time feedback of execution results to the interpreter to adjust and optimize rules and strategies. During execution, the executor obtains inference words and state word descriptions from the inference engine and state machine, evaluates the conditions of each rule, maintains and updates the basic rule base and strategy base, and sends the results to the inference engine. The business requirement pool is used to store and manage currently pending business requirements and coordinate the overall business process. The business requirement pool triggers the core module of the engine according to the business requirements and stores the new data received by the event-driven module or the terminal interaction module in the data storage module. When the business requirements change, the data transmitted in the business requirement pool is updated in a timely manner. The terminal interaction module is used to provide an interface to connect to external devices, realize the acquisition and input of external device operation data, and output commands to control the operation of external devices; The event-driven module is used to determine whether the input data from the terminal interaction module triggers an event. When an event is triggered, the event information is passed to the engine core module. The data storage module is used to store the data required by the core module of the local storage engine during runtime, including a basic rule library for storing rule data, a basic policy library for storing policy data, an archive library for storing archive data, a task library for storing task data, and an application database for storing data received by the event-driven module and the terminal interaction module. The resource management module is used to manage the system's own or hardware resources according to resource management policies. This includes LOG management for recording system logs, memory management for managing the system's memory resources, external storage management for managing resources on external storage devices, on-chip resource management for managing on-chip resources on embedded terminals, and off-chip extended resource management for managing extended external resources.

2. The multi-rule, policy engine system for embedded terminals according to claim 1, characterized in that: The server interaction module includes a service input unit, a service output unit, and a processing unit; the service input unit receives file data, task data, rule data, and policy data sent by the central server, and the service output unit sends terminal execution status, current terminal status, and other session information to the central server; The processing unit processes the received data and transforms it into rule-based object models and strategy-based object models.

3. The multi-rule, policy engine system applied to embedded terminals according to claim 2, characterized in that: The event-driven module includes an event-driven interface and an event driver; The event-driven interface is supported by an interface pool based on business requirements. The terminal interaction module connects to the sensors of external devices to collect monitoring data in real time. When the monitoring data meets the event triggering conditions, the event driver transmits the relevant monitoring data to the engine core module.

4. The multi-rule, policy engine system for embedded terminals according to claim 3, characterized in that: The inference engine obtains new data or instructions through chained reasoning and applies rules to arrive at results; the state machine is used to track and manage the system's state transitions and state behaviors, and works in conjunction with the inference engine.

5. A method for implementing a multi-rule, policy engine in an embedded terminal, employing the engine system described in claim 4, characterized in that... include: S1: The server interaction module receives business requests from the central server, processes these business requests, and stores them in the local data storage module; The business requirement pool transmits relevant business requirement data to the engine core module based on changes in business requirements. S2: The engine core module receives data or instructions, compiles and matches them in combination with the stored rule object model and strategy object model, and passes the matching results to the interpreter. The interpreter interprets and executes the intermediate expression instructions one by one, and passes the underlying tasks to the executor for further execution. The executor controls the operation of external devices through the terminal interaction module and feeds back the execution results of the external devices to the interpreter. The interpreter further adjusts and optimizes based on the execution results fed back by the executor, and the server interaction module outputs the execution status. S3: The terminal interaction module connects to the sensors of external devices through the terminal input interface, collects the operating data of external devices in real time, and transmits the collected data to the event-driven module. When the event-driven module determines that the current collected data meets the event triggering conditions, it transmits the relevant monitoring data that meets the event triggering conditions to the engine core module. The inference engine and state machine call the business requirement pool to transmit the relevant business data in the data storage module according to the rule requirements, perform inference and decision-making, and execute the corresponding actions or instructions according to the results of inference and decision-making. S4: The resource management module manages each resource according to the resource management strategy and releases unnecessary resources.

6. The method for implementing a multi-rule, policy engine in an embedded terminal according to claim 5, characterized in that: In step S3, after the core engine module is triggered by the event-driven module, the inference engine and state machine call the business requirement pool to pass relevant business data from the data storage module based on data and instructions, perform inference and decision-making, and the system updates the corresponding state information or data storage based on the execution results.

7. The method for implementing a multi-rule, policy engine in an embedded terminal according to claim 6, characterized in that: In step S4, the resource management module manages system logs, memory resources, external storage resources, on-chip resources, and off-chip extended resources.

Citation Information

Patent Citations

  • Data transmission method and system suitable for various environments

    CN107786665A

  • Rule reasoning method for realizing edge-end collaboration

    CN113627613A

  • Rule engine-based energy consumption monitoring management system and method

    CN116738163A

  • Offline service processing system and method on mobile equipment

    CN118606336A