Abstract

Mutual exclusion problems widely exist in discrete event systems in which several processes will compete for the common resource for maintaining their normal running. This competition is mutually exclusive. However, a special behavior, that is, periodic mutual exclusion behavior, is important for many discrete event systems. Once a process obtains the common resource, it will consecutively obtain the common resource in the following several competitions. The other processes should wait for the release of the common resource. All processes will compete for the common resource again after the common resource is released. These competitions have obvious periodicity. In this paper, a methodology is proposed to design periodic mutual exclusion supervisors to control the periodic mutual exclusion behavior in discrete event systems. Moreover, two original structural conversion concepts, called -derivation and -convergence processes, are proposed to construct the periodic mutual exclusion supervisors. The discussion results show that many undesirable execution sequences are forbidden since the periodic mutual exclusion behavior is controlled by the proposed periodic mutual exclusion supervisors. Finally, an example is used to illustrate the proposed methodology.

1. Introduction

Discrete event systems [1] are classic dynamic systems, which widely exist in communication, manufacturing, traffic, and computer network fields, such as e-business systems, online game server systems, embedded systems, flexible manufacturing systems, and traffic management systems [2]. The concurrency behavior [3] of discrete event systems is to consider several events that simultaneously occur and potentially interact with each other. Concurrent events can be alternately executed on a single processor but can be also concurrently executed on several processors. The occurrence sequences of these concurrent events are important since system concurrency behavior can optimize system performances and promote the sufficient utilization for finite system resources [4].

The occurrence of some concurrent events may simultaneously occupy some special resources, such as a CPU, a printer, a robot, or a shared file. These special resources are finite because of the restriction of high implementation costs. Therefore, these concurrent events should share their special resources. This will form a competition among these concurrent events [5]. On the other hand, the competition will maximize the utilization of shared special resources. A most widespread and important phenomenon is that only one special resource can be used for several concurrent events. This results in a mutual exclusion behavior [6] for these concurrent events (only one of them can obtain the special resource at the same time and the other events should wait for the release of the occupied special resource). Mutual exclusion behaviors as an important character in discrete event systems are usually used for resource allocation (resource sharing) or marking constraint in Petri nets [7], such as the user request distribution in a single input cluster of computer servers, the raw material distribution of a robot for two production lines, and the database access control for multiple processes.

In discrete event systems, the special resource utilization rates are an important indicator to measure the performance of discrete event systems. It is necessary to design appropriate control strategies to control the special resource distribution for discrete event systems. The purpose is to maximize the utilization of shared special resources. The authors in [8] consider deterministic feasibility and time complexity of two fundamental tasks in the distributed computing of consensus and mutual exclusions. In [9], a mutual exclusion element is described using a reflective semiconductor optical amplifier and a simple scheme for contention resolution in arrayed waveguide grating router based optical switches in data centers. The authors in [10] propose an approach to compete for the privilege of passing the intersection that is a classical mutual exclusion problem via the communications among vehicles and infrastructure. In [11], two algorithms are presented to compete for exclusive access to a shared resource among geographically close nodes in a mobile ad hoc network.

Supervisory control theory [12, 13] is widely used to perform the controller syntheses of discrete event systems, which is proposed by Ramadge and Wonham based on automata [14, 15]. In order to avoid the numerous state representations of automata, the subsequent researchers use Petri nets to study the control strategies. The authors in [16] present a framework for supervisor synthesis for discrete event systems. The approach is based on compositional minimization by using concepts of process equivalence. For the studies of control strategies in discrete event systems, maximally permissive problems should be considered. The authors in [17] present a computational method to design optimal control places in order to obtain a maximally permissive liveness-enforcing supervisor by using a vector covering approach. The authors in [18] distinguish between the offline and the online computation that is required for the effective implementation of the maximally permissive deadlock avoidance policy. The authors in [19] study the maximally permissive abstractions for the hierarchical and decentralized control of large-scale discrete event systems. Moreover, the structure optimization problems of supervisors are also important. The authors in [20] present two iterative deadlock prevention policies for flexible manufacturing systems. The proposed methods can reduce the overall computational time. The authors in [21] propose a deadlock prevention method to obtain maximally permissive supervisor and minimize its structure. The authors in [22] propose a deadlock prevention method for a flexible manufacturing system with a minimal supervisory structure. Furthermore, researchers also concern the design and implementation problems of Petri net based supervisors. In [23], the authors present the design, generation, and implementation of coordinating discrete event control code using Petri nets for an operating flexible manufacturing system. The authors in [24] use Petri nets to model the operated behaviors and to synthesize the command filters in a command filtering framework. Automation Petri nets can be used to perform the design and implementation of discrete event control systems by converting automation Petri nets into ladder diagrams on programmable logic controllers [25].

The main researches of supervisory control theory are divided into several classic problems based on Petri nets, that is, forbidden-state problems [26, 27], forbidden-string problems [28, 29], deadlock prevention problem [30], and liveness maintenance problems [31, 32]. The deadlock prevention problems and liveness maintenance problems can be transformed to forbidden-state problems directly [33, 34]. The authors in [35] address the forbidden-state problem of Petri nets by computing maximally permissive Petri net controllers. The design of control strategies for mutual exclusion mechanisms can be considered as resolving a forbidden-string problem. The authors in [36] use a colored generalized stochastic Petri net model to study the performance and correctness of a Lamport concurrent algorithm to solve the mutual exclusion problems. The authors in [37] discuss the simultaneous events in mutual exclusion transitions. The execution modes of sequential function charts are presented based on Petri nets. In [38], a method is proposed to control the occurrence of simultaneous events in mutual exclusion transitions by Petri nets based on supervisory control theory. The authors in [5] formulate two resource-sharing concepts, that is, parallel mutual exclusion and sequential mutual exclusion, and provide a theoretical basis for Petri net synthesis methods to model systems.

A class of specifications, that is, generalized mutual exclusion constraints, is studied in [39] for discrete event systems modeled using place/transition nets. According to these specifications, many constraints that deal with mutual exclusion problems between state and events or just events themselves can be transformed into generalized mutual exclusion constraints. This can be enforced by a set of places if all transitions are controllable. For the transitions that are uncontrollable, this specification is not always applicable. The authors in [40] provide a class of generalized mutual exclusion constraints on a class of forward-concurrent-free nets. In [41], a type of specification, called OR-AND generalized mutual exclusion constraints, is defined for place/transition nets. Such a specification consists of a disjunction of conjunction of several single generalized mutual exclusion constraints. The authors in [42] enforce the generalized mutual exclusion constraints on a Petri net plant by replacing the classical partition of event set into controllable and uncontrollable events from supervisory control theory. In [43], an algorithm is presented to transform a given generalized mutual exclusion constraint into an optimal admissible one for a class of Petri nets whose uncontrollable influence subnets are forward synchronization and backward conflict-free nets.

It is difficult to summarize the constraints for complex mutual exclusion mechanisms and special optimization problems in discrete event systems by using the existing control strategies, such as the following described periodic mutual exclusion problems. In many discrete event systems, one of the concurrent processes will occupy a common resource to maintain its normal running. To satisfy some special requirements, this process will consecutively obtain the common resource during the competition of the following finite times after it won a competition. The other processes only can wait for the release of the common resource. All concurrent processes will form a new competition again after this process finishes a periodical operation for the special requirements and the common resource is released. This mutually exclusive competition among these concurrent processes has periodicity, called periodic mutual exclusion behavior. It is necessary to design appropriate control strategies to distribute the common resources for these concurrent processes to control the periodic mutual exclusion problems.

In this paper, a methodology is proposed to design periodic mutual exclusion supervisors to control the periodic mutual exclusion behavior in discrete event systems. The structures of general mutual exclusion systems and periodic mutual exclusion systems are defined by using Petri nets. The proposal is convenient to construct formal models to analyze the properties of the two classes of mutual exclusion systems. Two original structural conversion concepts, called -derivation process and -convergence process, are proposed to construct the periodic mutual exclusion supervisors. The main idea is to derive a common resource to several virtual resources by the preliminary -derivation processes if a process obtains the common resource and these derived virtual resources will be converged into a common resource by the final -convergence processes after this process releases the common resource. The execution sequences of all processes are discussed in mutual exclusion systems with general mutual exclusion supervisors and periodic mutual exclusion supervisors, respectively. The discussion results show that many undesirable execution sequences are forbidden in the mutual exclusion systems with the periodic mutual exclusion supervisors because the periodic mutual exclusion behavior is controlled by these periodic mutual exclusion supervisors. Finally, a real example is used to illustrate the proposed methodology.

The main contributions of this paper are concluded as follows:(1)The structures of general mutual exclusion systems and periodic mutual exclusion systems are defined by using Petri nets. The proposal is convenient for constructing formal models for these two classes of mutual exclusion systems.(2)Two original structural conversion concepts, that is, -derivation process and -convergence process, are proposed to derive a common resource to several virtual resources in the preliminary stage and converge these virtual resources into a common resource in the final stage, respectively. The purpose is to enhance the execution permission for each process that obtains the common resource.(3)A methodology is proposed to design periodic mutual exclusion supervisors to control the periodic mutual exclusion behavior in discrete event systems. In the enhanced mutual exclusion systems, many undesirable execution sequences of all processes are forbidden by the periodic mutual exclusion supervisors.

The rest of this paper is organized as follows. Section 2 briefly recalls some basics of Petri nets. Section 3 introduces a class of mutual exclusion systems with resources and their periodic mutual exclusion behavior is discussed. Section 4 proposes the design method of periodic mutual exclusion supervisors. Section 5 gives the discussion of periodic mutual exclusion behavior in general mutual exclusion systems and periodic mutual exclusion systems. Section 6 introduces two examples to illustrate the proposed methods. Finally, the proposed methods are concluded in Section 7.

2. Preliminaries

We assume that the readers are familiar with the basics of Petri nets. Only some key concepts of Petri nets are provided. More details can be found in [44].

A Petri net is a 4-tuple , where and are finite, , , and . is a set of places and is a set of transitions. is called a flow relation represented by an arc with arrow from places to transitions and transitions to places. is a mapping that assigns a weight to an arc, where is the set of nonnegative integers. A Petri net is called an ordinary net if, , (denoted as ). An ordinary net is called a state machine if such that has only one input place and only one output place. A Petri net is self-loop-free if and only if such that and .

A marking of is a mapping from to . is called a net system, where is the initial marking of . The preincidence matrix of is . The postincidence matrix of is . A self-loop-free Petri net can be represented by its incidence matrix , where is a integer matrix with . For , denotes the sum of tokens contained in place . Place is marked by a marking if and only if . A subset is marked by if and only if such that is marked by . The sum of tokens in all places in is denoted by ; that is, . The subset is said to be empty at if and only if .

The preset of a node is defined as and the postset of a node is defined as . For a set of nodes , and . represents the item count in . A transition is enabled at a marking if such that , which is denoted as . If is enabled, its firing yields another marking such that, , denoted as . Marking is called reachable from if there exists a firing sequence such that . This is denoted by .

A -vector is a column vector indexed by , where is the set of integers. We denote a column vector where every entry equals 0(1) by 0(1). and are the transposed versions of vector and matrix , respectively. -vector is a -invariant if and . is called the support of . (resp., ) denotes the positive (resp., negative) support of . -invariant is called a minimal -invariant if is not a superset of the support of any other one and its components are mutually prime. If is a -invariant of , then such that .

3. Mutual Exclusion Systems with Resources

In this section, the model of mutual exclusion systems with resources (MESRs) is defined by using Petri nets with three classical patterns, that is, parallel pattern, dispersive pattern, and polymeric pattern. The details are shown as follows.

Definition 1. Let be a Petri net and be a node of . Node is called a root of if . Node is called a leaf of if .

For a Petri net, it may contain one or more roots and leaves. However, it is impossible to contain one or more roots or leaves in any closed-loop Petri net.

Definition 2. Let be a Petri net and be nodes such that , where , , and . A transient process, denoted as , can be defined if , where .

Definition 3. Let be a state machine and be nodes such that , where and . is called a linearity process if (1) is a set of places that represent the states of system;(2) contains only a root and a leaf, where is the root of , is the leaf of , and ;(3) only exhibits a transient process, denoted as .

Definition 4. Let be a linearity process and be the transient process from to . If all places are removed from , the rest of the transient process , denoted as , is called the T-Process of .

Figure 1(a) shows a linearity process . Place is a root and place is a leaf of . is a transient process and is a T-Process of . Figure 1(b) shows another linearity process . Place is a root and place is a leaf of . is a transient process and is a T-Process of . Figure 1(c) shows a Petri net that is not a linearity process since it contains two transient processes and . Figure 1(d) shows a Petri net that is also not a linearity process since it is not a state machine.

In a linearity process, the firing of its transitions may be restrained by some special resources, such as a CPU, a robot, a balancer, or a printer. Therefore, a linearity process with a special resource is defined as follows.

Definition 5. Let be a linearity process and place be a resource. A linearity process with the resource , denoted as , is defined as follows: (1) and .(2) such that and .(3), where is the initial marking.

Let be a linearity process with the resource . , the firing of will obtain the special resource . Conversely, , the firing of will release the special resource . Figure 2(a) shows two linearity processes with two special resources and ; that is, and . In , the special resource is occupied if fires and it is released if fires. This characteristic also exists in .

In a discrete event system, it may contain several linearity processes that compete for a common special resource. These linearity processes of the discrete event system can construct a mutual exclusion system.

Definition 6. Let and with () be () linearity processes with resources such that , , . An MESR, denoted as , is defined as follows: (1), , , , , where is the initial marking of .(2).(3). The MESR can be represented with one of the following three classical patterns: (i) is represented with dispersive pattern if , , and .(ii) is represented with parallel pattern if and .(iii) is represented with polymeric pattern if , , , , , , and .

Figure 2(b) shows an MESR with dispersive pattern, which resulted from the composition of and depicted in Figure 2(a) via and . Figure 2(c) shows an MESR with parallel pattern, which resulted from the composition of and via . Figure 2(d) shows an MESR with polymeric pattern, which resulted from the composition of and via , , , and .

Property 1. Let be an MESR with and be the initial marking of . Then, satisfies

Proof. It is easy to see that place and all places in can construct a -invariant. The result naturally holds.

For example, the MESR with dispersive pattern depicted in Figure 2(b) satisfies the restriction . Similarly, the MESR with parallel pattern depicted in Figure 2(c) satisfies the restriction . For the MESR with polymeric pattern depicted in Figure 2(d), it satisfies the restriction .

Property 2. Let be an MESR with dispersive pattern and be a marking of , where is the initial marking of . Then, such that holds if such that holds.

Proof. Since is an MESR with dispersive pattern, we can assume . Then, we have . If such that holds, we have and . However, , we have according to the structure of the MESR with dispersive pattern. Therefore, , holds since and . This means that, , holds.

Property 3. Let be an MESR with parallel or polymeric pattern and be a marking of , where is the initial marking of . Then, , holds if and such that .

Proof. , we have according to the structure of the MESR with parallel or polymeric pattern. If and such that , we have that, , holds.

Let be an MESR. Then, all transitions contained in are mutually exclusive. , will compete for the common resource for running its linearity process. If fires (its linearity process obtains the common resource), cannot fire (they need to wait until they obtain the common resource) since only contains a common resource. , will release the common resource from its linearity process. This should particularly emphasize that all transitions contained in will compete for the common resource again for their linearity processes if the common resource is released. For the MESR with dispersive pattern depicted in Figure 2(b), transitions and are both enabled or disenabled for all marking. If they are enabled, they will compete for the common resource . Once the common resource is released by one of the transitions and , transitions and will compete for the common resource again. Similar competitions also exist in the two MESRs depicted in Figures 2(c) and 2(d).

For an MESR, it may have some special requirements that are concluded as follows:(i)One of its linearity processes will be consecutively executed times once this linearity process obtains the common resource, where is an integer. The other linearity processes cannot be executed and need to wait until they obtain the common resource.(ii)Once this linearity process is consecutively executed times and the common resource is released, all linearity processes will compete for the common resource again.

These linearity processes are mutually exclusive with these special requirements. Their mutual exclusion characteristics are called periodic mutual exclusion behavior that widely exists in discrete event systems, such as the online team game server systems, flexible manufacturing systems, and intelligence traffic dispatch systems.

For the traditional mutual exclusion behavior, the methods of generalized mutual exclusion constraints presented in [39] can be used to design supervisors to perform the control of mutual exclusion mechanisms. However, it is difficult to use generalized mutual exclusion constraints to control the periodic mutual exclusion behavior. Therefore, the general mutual exclusion supervisors should be extended to handle these special problems.

4. Design of Enforced Supervisors

In this section, the methods of generalized mutual exclusion constraints are simply reviewed, which can be used to design general mutual exclusion supervisors. Furthermore, two important concepts, that is, -derivation process and -convergence process, are defined to extend the general mutual exclusion supervisors. Finally, a method is proposed to design periodic mutual exclusion supervisors to control periodic mutual exclusion problems.

The mutually exclusive competition for a common resource is a classical character in MESRs. Generalized mutual exclusion constraints can be used to design supervisors to perform the mutual exclusion mechanisms. For example, Figure 3(a) shows a plant that is composed of two linearity processes. If we assume that only one of the competition transitions and can fire in the plant, we have a restriction , where is a marking of the plant. A supervisor of the plant can be obtained by using the methods of generalized mutual exclusion constraints, as shown in Figure 3(b). The details about the methods of generalized mutual exclusion constraints can be found in [39]. The controlled system that is combined by the plant and the supervisor is shown in Figure 2(b). It can satisfy the restriction .

In order to design enhanced supervisors to control the periodic mutual exclusion behavior for MESRs, two important concepts, -derivation process and -convergence process, are defined as follows.

Definition 7. Let be a Petri net such that , , and , be a place, be a transition, and be an integer. Then, a -derivation process from to , denoted as , is a Petri net if , , , , , , and . Transition is called the derivative transition of . Place is called the derivation place of . is called the derivation coefficient of .

In the Petri net depicted in Figure 4(a), transition can fire only once since place contains only one token. Figure 4(b) shows a three-derivation process from to , which is transformed from the Petri net depicted in Figure 4(a). Transition is the derivative transition. Place is the derivative place and the derivation coefficient is three. Transition can fire three times after fired. The firing time of is derived from one to three.

Definition 8. Let be a Petri net such that , , and , be a place, be a transition, and be an integer. Then, a -convergence process from to , denoted as , is a Petri net if , , , , , , and . Transition is called the emergence transition of . Place is called the emergence place of . is called the emergence coefficient of .

A -convergence process from to is an inverse process of a -derivation process from to . In the Petri net depicted in Figure 4(c), each firing of transition will add a token to place . Figure 4(d) shows a three-convergence process from to , which is transformed from the Petri net depicted in Figure 4(c). Transition is the convergence transition. Place is the convergence place and the convergence coefficient is three. Only one token is added to place after transition fires three times. The firing time of is converged from three to one.

Definition 9. Let be an MESR with . Petri net with is called the mutual exclusion supervisor of if , , , and .

For example, Petri net depicted in Figure 3(b) is the mutual exclusion supervisor of the two MESRs depicted in Figures 2(b) and 2(c), respectively.

Actually, a -derivation process is a virtual resource expansion process. It can derive a resource to resources. The common resource can be virtually derived to virtual resources by the -derivation process. Similarly, a -convergence process is a virtual resource constriction process. It can converge resources to a resource. The virtual resources can be converged to a common resource by the -convergence process. Therefore, the methods of -derivation process and -convergence process can be used to extend general mutual exclusion supervisors to control periodic mutual exclusion behavior.

Definition 10. Let be an MESR, be the mutual exclusion supervisor of with and , and be two sets of places such that and , and and be two sets of transitions such that and , where , , and . Then, Petri net is called the periodic mutual exclusion supervisor of if, , and satisfy the notion that (i)Petri net is a -derivation process from to ;(ii)Petri net is a -convergence process from to .

() is the derivation coefficient and convergence coefficient of and , respectively.

The main idea of designing periodic mutual exclusion supervisors is to derive a common resource to several virtual resources by the preliminary -derivation processes and these derived virtual resources will be converged to a common resource by the final -convergence processes. Note that the -derivation processes and the -convergence processes come in pairs to derive and converge the common resource, respectively, in the periodic mutual exclusion supervisor of any MESR.

Figure 5 shows the periodic mutual exclusion supervisor for the two MESRs depicted in Figures 2(b) and 2(c), where , , , , , , and . is a three-derivation process from to and is a three-convergence process from to . Similarly, is a three-derivation process from to and is a three-convergence process from to .

For a given MESR with , it may contain the behavior of periodicity mutual exclusion. This behavior contains two important features, that is, mutual exclusion feature and periodic feature. The proposed approach to design the periodic mutual exclusion supervisor for MESR can be decomposed into two main steps as follows:(1)Extracting the mutual exclusion supervisor from the given MESR according to Definition 9(2)Converting the extracted mutual exclusion supervisor into the periodic mutual exclusion supervisor by using the paired -derivation processes and -convergence processes according to Definition 10.

After obtaining the periodic mutual exclusion supervisor , the periodic mutual exclusion behavior of MESR can be controlled by combining the periodic mutual exclusion supervisor with the MESR .

Definition 11. Let be an MESR with and be the periodic mutual exclusion supervisor of , where and . Petri net is called the enhanced MESR if , , , , and .

In an enhanced MESR, all of its linearity processes will compete for a common resource with periodic mutual exclusion behavior. However, the periodic mutual exclusion behavior is controlled by its periodic mutual exclusion supervisor. One of its all linearity processes can consecutively obtain the common resource with times from the following competitions, where is an integer. All of its linearity processes will compete for the common resource again after this linearity process releases the common resource.

5. Discussion

Let and with ( and ) be linearity processes with resources, be an MESR that is composed of the linearity processes, and be the initial marking of . Then, the permutation [45] of executing the T-Processes of the linearity processes in , denoted as , is discussed as follows:(i)If is represented with dispersive pattern, we assume . Then, , and . In the MESR , , the linearity process that contains transition will be executed if fires. The firing of transition will take away a token from and a token from . Therefore, each token contained in place may be taken away by one of the transitions in . Let . According to the methods of combinatorics [45], we assume that all tokens contained in are taken away by the transitions. The permutation of executing the T-Processes of the linearity processes in is a full permutation that is(ii)If is represented with parallel or polymeric pattern, we have , , , , and . Then, , all tokens contained in place only can be taken away by the transitions contained in . Let , where . According to the methods of combinatorics [45], a multiset is constructed. Therefore, the permutation of executing the T-Processes of the linearity processes in is also a full permutation that is

If the MESR is supervised by a periodic mutual exclusion supervisor with , the periodic mutual exclusion behavior will be controlled. Let be the derivation coefficient and emergence coefficient of the -derivation processes and the -convergence processes in the periodic mutual exclusion supervisor , respectively, where is an integer. In the enhanced MESR that is constructed by combining the MESR with the periodic mutual exclusion supervisor , the permutation of executing the T-Processes of the linearity processes in , denoted as , is discussed as follows:(i)If is represented with dispersive pattern, we have and . We assume . In the enhanced MESR , , each firing of will continuously take away tokens from once obtains the common resource since it will continuously fire times. Let . The tokens contained in place can supply the firing of these transitions contained in with times, where is the ceiling function of . According to the methods of combinatorics [45], the permutation of executing the T-Processes of the linearity processes in is(ii)If is represented with parallel or polymeric pattern, similarly, we have , , , , and . Then, , all tokens contained in place only can be taken away by the transitions contained in . Let , where . Then, , all tokens contained in place can supply the firing of these transitions contained in with times, where is the ceiling function of . According to the methods of combinatorics [45], a multiset is constructed. Therefore, the permutation of executing the T-Processes of the linearity processes in is

Let , where and are two integers. For the MESR with dispersive pattern and its enhanced MESR , according to (2) and (4), we haveLet, , , where and are two integers. For the MESR with parallel or polymeric pattern and its enhanced MESR , according to (3) and (5), we haveIt is clear that , where if . This means that many undesirable execution sequences of the T-Processes in are forbidden compared with that in . The reduced parts are due to the control of the periodic mutual exclusion supervisor for .

6. Example

In real world applications, periodic mutual exclusion behavior widely exists in many discrete event systems, such as game server systems, flexible manufacturing systems, intelligent security inspection systems, and other resource distribution systems. The server systems of many online team games suffer from periodic mutual exclusion problems. Figure 6(a) shows a server system of QQ Chinese Poker that is a popular online team game in China. It is constructed with two local servers, called Server 1 and Server 2, that are geographically distributed in different regions. All players need to visit the server system through the Internet and log in the server system. The load balancer of the server system should reasonably distribute all legal players into the two local servers unless they choose Server 1 or Server 2 themselves. The load balancer contains two main distribution rules that are concluded as follows:(1)Players should join a team if they want to play a game and each team consists of four players. A team can be created only when all four players participate in the same server system. Then, the four players can play a game together.(2)A player can join only one team at a time.

Figure 6(b) shows the Petri net model of the server system. Figure 6(c) shows an MESR with dispersive pattern, denoted as , which is a subsystem of the server system. It contains two linearity processes and that represent the two distribution processes of the two server systems. The two linearity processes share a common resource that represents the load balancer. The two T-Processes of the two linearity processes and are and , respectively. The nodes of the MESR depicted in Figure 6(c) are illustrated as follows:(i)Place is the root of the MESR . It represents the notion that all players are waiting for the distribution of the load balancer.(ii)Place (resp., ) represents the notion that a player is being distributed to Server 1 (resp., Server 2).(iii)Place (resp., ) represents the notion that a player has been distributed to Server 1 (resp., Server 2).(iv)Transition (resp., ) represents the notion that the load balancer begins to distribute a player to Server 1 (resp., Server 2).(v)Transition (resp., ) represents the notion that the load balancer finished distributing a player to Server 1 (resp., Server 2).

We can assume that there are nine players that are waiting for the distribution of the load balancer in MESR . This means and , where is the initial marking of . If the periodic mutual exclusion behavior is ignored in the MESR , according to (2), the permutation of executing the two T-Processes in is

This means that there are 512 distribution results for the nine players. For example, a distribution result is constituted by the six T-Process and three T-Process . This distribution result represents the notion that six players are distributed into Server 1 and only three players are distributed into Server 2. In this distribution result, only one team can be created and only four players can play game in Server 1 at this time according to the distribution rules. Figure 7(a) shows the firing sequence of the six T-Process and three T-Process . Similarly, Figure 7(b) shows another distribution result that is constituted by three T-Process and six T-Process . In this distribution result, only one team can be created and only four players can play a game in Server 2 at this time. The two distribution results are unreasonable since there are five players that cannot be distributed into a team to play a game. They are only two of the 512 distribution results. There are many similar unreasonable distribution results in the 512 distribution results, which should be controlled by a periodic mutual exclusion supervisor.

According to the distribution rules, the MESR has the periodic mutual exclusion behavior. In fact, there is an ideal result that two teams can be created and eight players can play a game at the same time for the nine players. The distribution result depicted in Figure 7(c) is an ideal distribution result that is constituted by five T-Process and four T-Process . In this distribution result, eight players can play a game at this time, where a team is created in Server 1 and another team is created in Server 2. Similarly, Figure 7(d) shows also an ideal distribution result that is constituted by four T-Process and five T-Process . In the two distribution results, only one player is waiting to join a team. We can see that the last two distribution results are better than the previous two distribution results. Therefore, this server system is not optimal.

In order to optimize this server system, we stipulate that if the load balancer distributes a player into Server 1 (resp., Server 2), the following three players should be also distributed into Server 1 (resp., Server 2). This is a classical periodic mutual exclusion problem. Therefore, a periodic mutual exclusion supervisor can be designed to control the load balancer to reasonably distribute players into Server 1 or Server 2.

For the MESR with , we can extract the mutual exclusion supervisor from according to Definition 9. Figure 8(a) shows the extracted mutual exclusion supervisor . Next, we can convert the extracted mutual exclusion supervisor into the periodic mutual exclusion supervisor by using two paired -derivation processes and -convergence processes according to Definition 10, where the derivation coefficient and convergence coefficient are four; that is, . Figure 8(b) shows the details of the conversion processes. The conversion processes from to and from to are two four-derivation processes and the conversion processes from to and from to are two four-convergence processes. Figure 8(c) shows the converted periodic mutual exclusion supervisor .

After obtaining the periodic mutual exclusion supervisor , an enhanced MESR with dispersive pattern can be constructed according to Definition 11. Figure 9(a) shows the enhanced MESR . Transitions and of the two T-Processes are mutually exclusive. According to (4), the permutation for executing the two T-Processes in is

This means that there are eight distribution results for the nine players in the enhanced MESR . It contains the two distribution results depicted in Figures 7(c) and 7(d). Comparing with the general MESR , about 504 (98.44%) undesirable distribution results are forbidden by the periodic mutual exclusion supervisor . The complete control system with periodic mutual exclusion supervisor is shown in Figure 9(b). For the nine players in the complete control system, two teams can be created and eight players can play a game. Only one player needs to wait for other players to visit this server.

Periodic mutual exclusion problems also exist in flexible manufacturing systems. For example, let a flexible manufacturing system contain a robot, two conveyors, and two machines. The robot is responsible for moving a part from one of the two conveyors to a corresponding machine. The two machines can use four parts to produce a product, respectively. This flexible manufacturing system will suffer from periodic mutual exclusion problems. If there are only nine parts that will be used to produce products, an ideal result is that two products are produced by eight parts. However, it is possible in this flexible manufacturing system that only one product is produced by four of the nine parts. For the other five parts, two parts are distributed to a machine and three parts are distributed to another machine. Therefore, it is feasible to design a periodic mutual exclusion supervisor to control the periodic mutual exclusion behavior of this flexible manufacturing system. Moreover, intelligent security inspection systems also suffer from periodic mutual exclusion problems. An effective measure to solve the heavy congestion problems of public transportation stations is to quickly disperse passengers. Generally, several familiar passengers will adjacently stand in the same queue to go through a security inspection system. They will leave the station after all of them go through the security inspection system. When all passengers stand in several queues to go through a security inspection system, it is a typical periodic mutual exclusion problem. If a passenger goes through the security inspection system, the adjacent passengers who stand in the same queue with the previous one should preferentially go through the security inspection system since they may be familiar with each other. Therefore, the proposed periodic mutual exclusion supervisors can control the periodic mutual exclusion behavior in the security inspection system to improve the congestion problems as far as possible. Furthermore, many resource distribution systems also suffer from periodic mutual exclusion problems. The proposed methodology can be extended to design periodic mutual exclusion supervisors to control these periodic mutual exclusion problems.

7. Conclusions

In this paper, periodic mutual exclusion behavior is controlled by the proposed periodic mutual exclusion supervisors in discrete event systems. The proposed -derivation processes and -convergence processes can forbid the undesirable execution sequences. The purpose is to optimize the control ability of the designed periodic mutual exclusion supervisors. The example results illustrate that a common resource can be derived to several virtual resources by using a -derivation process. Similarly, several virtual resources can be converged into a common resource by using a -convergence process after the executing process releases all virtual resources. The performance of the enhanced MESRs is optimized by using the proposed periodic mutual exclusion supervisors to control the distribution of the common resources. In future work, the performance of the proposed periodic mutual exclusion supervisors should be simulated and verified by developing a simulating tool. The construction method of periodic mutual exclusion supervisors should be optimized by constructing linear constraints based on some extended generalized mutual exclusion constraints.

Competing Interests

The authors declare that they have no competing interests.

Acknowledgments

This work was supported in part by the Foundations of Sichuan Educational Committee under Grants nos. 16ZA0158 and 15ZB0134, the Key Scientific Research Fund of Xihua University under Grant no. Z1512625, the Open Research Subject of Key Laboratory (Research Base) of Network Intelligent Information Processing under Grant no. szjj2016-045, the “Chun hui” Research Funds for Educational Department of China under Grant no. Z2015100, and the Scientific Research Funds Project of Science and Technology Department of Sichuan Province under Grant no. 2016JY244.