Component-based event composition modeling for CPS

In order to combine event-drive model with component-based architecture design, this paper proposes a component-based event composition model to realize CPS’s event processing. Firstly, the formal representations of component and attribute-oriented event are defined. Every component is consisted of subcomponents and the corresponding event sets. The attribute “type” is added to attribute-oriented event definition so as to describe the responsiveness to the component. Secondly, component-based event composition model is constructed. Concept lattice-based event algebra system is built to describe the relations between events, and the rules for drawing Hasse diagram are discussed. Thirdly, as there are redundancies among composite events, two simplification methods are proposed. Finally, the communication-based train control system is simulated to verify the event composition model. Results show that the event composition model we have constructed can be applied to express composite events correctly and effectively.


Introduction
Cyber Physical System (CPS) is a large-scale network system which is composed of sensors, actuators, physical entities and computing units. By deep integration of physical and computing processes, it is aimed at controlling physical entities efficiently and reliably [1,2,3]. As a distributed complex system, CPS tends to adopt event-driven architecture design. As a matter of fact, event-driven model has been widely applied to procedure developing, such as event-driven based windows operating system, eventbased Active Database [4], object-oriented DBMS [5], and so on. The above models are instructive but cannot be applied to CPS design. The reason is that event defined in these systems is simple, independent, of single attribute, and of object and subject. But in CPS, knowledge about time, space and other attributes from kinds of nodes needs to be managed, which means event fusion and combination [6]. This paper proposes that CPS is composed of components which are modelled by object-oriented method. This component-based design scheme can build good software structure, improve reuse of component and support software maintenance [7]. We define formal representation which is multi-tuple to describe event type. Concept lattice-based algebra system is constructed to implement component-based event composition which is represented by algebraic expression.

Algebra model of event composition
Tan Ying [8,9] first proposes CPS temporal-spatial event concept, and builds temporal-spatial event composition model. In view of the situation that, if at least one event arrives among 12 , ,......, n , the composite event will occur, we add operation "+" to express "or" relation on base of Tan's event model. As different components are sensitive to different events, we add attribute elements "component ID" and "event type" to the formal representation of event type. T ,L ,T ,L [8] are temporal-spatial attributes, and g g T ,L are time and location when and where cps is generated, oo T ,L are time and location when and where cps is monitored by observer.  id ρ denotes confidence level of cps , which varies with time t.

Component-based event composition model
Simon Bliudze [10] shows component-based algebra of interaction and defines interface type. Here the unary typing operator "[•] * " is introduced to denote event type, and binary operation "+" and "•" are introduced to denote the relations between events. This paper proposes concept lattice-based event algebra system which is built on base of component architecture and logic relations between events.
Let subcomp 1  (2) If events 12 , , , n which are of types 12 , , , n respectively arrive, and they can be integrated to cps , the composite event cps is called the conjunction of 12 , , , n , and the binary operation "•" is defined to express events composition relation. According to the definition of CPS concept lattice [8] , if events 12 , ,......, n all arrive, it is uncertain that composite event cps will be generated. When cps is generated, the relation is expressed by If at least one event arrives among 12 , , , n which are of types 12 , , , n respectively, and any of them can be extended to cps , event cps is accepted as the extraction of 12 , , , n . This kind of event composition relation can be represented by defining binary operations "+". Similarly, if at least one event arrives among 12 , , , n , it's uncertain that composite event cps will be generated. When cps is generated, the relation is expressed by , the composition operations satisfy the axioms [10] as follows: [[ According to the above definition and axioms, comp E is obtained by binary and unary operations based on RadixSet , and concept lattice-based event algebra system * (E , [ ] , , ) comp is built. The operations including binary and unary operations follow the computing priority rule that [•] * has higher level than "•" which is prior to "+".
According to the expression of event composition, there must exist some relations between subevents, maybe partial order relation by " ", conjunction by "•", or extraction by "+". Concept lattice-based Hasse diagram is built as follows: (1) The top level of Hasse diagram is the global observer which is a type of observer event.
(3) The event cps is of trigger type, if the component is sensitive to it. Under this circumstance, event cps is marked with filled circle ( ) in the Hasse diagram. Else it is marked with hollow circle ( ).
(4) Mass of events can be composed by traversing Hasse diagram. The events which are marked with filled circle are recorded when traversal trace passes through them. These recorded events have some effect on the component.

Events fusion process
CPS receives mass of events all the time, which can be represented by event algebra. It's necessary to simplify events so as to decrease the running time and avoid waste of resource. Simplification process means fusion of events which are the same or have the same effect, so as to avoid response to repeated events. This paper proposes two methods for events fusion: Concept lattice-based algebraic expression simplification process and Hasse diagram-based event composition simplification process.
(1) Concept lattice-based algebraic expression simplification process The received events received during one timeslot may be described redundantly by algebraic expression. By translating algebraic expression of events into normalized forms, the same events can be fused to one. The normalized formalization of event algebra expression is as follows [10] : are of synchronization type. The terms of the first summand indicate composite events have effects to the component. The terms of the second summand indicate composite events which are effective to the component cannot be generated by combining subevents. The terms of the third summand denotes that composite events or subevents don't belong to the event set of the component.
(2) Hasse diagram-based event composition simplification process Concept lattice-based event algebra model is shown in the above section. There exists some relation between any two composite events. They can form partial order relation, or they have the same On basis of algebra system, Hasse diagram and events simplification method proposed in the above sections, we summarize events composition process as follows: a. Composite events are generated by gathering the received events during one timeslot along Hasse diagram. b. Present the event algebra expression. c. Translate the expression from b into the form as equation (2) by following composition operation rules as equation (1). d. Simplify composite events. If there are partial order relations between events, and they are of the same type relative to the same component, retain the higher level events.

Simulation
Here we simulate that how the communication-based train control system avoids overspeeding and driving with close distance from other trains. Let diffV be the difference value between the highest speed and running speed, critiV andξbe the critical value of the speed difference and fluctuate range of it, diffD be the distance between train T1 and T2, emergD be the distance for carrying on emergency brake, and safeD be the safe distance. The formal representation of events of speed type from train T1 is as follows:  Table 1.
The speed event and distance event are combined, and the corresponding control activity is shown as Table 2.      Event computing unit will traverse the Hasse diagram and generate composite event Econstant, if atomic events E12, E13, E14 are received by train T1. Then Actuator performs actions to keep an even speed. Similarly, composite event Eregular will be generated when atomic event E15 is received by train T1. Then the actuator performs regular brake. Composite event Eemerg_l will be generated when atomic event E17 is received by train T1. Then the actuator performs emergency brake. Composite event Eemerg_h will be generated when atomic events E15, E18 are received by train T1. Then the actuator performs emergency brake. The simulation verifies information processing mechanism and event algebra model.

Conclusion
This paper proposes the component-based event composition model, defines concept lattice-based event algebra system, and describes the rules for drawing Hasse diagram. Moreover, simplification methods of mass of composite events are analysed. These theories and methods are in favour of event composition and component coordination. The simulation verifies accuracy of the model and high efficiency of event processing. In the future, we will focus on two aspects: one is how to fuse events on basis of temporal-spatial consistency. The other one is how to express the priority of responsiveness in the Hasse diagram.