On Multi-Step Look-Ahead Deadlock Prediction for Automated Manufacturing Systems Based on Petri Nets

Automated manufacturing systems (AMSs) are prone to be in deadlock states when resource allocation is unreasonable. Reasonably allocating system resources to achieve deadlock control is a primary task of the design of an AMS. This paper proposes a multi-step look-ahead deadlock prediction method to obtain an optimal deadlock avoidance policy for a class Petri nets, without calculating a complete reachability graph. As the reachability graph of a large-scale Petri net model is usually large, the analysis and calculation process to obtain the optimal deadlock avoidance policy is complicated. We first simplify a Petri net model by using the existing Petri net reduction methods or removing non-shared resources to simplify the model structure. Then we calculate the dead zone markings of the simplified model through a reverse generation method, and finally develop a multi-step look-ahead deadlock prediction method to obtain an optimal deadlock avoidance policy for a class of AMSs.


I. INTRODUCTION
The vigorous development of science and technologies has profoundly changed our human society, especially the widespread application of computer technology, automation technology, information technology and related basic sciences in real life. In the face of fierce competition and uncertain changes in the market, traditional commodity production methods cannot meet market demand. For this reason, automated manufacturing systems (AMSs) [1]- [4] have emerged and have been continuously improved and developed. AMSs can be classified as a discrete event system because of its event-driven characteristics [5]- [8]. In the production practice, an AMSs is very large, and it is a computer control system composed of multiple interacting subsystems or modules. The interaction between the subsystems or modules in a system is manifested as a competition for limited system The associate editor coordinating the review of this manuscript and approving it for publication was Guangdong Tian . resources [9], [10]. This will cause some undesirable situations, such as the occurrence of deadlocks, may cause serious consequences, and sometimes a system cannot run normally and the expected goal cannot be achieved, in the case of unreasonable resource allocation. Therefore, the deadlock control of a system is the focus of research [11], [12]. At present, extensive studies have been done on the problem of system deadlock [12]- [17]. As a mathematical model abstracted from an AMS, Petri nets [18]- [21] describe a system with simple and intuitive graphics, and are widely used in modeling, analysis and control of AMSs. Petri nets can be used to investigate a deadlock control policy of AMSs in a mathematical way [22], [23]. At present, the deadlock analysis and control of AMSs based on Petri net modeling mainly have the following two ways: (1) obtain a deadlock avoidance policy, based on the reachability graph analysis and the theory of regions [24]- [28]; (2) add control places to make a system deadlock-free [29]- [31], based on the structural analysis VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ [32], [33] of Petri nets in order to avoid clearing the strict minimum siphons [34]. For the early research on deadlock control of AMSs, the reachability graph analysis of Petri net model is widely used to obtain a system deadlock control method. Uzam [25] has studied a design method of the optimal active controller using the theory of regions. It divides the reachability graph of an uncontrolled system into a deadlock zone (DZ) and a non-deadlock zone (LZ), but this method is restricted by the state explosion problem [19]. After Uzam's research work, in 2003 Ghaffari et al. [24] designed an optimal deadlock controller using the theory of regions, which can obtain the maximum permissive behavior of a system. However, it is necessary to determine all legal markings of the Petri net to be controlled. Li et al. [35] propose a two-stage deadlock control policy combining the theory of regions and siphon control. The calculation time of this method is much shorter than that of using the theory of regions alone. Uzam and Zhou [36], [37] combine an iterative method with the theory of regions to obtain a system's deadlock control policy. In their research, the first bad marking (FBM) is defined in the DZ markings, which transforms the deadlock control into prohibiting dangerous markings in the LZ from reaching the FBM. This conversion requires multiple calculations of the reachability graph, which is not efficient. Chen and Li [38] use the vector covering method to find the minimum M FBM and the minimum dangerous marking set related to FBM, and design a deadlock controller to prohibit the transition from the dangerous markings to the first bad markings, but the calculation is complicated.
The Petri net's special structures, such as invariants [39], [40], siphons [30], resource transition circuits [45] are often closely related to the model activity. It is generally believed that there is a strict minimal siphon being cleared at a certain marking, which means that the system is deadlocked. Based on structural analysis of deadlock control policy such as siphon control, preventing strict minimum siphons form being emptied can achieve the purpose of deadlock control of a system. In 1995, Ezpeleta et al. [41] defined a simple sequential process system with resources (S 3 PR) as a type of Petri nets. Adding a control place to the siphon of the S 3 PR net can prevent the siphon from being emptied. Although an S 3 PR is more flexible in system modeling, in the face of complex and multi-process systems, the structural complexity of modeling with S 3 PR is high. Furthermore, the model contains a large number of siphons.
The design of siphon-based deadlock controllers requires solving siphons. To solve the problem of high computational complexity of siphons, Chu and Xie [42] propose a Mixed Integer Programming (MIP) method for computing siphons. A maximal empty siphon of the model is solved by a mathematical planning method. Although the computational complexity of the MIP method for calculating siphons is still high, it is improved in computing efficiency compared with the method of traversing all siphons and state set methods. Huang et al. [33] propose to use MIP to iteratively calculate the maximal empty siphon, and finally calculates all strict minimal siphons to add control places. Li and Zhou [43], [44] propose the concept of basic and dependent siphons in Petri nets to reduce the structural complexity, but the basic siphons can only be calculated after exhausting all strictly minimal siphons. Therefore this method does not improve the system deadlock controller design efficiency.
The reachability graph analysis method and structure analysis method of Petri net have their own advantages and disadvantages. Chao et al. [46], [47] proposes a multi-step forward deadlock prediction method based on structural analysis to obtain an optimal deadlock avoidance policy for the model. When determining the number of steps required for deadlock prediction, it is key to calculate the markings that no strict minimum siphons are cleared in the DZ. This requires the use of the reachability graph algorithm to calculate the complete reachability graph of the model, which limits the application of this method because the efficiency of calculating reachability graphs is often very low in the face of complex models. In this study, the reverse generation method is used to calculate the DZ markings, avoiding the calculation of the complete reachability graph. At the same time, the combination of model reduction rules and multi-step look-ahead deadlock prediction methods improves the efficiency of deadlock analysis methods in the literature [46], [47].
The remainder of the paper is arranged as follows. Section II reviews some basics of Petri net and S 3 PR. Section III combines the multi-step look-ahead deadlock prediction method with model reduction rules, and uses the reverse generation method to calculate the simplified model dead zone markings, and finally determines the number of steps required for deadlock prediction. In Section IV, we use a multi-step look-ahead deadlock prediction method for a class of S 3 PR to obtain the optimal deadlock avoidance policy. In Section IV, we reach some conclusions of this study and point out the work that should be done in the future.

II. BASIC DEFINITIONS A. BASIC DEFINITIONS OF PETRI NETS
A Petri net model is a four-tuple N = (P, T , F, W ), the non-empty finite set P = {p 1 , p 2 , · · · , p n } and T = {t 1 , t 2 , · · · , t m } representing the collections of places and transitions, respectively, and P∩T = ∅. F ⊆ (P×T )∪(T ×P) is a set of directed arcs from places to transitions or from transitions to places. Each directed arc has a weight. The mapping W : (P×T )∪(T ×P) → N is called weight function that assigns weights to directed arcs, that is, if f ∈ F, W (f ) > 0; otherwise W (f ) = 0, where N is a set of non-negative integers. From the perspective of graph theory, a Petri net is a dichotomous directed graph.
A marking M of a Petri net N = (P, T , F, W ) can be seen as a mapping: P → N. (N , M 0 ) represents a net system or an marked net with M 0 as the initial marking. For simplicity, a Petri net (P, T , F, W , M 0 ) with initial marking M 0 is denoted as (N , M 0 ). Let p ∈ P be a place of (N ,

B. S 3 PR MODELS
This section reviews the primary notions and properties of the system of simple sequential processes with resources, called S 3 PR, defined from the standpoint of Petri nets. It represents an important net type that can model a large class of automated manufacturing systems. This class of Petri nets has been extensively studied, due to its generality, perfect structural and behavioral properties.
Definition 1: A simple sequential process (S 2 P) is a Petri net N = (P A ∪{p 0 }, T , F) satisfying the following statements: (1) P A = 0 is called the set of the activity (operation) places; (2) p 0 / ∈ P A is called the process idle place or idle place; (3) N is a strongly connected state machine; (4) every circuit of N contains the place p 0 ; Definition 2: An S 2 P with resources (S 2 PR) is a Petri net Definition 4: An S 3 PR i.e., a system of S 2 PR can be defined recursively as follows: (1) An S 2 PR is an S 3 PR.
Given a resource r ∈ P R in an S 3 PR, the set of holders of r is denoted as C. AUTOMATA THEORY

Definition 5 ( [49]):
The characters in a finite alphabet collection E can constitute a string, and the language is a collection of strings. The set of all strings fixed on the alphabet E is denoted as E * . Definition 6 ( [49]): A deterministic finite automaton (DFA) is a 5-tuple.

III. OPTIMAL DEADLOCK AVOIDANCE POLICY A. MODEL REDUCTION RULES OF PETRI NETS
A Petri net reduction rules ensure that some subnets or structures in the model retain relevant attributes, e.g., boundedness and reversibility, such that it is possible to derive the properties of the original Petri net model through the simplified model. In the deadlock analysis of Petri nets, using model reduction rules to convert a given model into a simple model is an important means to improve the efficiency of deadlock control. In this section, we introduce some Petri net reduction rules [49] to simplify a large Petri net model to obtain an optimal deadlock prevention policy for AMSs.

B. MULTI-STEP LOOK-AHEAD DEADLOCK PREDICTION METHOD
A multi-step forward deadlock prediction method is a dynamic and online deadlock detection method. The main idea is to determine the safety of reachable states after the current state fire-enabled transition or transition sequence, that is, to detect in advance whether the system will enter deadlock.
If an S 3 PR net structure does not contain the ξ -resource, there are only safe markings and deadlock markings in the reachable graph [51], the system can reach a deadlock marking by firing a transition at a dangerous marking. There are no strict minimal siphons cleared at the safe markings, and those markings can return to the initial marking. As shown in Figure 2, by firing transition t i the dangerous marking M i can reach a DZ marking M i1 , at which exists strict minimal siphon cleared, where i ∈ {1, 2, . . . , n}. This means that the dangerous marking M i only needs to fire one transition can detect the deadlock.
When an S 3 PR contains a ξ -resource, there are a certain number of markings, at which without strict minimal siphons being emptied, in the DZ. In this paper, this type of markings is defined as pseudo safe marking, to distinguish it from other markings.
Definition 8 ( [47]): Given an S 3 PR(N , M 0 ) and a set of strict minimal siphons , a marking M ∈ DZ is said to be a pseudo safe marking, if for arbitrary strict minimal siphon S ∈ , M (S) > 0. The set of pseudo safe markings is denoted by M PSM . According to the relationship between siphon emptiness and deadlock, it is generally considered that if the system reaches a certain marking and there is a strict minimal siphon being emptied, then the system is said to be deadlocked. However, if the system reaches a pseudo safe marking, it is impossible to detect the deadlock based on whether the strict minimal siphon has been cleared. If the system reaches a pseudo safe marking, the system is actually deadlocked since the pseudo safe marking is a DZ marking.
To prevent a system from entering a deadlock without detecting it, this paper proposes a multi-step look-ahead deadlock prediction method. That is, a system arrives at a new marking, and fires a certain length of enable transition sequence to detect the security of the reachable marking. When the system arrives at a dangerous marking, through firing an enabled transition sequence in advance, it can reach a marking at which a strict minimal siphon is emptied in the DZ through the pseudo safe markings. This deadlock prediction method avoids the problem that the deadlock cannot be found. The following is a detailed analysis of the principle of multi-step forward deadlock prediction, to illustrate the principle and significance of the method of multi-step lookahead deadlock prediction. Figure 3 shows an S 3 PR's reachability markings divided into live and dead zones according to the theory of regions. In the figure, the dangerous marking M 0 fires transition t 0 can reach the dead zone marking M 01 , at which exist strict minimal siphon being emptied. The dangerous marking M i by firing transition t i , can reach pseudo safe marking M i1 , i ∈ {1, 2, . . . , n}. After M i1 fires transition sequence σ i and transition τ i can reach the DZ marking M i3 , with a strict minimal siphon being cleared. Thus, M 01 and M i3 are markings that can be used to determine whether a deadlock occurs in the system based on whether a strict minimal siphon has been cleared. This means that the markings M 0 and M i can reach the markings M 01 and M i3 by firing transition sequences of lengths 1 and |σ i | + 2, respectively. Under the markings M 01 and M i3 , a deadlock can be detected based on whether the strict minimal siphon has been cleared.
According to the above analysis, in order to ensure that the deadlock can be detected under each dangerous marking, it is necessary to find the longest transition sequence in {t 1 σ 1 τ 1 , t 2 σ 2 τ 2 , . . . , t n σ n τ n }. The corresponding model uses a multi-step look-ahead deadlock prediction method, and the number of steps required to predict the deadlock is equal to the length of the longest transition sequence. K represents the number of steps required for model deadlock prediction, and K = max{1, |t 1 σ 1 τ 1 | , |t 2 σ 2 τ 2 |, . . . , |t n σ n τ n |}.
The above analysis shows that the number of steps required for model deadlock prediction is determined by the pseudo safe marking. Therefore, the calculation of false security signs is the key to the application of multi-step forward deadlock prediction methods. For a given Petri net model, in order to improve the efficiency of calculating pseudo safe markings, this paper uses model reduction rules to reduce the complexity of the model structure. The model can be simplified using the reduction rule (b) shown in Figure 1, and the simplified model shown in Figure 5 can be obtained through the following steps. First, we remove places p 5 and p 9 , and transitions t 6 and t 11 . Second, we remove the flow relationships f 1 = (t 5 , p 5 ), f 2 = (p 5 , t 6 ), f 3 = (t 6 , p 16 ), f 4 = (t 6 , p 15 ), f 5 = (t 10 , p 9 ), f 6 = (p 9 , t 11 ), f 7 = (t 11 , p 10 ), and f 8 = (t 11 , p 17 ). Third, we increase the flow relationship f 9 = (t 5 , p 15 ), f 10 = (t 5 , p 16 ), f 11 = (t 10 , p 10 ), and f 12 = (t 10 , p 17 ). The simplified model is shown in Figure 5.
When analyzing the Petri net model show in Figure 4 and its reduced version, we can see that there are 196 and 96 markings in their reachability graph, respectively, and they contain four identical deadlock markings. This shows that the In this paper, in order to avoid calculating the complete reachability graph of a model, the reverse generation method is used to calculate the DZ markings of the simplified model, and the pseudo safe markings are obtained from the DZ markings.
In [48], the method of inverse calculation of the DZ markings of the model is studied. This method directly calculates the DZ markings to avoid calculating the complete reachability graph. In this paper, in order to avoid obtaining pseudo safe markings and calculate the complete reachability graph, this method is used to improve the efficiency of deadlock analysis. The following introduces the reverse generation method to calculate the DZ markings of the Petri net model.

D. THE FIRST STEP
Given a Petri net model (N , M 0 ) that has n places, the marking M of N can be defined as a mapping from VOLUME 8, 2020 P → N. The token number held by place p i at M 0 is M 0 (p i ), i ∈ {1, 2, 3, . . . , n}. By combining the branch and bound method and integer 0-1 programming, the M marking is decomposed into n parts. The i-th part of M represents the token number M (p i ). According to binary coefficients and Boolean algebra, M (p i ) is expressed in the following form: 1}. This means that the token number held by each place under the M marking is expressed linearly by a binary number, and any reachable marking can be represented by this method.
Suppose that N has k P-invariants, v strict minimal siphons. Through the information of the model, an integer linear programming, namely DM, can be established to calculate all the deadlock markings of (N , M 0 ).
The initial marking of N can be replaced by the above method as the objective function of linear programming, k P-invariants and v strict minimal siphons as constraints to establish integer 0-1 linear programming DM. During the iteration process, when the current strict minimal siphon is cleared and there is no feasible solution, we can replace other strict minimal siphons and continue to iterate until each strict minimal siphon is cleared and there is no feasible solution. After the above calculation process, all the deadlock markings can be obtained.

E. THE SECOND STEP
The DZ markings will inevitably reach deadlock markings. According to this feature, other DZ markings can be calculated inversely through deadlock markings. Deadlock markings are used as the initial data of the DZ markings to reversely enable calculation of other dead zone markings. During the calculation process, if the set of post-marking of a certain marking is included in the known DZ markings, this marking is the newly calculated DZ markings; otherwise it is the pending DZ marking. In the next calculation, we first calculate the previous set of DZ markings for the last new According to the deadlock makings calculated in the first step, the DZ making set of a model can be calculated by the following algorithm. The following is the symbol description in the algorithm: M DD indicates the set of pending DZ markings. M new is the calculated DZ markings. M pre represents the set of preceding markings of M . M post is the postset marking set. Through the above two calculation processes, by calculating the set of DZ markings of a given Petri net model, all DZ markings can be calculated without calculating the complete reachability graph.

IV. DEADLOCK AVOIDANCE POLICY OF A CLASS OF LOOPED S 3 PR NETS A. CLASSIFICATION OF RESOURCES
A resource allocation system is composed of multiple interacting subsystems or execution units. The interaction of subsystems or execution units is mainly reflected as the competition for limited system resources. In the case of unreasonable system resource allocation, a system is prone to deadlock. In order to prevent the system from entering a deadlock, it is necessary to reasonably allocate limited system resources to maximize system operation efficiency.
Definition 9 ( [46]): Given an S 3 PR(N , M 0 ), let S ∈ be a strict minimal siphon. If a resource r ∈ S R of (N , M 0 ) satisfies arbitrary p ∈ H (r) and p / ∈ S A , then r is called an independent resource. Otherwise r is called a dependent resource. Let S R in denote the set of independent resources in a siphon S.
In the field of deadlock control of Petri nets, according to whether they are related to the deadlock of a system, the independent resources of the system can be divided into weakly independent resources and strongly independent resources. Definition 10 ( [46]): Given an S 3 PR (N , M 0 ) with n strict minimum siphons S 1 , S 2 , . . . , S n , let S R in denote the set of independent resources. Let S R sin = {r | r ∈ (P R \ n i=1 S R i )} and S R win = S R in \ S R sin represent the sets of strongly independent resources and weakly independent resources of N , respectively.
Definition 11 ([46]): A holder-resource circuit (HR-circuit) with respect to a resource r in an S 3 PR, denoted by H(r), is a simple circuit if it contains only one resource r with |H(r)| = 1, an activity place p ∈ H(r), and transitions. If a resource corresponds to one holder-resource circuit only, the holder-resource circuit is said to be monoploid.
Definition 12 ( [46]): An S 3 PR (N , M 0 ) is said to be unitary if there is only one ξ -resource. For each S ∈ , r ∈ S R in , and r is associated with a monoploid holder-resource circuit.
A strongly monoploid HR-circuit H(r) is denoted by H s (r) if r ∈ S R sin . This means that H s (r) contains strongly independent resources. Similarly, H w (r) denotes a weakly monoploid HR-circuit.
For example, Figure 6 demonstrates an S 3 PR, where P R = {p 2 , p 3 , p 11 , p 12 , p 13 } is the set of resource place. The strict minimal siphon set of this model is denoted by = {S 1 , S 2 , S 3 }, where S 1 = {p 6 , p 10 , p 11 , p 12 }, S 2 = {p 7 , p 9 , p 12 , p 13 }, and S 3 = {p 7 , p 10 , p 11 , p 12 , p 13 }. The activity places of the model in are p 6 , p 7 , p 9 and p 10 ; thus S R in = {p 2 , p 3 }. According to the definition of strongly independent resources, S R sin = {p 2 , p 3 }. Hence S R win = S R in \ S R sin = ∅. Moreover there are nine HR-circuits in this model, such as p 3 t 2 p 4 t 3 p 3 , p 2 t 1 p 1 t 2 p 2 , and p 13 t 8 p 8 t 9 p 13 . However, only p 2 t 1 p 1 t 2 p 2 , p 2 t 1 p 1 t 4 p 2 , and p 3 t 2 p 4 t 3 p 3 are three strongly monoploid HR-circuits, and there is no weakly monoploid HR-circuit in this model.
In the model shown in Figure 6, p 2 and p 3 are strong independent resources that are not related to strict minimal siphons, and the subnet model that contains them, as shown in Figure 7, has nothing to do with the system's deadlock. Based on this fact, removing the subnet structure from the model during the deadlock analysis further reduces the structural complexity of the model and simplifies the necessary calculation process of the deadlock analysis to achieve the purpose of improving the calculation efficiency.
The simplified model of the Petri net shown in Figure 6 can be obtained by using the reduction rules of the model, and then the strongly independent resources can be removed from the simplified model to obtain the simplest model shown in Figure 8. For the convenience of discussion, the models shown in Figures 7 and 8  Compared with the model shown in Figure 6, model B has a lower structural complexity. If the deadlock control policy of the former can be obtained through the deadlock analysis of the latter, this will improve the efficiency of obtaining the system's deadlock control policy.
Definition 13: Given an S 3 PR net (N , M 0 ), r ∈ P is the ξ -resource of (N , M 0 ), and is a strict minimal siphon set of (N , M 0 ). Suppose a pseudo safe marking M ∈ M PSM , if M meets the following three conditions: (1) for arbitrary S ∈ , p ∈ P \ {r}, there is M (p) = 0, M (r) = 1.     M is called a critical pseudo safe marking. After the reverse generation method, it is calculated that model B has a pseudo safe marking M = 2p 5 + 2p 8 + p 12 + p 15 , which is a critical pseudo safe marking.
Model A has a simple structure and it is easy to calculate its three reachable markings as shown in Figure 9.
Definition 14: Let (N , M 0 ) be an S 3 PR net, if the ring exists in the reachability graph of N , the constant τ ∈ N represents the number of cycles times in the ring when the net system runs, and τ can be measured while the system is running.
Using these three markings and the pseudo safe marking of model B as synchronous operations, the pseudo safe markings of the model shown in Figure 6 can be calculated, as shown Figure 10.
There exists a ring among the three pseudo-security signs of the model shown in Figure 6. The worst case is that the system circulates integer times in the ring structure and traverses two signs when the ring structure is exited, so the number of steps required by the model for deadlock prediction is In the face of the model with the general structure shown in Figure 11, the above method can also be used to calculate When the structural parameters of the model take fixed values, the same method can also be used to obtain the number of steps required for deadlock prediction. First we use the rules to simplify the model, and then remove the strongly independent resources. Finally we can get the most simplified model of the model shown in Figure 12.
In fact, when the structure parameter takes a fixed value, the number of pseudo safe markings in the reachable graph can be determined, and the reverse generation method is easy to calculate those pseudo safe markings. For Figure 11, the following theorem is given.
Theorem 1: Let Petri net (N , M 0 ) be an S 3 PR net with a ξ -resource, and the structural parameters be m, n, p, and q that represent the number of weakly independent resources. There are n + p + 1 pseudo safe markings in the reachable markings of the model.
Proof: Suppose that its weakly independent resource set and pseudo safe markings set are {r m 1 , r m 2 , · · · , r m m , r n 1 , r n 2 , · · · , r n n , r p 1 , r p 2 , · · · , r p p , r q 1 , r q 2 , · · · , r q q } and M PSM , respectively. p 1 , r p 2 , · · · , r p p , r q 1 , r q 2 , · · · , r q q , p 13 } of the model shown in Figure 12 generate the same critical false safety sign during the emptying process. Therefore, for a model containing only one ξ -resource, there is only one critical pseudo safe marking.
In the model shown in Figure 12, when the token number of an idle place ensures that m + p resource places are emptied, a can be considered to be sufficiently large. When a is sufficiently large, it will not affect the number of pseudo safe markings. It should be noted that a + y = a.
For model D in Figure 14, when y = 1 and y > 1, there are three and four reachable markings respectively, as shown in Figures 9 and 15. So far, we can calculate all pseudo safe markings of the original model shown in Figure 11 by using the synchronous calculation through the reachable markings of model D and the pseudo safe markings of model C. Although there is a problem of state explosion when calculating a synchronous automation, the number of states involved in the calculation is small here. Compared with directly calculating the model shown in Figure. 11, the method adopted here effectively improves the calculation efficiency since it simplifies the model.
There is a ring structure between the reachable markings of this model, and the corresponding system operating cycle number in the ring structure is denoted by τ , which is a measurable constant. For Figure 11, the following theorem is given.
Theorem 3: Let Petri net (N , M 0 ) be an S 3 PR net with strongly independent resources, and the structural parameters be m, n, p, and q that represent the number of weakly independent resources. The number of steps required for deadlock prediction is K = 1 + k(3τ + 2), where k = max{n, p}.
Proof: (1) We find that there are two paths between the pseudo safe markings, and the longest path is related to the structural parameters n and p. This conclusion can be obtained from the proof process of Theorem 1.
(2) A pseudo safe marking of the original model is calculated from the pseudo safe marking of the simplified model and the reachable identification of the subnet structure where a strong independent resource is located by using the synchronous product operation of the automata. There is a multi-layered ring structure between the pseudo safe markings of the original model, and each ring contains three markings.
It can be seen from (1) that the longest path existing between the pseudo safe markings of the original model has a k-layer ring structure, where k = max{n, p}. The worst case is that the system arrives at the pseudo safe markings and visits τ times at each layer of the ring, and then traverses two markings to leave the ring structure, that is, the number of steps required for each layer of the ring structure is 3τ + 2. A dangerous marking needs to fire a transition to reach a pseudo safe marking, so K = 1 + k(3τ + 2).

C. ILLUSTRATIVE EXAMPLE
When the structural parameters m, n, p, q of the model take fixed values, an optimal deadlock avoidance strategy of the corresponding model can be obtained by the above method.
In the model shown in Figure 16, the structural parameters are m = 1, n = 2, p = 1, and q = 0. To calculate the pseudo safe markings of this model, the following steps can be employed: 1. We use reduction rules to remove p 9 , p 14 , t 9 , t 15 , and then remove the subnet structure that contains strongly independent resources p 2 , p 3 to obtain its most simplified model. In the simplification process, let M (p 22 ) = 1 in the subnet structure, where p 2 and p 3 are located.
2. According to the initial marking of this model, the P-invariants and the strict minimal siphons, an integer linear programming problem is established to obtain the dead marking set of the simplest model.
3. Taking the dead marking set of the simplest model as the initial data, the algorithm is called to calculate all the dead zone markings (DZ) of the simplest model. There are four pseudo safe markings to be obtained from DZ: M 1 = p 5 + p 6 + 2p 8 + p 10 + 2p 12 + p 13 + p 19 + p 23 , M 2 = p 5 + p 6 + 2p 8 + p 10 + p 11 + p 12 + p 13 + p 18 + p 23 , M 3 = p 5 + p 6 + 2p 8 + p 10 + p 11 + 2p 12 + p 17 + p 23 , M 4 = p 5 + p 6 + p 7 + p 8 + p 10 + 2p 12 + p 13 + p 20 + p 23  4. Obtain the pseudo safe markings of the simplest model from the DZ. These markings and the reachable markings of the subnet structure where p 2 and p 3 are located are calculated by synchronous product operations to calculate all pseudo safe markings of the model in Figure 16. The final calculation result is shown in Figure 17.
The subnet structure that contains strongly independent resources p 2 and p 3 can calculate three markings, namely M 1 = p 2 + p 3 + p 22   It should be noted that the result is divided into two sub-graphs for convenience of drawing, and this graph can be calculated by INA. Therefore, the optimal deadlock avoidance policy of the model can be calculated, i.e., K = 1 + 3(3τ + 2).
The above analysis results show that during the deadlock analysis of a given Petri net model, the model reduction rules can be used to simplify the model. On the basis of the simplified model, strongly independent resources, that is, the nonshared resources, can be further removed to fully simplify the model structure. In this paper, the method of obtaining the optimal deadlock avoidance strategy for a given Petri net model does not require direct analysis and calculation of the original model. The optimal deadlock avoidance strategy is obtained through its simplified model. It is easy to understand that simplifying the model can improve the efficiency of obtaining the optimal deadlock avoidance strategy. The multi-step look-ahead deadlock prediction method needs to analyze the model to obtain the number of steps required for the deadlock prediction.
Comparing with the existing methods, the above method of obtaining the optimal deadlock avoidance strategy of the model has the following advantages: (1) The simplified rules of the model and the removal of strongly independent resources are used to reduce the number of reachability markings.
(2) Using the reverse generation method to directly calculate the DZ markings, we avoid the calculation of the complete reachability graph and improve the calculation efficiency.
(3) The optimal deadlock avoidance policy of the original model is calculated by the simplified model. The method is to use the synchronous product operation in the automata to calculate the marking related to the deadlock control, and the number of markings involved in the calculation is limited.

V. CONCLUSION
In an S 3 PR with an ξ -resource, there is a kind of markings belonging to the dead zone markings, at which do not exist the strict minimal siphons of been emptied. The number of steps required for the deadlock prediction method is determined by these markings, and the optimal deadlock avoidance policy of the model can be obtained by calculating these markings. In this paper, according to the model reduction rules, the inverse generation method and the synchronous product operation, the multi-step look-ahead deadlock prediction method is proposed. The emergence of pseudo safe markings makes the multi-step look-ahead prediction method necessary. The method of calculating pseudo safe markings in this study is suitable for the existing one-step and multi-step look-ahead prediction methods. For a given Petri net model, if no pseudo safe marking is calculated, only one step look-ahead prediction method is needed to obtain the optimal deadlock avoidance policy. It is worth noting that other Petri net model simplification rules are combined with the multi-step look-ahead deadlock prediction method to make the multi-step lookahead prediction method more effective. This method can be also applied in multi-agent systems [52] and cyber-physical systems [53], [54].