Abstract:
A method for dynamically determining a predetermined previous condition of a rule-based system comprising a plurality of rules. Each of the plurality of rules is associated with a transaction and a condition under which the transaction is executed. In one embodiment, the method includes the steps of (a) determining a system condition; (b) determining an immediate previous condition that caused the system condition; (c) setting the immediate previous condition to the system condition; and (d) repeating steps (b) and (c) until the predetermined previous condition is reached.

Description:
FIELD OF THE INVENTION 
     The invention relates generally to the field of computer science and more specifically to the field of computer event logging. 
     BACKGROUND OF THE INVENTION 
     Event logs on computers serve the purpose of telling the computer operator what the state of the system was just before an event occurred. In this way, the computer operator can determine what caused an event, such as a malfunction, to occur and thereby aid in correcting the problem and preventing it from happening again. Typically, event logs require a good deal of storage to hold the event data and the results are generally difficult to interpret. 
     The present invention addresses these issues. 
     SUMMARY OF THE INVENTION 
     In one aspect, the invention relates to a method for dynamically determining a predetermined previous condition in a rule-based system comprising a plurality of rules. Each of the plurality of rules is associated with a transaction and a condition under which the transaction is executed. In one embodiment, the method includes the steps of (a) determining a system condition; (b) determining an immediate previous condition that caused the system condition; (c) setting the immediate previous condition to the system condition; and (d) repeating steps (b) and (c) until the predetermined previous condition is reached. 
     In one embodiment, the step of determining an immediate previous condition includes the step of determining a rule associated with the immediate previous condition wherein the execution of the rule causes the system condition. In another embodiment, the rule includes a data structure comprising an explanation describing the reason for executing the rule. In yet another embodiment, the transaction includes indicia as to the initiator of the transaction, wherein the indicia is selected from one of a user, a system component and a policy condition, and wherein the predetermined previous condition is reached when the indicia is a user or a system component. In another embodiment, the transaction further includes a unique transaction identifier identifying the transaction; a description of the transaction; a timestamp indicating the time of the transaction; and an explanation explaining why the transaction was executed. In another embodiment, the immediate previous condition is associated with at least one derivation, each derivation comprising a rule and an explanation for executing the rule. 
     In another aspect, the invention relates to the method of deriving a cause of a given state of a rule-based system comprising a plurality of rules, each rule comprising a transaction and a condition. In one embodiment, the method includes the steps of (a) determining a transaction resulting in the given state; (b) determining a condition under which the transaction executes; (c) determining which rule of the plurality of rules was executed by the condition; and (d) determining an explanation associated with the transaction. 
     In yet another aspect, the invention relates to a method of inspecting a rule-based system in a given state, the rule-based system comprising a plurality of rules, each rule including a transaction, each transaction initiated by a corresponding condition, each condition containing at least one derivation and an explanation associated with the rule. In one embodiment, the method includes for each transaction in the series of rule executions, (a) determining the condition executing the transaction; (b) determining the derivation identifying the rule triggering the transaction; (c) determining the explanation associated with the rule, thereby generating the cause of the given state by combining the explanation for each of the executed rules. 
     In still yet another aspect, the invention relates to an apparatus for dynamically determining a predetermined previous condition of a rule-based system including a plurality of rules, each of the plurality of rules is associated with a transaction and a condition under which the transaction is executed. In one embodiment, the apparatus includes a first condition determining module adapted to determine a given system condition of the rule-based system; a second condition determining module adapted to determine an immediate previous condition that caused the given system condition, the second condition determining module in communication with the first condition determining module; and a condition setting module adapted to set the immediate previous condition to the given system condition, the condition setting module in communication with both the first condition determining module and the second condition determining module. The condition setting module iteratively sets the immediate previous condition of a given system condition to the given system condition until the predetermined previous condition is reached. 
     In another embodiment, the first condition determining module is the second condition determining module. In yet another embodiment, the second condition determining module determines an immediate previous condition by determining a rule associated with the immediate previous condition, wherein the execution of the rule causes the given system condition. In still yet another embodiment, the rule includes a data structure comprising an explanation describing the reason for executing the rule. In yet another embodiment, the transaction includes indicia as to the initiator of the transaction, wherein the indicia is selected from one of a user, a system component and a policy condition, and wherein the predetermined previous condition is reached when the indicia is a user or a system component. In still yet another embodiment, the transaction further includes a unique transaction identifier identifying the transaction; a description of the transaction; a timestamp indicating the time of the transaction; and an explanation explaining why the transaction was executed. In still yet another embodiment, the immediate previous condition is associated with at least one derivation, each derivation comprising a rule and an explanation for executing the rule. 
     In yet another aspect, the invention relates to an apparatus for deriving a cause of a given state of a rule-based system. The apparatus includes a plurality of rules, each rule including a transaction and a condition. In one embodiment, the apparatus includes a transaction determining module adapted to determine a transaction resulting in the given state; a condition determining module adapted to determine a condition under which the transaction executes, the condition determining module in communication with the transaction determining module; a rule determining module adapted to determine which rule of the plurality of rules was executed by the condition, the rule determining module in communication with the condition determination module; and an explanation determining module adapted to determine an explanation associated with the transaction, the explanation determining module in communication with the rule determining module. 
     In another aspect, the invention relates to an apparatus for inspecting a previous state of a rule-based system, the rule-based system including a plurality of rules, each rule comprising a transaction, each transaction initiated by a corresponding condition, each condition containing at least one derivation and an explanation associated with the rule. In one embodiment, the apparatus includes: a rule execution module adapted to execute transactions in a series of rules, condition determining module adapted to determine each of the conditions causing the corresponding transactions, the condition determining module in communication with the rule execution module; a derivation determining module adapted to determine each of the derivations that identifies the corresponding rule, the derivation determining module in communication with the condition determining module; an explanation determining module adapted to determine each of the explanations associated with each of the rules, the explanation determining module in communication with the derivation determining module, a cause generating module adapted to generate the cause of the given state by combining the explanation for each of the executed rules, the cause generating module in communication with the explanation determining module. 
     Another aspect of the invention relates to an apparatus for dynamically determining a predetermined previous condition of a rule-based system including a plurality of rules, each of the plurality of rules is associated with a transaction and a condition under which the transaction is executed. In one embodiment, the apparatus includes a processor adapted to perform the steps of: (a) determining a system condition; (b) determining an immediate previous condition that caused the system condition; (c) setting the immediate previous condition to the system condition; and (d) repeating steps (b) and (c) until the predetermined previous condition is reached. 
    
    
     
       DESCRIPTION OF THE DRAWINGS 
       The invention is pointed out with particularity in the appended claims. The advantages of the invention described above, together with further advantages, may be better understood by referring to the following description taken in conjunction with the accompanying drawings. In the drawings, like reference characters generally refer to the same parts throughout the different views. The drawings are not necessarily to scale, emphasis instead generally being placed upon illustrating the principles of the invention. 
         FIG. 1  is a diagram of an embodiment of a data structure of the invention. 
     
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     This invention, in one embodiment, relies on the fact that the underlying system is a rule based system. A rule-based system includes a series of rules which includes a condition and a transaction. When a condition becomes true, the condition of the rule triggers the transaction of the rule. That is, the existence of a predefined condition causes a predefined transaction or action. By keeping track of what previous rule caused an action that caused a subsequent rule to trigger, one can work backwards from a given event and determine what series of steps caused that event to occur. 
     For example, a rule could be:
         IF A=“1” THEN SET B=“2”       

     Under this rule, when A becomes “1” then B is automatically set to “2.” So, given this rule and the fact that “B=2,” one can infer that “A” was set equal to “1.” 
     Rules can include multiple conditions and multiple actions. For example, assume the following is a condition for a rule to trigger:
         IF (A.type=“a” AND B.state=“active”)       

     In this rule “A” and “B” are objects, and “type” and “state” are properties of A and B respectively. Thus, when the type of object A is “a” and the state of object B is “active,” the condition on the left hand side of the rule is satisfied. When such a condition becomes satisfied, the following transaction (with two actions) occurs:
         THEN (C.type=“c” AND D.state=“inactive”)       

     That is, in one action of the transaction C will be set to type “c” and in the other action of the transaction the state of D will be set to “inactive.” These two actions make up the transaction of this rule. 
     In one embodiment of the system, each transaction is represented by an object. Referring to  FIG. 1 , each transaction object  20  includes the following properties: 
     an “ID property”  22  that points to the objects  24 ,  26  (in this case C and D respectively) updated by the transaction; 
     a “when property”  28  that indicates when the transaction occurred; 
     a “who property”  30  determines who caused the transaction property to be updated; and 
     a “condition property”  32  points to the rules which caused the condition to be triggered. 
     In more detail, the “who property”  30  make take on one of three values:
         User: The property was updated by a user request;   System: The property was updated by a system request;   Policy Rule: The property was updated due to a policy rule       

     Similarly, the “condition property”  32  contains derivations based on the rules that triggered the condition. A “condition property” can depend from multiple rules. Consider for example, the case where there are three possible rules with left hand side conditions:
         Rule 1: IF (a=1 and b=2)   Rule 2: IF (a=1)   Rule 3: IF (b=3)
 
Which lead to the right hand side action:
   THEN (c=3)       

     In this case, if “a=1” and the condition is triggered, then two derivations are generated indicating that C is equal to 3 due to both Rule 1 and Rule 2 being true. The “condition property” points to the derivations (in this example “Rule 1” and “Rule 2”) which include rule names and explanation. Each explanation includes a list of property IDs and values. That is: {PID: Value, PID: Value, . . . }. Thus, in this case the Rule 1 entry would have the PID for “a” and the value “1” and a PID for “b” and the value “2.” The Rule 2 entry would have only the PID for “a” and the value “1.” A string of derivations can then be formed because each property has a pointer to the transaction object that resulted in the current state. One can then extract the PID of one of the properties that was derived and use the transaction ID to navigate to the next previous transaction object from which more explanations can be extracted. This moving to the next transaction can continue until the “who property” of a transaction object is something other than a “Policy Rule.” This means that the backtracking stops when the property has either been updated due to a user request or a because of system component (e.g. temperature sensor) has changed to some predefined value. 
     In more detail, one embodiment of the data structures of the various objects are herein disclosed. 
     
       
         
               
             
           
               
                   
               
             
             
               
                 Structure of the Transaction Object: 
               
               
                 &lt;object name=“Transaction”&gt; 
               
               
                   &lt;description&gt;Includes information about why and when this transaction 
               
               
                 was executed&lt;/description&gt; 
               
               
                   &lt;ptype name=“Tid” kind=“key” link=“KeyTransaction” value=“integer” &gt; 
               
               
                     &lt;description&gt;A unique Transaction Identifier.&lt;/description&gt; 
               
               
                    &lt;/ptype&gt; 
               
               
                    &lt;ptype name=“RefCounter” value=“integer”&gt; 
               
               
                     &lt;description&gt;Number of properties that reference this Transaction 
               
               
                 object.&lt;/description&gt; 
               
               
                    &lt;/ptype&gt; 
               
               
                    &lt;ptype name=“Description” value=“string”&gt; 
               
               
                     &lt;description&gt;Description of the Transaction.&lt;/description&gt; 
               
               
                    &lt;/ptype&gt; 
               
               
                   &lt;ptype name=“Timestamp” value=“integer”&gt; 
               
               
                     &lt;description&gt;When the transaction was executed.&lt;/description&gt; 
               
               
                    &lt;/ptype&gt; 
               
               
                    &lt;ptype name=“Explanation” value=“string”&gt; 
               
               
                     &lt;description&gt;A string explaining why this transaction was initiated 
               
               
                 (only for conditions).&lt;/description&gt; 
               
               
                   &lt;/ptype&gt; 
               
               
                   &lt;ptype name=“Initiator” value=“string”&gt; 
               
               
                     &lt;description&gt;A string identifying the initiator. Can be a user name, 
               
               
                 a system component or a condition name.&lt;/description&gt; 
               
               
                   &lt;/ptype&gt; 
               
               
                   &lt;ptype name=“InitiatorType” value=“string”&gt; 
               
               
                     &lt;description&gt;Type of the Initiator. Can be SYS, USR or 
               
               
                 COND.&lt;/description&gt; 
               
               
                   &lt;/ptype&gt; 
               
               
                    &lt;ptype name=“ConditionKeyString” value=“string”&gt; 
               
               
                     &lt;description&gt;If the Initiator is a Condition, this string identifies the 
               
               
                 Condition instance within the Condition.&lt;/description&gt; 
               
               
                    &lt;/ptype&gt; 
               
               
                    &lt;property name=“Tid” /&gt; 
               
               
                    &lt;property name=“RefCounter” /&gt; 
               
               
                    &lt;property name=“Description” /&gt; 
               
               
                    &lt;property name=“Timestamp” /&gt; 
               
               
                    &lt;property name=“Initiator” /&gt; 
               
               
                    &lt;property name=“InitiatorType” /&gt; 
               
               
                    &lt;property name=“ConditionKeyString” card=“zeromore” /&gt; 
               
               
                   &lt;property name=“Explanation” card=“zeroone” /&gt; 
               
               
                 &lt;/object&gt; 
               
               
                 Structure of the Condition Object: 
               
               
                 &lt;object name=“Condition”&gt; 
               
               
                   &lt;description&gt;Includes information about the triggered 
               
               
                 condition&lt;/description&gt; 
               
               
                    &lt;ptype name=“condKey” kind=“key” link=“KeyTransaction” value=“integer” 
               
               
                 &gt; 
               
               
                      &lt;description&gt;A unique condition Identifier.&lt;/description&gt; 
               
               
                    &lt;/ptype&gt; 
               
               
                    &lt;ptype name=“condName” value=“string”&gt; 
               
               
                     &lt;description&gt;The name of the condition.&lt;/description&gt; 
               
               
                   &lt;/ptype&gt; 
               
               
                    &lt;ptype name=“parameters” value=“list”&gt; 
               
               
                      &lt;description&gt;List of values for the condition 
               
               
                 parameters.&lt;/description&gt; 
               
               
                    &lt;/ptype&gt; 
               
               
                   &lt;ptype name=“derivations” value=“list”&gt; 
               
               
                     &lt;description&gt;List of derivations.&lt;/description&gt; 
               
               
                   &lt;/ptype&gt; 
               
               
                   &lt;property name=“condKey” /&gt; 
               
               
                    &lt;property name=“condName” card=“zeroone” /&gt; 
               
               
                    &lt;property name=“parameters” /&gt; 
               
               
                    &lt;property name=“derivations” /&gt; 
               
               
                 &lt;/object&gt; 
               
               
                 Structure of the Derivation Object: 
               
               
                 &lt;object name=“derivation”&gt; 
               
               
                   &lt;description&gt;Includes information about the derivation from a 
               
               
                 condition&lt;/description&gt; 
               
               
                    &lt;ptype name=“derivationKey” kind=“key” link=“condKey” value=“integer” &gt; 
               
               
                     &lt;description&gt;A unique derivation Identifier.&lt;/description&gt; 
               
               
                    &lt;/ptype&gt; 
               
               
                    &lt;ptype name=“ruleName” value=“string”&gt; 
               
               
                      &lt;description&gt;The name of the rule that was 
               
               
                 triggered.&lt;/description&gt; 
               
               
                    &lt;/ptype&gt; 
               
               
                    &lt;ptype name=“pidValues” value=“list”&gt; 
               
               
                    &lt;description&gt;List of property ids and their respective 
               
               
                 values.&lt;/description&gt; 
               
               
                   &lt;/ptype&gt; 
               
               
                    &lt;property name=“derivationKey” /&gt; 
               
               
                     &lt;property name=“ruleName” /&gt; 
               
               
                    &lt;property name=“pidValues” /&gt; 
               
               
                 &lt;/object&gt; 
               
               
                   
               
             
          
         
       
     
     The linked data structures permit user to back track from an event to the causes of the event. For example, assume that a user wants to know why “c” is in its current state. The system allows the user to select “c,” and then provides a set of derivations each listing the rule names and the values which ultimately cause the current condition “c” to occur. Each of these explanations can then be converted into any natural language of the user&#39;s choosing, to provide an easy to understand explanation of the series of events that lead to “c” being its current value. 
     Consider a more complex example wherein a user requests a shutdown of one of two computers interconnected to each other in a single system. Before the software shuts down the computer, the system needs to move any outstanding/current operations to the other interconnected computer which will continue to run the application. After all the operations are migrated to the remaining computer, then the first computer can be shut down. A simplified view of what information will be populated in such a table is: 
     
       
         
               
               
               
               
             
           
               
                   
               
               
                 ID 
                 Property Changed To: 
                 Function/rule 
                 Parent ID 
               
               
                   
               
             
             
               
                 0 
                 ShutdownRequest (false-&gt; true) 
                 User Request 
                 null 
               
               
                 1 
                 Operating On (1 -&gt; 2) 
                 changeOperation 
                 0 
               
               
                   
               
             
          
         
       
     
     At any point in time the user can ask why the operating system is running on computer (2). The property that holds that information is “OperatingOn”; that is, what computer is the system operating on. The function or rule that caused the system to be operating on computer 2 was changeOperation from (1) to (2) on the date/time stored with the property. The function changeOperation can then be translated into a natural language equivalent in layman terms in any language. 
     If the user then asks why the operation was changed, the first check will be to determine if that property has a parent ID. In this case the parent ID is “0” and the property with ID 0 investigated. ID 0 property indicates there was a shutdown requested by a user on date/time. The user can continue to ask why there was a shutdown requested. The shutdown property indicates it was due to a user request on the specified date/time. Because the parent ID is a null, there is no further backtracking possible. Note that the user can query any parameter in the flow without having to start from the beginning and still reach the same conclusions. It is worth noting that a single operation can point back to multiple parent IDs. 
     Although a rule-based system is one type of platform under which the invention can be implemented, it is not the only type of system that can be used. In one embodiment, a standard non-rule-driven relational based database is used to develop such a log system. Today, relational databases are more prevalent compared to rule-driven parallel systems. A key difference is how the information is stored so as to take advantage of the explanation techniques. Specifically every update must be tracked and meta-data entered as to why the update was performed. That is, a mechanism is needed to generate the appropriate explanation for each update at any point in time. An update, in addition, can cause multiple updates with multiple explanations. This update data can be stored in an updates table. The updates table also points to a Transaction ID which provides information as to why the update occurred and what transaction is responsible for the update. Thus, although not as directly implemented as in a rule-based system, a relational database implementation of the invention is possible. 
     An example of how the current invention compares to traditional log files is now considered. Assume there is a rule that states if a=1 and b=2, then c=3. Also assume that the following events have occurred:
         On Oct. 23, 2007 at 10:33 am “a” was set to 1.   On Oct. 29, 2007 at 4:22 am “b” was set to 2.   Immediately afterwards: “c” was set to “3.”       

     A user attempting to use “log” files to analyze all the variable changes and determine why c is set to “3” would need to review 6 days of log files (between the setting of “c” on Oct. 29, 2007 and the setting of “a” on Oct. 23, 2007. However, with the present invention however, the change in “c” may be determined simply by querying why the state of “c” is “3.” Note that if “a” and “b” were computed variables based on other variables and so on, there might be multiple levels of computations before “a” became “1” or “b” became “2.” 
     It is important to remember that unlike conventional log files, the fact that “c” became “3” on Oct. 29, 2007 when “b” became “2” after “a” became “1” on Oct. 23, 2007 was not known prior to the query. It was simply generated from the rules once the query “Why is “C” set to “3” is asked. 
     EXAMPLE 
     Consider the following example in which multiple rules are triggered. Assume that two nodes (Nodes N1 and N2) are connected together making a single processing system referred to as the Unit. A virtual machine is created as part of the single processing system running on Node N1. At some time, (for example day 6) the virtual machine on Node N1 is determined to be not running and the operator wants to know why. Assume that the following five rules exist: 
     Available Rules: 
     
         
         Rule 1: 
       
    
     if a sensor on a node becomes critical
         then node is predicted to fail       Rule 2:   

     if a disk on a node fails
         then node is predicated to fail       Rule 3:   

     if a single node is predicted to fail
         then migrate any virtual machines on that node to the other       Rule 4:   

     if both nodes are predicted to fail
         then the Unit is predicted to fail       Rule 5:   

     if a virtual machine is running and the Unit is predicted to fail
         then shutdown the virtual machine       

     Let us assume the following timeline and resulting rules being fired:
     Day 1: A disk fails on Node N1 causing RULE 2 to trigger and Node N1 is flagged as “Predicted to Fail”. As a result RULE 3 triggers and the virtual machine migrates from Node N1 to Node N2.   Day 5: Node N2 has a temperature sensor that registers a critical temperature value and RULE 1 to trigger and Node N2 is flagged as “Predicted to Fail”. As a result RULE 4 triggers causing RULE 5 to trigger. As a result of RULE 5 triggering the virtual machine now on Node N2 is shutdown.   Day 6: At this point an operator notices that the virtual machine is not running and queries the system: “Why is the Virtual Machine State Shutdown?”   The system then replies: “Based on Rule 5: The Unit was predicted to fail”   The operator can keep interrogating the system: “Why?”   The system replies: “Based on Rule 4: Both Nodes were predicted to fail”   Again the operator asks “Why?”   The system then replies: “Based on Rule 1: N2 had a critical temperature sensor value. Based on Rule 2: N1 had a disk fail”   

     Therefore, the operator knows that the disk on N1 failed or was about to fail and that Node N2 had a critical temperature value and was about to fail. Because both nodes of the Unit failed or were about to fail, the virtual machine was shutdown. Thus, a query can be made and the explanations provided to the operator. Note that in this case, this method of tracing through the rules tree avoids having the user dig deeply into log files that span ˜4 days. Since 4 days of log files contain huge amount of many other unrelated data that the operator does not need, the system equivalently filters the unnecessary material out. 
     While the present invention has been described in terms of certain exemplary preferred embodiments, it will be readily understood and appreciated by one of ordinary skill in the art that it is not so limited, and that many additions, deletions and modifications to the preferred embodiments may be made within the scope of the invention as hereinafter claimed. Accordingly, the scope of the invention is limited only by the scope of the appended claims.