Shared Stateless Class for Rete Network Memory Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In compiled language environments like Java™ DSL, production rule engines face memory inefficiency due to the creation of multiple object classes for shared constraints in a production rule network, which can lead to redundant memory storage and decreased performance.
Innovation Solution
The solution involves generating a shared stateless class at compile time, using digital fingerprints and enumeration patterns to create a singleton class for shared constraints, and implementing garbage collection to manage memory usage, thereby avoiding redundant data structures and optimizing memory efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If multiple object classes are created for shared constraints in a production rule network using a compiled language, then the rule engine can execute with compiled language performance benefits, but memory storage requirements increase due to redundant object creation
Solution Approach 1:
The patent merges multiple object classes that represent shared constraints into a single shared object class. When the same constraint is encountered multiple times in the production rule network, instead of creating separate object instances, the system creates one shared object class that is referenced by multiple nodes. This combining approach eliminates redundant memory storage while preserving the compiled language execution performance.
Solution Approach 2:
The shared object class is designed to serve multiple functions simultaneously - it can be instantiated multiple times and used by different nodes in the production rule network. The single object class structure is made universal so that it can fulfill the role of constraint representation for multiple different rules without requiring separate dedicated objects for each usage.
2Reliability
If separate object classes are created for each constraint instance, then each node can independently manage its constraint evaluation, but memory efficiency decreases due to duplication of data structures
Solution Approach 1:
Instead of creating separate object classes for each constraint instance, the patent uses a copying approach where a single shared object class is instantiated multiple times. Each node receives an instance of the shared object class, maintaining independent evaluation capability, while the underlying class definition remains single-shared in memory. This allows nodes to operate independently on their constraint instances while sharing the common class structure.
3Quantity of substance
If constraints are shared across multiple nodes in a production rule network, then memory storage is optimized, but the complexity of managing shared state increases
Solution Approach 1:
The patent applies local quality by making the shared object class stateless. Each instance of the shared object class maintains only the specific constraint data needed for its particular node, without maintaining global shared state. This allows memory storage optimization through sharing while avoiding the complexity of managing shared state, as each node works with its own local instance data derived from the shared class definition.
Data Source
AI summary
Aspects and features of the present disclosure can reconcile node sharing within a production rule network that is fully coded in a compiled language. As an example, the shared, stateless class can represent constraints shared by the alpha node of a rete network. Code can be post processed to create a shared stateless class defined in memory. When the rule engine is executed and the rule network is produced, the shared stateless class can be referenced to evaluate a constraint shared by a node of the production rule network, reducing the number of classes stored in memory. Garbage collection can be used within the shared stateless class, deleting objects from memory structure when no longer used, further improving storage efficiency.


