SYSTEM AND METHOD FOR PREDICTING COMPLEX EVENTS
Patent Information
- Application Number
- DE602020042423
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-08-14
- Publication Date
- 2024-12-04
- Estimated Expiration
- 2040-08-14
AI Technical Summary
Current complex event forecasting systems lack the capability to accurately predict the occurrence of complex events in real-time data streams with low latency, as they rely on predefined patterns and do not effectively handle the temporal aspect of event forecasting.
A method utilizing a probabilistic model constructed from a received pattern and a variable-order Markov model, combined with a deterministic symbolic finite automaton, to forecast the occurrence of complex events in a stream of events, providing guaranteed precision and adaptability to changing event patterns.
This approach enhances forecasting accuracy and reduces computational resources by dynamically adapting to meaningful dependencies in the event stream, enabling efficient and accurate prediction of complex events before they are detected, with improved throughput and minimal user intervention.
Description
TECHNICAL FIELD
[0001] The present invention relates to complex event forecasting. More particular, it relates to a method and a system which allow a user to define a pattern for a complex event and then construct a probabilistic model for it in order to forecast, while consuming a stream of events, if and when a complex event is expected to occur.BACKGROUND
[0002] The avalanche of real-time data in the last decade has sparked an interest in fields focused on processing high-velocity data streams. Complex Event Recognition (CER) is one of these fields which have enjoyed increased popularity. The main goal of a CER system is to detect interesting activity patterns occurring within a real-time stream of events, coming, e.g., from sensors or other devices.
[0003] The input to a CER system comprises two main components: a stream of events, also called simple events (SEs), and a set of patterns that define relations among the SEs and must be detected upon the input stream. Instances of pattern satisfaction are called complex events (CEs). The output of the CER system is another stream, composed of the detected CEs. It is typically required that CEs must be detected with very low latency, which, in certain cases, may even be in the order of a few milliseconds.
[0004] For example, a CER system can receive an input stream consisting of events emitted from vessels sailing at sea. The events may contain information regarding the status of the vessel. An analyst may be interested to detect several activity patterns for monitored vessels, such as sudden changes in the kinematic behavior of a vessel (e.g., sudden accelerations), sailing in restricted areas, etc. Respective patterns are first defined and then used by a computational model applied on the stream of events to detect CEs.
[0005] In many situations it is however not sufficient to detect CEs based on predefined patterns. Often it is necessary to forecast if and when a complex event might occur in a real-time stream of events, while consuming the stream and before such an occurrence is actually (or can be) detected by a CER system. It is therefore desired to endow complex event processing systems with forecasting capabilities.
[0006] There are multiple ways to define the task of "forecasting" over time-evolving data streams. The terms "forecasting" and "prediction" are often used interchangeably as equivalent terms. For reasons of clarity, the term "forecasting" is used in the present document, since there does exist a conceptual difference between forecasting and prediction, as the latter term is understood in machine learning. In machine learning, the goal is to "predict" the output of a function on previously unseen input data. The input data need not necessarily have a temporal dimension and the term "prediction" refers to the output of the learned function on a new data point. For this reason the term "prediction" is avoided in the present document. Instead, the term "forecasting" or "forecast" is chosen to define the task of predicting the temporally future output of some function or the occurrence of an event. Time is thus a crucial component for forecasting. Moreover, an important challenge stems from the fact that, from the (current) time point where a forecast is produced until the (future) time point for which a forecast is made, no data is available. A forecasting system must (implicitly or explicitly) fill in this data gap in order to produce a forecast, whereas in a typical machine learning task a prediction can be made using all available data that refer to the target point of the prediction.
[0007] Some systems and methods for forecasting future behavior of event streams are known in the art. For example, European Patent No. 2 560 106 relates to forecasting the future behavior of event streams in complex event processing environments. While events stream in, new forecasts are automatically computed with respect to a continuously or discontinuously moving time window. The forecast may then estimate on the basis of the movable window the future values and the time they will occur. The forecasting framework may be flexibly defined and parameterized to allow for a tailored adaptation in certain implementations.
[0008] Further, the scientific paper "Event Forecasting with Pattern Markov Chains" by Elias Alevizos et al. relates to event forecasting with Pattern Markov Chains. The described system consumes streams of events and forecasts when a pattern - given in the form of a regular expression - is expected to be fully matched. As more events are consumed, the system revises its forecast to reflect possible changes in the state of the pattern. The framework of Pattern Markov Chains is used to learn a probabilistic model for the pattern, with which forecasts with guaranteed precision may be produced, in the form of intervals within which a full match is expected.
[0009] The scientific paper "Symbolic Automata with Memory: a Computational Model for Complex Event Processing" by Elias Alevizos et al. describes an automaton model which is a combination of symbolic and register automata, i.e., a symbolic automata is enriched with memory. The automata are called Register Match Automata (RMA). RMA extend the expressive power of symbolic automata, by allowing Boolean formulas to be applied not only to the last element read from an input string, but to multiple elements, stored in their registers. RMA also extend register automata, by allowing arbitrary Boolean formulas, besides equality predicates.
[0010] It is desirable to provide an improved implementation for a complex event forecasting system which allows forecasting with high accuracy and / or low latency if and when a complex event will probably occur in a stream of events, before the event is actually detected.SUMMARY
[0011] The invention is defined in the appended independent claims. Particular embodiments are set out in the dependent claims.
[0012] In particular, the present invention provides a method for forecasting complex events (CE) in a complex event forecasting (CEF) system. A pattern defining a complex event is received or obtained. The pattern may define the complex event in a declarative manner. Further, an event stream including a plurality of events is received or obtained. A forecast of the complex event is based upon the received event stream. A probabilistic model is then constructed in order to forecast if and when a complex event is expected to occur in the event stream. An automaton derived from the received pattern and a variable-order Markov model are employed for constructing the probabilistic model and / or are part of the probabilistic model. Based on the received event stream, a complex event is then forecasted by means of the probabilistic model. The forecasted complex event satisfies the received pattern (i.e., it fully matches the received pattern). The result of the forecast is output with a guaranteed precision, in the form of intervals within which the complex event is expected.
[0013] The pattern may define relations among one, two, three or more events included in the event stream and / or may define the complex event in a declarative manner (i.e., by a declarative language). Complex events may refer to correlations between one or more events of the plurality of events in the event stream. For example, complex events in the event stream as defined by the pattern represent situations of particular interest in the event stream (e.g., interesting activity patterns).
[0014] The method may consume the event stream. Events of the event stream may be received in the form of a plurality of tuples. Each tuple includes one or more numerical and / or categorical values. Further, the event stream may be a continuous or time-evolving event stream. Additionally or alternatively, the event stream may have a temporal dimension. For example, the event stream may be a constantly updated event stream 5 which has the form of an infinite sequence S = t 1 , t 2 , ..., where each t i is a tuple. The goal of the method thus is to report the index i at which a CE matching the received pattern is expected.
[0015] The probabilistic model for forecasting the complex event comprises the automaton and the variable-order Markov model. The method also converts the received pattern to the automaton. Certain features may then be extracted from the automaton. Further, the variable-order Markov model is generated to encode statistical properties of at least a portion of the received event stream. The variable-order Markov model is then combined with the automaton in a way that makes it possible to derive a probabilistic description of the combined automaton. The probabilistic description is used to derive the actual forecast. The combined automaton thus represents a computational model for determining complex events.
[0016] Variable-order Markov models are Markov models whose order (i.e., how deep into the past they can look for dependencies) can be increased beyond what is possible with full-order Markov models. Variable-order Markov models can do this by avoiding a full enumeration of every possible dependency and focusing only on "meaningful" dependencies.
[0017] Let Σ denote an alphabet, σ E Σ a symbol from that alphabet and s 6 Σ m< a string from that alphabet of length m. For full-order Markov models, the predictor P̂ is derived through learning conditional distributions P̂(σ | s), where m is constant and equal to the assumed order of the Markov model. Variable-order Markov models (VMMs), on the other hand, learn such conditional distributions by relaxing the assumption of m being fixed. The length of the context s (as it is often called) may vary, up to a maximum order m max , according to the statistics of the training dataset. By looking deeper into the past only when it is statistically meaningful, VMMs can capture both short- and long-term dependencies.
[0018] As mentioned above, the complex event is forecast based on the probabilistic model. That means that the method forecasts, while consuming the event stream, if and when a complex event is expected to occur before the complex event is received as part of the received event stream and before it actually occurs in the event stream. It is clear that the method forecasts possible complex events in the event stream only with a certain certainty, but cannot guarantee the occurrence of the complex event in the event stream.
[0019] As a result, the method thus forecasts if and when a complex event, defined through the received pattern, will possibly occur in the event stream before it is actually detectable by a CER system.
[0020] The steps of the method may be performed by the CEF system.
[0021] The described method has numerous advantages over previous approaches.
[0022] By using a variable-order Markov model as part of the probabilistic model, the method offers higher quality forecast capabilities. In particular, variable-order Markov models have the advantage that they can look deeper into the past in order to uncover longer probabilistic dependencies in the event stream that affect the probability of encountering a complex event in the future. This allows providing a forecast with a higher accuracy (i.e., higher Matthews correlation coefficient scores or higher AUC (area under curve) for ROC curves). Moreover, no fixed-length window of past data must be maintained. The length of the context / window of past data is dynamically adapted.
[0023] At the same time, a variable-order Markov model only retains those states that are "informative" enough. The variable-order Markov model automatically learns which features are the most informative and must be included in the probabilistic model. Compared to a full order Markov model, the number of states is therefore reduced so that necessary computational resources for forecasting complex events are minimized or at least reduced compared to a full order Markov model.
[0024] The described method also has the advantage that multiple types of forecasting tasks can be performed in a highly efficient manner (i.e., higher throughput by processing more events per second).
[0025] Consequently, even in cases in which the accuracy of the method with the variable-order Markov model is comparable to that of a full-order Markov model, the method with the variable-order Markov model typically has better training times and throughput performance (when used in a streaming setting).
[0026] The described method also requires minimal intervention by the user. A given pattern is defined and the pattern is subsequently automatically translated to an automaton and used in combination with the Markov model. Thus, the described method is able to seamlessly construct a probabilistic model from a given (declaratively defined) complex event pattern, without requiring extensive domain knowledge. The method is thus versatile, highly adaptable, and can be applied in many different areas.
[0027] The automaton derived from the received pattern is a deterministic symbolic finite automaton (DSFA) and / or the received pattern is defined by a symbolic regular expression (SRE) and is convertible to a deterministic symbolic finite automaton.
[0028] The main idea behind symbolic automata is that each transition, instead of being labeled with a symbol from an alphabet, is equipped with a unary formula from an effective Boolean algebra. A symbolic automaton can then read strings of elements and, upon reading an element while in a given state, can apply predicates of this state's outgoing transitions to that element. The transitions whose predicates evaluate to TRUE are said to be "enabled" and the automaton moves to their target states.
[0029] As with classic regular expressions and automata, every symbolic regular expression can be translated to an equivalent symbolic finite automaton (i.e., to a symbolic finite automaton with the same language ). That means that for every symbolic regular expression R there exists a symbolic finite automaton M such that (R) = (M).
[0030] An effective Boolean algebra is a tuple D , Ψ , 〚 _ 〛 , ⊥ , ⊤ , ∨ , ∧ , where is a set of domain elements; Ψ is a set of predicates closed under the Boolean connectives; 1,T E Ψ; the component [_]] : Ψ -> is a denotation function such that 〚 ⊥ 〛 = ∅ ,, 〚 ⊤ 〛 = D ,, and ∀φ, ψ ∈ Ψ: 〚 ϕ ∨ ψ 〛 = 〚 ϕ 〛 ∪ 〚 ψ 〛 〚 ϕ ∧ ψ 〛 = 〚 ϕ 〛 ∩ 〚 ψ 〛 〚 ¬ ϕ 〛 = D ∖ 〚 ϕ 〛 It is also required that checking satisfiability of Φ, i.e., whether 〚ϕ〛≠∅, is decidable and that the operations of V, Λ, and ¬ are effectively computable.
[0031] For Boolean algebras, elements of D are called "characters" and finite sequences of characters are called "strings". A set of strings constructed from the elements of ( ⊆ , where * denotes Kleene-star) is called a "language over D".
[0032] As with classical regular expressions, symbolic regular expressions can be used to represent a class of languages over D.
[0033] A symbolic regular expression over an effective Boolean algebra (D, Ψ, 〚 _ 〛, 1 , T, V, Λ, ¬) is recursively defined as follows: The constants ε and Ø are symbolic regular expressions with (ε) = {ε} and (Ø) = {Ø). If ψ ∈ Ψ, then R := ψ is a symbolic regular expression with L ψ = 〚 ψ 〛 , i.e., the language of ψ is the subset of for which ψ evaluates to TRUE. If R 1 and R 2 are symbolic regular expressions, then R := R 1 + R 2 is also a symbolic regular expression, with (R) = (R 1 ) ∪ (R 2 ). If R 1 and R 2 are symbolic regular expressions, then R := R 1 · R 2 is also a symbolic regular expression, with (R) = (R 1 ) · (R 2 ), where · denotes concatenation. (R) is then the set of all strings constructed from concatenating each element of (R 1 ) with each element of (R 2 ). If R is a symbolic regular expression, then R' := R* is a symbolic regular expression, with L(R*) = (L(R))*, where L* = U i≥0 L i< and L i< is the concatenation of L with itself i times.
[0034] Given a Boolean algebra, symbolic automata can be defined. The definition for a symbolic finite automaton is a tuple M = (, Q, q s< , F, Δ), where is an effective Boolean algebra; Q is a finite set of states; q s< E Q is the initial state; Q f< ⊆ Q is the set of final states; Δ ⊆ Q × × Q is a finite set of transitions. A string w = a1a2a ... a k is accepted by a symbolic finite automaton M if, and only if, for 1 ≤ i ≤ k, there exist transitions qi−1→aiqi such that q0 = q s< and q k E Q f< . The set of strings accepted by M is the language of M, denoted by (M).
[0035] The advantage of symbolic expressions and automata is that, contrary to other automata-based CER models, symbolic expressions and automata have closure properties and clear, compositional semantics.
[0036] In some embodiments, the symbolic regular expression is a streaming regular expression (sSRE) and / or the symbolic finite automaton is a streaming finite symbolic automaton (sSFA).
[0037] The method may process continuously updated streams of events and detect instances of symbolic regular expression satisfaction as soon as they appear in the streams. In order to accommodate this scenario, the symbolic regular expression and the symbolic finite automaton may work in a streaming setting. For example, the automaton of a (classical) regular expression a · a would accept only the string a, b. In a streaming setting, it is however necessary that an automaton reports a match every time this string appears in a stream. For the stream a, b, c, a, b, c, it thus is expected that two matches would be reported, one after the second symbol and one after the firth.
[0038] In this scenario, events come in the form of tuples with both numerical and categorical values. As discussed above, the stream S then has the form of an infinite sequence S = t 1 , t 2 , ..., where each t i is a tuple (t i 6 ) and the method reports the indexes i at which a CE is detected. More precisely, if S 1..k = ..., t k-1 , t k is the prefix of 5 up to the index k, an instance of a SRE R is detect at k if, and only if, there exists a suffix S m..k of S 1..k such that S m..k E (R). In order to detect CEs of a SRE R on a stream, a streaming version of SRE and SFA is used.
[0039] If R is a SRE, then R S = T * · R is called the streaming SRE (sSRE) corresponding to SRE corresponding to R. A symbolic finite automaton M RS constructed from R S is called a streaming SFA (sSFA) corresponding to R.
[0040] Using the streaming SRE R S CEs of R can be detected while consuming a stream S, since a stream segment S m..k is recognized by R if, and only if, the prefix S 1..k is recognized by R S . The prefix T* allows skipping any number of events from the stream and start recognition at any index m, 1 ≤ m ≤ k. That means that if S = t 1 , t 2 , ... is a stream of domain elements from an effective Boolean algebra = D , Ψ , 〚 _ 〛 , ⊥ , ⊤ , ∨ , ∧ , (t i ∈ ) and R is a symbolic regular expression over the same algebra, then, for every S m..k , S m..k E (R) if, and only if, S 1..k E (R s ) (and S 1..k ∈ (M Rs )).
[0041] As an example, if R := (speed < 5) · (speed > 20) is the pattern for sudden accelerations, then its sSRE would be R': = τ*· (speed < 5) · (speed > 20).
[0042] The streaming behavior of a sSFA as it consumes a stream 5 can be described through the notation of configuration. Assume S = t 1 , t 2 , ... is a stream of domain elements from an effective Boolean algebra, R is a symbolic regular expression over the same algebra and M Rs a sSFA corresponding to R. A configuration c of M Rs is a tuple [i, q], where i is the current position of the stream (i.e., the index of the next event to be consumed) and q the current state of M Rs . Under these assumptions, c' = [i', q'] is a successor of c if, and only if, ∃δ E M Rs . Δ: δ = q , ψ , q ′ ∧ t i ∈ 〚 ψ 〛 ∨ ψ = ϵ ; and i = i' if δ = ε. Otherwise, i' = i + 1. A succession is denoted by i q → δ i ′ , q ′ .
[0043] For the initial configuration c s< , before consuming any events, i = 1 and c s< .q = M Rs . q s< , i.e., the state of the first configuration is the initial state of M Rs . In other words, for every index i, we move from our current state q to another state q' if there is an outgoing transition from q to q' and the predicate on this transition evaluates to TRUE for t i . Then, the reading position is increased by 1. Alternatively, if the transition is an ε-transition, the reading position is moved to q' without increasing the reading position.
[0044] The actual behavior of a sSFA upon reading a stream is captured by the notion of the run. A run of a sSFA M over a stream S 1..k is a sequence of successor configurations 1 , q 1 = M . q S → δ 1 2 , q 2 → δ 2 … → δ k k + 1 , q k + 1 . A run is called accepting if, and only if, q k+1 E M. Q f< .
[0045] It is easy to see that a run of a sSFA M Rs , over a stream S 1..k is accepting if, and only if, S 1..k ∈ (R s ), since M Rs , after reading S 1..k must have reached a final state. Therefore, for a sSFA that consumes a stream, the existence of an accepting run with configuration k + 1 implies that a CE for the SRE R has been detected at the stream index k.
[0046] In some embodiments, a prediction suffix tree (PST) is used as the variable-order Markov model. The predication suffix tree encodes statistical properties of at least a portion of the received event stream which acts as a training dataset.
[0047] The prediction suffix tree may be used to learn the probabilistic model from the received event stream. Prediction suffix trees have the advantage that after they are learned, they can be readily converted to a probabilistic automaton, which can then be combined with a symbolic automaton. More precisely, a probabilistic suffix automaton (PSA) is learnt, whose states correspond to contexts of variable length and the outgoing transitions from each state encode the conditional distribution of seeing a symbol given the context of that state.
[0048] The definition for a prediction suffix tree is as follows: Let Σ be an alphabet. A PST T over Σ is a tree whose edges are labeled by symbols σ E Σ and each internal node has exactly one edge for every σ E Σ (hence, the degree is |Σ|). Each node is labeled by a pair (s; γ s ), where s is the string associated with the walk starting from that node and ending in the root, and γ s : Σ -> [0,1] is the next symbol probability function related with s. For every string s labeling a node, Σ σ∈Σ γ s (σ) = 1.
[0049] The definition for a probabilistic suffix automaton (PSA) is the following: A probabilistic suffix automaton M is a tuple (Q, Σ, τ, γ, π), where: Q is a finite set of states; Σ is a finite alphabet; τ: Q × Σ -> Q is the transition function; γ: Q × Σ -> [0,1] is the next symbol probability function; and π: Q -> [0,1] is the initial probability distribution over the starting states. The following conditions must hold: For every q E Q, it must hold that Σ σ∈Σ γ (q, σ) = 1 and Σ q∈Q π (q) = 1. Each q E Q is labeled by a string s E Σ* and the set of labels is suffix free, i.e., no label s is a suffix of another label s'. For every two states q 1 , q 2 ∈ Q and for every symbol σ E Σ, if τ(q 1 , σ) = q 2 and q 1 is labeled by s 1 , then q 2 is labeled by s 2 , such that s 2 is a suffix of s 1 · σ. For every s labeling some state q, and every symbol σ for which γ(q, σ) > 0, there exists a label which is a suffix of s · σ. The graph of M is strongly connected.
[0050] A PSA does not act as an acceptor (i.e., there are no final states), but may act as a generator of strings. It can use π, its initial distribution on states, to select an initial state and generate its label as a first string and then continuously use γ to generate a symbol, move to a next state and repeat the same process. At every time, the label of its state is always a suffix of the string generated thus far. It is also clear that a PSA is a Markov chain as well. τ and γ can be combined into a single function, ignoring the symbols, and this function, together with the first condition, would define a transition matrix of a Markov chain. The last condition about M being strongly connected also ensures that the Markov chain is composed of a single recurrent class of states.
[0051] A PSA may also be used to read a string or stream of symbols. In this mode, the state of the PSA at every moment corresponds again to a suffix of the stream and the PSA can be used to calculate the probability of seeing any given string in the future, given the label of its current state. It is intended to use this derived PSA to process streams of symbols, so that, while consuming a stream S 1..k , it is known what its meaningful suffix are and use that suffix for any inferences.
[0052] A PST whose leaves are all of equal depth m corresponds to a full-order Markov model of order m, as its paths from the root to the leaves correspond to every possible context of length m. The goal is therefore to incrementally learn a PST T̂ by adding new nodes only when it is necessary and then use T̂ to construct a PSA M̂ that would be close enough to the actual PSA M that has generated the training data. For example, a learning algorithm may start with a tree having only a single node, corresponding to the empty string ε. Then, it decides whether to add a new context / node s by checking two conditions that must hold: there must exist σ E Σ such that P̂(σ | s) > θ 1 must hold, i.e., σ must appear "often enough" after s; P^σ|sP^σ|suffixs>θ2 must hold, i.e., it is "meaningful enough" to expand to s because there is a significant difference in the conditional probability of σ given s with respect to the same probability given the shorter context suffix(s).
[0053] The thresholds θ 1 and θ 2 depend, among others, on an approximation parameter ε, meaning how close the estimated PSA M̂ should be compared to M, on n, denoting the maximum number of states that we allow M̂ to have and on m max , denoting the maximum order / length of the dependencies to be captured. After a PST T̂ has been learned, it is converted to a PSA M̂ as described above.
[0054] The prediction suffix tree is a preferred example for a variable-order Markov model. Alternative examples for Markov models of variable order may be prediction by partial matching (PPM) or context tree weighting (CTW).
[0055] The pattern is received in a form of a symbolic regular expression (SRE) or the received pattern is convertible into a SRE. In these cases, the construction of the probabilistic model comprises the steps of: constructing a streaming finite symbolic automaton (sSFA) based on and / or equivalent to the SRE as described above; constructing a deterministic symbolic finite automaton (DSFA) based on and / or equivalent to the streaming finite symbolic automaton; using minterms of the DSFA and at least a portion of the received event stream as training dataset to learn a probabilistic suffix automaton (PSA), the PSA encoding statistical properties of the portion of the received event stream; and combining the DSFA with the PSA into a single automaton embedding the DSFA and the PSA.
[0056] That means, initially a SRE R and a training stream 5 (e.g., as part of the event stream) is received. The SRE R is first used to construct an equivalent sSFA. This sSFA is then determinized into a DSFA M R . M R can be used to perform recognition on any given stream, but cannot be used for any probabilistic inferences. The next step is therefore to use the minterms of M R (acting as "symbols") and the training stream 5 to learn a PSA M S which encodes the statistical properties of S, but has no knowledge of the structure of R (it only knows its minterms). PSA M S is not an acceptor and cannot be used for recognition. At this point, there are two different automata, M R for recognition, and M S , describing the properties of the training dataset. M R and M S then may be combined into a single automaton M that has the power of both M R and M S and can be used both for recognition and for inferring, according to the properties of S, when a CE of R will be detected. In other words, M is the embedding of M S in M R .
[0057] The definition of a DSFA is similar to that for classic deterministic automata. A SFA M is deterministic if, for all transitions (q, ψ 1 , q 1 ), (q, ψ 2 , q 2 ) ∈ M. Δ, if q 1 ≠ q 2 then 〚 ψ 1 ∧ ψ 2 〛 = ∅. That means that for every state and every tuple / character, the deterministic SFA can move to at most one next state upon reading that tuple / character. Since two predicates may be different, but still evaluate to TRUE for the same tuple, it is important that the definition for a DSFA also takes this into account.
[0058] Using this definition for a DSFA it can be shown that SFAs are indeed closed under determinization. The determinization process first needs to create the minterms of the predicates of a SFA M (i.e., the set of maximal satisfiable Boolean combinations of such predicates), denoted by Minterms(Predicates(M S )), and then use these minterms as guards for the DSFA.
[0059] There are two factors that can lead to a combinatorial explosion of the number of states of the resulting DSFA: first, the fact that the powerset of the states of the original SFA must be constructed (similarly to classical automata); second, the fact that the number of minterms (and, thus, outgoing transitions from each DSFA state) is an exponential function of the number of the original SFA predicates. In order to mitigate this doubly exponential cost, two optimization techniques may be used. Instead of constructing the powerset of states of the SFA and then adding transitions, the states of the DSFA are constructed incrementally, starting from its initial state, without adding states that will be inaccessible in the final DSFA. Further, the number of minterms may be reduced by taking advantage of some previous knowledge about some of the predicates. In cases where it is known that some of the predicates are mutually exclusive, i.e., at most one of them can evaluate to TRUE, then some minterms can be discarded and some others can be simplified.
[0060] A DSFA always has an equivalent (through an isomorphism) deterministic classical automaton. Minterms(Predicates(M)) induces a finite set of equivalence classes on the (possibly infinite) set of domain elements of M. For example, if Predicates(M) = {ψ 1 , ψ 2 }, then Minterms(Predicates(M)) = {ψ 1 ∧ ψ 2 , ψ 1 ∧ ¬ψ 2 ¬ψ 1 ∧ ψ 2 , ¬ψ 1 ∧ ¬ψ 2 } and each domain element, which is a tuple, can be mapped to exactly one of these 4 minterms: the one that evaluates to TRUE when applied to the element. Similarly, the set of minterms induces a set of equivalence classes on the set strings (i.e., event streams). For example, if S = t 1 , ..., t k is an event stream, then it could be mapped to S' = α,..., b, with a corresponding to ψ 1 Λ ¬ψ 2 if ψ 1 (t 1 ) ∧ ¬ψ 2 (t 1 ) = TRUE, b to ψ 1 Λ ψ 2 , etc.
[0061] Thus, if 5 is a stream from the domain elements of the algebra of a DSFA M and T = Minterms(Predicates(M)), then S' is the stream induced by applying T on S, i.e., it is the equivalence class of S induced by T.
[0062] It can also be proven that for every deterministic symbolic automaton M S there exists a deterministic classical automaton M c such that (M c ) is the set of strings induced by applying to T = Minterms(Predicates(M)) to (M S ).
[0063] A direct consequence is that for every run → δ k k + 1 , q k + 1 followed by M S by consuming a symbolic string (stream of tuples) S, the run that M c follows by consuming the induced string S' is also → δ 2 … → δ k k + 1 , q k + 1 , i.e., it follows the same copied / renamed states and the same copied / relabeled transitions.
[0064] This direct relationship between DSFA and classical DFA allows transferring techniques developed for classical DFA to the study of DSFA. Moreover, the notation can be simplified by employing the terminology of symbols / characters and strings / words that is typical for classical automata.
[0065] In a next step, the DSFA may then be converted to a Markov chain that encodes dependencies among the events in the received event stream. For example, the Markov chain is learned from a portion of the event stream which acts as training dataset and is used to derive probabilistic forecasts about when the DSFA is expected to reach a final state or, equivalently, about when a CE defined by the pattern is expected to occur.
[0066] A straightforward approach to build a Markov chain is to map each state of the automaton to a state of a Markov chain, then feed a training stream of symbols to the automation, count the number of transitions from each state to every other state and use these counts to calculate the transition probabilities. With this approach however in the worst case the order of the states of the Markov chain (i.e., how deep into the past a state can look when calculating its transition probabilities) can be 0 for all states, thus essentially assuming that the stream is composed of independent, identically distributed events.
[0067] An alternative approach is to first set a maximum order m that is captured and then iteratively split each state of the original automaton into as many states as required so that each new state can remember the past m symbols that have led to it. The new automaton that results from this splitting process is equivalent to the original, in the sense that they recognize the same language, but can always remember the last m symbols of the stream. With this approach, it is possible to guarantee that m-order dependencies can be captured. However, higher values of m can quickly lead to an exponential growth of the number of states and the approach may be practical only for low values of m.
[0068] For these reasons, the described method uses a VMM to mitigate the high cost of increasing the order m. As a result, the maximum order m can be increased to values not possible with the previous approaches and thus capture long-term dependencies, which can lead to a better accuracy.
[0069] VMMs learn conditional distributions by relaxing the assumption of length m being fixed. The length of the context s may vary, up to a maximum order m max , according to statistics of the training data. By looking deeper into the past only when it is statistically meaningful, VMMs can capture both short- and long-term dependencies. The learning process can be broken down into three main components: counting, where it is counted how many times a symbol σ appears after a context s and derive conditional probabilities; smoothing, where symbols are taken into account that belong to the alphabet, but never appear in the training dataset; and modeling the VMM, which may follow various directions, e.g., either predetermining m max or decided by the data.
[0070] As mentioned above, the present invention may use a PST as VMM of choice which is then converted to a PSA. This PSA is then embedded into each state of the DSFA, which then allows inferring when the DSFA will reach one of its final states, taking into account at the same time the statistical properties of the stream, as encoded into the PSA.
[0071] Consequently, the PSA is embedded in the DSFA so that a single automaton that has the power of both the DSFA and the PSA and can be used both for recognition and for inferring.
[0072] The embedding of the PSA in the DSFA can be formally defined as follows: Let M R be a DSFA (its mapping to a classic automaton) and M S a PSA with the same alphabet. An embedding of M S in M R is a tuple M = (Q, Q s< , Q f< , Σ, Δ, Γ, π), where: Q is a finite set of states; Q s< ⊆ Q is the set of initial states; Q t< ⊆ Q is the set of final states; Σ is a finite alphabet; Δ: Q × Σ -> Q is the transition function; Γ: Q × Σ -> [0,1] is the next symbol probability function; π: Q -> [0,1] is the initial probability distribution.
[0073] The language (M) of M is defined, as usual, as the set of strings that lead M to a final state. The following conditions must hold: Σ = M R . Σ = M S . Σ, i.e., all automata have the same alphabet; (M) = (M R ), i.e., M is equivalent to M R by having the same language; and for every string / steam S 1.. k P M (S 1..k ) = P MS (S 1..k ), where P M denotes the probability of a string calculated by M (through Γ) and P MS the probability calculated by M S (through γ), i.e., M is equivalent to M S , since both automata return the same probability for every string.
[0074] For every DSFA M R and PSA M S learned with the minterms of M R , there exists an embedding of M S in M R that is equivalent to both M R and M S .
[0075] The statistical properties of the portion of the event stream, as encoded in the probabilistic suffix automaton PSA, are then used in order to be able to infer when the complex event of the pattern as defined by a symbolic regular expression SRE R will be detected. Equivalently, it is interesting to infer when the DSFA of R will have reached one of its final states.
[0076] The single automaton embedding the deterministic symbolic finite automaton (DSFA) and the probabilistic suffix automaton (PSA) is used to perform forecasting on the received event stream.
[0077] After constructing an embedding M from the deterministic symbolic finite automaton DSFA M R and the symbolic finite automaton PSA M S , the embedding M is used to perform forecasting on the event stream. Since the embedding M is equivalent to the deterministic symbolic finite automaton M R , it can also consume a stream and detect the same instances of the symbolic regular expression R as those of M R . The goal thus is to forecast, after every event, when M will reach one of its final states. More precisely, the number of transitions from any state M is estimated that might be in until it reaches for the first time one of its final states. Towards this goal, the theory of Markov chains can be used. Let N denote the set of non-final states of M and F the set of its final states. The transition matrix of M can be organized in the following way: Π = N N F F N F where N is the sub-matrix containing the probabilities of transitions from non-final to non-final states, F the probabilities from final to final states, F N the probabilities from final to non-final states and N F the probabilities from non-final to final states. By partitioning the states of a Markov chain in two sets, such as N and F, the probability of reaching a state in F starting from a state in N can be estimated.
[0078] If Π is the transition probability matrix of a homogeneous Markov chain Y t in the form described above and ξ init its initial state distribution, then the probability for the time index n when the system first enters the set of states F, starting from a state in N, can be obtained from: P Y n ∈ F , Y n − 1 ∉ F , … , Y 1 ∉ F | ξ init = ξ N T N n − 1 1 − N 1 where ξ N is the vector consisting of the elements of ξ init corresponding to the states of N.
[0079] In the present case, the sets N and F have the meaning of being the non-final and final states of M. The above equation gives the desired probability of reaching a final state. In this case, the probability for the time index n when the system first enters the set of states F, starting from a state in F, can be obtained from: P Y n ∈ F , Y n − 1 ∉ F , … , Y 1 ∈ F | ξ init = { ξ N T F 1 if n = 2 ξ N T F N N n − 2 I − N 1 otherwise where ξ F is the vector consisting of the elements of ξ init corresponding to the states of F.
[0080] Using the two above equations, waiting-time distributions for any state q of the automaton can be calculated, i.e., the distribution of the index n, given by a waiting-time variable W q = inf{n : Y 0 , Y 1 , ... , Y n , Y 0 = q, q ∈ Q\F, Y n ∈ F}.
[0081] The above provide a way to calculate the probability of reaching a final state, given an initial state distribution ξ init. In the present case, where an automaton moves through its various states, ξ init has a special form. As the automaton consumes a stream, it always finds itself (with certainty) in a specific state q. As a result, for each state q that the automaton might find itself in, ξ init is a vector with all of its elements being equal to 0, except for the element corresponding to the current state of the automaton, which is equal to 1.
[0082] The waiting-time distributions can be used to produce various kinds of forecasts. In a first case, a distribution is scanned in order to find the point with the highest probability and this point is returned as forecast. Alternatively, it is determined whether a CE will occur within the next w events. In this case, the probabilities of the first w points of a distribution can be summed up and if this sum exceeds a given threshold a "positive" forecast (meaning that a CE is indeed expected to occur) is emitted. Otherwise, a "negative" forecast (no CE is expected) is emitted.
[0083] In a third case, the forecast from a state q has the form of an interval whose calculation is based on the waiting-time distribution of q. The meaning of such a forecast interval I = (start, end) is the following: given the automaton is in a state q, it is forecast that the automaton, with confidence at least θ fc , will have reached its final state(s) in n transitions from now, where start ≤ n ≤ end. The confidence threshold θ fc is a parameter which may be set by a user. If multiple intervals exceeding θ fc exist, the one with the smallest spread is chosen, where spread = end - start.
[0084] Instead of continuously producing (low-quality) forecasts, the described method emits new forecasts only when it is necessary through various mechanisms. First, it may produce forecasts only when they are probable enough. Second, if it is known when a future complex event is about to happen (e.g., in testing scenarios), a distance may be fixed before the complex event and forecasts are only produced at that distance. Third, in real-word scenarios, where the occurrence of a complex event is unknown, it can be inferred how close a pattern is to its completion by analyzing its structure. Based on this analysis, it can be estimated an expected distance (or ranges of distances).
[0085] The reason for constructing an embedding, as described above, is that it is based on a variable-order Markov model and the expectation is that it will thus consist of much fewer states than a full-order Markov model. In practice, however, it has been observed that the gains from creating an embedding are not always as significant as expected. Although the number of states of an embedding may be smaller (even up to 50%), it is often still in the same order of magnitude as that of a full-order Markov model. A reduction in the number of states that can reach up to 50% might seem significant, but the fact that the order of magnitude remains the same means that such a reduction is sometimes of little use. For example, if a full-order Markov model requires 1 million states and it is thus impossible to build this model, reducing this number to 500.000 states makes no difference, since it is often still not possible to handle so many states.
[0086] One specific step in the process of creating an embedding acts as main bottleneck: the step of converting a PST to a PSA. The difference between the number of nodes of a PST and the number of states of the PSA constructed from that PST has a range that covers several orders of magnitude.
[0087] In some embodiments, the method therefore estimates the required waiting-time distributions without actually constructing the embedding, by making direct use of a prediction suffix tree. In particular, if the received pattern is received in a form of a symbolic regular expression (SRE), the method constructs a streaming finite symbolic automaton (sFSA) based on and equivalent to the SRE. A deterministic symbolic finite automaton (DSFA) is then constructed based on and equivalent to the sFSA. The method generates a prediction suffix tree (PST) as the variable-order Markov model. The PST encodes statistical properties of at least a portion of the received event stream. As events of the event stream are consumed, besides feeding them to the DSFA, they are also feed to a buffer that always holds the last m events from the event stream, where m is equal to the maximum order of the PST. After consuming an event and feeding it to the buffer, the PST is traversed according to contents of the buffer. This traversal leads to a leaf l of the PST. Thus, it is possible to estimate the probability of any future sequence of events.
[0088] If S 1. .k = ···, t k-1 , t k is the seen stream, then the next symbol probability for t k+1 can be directly retrieved from the distribution of the leaf (P(t k+1 | t k-m+1 , ... , t k )). In order to look further into the future, e.g., into t k+1 , t k+2 this process may be iterated as many times as necessary. The probability for t k+2 , (P(t k+2 | t k-m+2 , ... , t k+1 )), can again be retrieved from the probabilistic suffix tree T, by finding the leaf l' that is reached with t k+1 , ... , t k-m+2 . Thus, the probability of any future sequence of events can be found. As a result, the probability of any future sequence of states of the DSFA M R can be found, since these future event sequences are simply fed to M R and a "forward" recognition is performed with these projected events. Finally, since the probability for any future sequence of states of M R can be estimated, the definition of the waiting-time variable (W q = inf{n : Y 0 , Y 1 , ..., Y n , Y 0 = q, q ∈ Q\F, Y n ∈ F}) can be used to calculate the waiting-time distributions.
[0089] This approach thus optimizes the determination of the forecast by bypassing the construction of a PSA and can estimate forecasts directly via a PST.
[0090] In some embodiments, the output forecast comprises forecast intervals estimated from waiting-time distributions.
[0091] The waiting-time distributions are estimated in turn either from the Markov chain corresponding to the automaton or directly from a prediction suffix tree, when the above optimization is employed.
[0092] In some embodiments, the method estimates a number of occurrences of events in the received event stream by using a tree data structure, wherein each node of the tree data structure is a tuple which comprises a symbol from an alphabet of the received event stream and a counter, and wherein the counter of every node is equal to the sum of the counters of children of the node.
[0093] In order to calculate empirical probabilities of symbols given various contexts the number of occurrences of various candidate strings s in S 1..k may be counted.
[0094] The number of occurrences may be estimated by using a tree data structure which allows scanning the training dataset (i.e., a portion of the event stream) only once. This structure is called a counter suffix tree (CST). Each node in a CST is a tuple (a, c) where σ is a symbol from the alphabet (or ε only for the root node) and c a counter. The counter of every node is equal to the sum of the counters of its children. By following a path from the root to a node, we get a string s = σ 0 · σ 1 ... σ n , where σ 0 = ε corresponds to the root node and σ n to the symbol of the node that is reached. The property that we maintain as we build a CST from a stream S 1..k is that the counter of the node that is reached with s gives us the number of occurrences of the string σ n · σ n-1 ... σ 1 (the reversed version of s) in S 1 ..k .
[0095] A CST can be incrementally constructed by maintaining a buffer of size m that always holds the last m elements of S. The contents of the buffer are fed into the CST after every new element is read. The CST starts following a path according to the string provided by the buffer. For every node that already exists, its counter is incremented by 1. If a node does not exist, it is created and its counter set to 1. After the CST has read the training dataset, it can be used to retrieve the necessary counters and estimate the empirical probabilities.
[0096] In some embodiments, the method performs regression CE forecasting and / or classification CE forecasting.
[0097] The method may perform various types of forecasting tasks. For example, the method allows a) SE forecasting, where the goal is to forecast the immediately next SE or SEs in the input stream; b) regression CE forecasting, where the goal is to forecast when a CE is expected to occur; and / or c) classification CE forecasting, where the goal is to forecast whether or not a CE will occur within a predetermined future window.
[0098] In SE forecasting, the method may forecast the next simple event (SE) to appear in the input stream, given that the last m SEs are known. This task is equivalent of next symbol predication in the terminology of the compression community. The "symbols" which the method predicts are essentially the minterms of the DSFA. In other words, the method does not predict what the next SE will be, but which minterm the next SE will satisfy.
[0099] In SE forecasting, a forecast may be emitted after every SE is consumed.
[0100] In regression CE forecasting, it is forecast when a CE will occur. These forecasts are called regression CE forecasting due to the fact that the forecasts are "continuous" values in the form of forecast intervals / points. This is in contrast to classification CE forecasts, where each forecast is a binary value, indicating whether a CE will occur or not.
[0101] In regression (and classification) CE forecasting, emitting a forecast after every new SE is feasible in principle, but not very useful and can also produce results that are misleading. By their very nature, CEs are relatively rare within a stream of input SEs. As a result, if a forecast is emitted every new SE, some of these forecasts (possibly even the vast majority) will have a significant temporal distance from the CE to which they refer.
[0102] For these reasons, before forecasting CEs, the method may further comprise a preprocessing step. The goal is to find time points within a stream where it is "meaningful" to emit forecasts. These time points may be called "checkpoints" of the stream. To do so, a recognizing step is first performed on the stream to find the time points where CEs are detected. Then, a required distance d is set which defines the distance a forecast is separated from its CE, in the sense that it is required that each forecast to be emitted d events before the CE. After finding all the CEs in a stream and setting a value for d, all the SEs are set as checkpoints which occur d events before the CEs. This typically means that there are as many checkpoints as CEs for a given value d (unless the distance between two consecutive CEs is smaller than d, in which case no checkpoint for the second CE exists).
[0103] At each checkpoint, a forecast is produced as described above. However, an extra constraint may be imposed, requiring that the maximum spread of each forecast is 0, i.e., point (instead of interval) forecasts are produced. The reason for this is that some of the metrics that are used to assess the quality of the forecasts assume that forecasts are in the form of points. Such point metrics are the following: the Root Mean Squared Error (RMSE) and the Mean Absolute Error (MAE) (the latter is less sensitive than RMSE to outliers). If the set of all checkpoints is denoted by C, the actual distance (in number of events) between a checkpoint c and its CE (which is always d) is denoted by y c , and the forecast is denoted by ŷ c , than the definitions for RMSE and MAE are as follows: RMSE = 1 C ∑ c ∈ C y ^ c − y c 2 MAE = 1 C ∑ c ∈ C y ^ c − y c
[0104] Besides these points metrics, an interval metric is used, the so-called negatively oriented interval score. If ŷ c = (l c , u c ) is an interval forecast produced with confidence b = 1 - a and y c the actual observation (distance), then the negatively oriented interval score (NOIS) for this forecast is given by: NOIS c = u c − l c + 2 a l c − y c I x < l c + 2 a y c − u c I x > u c
[0105] The average negatively oriented interval score (ANOIS) is estimated as follows: ANOIS = 1 C ∑ c ∈ C NOIS c
[0106] The best possible value for ANOIS is 0 and is achieved only when all forecasts are point forecasts (so that u c - l c is always 0) and all are also correct. In every other case, a forecast is penalized if its interval is long (so that focused intervals are promoted), regardless of whether it is correct. If it is indeed correct, no other penalty is added. If it is not correct, then an extra penalty is added, which is essentially the deviation of the forecast from the actual observation, weighted by a factor that grows with the confidence of the forecast. For example, if the confidence is 100%, then b = 1.0, a = 1.0 and the extra penalty, grows to infinity. Incorrect forecasts produced with high confidence are thus severely penalized. If only point forecasts (ŷ c = l c = u c ) are emitted, then NOIS and ANOIS could be written as follows: NOIS c = 2 a y ^ c − y c ANOIS = 1 C ∑ c ∈ C 2 a y ^ c − y c
[0107] ANOIS then becomes a weighted version of MAE.
[0108] In classification CE forecasts, the goal is to predict the occurrence of CEs within a short window or provide a "negative" forecast if the method predicts that no CE is likely to occur within this window.
[0109] In regression CE forecasting, CEs provide a natural point of reference. In classification CE forecasting, such reference points do not exist, since it is required to predict the absence of CEs. As a result, instead of using the stream to find checkpoints, the structure of the automaton itself is used. Even if the actual distance to a CE is not known, the automaton can provide an "expected" or "possible" distance. For an automaton that is in a final state, it can be said that the distance to a CE is 0. More conveniently, the "process" which it describes has been completed or, equivalently, that there remains 0% of the process until completion. For an automaton that is in a non-final state but separated from a final state by a single transition, it can be said that the "expected" distance is 1. The term "expected" is used to indicate that it is not important whether the automaton will actually take the transition to a final state. When the automaton fails to take the transition to a final state (and thus there is an absence of a CE), this "expected" distance is not an actual distance, but a "possible" one that failed to materialize. Furthermore, there might also exist other walks from this non-final state to a final one whose length could be greater than 1 (in fact, there might exist walks with "infinite length", in case of loops). In order to estimate the "expected" distance of a non-final state, the shortest walk to a final state is used. After estimating the "expected" distances of all states, they can then be expressed as percentages be dividing them by the greatest among them. A 0% distance will thus refer to final states, whereas a 100% distance to the state(s) that are the most distant to a final state, i.e., the automaton has to take the most transitions to reach a final state. These are the start states. Checkpoints then can be determined by specifying the states in which the automaton is permitted to emit forecasts, according to their "expected" distance. For example, checkpoints may be established by allowing only states with a distance between 40% and 60% to emit forecasts. The intuition here is that, by increasing the allowed distance, the forecasting task is made more difficult.
[0110] The task itself comprises the following steps. At the arrival of every new input event, it is checked whether the distance of the new automaton state falls within the range of allowed distances, as explained above. If the new state is allowed to emit a forecast, we use its waiting-time distribution to produce the forecast, albeit in a manner slightly different than that described above. Two parameters are taken into account: the length of the future window w within which it is to be determined whether a CE will occur and the confidence threshold θ fc . If the probability of the first w points of the distribution exceeds the threshold θ fc , a positive forecast is emitted, essentially affirming that a CE will occur within the next w events; otherwise, a negative forecast is emitted, essentially rejecting the hypothesis that a CE will occur. The method thus provides a binary classification task.
[0111] As far as the metrics are concerned, the standard ones used in classification tasks are used, like precision and recall. Each forecast is evaluated: a) as a true positive (TP) if the forecast is positive and the CE does indeed occur within the next w events from the forecast; b) as a false positive (FP) if the forecast is positive and the CE does not occur; c) as a true negative (TN) if the forecast is negative and the CE does not occur and d) as a false negative (FN) if the forecast is negative and the CE does occur. Precision is then defined as Precision = TP TP + FP and recall (also called sensitivity or true positive rate) as Recall = TP TP + FN . As already mentioned, CEs are relatively rare in a stream. It is thus important for a forecasting engine to be as specific as possible in identifying the true negatives. For this reason, besides precision and recall, specificity (also called true negative rate) is used, defined as Specificty = TN TN + FP .
[0112] A classification experiment is performed as follows. For various values of the "expected" distance and the confidence threshold θ fc , precision, recall and specificity are estimated on a test dataset. For a given distance, θ fc acts as a cut-off parameter. This means that, for each distance, precision-recall and ROC curves are plotted, using the points obtained from the values of θ fc . For each distance, the area under curve (AUC) then can be estimated for both the precision-recall and ROC curves. The higher the AUC value, the better the model is assumed to be.
[0113] In some embodiments, the method for forecasting is distributed so that it is processible by two or more processing units (e.g., processors, processor cores, or threads).
[0114] Typically, training a variable-order Markov model is expensive and performed offline. In order to perform both the training and the actual processing in an online manner, the described method employs distribution techniques.
[0115] For example, a query-based parallelization technique is used. Each query is assigned to a different processing unit and the queries are executed in parallel. Queries are essentially patterns transformed to automata. That means that the number of patterns to forecast is equally divided to the number of available processing units. In this solution, the event stream is broadcast to all parallel instances, since all the patterns work for the same event stream.
[0116] In some embodiments, the Markov model is trained in an offline manner.
[0117] In an offline training phase, a model is first learned from stored data and then this learned model is used in an online fashion to emit forecasts. For example, the described method may use a portion of the event stream as training dataset for the Markov model. When the training is completed, the Markov model has the ability to derive probabilistic forecasts from the events of the stream as they arrived (i.e., online).
[0118] When there are multiple patterns to forecast, multiple Markov models are created - one for each pattern. One Markov model needs to train on the whole stream, then the next Markov chain on the whole stream and so on.
[0119] The Markov model is trained in an online manner.
[0120] Online training means that the model is "continuously" updated, ideally after every single input event. Such an approach is normally prohibitively expensive. The described method is however able to update the variable-order Markov model only when it is actually necessary. For example, an update of the model may be triggered when a concept drift is detected.
[0121] As a result, the forecasting and training is performed at the same time. The method consumes events as input and emits events, while at the same time it constructs / updates the model. Thus, the learned model is always up to date.
[0122] The described method may be used by domain analysts who apply methods of complex event processing to analyze data streams from different domains and need to be able to predict occurrences of complex events.
[0123] The described method is not domain-specific, but may be potentially applied to any domain where data is continuously produced in a streaming fashion and needs to be analyzed online with strict latency requirements. In particular, the described method system may consume high-velocity, high-volume data streams in order to analyze them, according to patterns of interests defined by domain experts through the received pattern (or automatically learnt). The forecasted complex events are used to notify analysts about impending critical situations, or, in general, situations of interest.
[0124] Some application domains are discussed below.
[0125] In some non-claimed embodiments, the described method is used to monitor and / or analyze financial transactions to detect fraud or to support a decision-making process, for example, with securities transactions.
[0126] For example, events of the event stream are credit card transactions, accompanied by several arguments, such as the time of the transaction, the card ID, the amount of money spent, the country where the transaction took place, etc. In the real world, a small amount of such transactions are fraudulent and the goal of a complex event forecasting system would be to detect, with very low latency (e.g., in the order of a few milliseconds), fraud instances and / or suspicious activity patterns. A processing system then can devote more resources and higher priority to those instances or patterns. To do so, a set of fraud patterns must be provided. For typical cases of such patterns in a simplified form are known in the art. For example, one such pattern comprises a sequence of consecutive transactions where the amount spent at each transaction is greater than that of the previous transaction. Such a trend of steadily increasing amounts constitutes a typical fraud pattern.
[0127] The detection of fraud is however not limited to credit card transactions. The described method may also be used, among others, for insurance or investment fraud forecasting.
[0128] With the described method, it is possible to forecast if and when such a pattern will be completed, even before it is detected by a recognition engine (if in fact a fraud instance occurs), so as to possibly provide a wider margin for action. Thus, the described method makes it possible to take proactive actions before the fraud is normally detected.
[0129] Another example for using the described method in the financial field is the stock market. Based on historical data and / or share price developments, the described method allows forecasting whether the price is expected to rise or fall in the future. The described method therefore also allows making smarter and / or more informed decisions.
[0130] In the financial field, the described method therefore allows enhancing the security by forecasting fraudulent behavior before it actually occurs.
[0131] In some other embodiments, the described method is used to control vehicles.
[0132] For example, the complex event forecasting system receives events from vessels sailing at sea. Each event of the received event stream may contain information regarding the status of a vessel, e.g. its location, seeps, heading. The emitted events may be AIS (Automatic Identification System) messages. Respective trajectories can be analyzed, using the described method, in order to detect and forecast interesting patterns in the behavior of vessels.
[0133] A possible pattern could be a movement pattern in which a vessel approaches a port. Thus, the method forecasts when a vessel will enter a port.
[0134] Additionally or alternatively, the described system also allows controlling autonomous systems. Based on sensor and / or location data received from a vehicle (e.g., ships at sea, aircrafts in the air, or vehicles on the ground), it is possible to forecast certain events and / or control autonomous systems. For example, collision avoidance is obviously of paramount importance for this domain. The described method may infer that two (or more) moving objects are on a collision course and forecast that they will indeed collide if no action is taken.
[0135] In other non-claimed embodiments, the described method is used for machine monitoring and / or machine maintenance.
[0136] Many machines or vehicles are serviced at fixed intervals. Nevertheless, it often happens that such machines or components thereof fail and then have to be replaced.
[0137] Predictive maintenance (or proactive maintenance) is maintenance that monitors the performance and condition of equipment during normal operation to reduce the likelihood of failures. In order to ensure operability and safety of machines or vehicles, the present method can forecast possible failures based, for example, on the performance data received from the machines or vehicles. If failures are to be expected, it is possible to replace respective components or machines before malfunctions actually occur. This reduces both downtime and costs.
[0138] Different types of machines or vehicles may be monitored. For example, aircrafts (e.g., civil and military airplanes), vessels (e.g., ships), land vehicles (e.g., cars or trucks), industrial equipment (e.g., production machine, oil and gas production systems, etc.), robots (e.g., used for smart manufacturing), etc.
[0139] In other non-claimed embodiments, the described method is used for monitoring and / or analyzing simulations.
[0140] The described method may also play an important role in (large-scale) biological simulations or in in-silico biology, where computationally demanding simulations of biological systems are often executed to determine the properties of these systems and their response to treatments. These simulations are typically run on supercomputers and are evaluated afterwards to determine which of them seem promising enough from a therapeutic point of view. The described method may monitor these simulations as they run, predict which of them will turn out to be non-pertinent and decide to terminate them at an early stage could thus save valuable computational resources and significantly speed-up the execution of such in-silico experiments. For example, expensive tumor growth simulations can be monitored to forecast which might be interesting from a therapeutic perspective.
[0141] In the field of computing, the described method can be used for high performance computing optimization.
[0142] In addition to the above-described method for forecasting complex events, several alternative concepts are possible.
[0143] As described above, the described method receives a pattern defining a complex event. An automaton (e.g., a DSFA) is then derived from the pattern. In an alternative implementation, the method may receive or obtain the DSFA as input. In such an implementation, the method does not receive the pattern defining the complex event and does not construct the streaming finite symbolic automaton and the deterministic symbolic finite automaton, but directly uses the DSFA to create and learn a PSA.
[0144] In other implementations, the method is also able to work without a previously received pattern, given that a labeled training stream is available. In such cases, the method may independently discover the paths that a pattern follows to produce full matches, encode these paths in a probabilistic structure and use it to perform forecasting.
[0145] A data processing system or data processing device comprising a processor and a memory is also provided. The processor is configured to perform the method disclosed herein.
[0146] A "processor" includes any, hardware system, mechanism or component that processes data, signals or other information. A processor can include a system with a central processing unit, multiple processing units, dedicated circuitry for achieving functionality, or other systems. Processing need not be limited to a geographic location, or have temporal limitations. For example, a processor can perform its functions in real-time, offline, in a batch mode, etc. Portions of processing can be performed at different times and at different locations, by different (or the same) processing systems.
[0147] Those skilled in the relevant art will appreciate that the method may be implemented or practiced with different computer system configurations, including without limitation multi-processor systems, network devices, mini-computers, mainframe computers, data processors, and the like. The invention may be embodied in a computer or data processor that is specifically programmed, configured, or constructed to perform the functions described in detail herein. The invention may also be employed in distributed computing environments, where tasks or modules are performed by remote processing devices, which are linked through a communications network such as a LAN, WAN, and / or the Internet. In a distributed computing environment, program modules or subroutines may be located in both local and remote memory storage devices. These program modules or subroutines may, for example, be stored or distributed on computer-readable media, including magnetic and optically readable and removable computer discs, stored as firmware in chips, as well as distributed electronically over the Internet or over other networks (including wireless networks). Example chips may include Electrically Erasable Programmable Read-Only Memory (EEPROM) chips.
[0148] Various software / hardware / network architectures may be used. For example, the functions of the described method may be implemented on one computer or shared / distributed among two or more computers in or across a network. Communications between computers implementing embodiments can be accomplished using any electronic, optical, radio frequency signals, or other suitable methods and tools of communication in compliance with known network protocols.
[0149] Further, a computer program product is provided. The computer program product comprises instructions which, when the program is executed by a computer or a computing device, cause the computer or the computing device to carry out the above described method.
[0150] Any suitable programming language may be used to implement the routines, methods, or programs of embodiments of the invention described herein, including C, C++, Java, JavaScript, HyperText Markup Language (HTML), Python, or any other programming or scripting code.
[0151] Further, different programming techniques may be employed such as procedural or object oriented. Any particular routine may execute on a single computer processing device or multiple computer processing devices, a single computer processor or multiple computer processors.
[0152] A computer-readable medium comprising the computer program product is also provided. For example, the computer program product may be stored as computer instructions on a non-transitory computer-readable storage medium.
[0153] A "computer-readable medium" as used herein may be any medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with an instruction execution system, apparatus, system, or device. The computer-readable medium may be, by way of example only but not by limitation, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, system, device, propagation medium, or computer memory. Such computer-readable medium shall be machine readable and include software programming or code that can be human readable (e.g., source code) or machine readable (e.g., object code).
[0154] Examples of non-transitory computer-readable media may include random access memories, read-only memories, hard drives, data cartridges, magnetic tapes, floppy diskettes, flash memory drives, optical data storage devices, compact-disc read-only memories, and other appropriate computer memories and data storage devices. Some or all of the software components may reside on a single computer or on any combination of separate computers.
[0155] The method discussed herein (or parts thereof) may be implemented in suitable instructions that may reside on the non-transitory computer-readable medium, hardware circuitry or the like, or any combination and that may be translatable by one or more machines.BRIEF DESCRIPTION OF THE DRAWINGS
[0156] The forgoing and other features and advantages of the invention will become further apparent from the following detailed description read in conjunction with the accompanying drawings. In the drawings, like reference numbers refer to like elements. Fig. 1 is a schematic drawing illustrating steps for calculating forecasts for a given pattern according to an embodiment of the invention. Fig. 2 is a schematic drawing illustrating steps for calculating forecast intervals of a DSFA according to an embodiment of the invention. Figs. 3A-B are schematic drawings illustrating a conversion of a PST to a PSA. Figs. 4A-B are schematic drawing showing an example of embedding a DSFA into a PSA. Figs. 5A-B are schematic drawing showing an example for an automaton and its waiting-time distribution. Figs. 6A-C are schematic drawings showing examples of estimating a waiting-time distributions without a Markov chain. Fig. 7 is a schematic drawing showing an example of a counter suffix tree. Fig. 8 is a flow diagram illustrating a method for building a complex event forecasting system according to an embodiment of the invention. Fig. 9 is a diagrammatic representation of a data processing system for performing the method disclosed herein. DETAILED DESCRIPTION
[0157] In the following, embodiments of the invention will be described in detail with reference to the accompanying drawings. It is to be understood that the following description of the embodiments is given only for the purpose of illustration and is not to be taken in a limiting sense. It should be noted that the drawings are to be regarded as being schematic representations only, and elements in the drawings are not necessarily to scale with each other. Rather, the representation of the various elements is chosen such that their function and general purpose become apparent to a person skilled in the art.
[0158] Fig. 1 illustrates method steps for calculating forecasts for a given pattern.
[0159] As input, the method 100 receives a symbolic regular expression. In step 110, the symbolic regular expression is converted to a streaming symbolic regular expression. Step 120 uses the streaming symbolic regular expression to construct a streaming finite symbolic automaton which is then determinized into a deterministic symbolic finite automaton (step 130).
[0160] In step 140, an order of a prediction suffix tree m, an approximation parameter for tree learning α, a maximum number of states for a learned suffix automaton n, thresholds for tree learning θ 1 , θ 2 , and a training stream 5 are input or obtained. These inputs together with the deterministic symbolic finite automaton created in step 130 are used to generate a probabilistic model.
[0161] Step 150 then employs the probabilistic model to calculate waiting-time distributions. Based on the waiting-time distributions, a confidence threshold θ fc , and a maximum index of the distribution h, forecast intervals are determined (step 160).
[0162] Fig. 2 shows steps for calculating forecast intervals of a DSFA, along with input required for each of the steps. m is a maximum assumed order, ε an approximation parameter, n a maximum number of states for a probabilistic suffix automaton (PSA) and θ fc a confidence threshold of the intervals.
[0163] Step 210 takes as input minterms of a received or constructed DSFA, the maximum order m of dependencies to be captured and a training stream S 1..k . Its output is a counter suffix tree (CST) of maximum depth m. In step 220, the CST is then converted to a prediction suffix tree (PST), using the approximation parameter ε and the parameter n for the maximum number of states for the PSA to be constructed in the next step. Step 230 converts the PST to the PSA, by using the leaves of the PST as states of the PSA. This PSA is then merged with the initial DSFA to create an embedding of the PSA in the DSFA (step 240). From the embedding waiting-time distributions are calculated in step 250 and the waiting-time distributions are used to derive the forecast intervals in step 260, using a predetermined confidence threshold θ fc provided by a user. In step 230', Fig. 2 also shows an alternative option of bypassing the construction of the PSA, by estimating the waiting-time distributions directly from the PST.
[0164] Figs. 3A and 3B show example of a prediction suffix tree 310 and its corresponding probabilistic suffix automation 320.
[0165] In Fig. 3A, the prediction suffix tree 310 is depicted for Σ = {a, b} and m = 2. Each node of the prediction suffix tree 310 contains the label and the next symbol probability distribution for a and b. Fig. 3B shows the probabilistic suffix automaton 320 constructed from the prediction suffix tree 310, using leaves of the probabilistic suffix tree 310 as states of the probabilistic suffix automaton 320. Each state contains its label. Each transition is composed of the next symbol to be encountered along with that symbol's probability.
[0166] A full-order probabilistic suffix automaton for m = 2 would require a total of 4 states, given the two symbols. If the prediction suffix tree 310 is used, the probabilistic suffix automaton 320 can be constructed with 3 states. State b does not need to be expended to states bb and ab, since the prediction suffix tree 310 tells that such an expansion is not statically meaningful.
[0167] Using a PSA, a stream of symbols can be consumed and at every point an estimate about the next symbols that are encountered along with their probabilities can be provided. For the probabilistic suffix automaton 320, if the last symbol consumed from the stream is b, then the probabilistic suffix automaton 320 would be in state b and the probability of the next symbol being a would be 0.5. If the last symbol in the stream is a, it is necessary to expand this suffix to look at one more symbol in the past. If the last two symbols are aa, then the probabilistic suffix automaton 320 would be in state aa and the probability of the next symbol being a again would be 0.75.
[0168] Figs. 4A and 4B show an example of an embedding 420 of a DSFA 410 into the prediction suffix automaton 320 of Fig. 3B.
[0169] In the example, Fig. 4A depicts the DSFA 410 for the expression R = a · b with Σ = {a, b}. It is presented as a classical automaton, but the symbols correspond to minterms. Thus, Σ is the set of minterms. Fig. 3A shows the prediction suffix tree 310 that could be learned from a training stream of symbols from Σ and Fig. 3B shows the probabilistic suffix automaton 320 constructed from the prediction suffix tree 310.
[0170] Fig. 4B shows the embedding 420 that would be created, following the construction procedure according to the methods described herein. The embedding 420 in Fig. 4B has some redundant states and transitions. The states (1, ba), (1, b), (2, aa), and (2, b) have no incoming transitions and are thus inaccessible. The reason is that some states of the DSFA 410 in Fig. 4A have a "memory" imbued to them from the structure of the automaton itself. All incoming transitions to state 1 of the DSFA 410 have a as their symbol. Similarly, state 2 has only one transition with b as its symbol. Therefore, there is no point in merging state 1 of the DSFA 410 with all the states of the probabilistic suffix automaton 320, but only with state b. If a straightforward construction is followed, as described above, the result will be the automaton depicted in Fig. 4B, including the redundant states. To avoid the inclusion of such states, the DSFA 410 and the probabilistic suffix automaton 320 can be merged in an incremental fashion as described above. The resulting automaton would then consist only in states (0, b), (0, ba), (0, aa), (1, aa) and (2, ba) and the respective transitions of Fig. 4B.
[0171] Figs. 5A and 5B show an example of an automaton 510, along with the waiting-time distributions 520 for its non-final states.
[0172] If the automaton 510 is in state 2, then the probability of reaching the final state 4 for the first time in 2 transitions is ≈ 50% but 0% for 3 transitions (the automaton has no path of length 3 from state 2 to state 4).
[0173] Fig. 5B shows the forecast interval produced for state 1 of the automaton of Fig. 3A, with θ fc = 50%.
[0174] In Figs. 6A-C, exemplary steps of a process for estimating waiting-time distributions without actually constructing an embedding are shown. Fig. 6A shows an DSFA 610 and Fig. 4B shows an PST 620.
[0175] As mentioned above, the conversion of the PST 620 to a PSA could lead to a blow-up in the number of states. The basic step in such a conversion is to take the leaves of PST 620 and use them as states for the PSA. If this were the only step, the resulting PSA would always have fewer states than the PST. As this example shows, this is not the case.
[0176] Imagine that the states are just the leaves of PST 620 and that we are in the right-most state / node, b, (0.5, 0.5). If an a event arrives, it is not possible to find a proper next state. The state aa, (0.75, 0.25) is obviously not the correct one, whereas states aba, (0.9, 0.1) and bba, (0.1, 0.9) are both "correct", in the sense that ba is a suffix of both aba and bba. In order to overcome this ambiguity regarding the correct next state, node b, (0.5, 0.5) of PST 620 first has to be expanded and then the children of this node as states of the PSA are used. In this simple example, this expansion of a single problematic node would not have serious consequences. But for deep trees and large alphabets, the number of states caused by such expansions far outweighs the number of the original leaves. As a result, the size of the PSA is far greater than that of the original, unexpanded PST.
[0177] Fig. 6C shows how the probability for any future sequence of states of the DSFA 610 can be estimated, using the distributions of the PST 620. For example, after consuming the last event, the DSFA 610 is in state 1 and the PST 620 has reached node, aa, (0.75, 0.25). Each node in this figure has two elements: the first one is the state of the DSFA 610 and the second the node of the PST 620, starting with node 633 {1, aa} as the current "configuration". Each node has two outgoing edges, one for a and one for b, indicating what might happen next and with what probability. For example, from the node 633, according to the PST 620, a might be seen with probability 0.75 and b with probability 0.25. If we do encounter b, then the DSFA 610 will move to state 2 and the PST 620 will reach leaf b, (0.5, 0.5). This is shown in Fig. 6C as the node 632 (labeled with {2, b}). Node 632 has a double border to indicate that the DSFA 610 has reached a final state. In a similar manner, this tree may be expanded into the future.
[0178] This can be used to estimate the waiting-time distribution. In order to estimate the probability of reaching a final state for the first time in k transitions, we first find all the paths starting from node 633, having length k, ending in a final state and without another final state at a level below k. In the example of Fig. 6C, if k=1, then the path from node 633 (i.e., {1, aa}) to node 632 (i.e. {2, b}) is such a path and its probability is 0.25. Thus, P(W {1,aa} = 1) = 0.25. For k=2, nodes 631, 632, and 633 show a path that leads to a final state after 2 transitions. Its probability is 0.75 * 0.25 = 0.1875, since we just need to multiply the probabilities of the edges. If there were more such paths, it is necessary to add all their probabilities. Thus, P(W {1,aa} = 2) = 0.1875.
[0179] It is obvious that this tree grows exponentially if it is looked deeper into the future. This cost can be significantly reduced by employing some simple optimizations. First, note in Fig. 6C, that the paths starting from nodes 632 and 632' (i.e., {2, b}) are grayed out. This indicates that these nodes need not be expanded, since they correspond to final states and any paths starting from them will not be used again. Only the first time M R reaches a final state is interested and not the second, third, etc. As a result, paths with more than one final state in Fig. 6C are not useful. With this optimization, an exact estimation of the waiting-time distribution can still be made. Another useful optimization tries to prune paths that should normally be expanded (i.e., no final state is involved). The intuition is that a path with a very low probability will not contribute significantly to the probabilities of the waiting-time distribution, even if it is expanded. Such paths thus can be pruned, accepting the risk that an approximate estimation of the waiting-time distribution will be received.
[0180] Fig. 7 shows an example of a counter suffix tree 700 with maximum depth m = 2 and S = aaabaabaaa.
[0181] The number of occurrences of the string b · a in S can be retrieved by first taking left child 720 of root node 710 and then right child 730 of the left child 720. The content of right child 730 is (b, 2) and indeed b · a occurs twice in S.
[0182] In Fig. 8, a method 800 for forecasting complex events in a complex event forecasting system is show. In step 810, a pattern defining a complex event is received. An event stream including a plurality of events upon which a forecast is to be based is received in step 820. Then, a probabilistic model is constructed (step 830) by means of an automaton derived from the received pattern and of a variable-order Markov model encoding statistical properties of at least a portion of the received event stream which acts as a training dataset. The method then forecasts a complex event for the received event stream based on the probabilistic model in step 840.The forecasted complex event satisfies the received pattern. In step 850, outputting the forecasted complex event is output.
[0183] Fig. 9 depicts a diagrammatic representation of a data processing system 900 for implementing a method for forecasting complex events as described herein.
[0184] As shown in Fig. 9, the data processing system 900 includes one or more central processing units (CPU) or processors 901 coupled to one or more user input / output (I / O) devices 902 and memory devices 903. Examples of I / O devices 902 may include, but are not limited to, keyboards, displays, monitors, touch screens, printers, electronic pointing devices such as mice, trackballs, styluses, touch pads, or the like. Examples of memory devices 903 may include, but are not limited to, hard drives (HDs), magnetic disk drives, optical disk drives, magnetic cassettes, tape drives, flash memory cards, random access memories (RAMs), read-only memories (ROMs), smart cards, etc. The data processing system 900 is coupled to a display 906, an information device 907 and various peripheral devices (not shown), such as printers, plotters, speakers, etc. through the I / O devices 902. The data processing system 900 is also coupled to external computers or other devices through a network interface 904, a wireless transceiver 905, or other means that is coupled to a network such as a local area network (LAN), wide area network (WAN), or the Internet.
[0185] It will also be appreciated that one or more of the elements depicted in the drawings / figures can also be implemented in a more separated or integrated manner, or even removed or rendered as inoperable in certain cases, as is useful in accordance with a particular application.
[0186] As used herein, the terms "comprises", "comprising", "includes", "including", "has", "having", or any other variation thereof, are intended to cover a non-exclusive inclusion. For example, a method, process, product, article, or apparatus that comprises a list of elements is not necessarily limited only to those elements but may include other elements not expressly listed or inherent to such method, process, product, article, or apparatus.
[0187] Furthermore, the term "or" as used herein is generally intended to mean "and / or" unless otherwise indicated. For example, a condition A or B (as well as a condition A and / or B) is satisfied by any one of the following: A is true (or present) and B is false (or not present), A is false (or not present) and B is true (or present), and both A and B are true (or present).
[0188] As used herein, including the claims that follow, a term preceded by "a" or "an" (and "the" or "said" when antecedent basis is "a" or "an") includes both singular and plural of such term, unless clearly indicated within the claim otherwise (i.e., that the reference "a" or "an" clearly indicates only the singular or only the plural). Also, as used in the description herein and throughout the claims that follow, the meaning of "in" includes "in" and "on" unless the context clearly dictates otherwise.
Claims
1. A computer-implemented method for controlling a vehicle the method comprising the steps of: receiving (810) a symbolic regular expression defining a complex event; receiving (820), from sensors of a vehicle, an event stream including a plurality of events upon which a forecast is to be based, the plurality of events including location data from the vehicle; constructing (830) a probabilistic model by means of a deterministic symbolic finite automaton (410) derived from the symbolic regular expression and of a variable-order Markov model encoding statistical properties of at least a portion of the received event stream, the portion of the received event stream acting as a training dataset, each transition of the deterministic symbolic finite automaton (410) being equipped with a unary formula from an effective Boolean algebra, wherein the probabilistic model is constructed (830) by: constructing a streaming finite symbolic automaton based on and / or equivalent to the symbolic regular expression; constructing the deterministic symbolic finite automaton (410) based on and / or equivalent to the streaming finite symbolic automaton; using minterms of the deterministic symbolic finite automaton (410) and the portion of the received event stream to create and learn a probabilistic suffix automaton (320) as the variable-order Markov model, the probabilistic suffix automaton (320) encoding the statistical properties of the portion of the received event stream; and combining (240) the deterministic symbolic finite automaton (410) and the probabilistic suffix automaton (320) into a single automaton (420); forecasting (840), by the single automaton (420) embedding the deterministic symbolic finite automaton (410) and the probabilistic suffix automaton (320), a complex event for the received event stream by determining when the single automaton (420) is expected to reach one of its final states for the first time while continuously updating the variable-order Markov model in an online manner based on the received event stream, wherein the forecasted complex event matches the received symbolic regular expression; and controlling the vehicle based on the forecasted complex event.
2. The method of claim 1, wherein the symbolic regular expression is a streaming symbolic regular expression.
3. The method of claim 1 or 2, further comprising calculating (250) waiting-time distributions from the single automaton (420) embedding the deterministic symbolic finite automaton (410) and the probabilistic suffix automaton (320).
4. The method of any of the preceding claims, wherein the method further comprises estimating a number of occurrences of the events in the received event stream by using a tree data structure (700), wherein each node (710, 720, 730) of the tree data structure (700) is a tuple which comprises a symbol from an alphabet of the received event stream and a counter, and wherein the counter of every node (710, 720, 730) is equal to the sum of the counters of children of the node (710, 720, 730).
5. The method of any of the preceding claims, wherein the method performs regression complex event forecasting to forecast when the complex event is expected to occur and / or classification complex event forecasting to forecast whether or not a complex event will occur within a predetermined future window.
6. The method of any of the preceding claims, wherein the method is distributed.
7. A data processing system comprising a processor (901) configured to perform the method of any of claims 1-6.
8. A computer-readable storage medium comprising instructions which, when executed by a computer (900), cause the computer (900) to carry out the method of any of claims 1-6.
