STEIM: A Spatiotemporal Event Interaction Model in V2X Systems Based on a Time Period and a Raster Map

. The Internet of Vehicles (IoV) is an important artiﬁcial intelligence research ﬁeld for intelligent transportation applications. Complex event interactions are important methods for data ﬂow processing in a Vehicle to Everything (V2X) environment. Unlike the classic Internet of Things (IoT) systems, data streams in V2X include both temporal information and spatial information. Thus, eﬀectively expressing and addressing spatiotemporal data interactions in the IoV is an urgent problem. To solve this problem, we propose a spatiotemporal event interaction model (STEIM). STEIM uses a time period and a raster map for its temporal model and spatial model, respectively. In this paper, ﬁrst, we provide a spatiotemporal operator and a complete STEIM grammar that eﬀectively expresses the spatiotemporal information of the spatiotemporal event ﬂow in the V2X environment. Second, we describe the design of the operational semantics of the STEIM from the formal semantics. In addition, we provide a spatiotemporal event-stream processing algorithm that is based on the Petri net model. The STEIM establishes a mechanism for V2X event-stream temporal and spatial processing. Finally, the eﬀectiveness of the STEIM-based system is demonstrated experimentally.


Introduction
e Vehicle-to-Everything (V2X), which is the information exchange between vehicular systems and the outside world of information exchange, is a critical technology for future intelligent transportation systems. V2X enables vehicles, base stations, and infrastructure to obtain real-time traffic information, road information, and pedestrian information [1]. V2X improves safety, reduces congestion, improves traffic efficiency, and provides on-board entertainment information [2]. Currently, V2X applications in the Internet of Vehicles (IoV) remains in the exploratory stage as technical applications for traffic safety, information security problems, and all types of application stability, and interoperability problems have not been tested [3].
V2X provides a connection with the outside world; thus, it is a basic and key technology for intelligent automobiles, autonomous vehicles, and future intelligent transportation systems [4]. V2X primarily consists of four functions: Vehicle-to-Network (V2N), Vehicle-to-Vehicle (V2V), Vehicle-to-Infrastructure (V2I), and Vehicle-to-Pedestrian (V2P). V2X uses Dedicated Short Range Communications (DSRC) and Long-Term Evolution-Vehicle (LTE-V); both DSRC and LTE-V are well-known technical standards in the industry [5,6].
In the Intelligent Connected Vehicle (ICV) environment, the cooperative intelligent interaction communication mechanism is the interaction mode between each intelligent agent. Data streams in the V2X include both temporal information and spatial information. In applications, vehicles periodically broadcast a Basic Safety Message (BSM) to other intelligent agents, including information such as position, longitude, latitude, posture state, heading angle, velocity, and acceleration to surrounding vehicles. e vehicle simultaneously receives similar information from surrounding intelligent agents. By processing and analysing these data streams, a vehicle can determine the current values of the surrounding agents. Real-time acquisition, interaction, and processing of information from surrounding vehicles and the relative position of the current vehicle, combined with the actual working situation of vehicle traffic, are numerous complex events [7]. As a starting point, to ensure vehicle and public safety, a variety of different conditions may be derived from this information, such as early warning of unknown states, early warning of known states, emergency braking situations, and vehicle lane change warnings [8,9].
Vehicles run in a complex environment in real time. us, complex event-processing technology is required to filter the massive data stream generated by event instance flows to obtain those that concern the user via an eventprocessing model [10,11]. Events that concern users are sent to a client events library or disposed of based on a user's predefined rules. e corresponding processing must also occur in real time [12,13]. Complex event-processing technology has been successfully applied to IoV systems; however, the spatial data model in V2X driving scenarios has two problems: first, it is incompatible with the spatial model in a geographic information system. Without considering the direction of spatial data, a model that is suitable for both time and space is not available. Second, the direction of the spatial data is not considered. In a complex event processing model for the Internet of ings, the adoption of an appropriate temporal and spatial model can reduce the complexity of the model [14,15].

Our Contributions.
How to effectively express and address the spatiotemporal data flow in the IoV in V2X is a critical problem that must be solved to satisfy the challenges of the massive temporal and spatial information data stream produced in a vehicular network. In this paper, a spatiotemporal event interaction model (STEIM) is proposed. e STEIM model establishes the grammar and the operational semantics.
e contributions of the current study are summarised as follows: (1) A spatiotemporal event interaction model is proposed for V2X. is model establishes the model's syntax and operational semantics. (2) e raster map model in a geographic information system (GIS) is adopted as the spatial model in V2X. Based on this raster map spatial model, we provide a method for determining the spatial data direction relations in a vehicular network. (3) An event flow-processing algorithm model that is based on a Petri net is adopted. We expound on the effectiveness of the processing mechanism in the experimental results and analysis section.

Paper
Organization. e remainder of this paper is organised as follows: In Section 2, we provide an overview of related studies and similar systems that inform this framework. We provide the data model and the temporal and spatial events for V2X in Section 3. Section 4 presents the STEIM grammar. Section 5 describes the design of STEIM and its operational semantics. Section 6 presents the STEIM algorithm based on a Petri net. e experimental results that concern the task performance and efficiency are provided in Section 7. Section 8 presents our concluding remarks.

Related Work
Many studies have discussed complex event handling in V2X. e approach proposed in Ashok and Vaidehi [16] primarily relies on spatial abstractions of each object and mining frequent temporal patterns in a sequence of frames to form a regular temporal pattern. is process is repeated for each window of sequences, and support for a temporal sequence is obtained to discover the regular patterns of normal events. However, this approach depends on the outcomes of object detection and tracking methods that are applied to videos. Liu and El Kamel [17] used an algorithm that is designed to improve the information throughput by reorganising the surrounding vehicle platoons. e algorithm considers safety, fuel consumption, speed limits, heterogeneous vehicle features, and passenger comfort. However, the algorithm needs to determine when to activate the algorithm. Li and Yixiang [18] proposed a novel spatialtemporal complex event-processing language for vehicular networks that establishes syntax based on modified spatiotemporal relation operators. In addition, they designed an event-instance stream-processing algorithm. However, their approach did not consider the problem of protecting information security or reliable transmission of incident flow. e approaches in [19][20][21][22] achieve a reasonable level of privacy protection. In these studies, vehicles are issued pseudonym certificates, and certificate generation and provisioning are divided among multiple organisations. e schemes support anonymous authentication in V2X. Subsequent research includes automatic adaptation and optimisation of the configuration parameters for the selected road network but also involves heuristic optimisation of these parameters during a preprocessing procedure.
In terms of visual analysis of traffic data, Wang et al. [23] used visualization technology to design a spatiotemporal data visualization platform for traffic based on points and heat, which could accurately reflect road traffic conditions and provide scientific and reliable data support for urban road traffic planning and management. Sarraf and McGuire [24] conducted visualization research on accident data from sensors and designed an interactive view interface integrating multisource data. So et al. [25] proposed a traffic congestion index visual analysis system based on GPS trajectory. In conclusion, data visual analysis is increasingly used in intelligent transportation. Data visualization has achieved certain results in the application of traffic data such as trajectory data, traffic flow data, and taxi data. However, there are few research results on traffic accident data transmission visualization.
In terms of the identification method of accident occurrence, with the continuous increase of car ownership, the road traffic safety situation is particularly serious. Identifying traffic accidents requires traffic police departments to allocate police forces and deploy rescue equipment according to different road sections [26]. It is of great significance to improve the ability of traffic control. e identification of multiple accident sections is based on the safety of sections to determine the dangerous sections of highways. At present, the identification methods of road sections with multiple traffic accidents mainly include the following categories: (1) applying traffic conflict analysis technology [27]. It judges the possible traffic conflict points by predicting the running track of vehicles and judges the more serious traffic conflicts as the road section with frequent accidents. e method relies less on the historical data of traffic accidents, but the workload of traffic conflict analysis method is larger. erefore, it is only applicable to the identification of traffic accidents on small urban roads. (2) Identification method based on historical traffic accident data. It first segmented the studied road manually. en the accident number method and the accident rate method are used to identify the road sections with multiple accidents. Or the accident data can be analysed by building models such as Poisson regression, negative binomial regression, and empirical Bayesian method, and the multiaccident sections can be judged according to the prediction of the accident development trend [28]. is kind of method requires manual segmentation of the road before identification, and the result of segmentation will directly affect the prediction of traffic accident-prone sections. On the other hand, time and weather conditions have a significant impact on traffic safety. e above identification methods of traffic accident-prone sections do not take into account time and weather conditions, which greatly reduces the accuracy of the identification results [29].
For the visualization of accident-prone road sections, Fan et al. [30] proposed context-aware big data analysis and spatiotemporal visualization methods for traffic data such as road networks, vehicles, drivers, and weather. Shafabakhsh et al. [31] combined geographic information technology and spatial statistical analysis to reveal the influence of spatial factors on fatal, injured, property loss, and other traffic accidents. Among them, nearest neighbor analysis and k-function were used to study the distribution of urban traffic accidents, and kernel density estimation was used to identify the dangerous areas in the urban network. Based on a large amount of human activity data and traffic accident data and combined with real-time data, Li et al. [32] established a universal prediction model for large-scale realtime traffic accident risk simulation.
Some event-processing models focus on the spatial relationships between two events. Jin et al. [33] presented a composite subscription model that describes moving events related to mobile objects and detects whether events are matched with subscriptions in a distributed manner. However, some objects do not share GIS spatial information to obtain a global map. Lee et al. [34] designed a roadnetwork-aware spatial alarm processing system by developing a suite of optimisation techniques using motion-aware filters.
e system can increase the hibernation time of mobile clients and reduce wakeups and alarm check frequencies while ensuring a high spatial alarm processing accuracy. Zheng et al. [35] used taxi trajectory data to study the spatiotemporal characteristics of urban residents' travel patterns from popular areas and hotspots. ey proposed a spatiotemporal trajectory clustering method to discover hotspots among popular destinations. However, Lee and Zheng did not consider the direction of spatial data.
Our project team began researching individual intelligent vehicles in 2012. We began our research on the technology, platform, and transfer of information concerning driving brain cognition for intelligent vehicles in 2014 [36][37][38]. Since 2016, we have been studying how V2X vehicles and subsystems should authenticate with each other [2,39,[40][41][42][43][44]. e spatiotemporal event interaction model architecture is shown in Figure 1, which includes both individual intelligent vehicles.
Based on the actual surrounding vehicles relative to the location of the current vehicle, the vehicle relative location map in Figure 2 can be divided into 13 relative positions according to distance and orientation, namely, front, right front, left front, far ahead, far front left, far front right, left, right, left rear, right rear, far behind, far back left, and far back right. e vehicle relative location map in Figure 2 can be divided into 14 relative positions according to distance and orientation, namely, front, right front, left front, far ahead, far front left, far front right, left, right, left rear, right rear, back, far behind, far back left, and far back right.
Statistical analyses of the causes of traffic accidents are based on accident frequency and loss cost factors, such as comprehensive consideration. e working condition of an accident environment can be divided into vehicles that should stop, loss of vehicle control, vehicle turns, slowing down in the absence of light, and vehicle lane changes. Similarly, the system functions in V2X scenarios spawned a variety of applications for emergency cases, such as abnormal vehicle reminders, dangerous road condition reminders, speed limit warnings, warning for running a red light, dangerous traffic participants collision warnings, green wave guide, congestion reminders, and emergency vehicles ahead. ese advanced warnings can help improve the safety and efficiency of public traffic and public transportation systems. e specific scene application function of V2X systems involves distinguishing the relative positions of two objects, calculating the distance and time to collision, and providing a warning.
In this paper, we focus on generalising our previous work on formalising driving brain cognition for intelligent vehicles. In addition, we adopt a time period and raster map to form a temporal model and a spatial model, respectively, when building the spatiotemporal event interaction model. e result is the establishment of a mechanism that can be formulated in V2X.

Driving Brain Cognition Formalization in V2X
In V2X, various sensors continuously generate a large number of multisource and multidimensional data. ese data include time, location, direction, speed, acceleration, temperature, license plate numbers, and traffic signals. e majority of these data can be expressed using a common numerical model; for example, velocity can be expressed as a Mobile Information Systems 3 real number. e driving brain formalisation includes a time data model, a spatial data model, and a temporal event instance model.

e Time Data
Model of the V2X. In V2X, sensors periodically identify the physical state and generate corresponding data. erefore, in V2X, the specific time points of data occurrence cannot be obtained; however, they can be inferred from the time interval between two event occurrences. In this paper, the time interval is used to define the time data model for the vehicular network.
Definition 1. e time data model in V2X consists of a time interval, whose value is a pair of sequential time points: where start represents the start of the time interval and end represents the end of the time interval. Time is expressed as 24 hours and is accurate to the second. e temporal relationship among time interval data has been the subject of considerable research. Compared with the classic Allen definition, seven temporal sequence relationships are established based on time periods [45]. Based on the actual demands of V2X, we adopt the simplified Allen time series relationship model shown in Figure 3.
According to Figure 3, the temporal relationship of time data can be obtained by comparing the start time and the end time. Given the two time data sets TIME 1 � (start 1 , end 1 ) and TIME 2 � (start 2 , end 2 ), the time sequence relationship is determined as follows: (1) TIME 1 BEFORE TIME 2 Judgement condition: end 1 < start 2 (2) TIME 1 EQUAL TIME 2 Judgement condition: start 1 � start 2 and end 1 � end 2 (3) TIME 1 OVERLAP TIME 2 Judgement condition: end 1 � start 2 (4) TIME 1 DURING TIME 2 Judgement condition: start 1 < start 2 and end 1 ≥ start 2 and end 1 < end 2 (5) TIME 1 DURING TIME 2 Judgement condition: start 1 ≥ start 2 and end 1 ≤ end 2 (6) TIME 1

e Spatial Data Model of the V2X.
e spatial data model of V2X needs to be GIS-compatible. In a GIS, the map space can be represented by a raster spatial data model, in which space is considered to be a continuous whole. In addition, the space is divided into an array of uniform ruled grid cells. Each raster is a grid that has a unique number. e number of rows and columns depends on the resolution of the system and the characteristics of the spatial entity. e basic unit in the raster data model is the grid. e points, lines, broken lines, and areas in the raster spatial data model are represented in the black parts of Figures 4(a)-4(d), respectively.

Definition 2.
e V2X spatial data model is a raster spatial data model, whose values are a set of contiguous raster sequence pairs denoted as LOCATION � row 1 , column 1 , row 2 , column 2 , . . . , row n , column n .
is spatial data model is collectively referred to as the "driving brain." e driving brain model can be formalised in V2X. For example, monitoring the overtaking of a moving vehicle involves judging the directions of the two vehicles. e definition of the direction relationship of the driving brain formalisation spatial data model in V2X is presented as follows: e formalised driving brain raster spatial data model has seven spatial direction relations: NORTH, EAST, NORTHEAST, NORTHWEST, EQUAL, OVERLAP, and IN, where the NORTH, EAST, NORTHEAST, and NORTHWEST relationships indicate that the directional relationship of the intersection of two spatial data sets is empty. is model can fully describe the disjoint position relations for eight types of spatial data. e EQUAL, OVERLAP, and IN spatial position relations describe the relationship between two groups of spatial data. EQUAL reflects that the two spatial data are equal. e IN relation describes one spatial data set as a subset of the other spatial data set. e OVERLAP relationship describes non-EQUAL and non-IN relations and represents the direction of the intersection. e spatial orientation relationship in this definition is shown in Figure 5.
Based on Figure 5, the direction relationship of spatial data can be obtained by comparing the grid collection relations of the spatial data model. ere are two spatial data: Here, row a and column a represent the row value sequence and the column value sequence, respectively, of the spatial data: row a � row a1 , row a2 , . . . , row an , column a � column a1 , column a2 , . . . , column an .
(4) e min( ) and max( ) function obtain the minimum value and maximum value, respectively. us, min(row a ) and max(row a ) represent the minimum value and maximum value, respectively, of the row values in the spatial data LOCATION a . Similarly, min(column b ) and max(column b ) represent the minimum value and maximum value, respectively, of the column values in LOCATION b . e judgement conditions of the direction relationship of the spatial data in V2X are as follows:  max row a < min row b , min column a > max column b .
LOCATION a EQUAL LOCATION b Judgement condition: Judgement condition:

Spatial and Temporal Event Instance Model of V2X.
In the driving brain architecture of V2X, all data are abstracted into event instances. As the data of V2X is spatiotemporal, the event instances of the system are also spatiotemporal. V2X focuses on the object condition attribute values, such as speed, time, location, direction, status, and value. ese attributes are generated by various sensor types, which are embedded in the sensing equipment. Data collection occurs for particular objects, in which an object is a spatial-temporal event instance.

Definition 4.
e V2X time event instance contains a sequence of various sensing data of objects in the vehicular network: where ID is a unique identification value for the object in V2X. e value can be an IP address, a QuickMark code, or an RFID tag. TIME is a time attribute value that uses the time data model in Definition 1. LOCATION is a spatial attribute value that uses the spatial data model in Definition 2: where Attribute 1 , Attribute 2 , . . ., Attribute n are the values of other types of numeric attributes, including speed, acceleration, temperature, and humidity. Definition 4 emphasises that the event instance in V2X must include the spatial and temporal characteristics. us, the time attribute values and spatial attribute values of the event instance are critical. All types of sensors continuously generate data in V2X. us, these basic spatiotemporal event instance sequences constitute the instance flow of the spatiotemporal events.

The STEIM Model
In a vehicular network, various objects continuously generate temporal and spatial event flows. However, the people in the vehicle generally focus only on the event instances that satisfy certain conditions. Different vehicles tend to focus on different event instances, and different users tend to focus on different events. us, users need to indicate their interest in processing specific events. In the STEIM architecture, the model supports event-processing selections.
ese event-processing selections are transformed into the corresponding event instance flow handler by event-processing middleware to complete the processing of the event instance flow. In Figure 6, the spatiotemporal event-processing STEIM model for V2X involves the following syntax collection: the model is divided into three modules: vehicular users, on-board computer systems, and a cloud database. Vehicular users transmit their vehicle information to the on-board computer system via data-processing statements. e on-board computer system uses event flow-processing rules to parse the eventprocessing sentences and upload them to the cloud database. Vehicular users obtain vehicle information from the cloud database for other vehicular users.

Constant Collection.
e value of an event handler expression is the Boolean set, whose elements are represented by B: A collection of event instances in V2X, whose elements are represented by VE, is represented as Each event instance can contain several attributes.

VE � (ID, T, LOC, A). (13)
An identity collection of event instances in V2X has elements represented by VE i d .
A collection of time attributes for event instances in V2X has elements represented by VE t : VehicularEventTIME � start 1 , end 1 , start 2 , end 2 , . . . , start n , end n .

(15)
A collection of spatial attributes for the spatiotemporal events in V2X has elements that are represented by VE loc : e elements of other numeric attribute values of temporal and spatial events in V2X are represented by VE a :

Variables' Collection.
e variable that holds the instance of the space time event is denoted by x, and its variable set is represented by X. e variable x is composed of the object variable x id , the time variable x t , the location variable x loc , and the attribute variable x a , and is expressed as Each subvariable is specifically defined as follows: the variable x id holds the object identification value of the spatiotemporal event instance and is represented by X id ; the variable x t holds the time attribute value of the temporal and spatial event instance and is represented by X t , while the x loc holds the spatial attribute value of the temporal and spatial event instance and is represented by X loc . e variable x a holds the other numeric attribute values of a temporal and spatial event instance and is represented by X a .

Expression Collection.
e set of event-processing statements in the STEIM model is referred to as spatiotemporal event interaction (SEI). e elements of SEI are represented by sei. SEI consists of Boolean expressions. e object identification value Boolean expression that determines the occurrence of temporal and spatial events is IBSEI.

Grammar Interaction of STEIM.
e STEIM model applies to a known constant set and a variable set. A variable is usually represented by a nonnull string. In addition, variables are not empty or followed by a string.
(1) e object Boolean expression IBsei is where " � " denotes an "equal" relation. e time Boolean expression is tbsei ⩴x t BEFORET x t EQUALT x t OVERLAPT x t DU RINGT. (19) In this formula, BEFORE, EQUAL, OVERLAP, and DURING represent the temporal relations of time data. For example, the expression VehicleTime BEFORE where "EQUAL","OVERLAP", "IN", "NORTH", "EAST","NORTHWEST," and "NORTHEAST" are the seven spatial data relations that were previously defined. For example, the expression "VehicleLoc NORTH (985, 266)" determines whether the value of the spatial attribute variable VehicleLoc in a vehicle's data is located NORTH of (985, 266).
(3) e general numerical attribute Boolean expressions ABsei are described as follows: where " � " denotes an "equal" relation, ">" indicates a "greater than" relation, and "<" denotes a "less than" relation. For example, the expression "VehicleV>65" returns a Boolean value that represents whether the value of the speed variable VehicleV in a vehicle's data is greater than 65 km/h.
For example, the event-handling statement,   Mobile Information Systems 9

Setting Property Variables in STEIM.
e value of each expression in the model is determined by the value of each attribute variable. ese values are currently stored in the temporal and spatial event instance. e temporal and spatial event state of STEIM is defined as a function of the temporal and spatial EventInstance variable set of the on-board computer system: e object identification subvariable state is defined as the time-space event instance object identified by a function of the set X id to the temporal and spatial event instance object identification value set VehicularEventID: e time-dependent variable state is defined as a function of the time attribute value variable set X t to the time attribute value set VehicularEventTIME: e spatial subvariable state is defined as a function of the spatial attribute value variable set X loc to the spatial value set VehicularEventLOCATION: e state of the numerical subvariables is defined as a function of the numeric attribute value set X a to the timespace event instance numeric value set VehicularEventATTRIBUTE: δ a X a ⟶ VehicularEventATTRIBUTE. (28) us, in state δ, the value VE of the space event instance variable x is expressed as δ(x). In state δ id , the value VE id of the object identifier variable x id is expressed as δ id (x id ). In state δ t , the value VE t of the time attribute value variable x t is expressed as δ t (x t ). In state δ loc , the value VE loc of the spatial attribute variable x loc is expressed as δ loc (x loc ). In state δ a , the value VE a of the numeric attribute variable x a is expressed as δ a (x a ).
In the STEIM model, event instances of spatial and temporal events in the database are sent to clients. e client database of spatiotemporal events functions as a storage unit for the spatiotemporal event instance set EventInstance B : In state δ i d , the IBSEI waits for the calculation and evaluates the results to the Boolean TRUE or FALSE, which is expressed as 〈ibsei, δ id 〉 ⟶ B. In state δ: Σ B , the time event instance variable x results are stored in the client event database as δ ′ : Σ B′ , which is expressed as 〈ibsei, δ: Σ B 〉 ⟶ δ ′ : Σ B′ , where 〈ibsei, δ id 〉 and 〈ibsei, δ: Σ B 〉 are IBSEI expressions.

Operational Semantics of STEIM
(1) e assignment rule for an object using the Boolean IBSEI expression is expressed as follows: which is the assignment rule for the expression x id � ID. e variable name of the stored time event instance is x, and the stored child variable x id stored is the identifier value of the time event instance. If the variable x id is a constant ID in the current state δ id , the value of the expression x id � ID is the Boolean TRUE value. When the variable x id is not a constant ID in the current state x id , the value of the expression x id � ID is the Boolean FALSE value. (2) e assignment rule of the time attribute for the Boolean expression TBSEI is which is the assignment rule for the expression x t BEFORE T. e variable name of the storage timespace event instance is x. In addition, the child variable x t stores the time value of the time-space event instance. If the variable x t is δ(x t ).end < T.start in the current state δ t , the value of the expression x t BEFORE T is the Boolean TRUE. If the variable x id is δ(x t ).end ≥ T.start in the current state δ t , the value of the expression x t BEFORE T is the Boolean value FALSE. e remainder of the time-space attribute value Boolean expressions have the same assignment rule as the previous inference rule.
(3) e assignment rule of the spatial attribute for the Boolean expression LBSEI is expressed as which is the assignment rule for the expression x loc EQUAL LOC. e variable name of the stored spatial attribute event instance is x. In addition, the child variable x loc stores the time value of the spatial attribute event instance. If the variable x loc is δ(x loc ) � LOC in the current state δ loc , the value of the expression x loc EQUAL LOC is the Boolean TRUE value. When the variable x loc is δ(x loc ) ≠ LOC in the current state δ loc , the value of the expression x loc EQUAL LOC is the Boolean FALSE value. e remainder of the spatial attribute value Boolean expressions have the same assignment rule as the previous inference rule. (4) e assignment rule of a general numerical attribute for the Boolean expression ABSEI is expressed as follows: which is the assignment rule for the expression x a > A. e variable name of the stored spatial event instance is x. In addition, the child variable x a stores the number value of the spatial event instance. If the variable x a is δ(x a ) > A in the current state δ a , the value of the expression x a > A is the Boolean TRUE value. When the variable x a is δ(x a ) < A in the current state δ a , the value of the expression x a > A is the Boolean FALSE value. e remainder of the spatial value Boolean expressions have the same assignment rule as the previous inference rule.

STEIM Algorithm Based on Petri Net
Finite automata is a basic computer model with extremely limited storage capacity. It is a better model for small storage devices. Push-down automata (PDA) is a better model for infinite storage devices. It has an additional device stack. e stack provides additional unlimited storage, so the device is used as a "last in, first out" stack. It writes symbols on the stack, then reads and writes a symbol and "pushes down" all the other symbols in the stack. erefore, finite automata can provide theoretical support for some limited state transformations, such as the design of automatic door controller, and push-down automata can provide context-free language recognition. ey can play a role in some limited fields. But, these models have proved that some simple tasks cannot be completed, and are too limited to be used as a general model of computers. However, only by improving them on the basis of the two automata models can we get a more mature P1  TS1  P3  TS2   P2  TS1  P4  TS2   P3  TS4   P4  TS3  P5  TS4   P6  TS5  P8   P7  TS5  P9   TS6   P10   TS7   P11   TS8   P12   TS8   P13   P27   TS8   P28   TS9  TS9   P29   P16  TS11  P18   P17  TS11  P19   TS12   P20   P22  TS14   P21  TS13  P23  TS14   P24  TS15  P25   P14  TS10  P15   TS17   TS16   P26 (1) (4) Figure 7: e Petri net-processing model of STEIM. and useful automation model-the Turing machine. e Turing machine can be defined as a seven-tuple (Q, Σ, Γ, δ, q 0 , q accept , q reject ), where Q, Σ, Γ are all finite sets. Q is a state set; Γ is an alphabet on an infinite square. Among them, the blank symbol ∈ Γ; δ: } is the transfer function, where L and R represent their transfer direction, respectively; q 0 ∈ Q is the initial state, q accept ∈ Q is the acceptance state; q reject ∈ Q is the rejection state, and q accept ≠ q reject . A real system can be defined as a set or sum of all entities that interact and depend on each other in accordance with certain laws. e system may be natural or artificial, existing or planned for the future. Modeling of these complex systems needs to take into account the system-related factors involved in system changes, including raw materials, components, products, personnel, tools, equipment, data and information, as well as the asynchronous and parallel mode of system state changes. Turing machine is a very effective modeling tool for simple systems with serial algorithms, but it is much more difficult to apply it to complex systems. Petri net is developed from Turing machine. It provides a powerful theoretical basis and modeling tools for complex asynchronous, parallel systems, and modeling. Petri net theory was proposed by Carl A. Petri, a German scholar, in 1962. Since then, this formal description language has been widely used in many fields. Petri net is a graphical tool used to describe the behavior of complex systems. It is different from other graphical system description tools (such as flow chart, logic tree), and it can represent the parallelism, synchronization, conflict, and causal dependence in the system. Petri net is defined as a three-tuple PN � (S, T; F), where elements S and T are called Place and Transition sets of PN, respectively. F is Flow-relation. It is a set of ordered pairs composed of elements S and T. e necessary and sufficient conditions are : (x, y) ∈ F , which are, respectively, the definition domain and value domain of F. Automata, Turing machine, and Petri net have one thing in common: there is a state transition process within the system, which can be transformed from one state to another state, and can be expressed by state diagram and correlation matrix. Petri nets are equivalent to automation and Turing machines. Although they are equivalent, automata and Turing machines are not competent for simulating some complex systems with parallel, conflict, and synchronization. Petri nets have good simulation capabilities for these systems, and Petri net is also a good model to solve the reuse problem of software components.
To use the STEIM model for temporal and spatial eventstream processing in V2X, we need to compile the statements into a corresponding executable model. According to the corresponding spatiotemporal processing model, we can design an event-stream processing algorithm and a programming implementation.
A Petri net, which is also known as a place/transition (PT) net, is one of the several mathematical modeling languages for describing distributed systems. A Petri net consists of places, transitions, and arcs. Arcs run from a place to a transition or vice versa but never run between places or between transitions. e places from which an arc runs to a transition are referred to as the input places of the transition. e places to which arcs run from a transition are referred to as the output places of the transition. Graphically, places in a Petri net may contain a discrete number of marks, termed tokens. Any distribution of tokens over the places represents a net configuration, which is referred to as a "marking." In an abstract sense, when considering a Petri net diagram, a transition in a Petri net may "fire" (execute) if it is enabled.
In the event-stream processing model that is based on Petri nets, the Petri net input is indicated by the place where the event has occurred or an attribute value of one of the basic events. e output is the storage location of the database events. Each token in the place indicates whether an instance of the corresponding event is represented. When an event instance arrives, the token state in the place that represents the event will launch the transition. e transition result is calculated by calculating the transition function. When the function is satisfied, it causes the transition from the state of the input to the output until a change in the token state in the output place is detected.

Spatiotemporal Event Flow-Processing Algorithm.
In vehicular networking, space and time are the main functions of the event-stream processing program. Based on eventstream processing, the Petri net model returns the eventstream processing results; the core algorithm is shown in this section. In this algorithm, all transitions in the input Petri net model are divided into four classes: TransitionStart, TransitionMid, TransitionParallel, and TransitionEnd. Among these classes, the function of TransitionStart is to detect the attribute value of the received event instance. e TransitionStart method from the shared place is connected to TransitionMid and TransitionParallel. e method passes information to the output place of the TransitionStart, and the TransitionMid and TransitionParallel places share the same variable. TransitionEnd is a special instance of Tran-sitionMid for which no subsequent transition occurs.
is algorithm, from TransitionStart to execution, follows a Petri net structure to TransitionEnd step by step. As the number of transitions between TransitionStart and

Mobile Information Systems
TransitionEnd in the Petri net is limited, the algorithm can be terminated for a single event instance. In addition, the number of transitions in the Petri net model in this algorithm is n, and the time complexity of the algorithm for a single event instance is O(n).

Petri Net-Processing Model of STEIM.
In the Petri netprocessing model for a complex event, the input place of the Petri net indicates that the basic events and the output place of the Petri net expresses the complex events. e number of tokens in the place represents the number of event instances. When an event instance arrives, the token in the place will change. By calculating the transition function, the model can determine whether the transition conditions are satisfies. If the transition rule is satisfied, the transition will fire, and the statuses of the input and output places will change. In Figure 7, the event flow transmission rates of the event flow handlers, which correspond to the four STEIM event processing statements, are set to S 1 , S 2 , S 3 , and S 4 . e processing rates of the event flow handlers are V 1 , V 2 , V 3 , and V 4 , respectively. e service intensity of the queuing system is I � S/V, and the sufficient and necessary conditions for a stable-state distribution of the queuing system are expressed as follows: According to the random Petri net of the series structure, the network delay is calculated. We assume that the delay time required for n series transitions involves n independent  random variables. In addition, the parameters are the exponential distribution functions λ 1 , λ 2 , . . . , λ n . e average delay times for n transitions are 1/λ 1 , 1/λ 2 , . . . , 1/λ n . e total equivalent delay time for the n transitions is 1/λ � n i�1 1/λ n . In the same manner, the random Petri net delay method of parallel structures is calculated. We assume that the delay time required for n parallel transitions involves n independent random variables. e total equivalent delay times for n transitions is Figure 7 shows a comparison of the event flow handler's performance, which corresponds to the four STEIM models. e parameters for the same types of transitions are set to the same processing rate. e parameters are listed in Table 1. e processing rate of the event flow handler is V i � λk. As the service intensity of the queuing system is To analyse the dynamic performance of the instance, we construct an application scenario in which the arrival rate of event flow S changes. e processing rate of the computer is constant at k (we set k � 50). e dynamic performance of the instance system is shown in Table 2. When the computer processing speed is constant and the event-stream transmission rate increases, the expected system event processing slowly increases. e expected residence time of events in the system slowly increases, and the expected waiting time for each event slowly increases. As the event-stream transmission rate increases, the event waiting time ratio slowly increases. Model 1 is the most expensive model, and Model 2 involves the least amount of time spent by the four event flow handlers to process events.

Experimental Results and Analysis
To test the effectiveness of the system based on the STEIM model for V2X event-stream processing, the following is theoretical derivation and derivation indicate that the operational semantics of the STEIM language are effective. discussions address two aspects: theoretical derivation and simulation example verification. e experiment results are analysed and compared. Figure 12 shows the experimental and test platform of the STEIM model. On the data integration and analysis platform, the data analysis is performed on the industrial personalCcomputer (IPC) and data transmission is con-ducted via the LTE network. Figure 13 shows the data test vehicle group. During the experiment, IPC was received by each device in the test vehicle on the project team. According to the output results of the STEIM model, vehicle control based on the CAN bus was performed. All tests were performed on campus and the playground.
e temporal and spatial event instance in the instance flow of temporal and spatial events is recorded as EI. Table 2 lists the values of a spatial and temporal event stream.
Four users (User 1 , User 2 , User 3 , and User 4 ) in V2X that are monitoring the vehicle, respectively. As these users are concerned with different events, they use the following four STEIM statements, which are referred to as EventInstence, to process the spatiotemporal event flow generated by the vehicle. Two spatial data sets are established: ‖ VehicleV > 60. (38) e STEIM statement of vehicle User 2 is EventInstence 2 :        Table 3.
Two examples are selected to illustrate the derivation process.
Formula derivation 1: User 2 ′ s event processing statement EventInstence 2 handles the processing of the time event instance EI 2 as follows.
e current temporal and spatial event instance is EI 2 . In the current on-board computer system, the state of the Input: temporal and spatial event flow, STEIM statement Petri net model Output: an event instance that satisfies the STEIM statement condition (1) while TRUE do (2) Event ⟵ it is an instance of an Event that the current pointer points to.
us, in the EventInstence 2 calculation results of the on-board computer system, the spatial and temporal event variable for each attribute variable (VehicleID, VehicleTime, VehicleLoc, and VehicleV) value is empty, and User 2 client's event library remains unchanged.
Formula derivation 2: User 4 's event processing statement EventInstence 4 handles the processing of the time event instance EI 4 as follows. e current temporal and spatial event instance is EI 4 , and in the current on-board computer system, the state of the temporal and spatial event variable is δ 4 As shown by this derivation, the spatiotemporal event instance EI 4 time attribute values satisfy the event-processing statement EventInstence 4 time expression. us, in the EventInstence 4 calculation results of the on-board computer system, the spatial and temporal event variable for attribute variable (VehicleID, VehicleTime, VehicleLoc, and VehicleV) value is empty. us, vehicle User 4 client's event library remains unchanged.
Based on the corresponding operational semantics, other STEIM statements are similar to the reasoning process of the five temporal and spatial event instances listed in Table 3. e set of four user events store the initial state of Σ B1 , Σ B2 , Σ B3 , and Σ B4 . Using the spatiotemporal event instance flow theory in Table 3, the results shown in Table 4 are obtained.

Performance Analysis.
We run experiments in the proposed scheme in terms of computation costs of the RSU and the vehicles and communication overhead of the RSU and the vehicles. e experimental hardware includes an Intel Core i7-7900 processor with a 3.60 GHz clock frequency and 64 GB of memory. e performance results of the proposed scheme and the relevant models are shown in Table 5.
In Figure 14, we plot and compare the computation cost of the vehicle in terms of the data dimension, which ranges from 5 to 40, during the data collection phase. Meanwhile, in Figure 15, we plot and compare the computation cost of RSU in the three schemes in terms of the data dimension that ranges from 5 to 40, during the data acquisition phase. e comparison results show that compared with the [22] scheme and traditional scheme, STEIM can greatly reduce the computation complexity of the involved entities.

Simulation Results and Analysis.
Based on the operational semantics of the STEIM model and the spatiotemporal event flow processing (Algorithm 1), which are based on a Petri net, the following experiment is performed. First, we implemented the STEIM model compiler using the open source tool ANTLRWorks 1.5. ANTLER is a for language recognition that provides a framework for constructing recognisers, interpreters, compilers, and translators from grammatical descriptions that contain actions in a variety of target languages. e experimental hardware includes an Intel Core i7-4790 processor with a 3.60 GHz clock frequency and 32 GB of memory. Figure 16 shows the syntax of the STEIM model based on the ANTLRWorks tool.
In the simulation experiment, a STEIM statement is entered into the event editor interface, and a unique number is set for each STEIM statement. e statement is activated, and the number of events represented by the STEIM statement is displayed in the event query result list. e user can select the number of events to obtain a detailed listing of the events in the event query result details. e initial state of the event library with 4 users is an empty set. e simulation results of the spatiotemporal event instance flow listed in Table 3 are shown in Table 6.
As shown in Table 6, the spatiotemporal event flow algorithm based on a Petri net is effective. A comparison of the results of Tables 4 and 6 reveals that the results after theoretically deriving the STEIM operation semantics of the model and the experimental results from the simulation program using the structure shown in Algorithm 1 are consistent and support each other.
ese results demonstrate that processing a vehicular networking spatiotemporal event stream based on the STEIM model proposed in this paper is effective.

Conclusion
In this paper, we propose the spatiotemporal operator and the complete grammar of STEIM. is approach effectively expresses the spatiotemporal information of the spatiotemporal event flow in V2X. e formal semantics of the STEIM model is used to design the operational semantics. In addition, we provide a spatiotemporal event-stream processing algorithm that is based on a Petri net model. is algorithm establishes a working mechanism for processing the V2X event-temporal and spatial event stream. In addition, we demonstrate the effectiveness of the system based on STEIM via experiments. Future work should consider protecting the security of information and ensuring the reliable transmission of event streams. As the scale of event flows in V2X increases, conducting distributed event flow processing in vehicular network environments requires further study.

Data Availability
In our research, we made experiments to verify our theory. However, the experimental data in our paper used to support the findings of this study have not been made available because the data will be used commercially.

Conflicts of Interest
e authors declare that they have no conflicts of interest.