Online fault detection method for flexible manufacturing system based on labeled petri net

By adopting an online fault detection method based on labeled Petri nets, the problems of real-time performance and computational complexity in fault detection in flexible manufacturing systems are solved, achieving real-time and accurate fault detection, which is applicable to complex systems.

CN117591325BActive Publication Date: 2026-05-19UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
UNIV OF ELECTRONICS SCI & TECH OF CHINA
Filing Date
2023-11-21
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Most existing fault detection methods for flexible manufacturing systems are offline or online diagnostics, and the time is positively correlated with the observation sequence, which cannot meet the real-time requirements. Furthermore, traditional Petri net-based fault diagnostics have high computational complexity in large systems and suffer from severe state space explosion problems.

Method used

An online fault detection method based on labeled Petri nets is adopted. By constructing a labeled Petri net model, calculating the minimum identifier and the unobservable sequence, and designing a Petri net fault diagnostic tool, online fault detection is achieved, avoiding state space explosion and reducing computational complexity.

Benefits of technology

It enables real-time fault detection in flexible manufacturing systems, improving the timeliness and accuracy of fault detection. It has low computational complexity and is suitable for systems with various complex workflows and state transition rules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117591325B_ABST
    Figure CN117591325B_ABST
Patent Text Reader

Abstract

The application discloses an online fault detection method of a flexible manufacturing system based on a labeled Petri net modeling, is applied to the field of manufacturing system fault diagnosis, and aims at the problem of high complexity of a designed diagnostic device in existing fault diagnosis technologies; firstly, the application models a corresponding labeled Petri net system according to the physical characteristics of the flexible manufacturing system, then calculates the minimal marking of each observable transition in the labeled Petri net system, fully reflects the path of event occurrence in system operation, next, constructs a corresponding fault diagnostic device based on the obtained minimal marking, finally, estimates the current system state according to the observed event occurrence sequence, and judges whether a fault transition is emitted, that is, whether a fault occurs, so that the fault detection is realized; the method of the application can not only effectively reduce the complexity of the diagnostic device, but also accurately judge the fault condition of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of manufacturing system fault diagnosis, and specifically relates to an online fault detection technology. Background Technology

[0002] With the development of modern manufacturing, flexible manufacturing systems are being applied more and more widely. However, due to the complexity of flexible manufacturing systems, failures can lead to system downtime, resulting in significant economic losses. Therefore, fault detection and diagnosis of flexible manufacturing systems are of great practical importance. Flexible manufacturing systems conform to the characteristics of discrete event systems, meaning that the state space of a flexible manufacturing system can be described as a discrete set, and the state transitions of a flexible manufacturing system depend entirely on the occurrence of asynchronous discrete events in the time domain. Currently, the mainstream research methods for discrete event systems are automata and Petri net theory. Compared to automata theory, Petri net theory can visualize the static structure and dynamic changes of discrete event systems, and can also perform mathematical formal analysis of the structural and behavioral characteristics of discrete event systems, making it more intuitive and easier to understand.

[0003] Fault detection problems can generally be divided into two aspects: fault diagnosability and fault diagnosis. The diagnosability problem studies whether the existence of a fault can be inferred within a finite number of operating steps, while the fault diagnosis problem infers the system state and determines whether it is normal, abnormal (faulty), or in an uncertain state.

[0004] In Petri net theory, the necessary and sufficient condition for diagnosability is that the system is diagnosable if and only if there are no two infinitely long sequences of identical observations, one without a fault and the other with a fault. Some scholars have proposed methods for constructing diagnostic tools based on automata theory, but the complexity of such diagnostic tools is exponentially positively correlated with the number of fault types and the number of system states, potentially leading to an explosion of the state space. Other scholars have proposed a class of k-step diagnosability analysis methods based on labeled Petri nets, but these diagnostic tools require calculating the system's reachability graph. Since the reachability set grows exponentially with the net size, these diagnostic tools are not suitable for large systems. Regarding fault diagnosis, some proposed diagnostic tool construction methods require analyzing all states that correspond to the observed event sequences. Such diagnostic tools have two drawbacks: first, if the number of associated states in the system expands infinitely, the diagnostic tool will be unable to handle the load; second, the number of associated states is positively correlated with the length of the observed sequence, resulting in very long computation times for online diagnosis.

[0005] In summary, the fault detection problem involves both diagnosability and fault diagnosis, and different methods and techniques can be proposed based on automata theory and Petri net theory to solve these problems. However, existing Petri net-based fault diagnosis methods are either offline, i.e., collecting data during system operation and then performing offline analysis and diagnosis. While this method can identify the cause of the fault, it cannot detect the fault in real time, thus failing to take timely measures to prevent the fault from occurring. Or, the online fault diagnosis time is positively correlated with the observation sequence, which may lead to excessively long computation time, failing to meet the real-time requirements of current flexible manufacturing systems. Summary of the Invention

[0006] To address the aforementioned technical problems, this invention proposes an online fault detection method for flexible manufacturing systems based on labeled Petri net modeling. This method improves the timeliness of fault detection and has lower complexity compared to traditional diagnostic tools based on reachability analysis.

[0007] The technical solution adopted in this invention is: an online fault detection method for flexible manufacturing systems based on labeled Petri nets, comprising:

[0008] S1: Construct a labeled Petri net model; Specifically: Construct the corresponding labeled Petri net model based on the workflow and state transition rules of the flexible manufacturing system;

[0009] S2: Calculate the minimum identifier and corresponding unobservable sequence for each observable transition in the labeled Petri net model;

[0010] S3: Based on the minimal identifiers and unobservable sequences obtained in step S2, construct a new Petri net, namely the diagnostic Petri net, using the original labeled Petri net as the basic model.

[0011] S4: During the operation of the flexible manufacturing system, the current state of the diagnostic Petri net system constructed in step S3 is inferred by observing the events, so as to determine whether a fault has occurred based on the current state.

[0012] In step S1, devices and resources are represented as places in the Petri net, and operations on devices and resources are represented as transitions in the Petri net. The number of devices and resources corresponds to the number of tokens in the Petri net, and the transitions of device states correspond to the changes in the identifiers generated by the transitions in the Petri net.

[0013] The beneficial effects of this invention are as follows: Most traditional methods are based on reachability analysis, while this invention is based on network structure analysis. The fault diagnostic tool designed in this invention does not require calculation of reachable sets, making it more advantageous in applications with unbounded Petri nets and effectively avoiding state space explosion. Specifically, the advantages of this invention are as follows:

[0014] 1. Online fault detection: This invention enables online fault detection during system operation, improving the timeliness of fault detection, which has high application value for troubleshooting in flexible manufacturing systems;

[0015] 2. High accuracy: By calculating all possible paths of system operation, this invention can accurately determine all states that may lead to failure, thus improving the accuracy of fault detection;

[0016] 3. High versatility: This invention is based on tagged Petri nets and has excellent application results in both bounded and unbounded Petri nets. It can be applied to more than a dozen flexible manufacturing systems with complex workflows and state transition rules, demonstrating strong versatility.

[0017] 4. Easy to implement: The method steps of this invention are clear, the algorithm is simple, and it is easy to implement in a computer system, which is conducive to improving production efficiency and product quality. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of the logical structure of the design scheme of the present invention.

[0019] Figure 2 This is a schematic diagram of the Petri net label in this invention.

[0020] Figure 3 This is a flowchart of the minimum identifier calculation in an embodiment of the present invention.

[0021] Figure 4 This is a Petri net schematic diagram of the fault diagnostic device in an embodiment of the present invention. Detailed Implementation

[0022] To facilitate understanding of the technical content of this invention by those skilled in the art, the invention will be further described below with reference to the accompanying drawings.

[0023] This invention proposes an online fault detection method for flexible manufacturing systems based on labeled Petri net modeling. This method enables online fault detection of flexible manufacturing systems by constructing a corresponding diagnostic Petri net. The innovation and key protection lie in the design of the diagnostic Petri net. Traditional methods are mostly based on reachability analysis, while this invention uses network structure analysis to design the fault diagnostic net. Furthermore, this invention performs better in the application of unbounded Petri nets.

[0024] The technical solution of this invention is as follows: First, a tagged Petri net system is modeled according to the physical laws of flexible manufacturing systems. Then, the minimum identifier and corresponding unobservable path of each observable transition in the tagged Petri net system are calculated. Next, a fault diagnostic Petri net is constructed based on the minimum identifier. Finally, based on the real-time observed event sequence, the current system state is estimated, and it is determined whether a fault transition has occurred, thereby achieving fault detection. The following is a detailed description of each step. Figure 1 This is a logic block diagram of the present invention. The method of the present invention includes the following steps:

[0025] A. Construct a labeled Petri net model:

[0026] Based on the workflow and state transition rules of the flexible manufacturing system, a corresponding labeled Petri net model is constructed.

[0027] In Petri net modeling, the structure of a Petri net is a directed graph N = (P, T, Pre, Post) described by four tuples, where:

[0028] (1) P = {p1, ..., p} m} represents an m-dimensional finite set of places;

[0029] (2)T={t1,…,t n} represents an n-dimensional finite set of transitions;

[0030] (3)Pre: And Post: These are m×n dimensional input and output matrices, used to represent the relationship between each repository and the transition, where... A set representing non-negative integers.

[0031] From a graphical representation perspective, places are typically represented by hollow circles, transitions by bars, and weighted directed arcs connect places and transitions according to defined input-output relationships. Petri nets contain tokens, which are graphically represented as solid circles, used to display the local state of each place.

[0032] The identifier M:P→N of a Petri net is an m-dimensional column vector. M(p)=k indicates that there are k tokens in place p∈P. Specifically, M0 is used to represent the initial identifier. The Petri net system is represented as follows:<N,M0> , where N represents the structure of the Petri net and M0 is the initial identifier.

[0033] The correlation matrix C = Post-Pre of a Petri net is an m×n dimensional non-negative integer matrix, where any element C(p,t) represents the change in the number of tokens in place p after transition t, where:

[0034] (1) If C(p,t)>0, the library p will receive C(p,t) tokens.

[0035] (2) If C(p,t)<0, the library p loses C(p,t) tokens.

[0036] Let x∈P∪T be a node in Petri net N, with its input set and output set denoted as ·x and x·, respectively.

[0037] A transition t is said to be enabled at identifier M if the following equation holds:

[0038]

[0039] This situation is denoted as M[t>, where ·t represents the preceding place of transition t. For a sequence of transitions σ∈T*, if σ is enabled at M, it can be denoted as M[σ>, and the sequence is said to be realizable.

[0040] The labeled Petri net is a quadruple G = (N, M0, E, λ), where<N,M0> It is a Petri net system, where E corresponds to the label set, and λ:T→E∪{ε} represents the mapping relationship between transitions and labels. A transition can be configured with a label contained in E or assigned an empty label ε. ∪ is the union symbol.

[0041] Depending on the labels, the transition set is divided into two disjoint subsets T = T o ∪T u T o ={t∈T|λ(t)∈E} is an observable transition set, T u ={t∈T|λ(t)∈ε} is the set of unobservable transitions. It is assumed that all observable transitions are controllable, and all unobservable transitions are uncontrollable. If the subset of unobservable transitions in a labeled Petri net is empty, i.e. This network is then called a lambda-labeled Petri net.

[0042] For flexible manufacturing systems, equipment and resources are represented as places in a Petri net, operations are represented as transitions, the number of equipment and resources corresponds to the number of tokens, and changes in equipment states correspond to changes in identifiers emitted as transitions occur. Based on these rules, a labeled Petri net model of the actual flexible manufacturing system is established. After the model is established, the system's diagnosability needs to be assessed. Fault detection can only be implemented if the following conditions are met:

[0043] (1) The system is diagnosable;

[0044] (2) The system has no deadlocks;

[0045] (3) Fault transitions are not observable;

[0046] (4) The unobservable subnet is acyclic.

[0047] B calculates the minimum identifier of the transition:

[0048] In fault diagnosis, this stage focuses on the minimum number of tokens required to infer the emission of a given observable transition. Observable transitions are those directly related to observable events, and their emission can be determined by observing these events. Fault transitions are those directly related to fault events, and their emission indicates the occurrence of those fault events.

[0049] By considering the paths corresponding to observable transitions and fault transitions, this step determines the minimum identifier that enables the observable event to be emitted, i.e., the identifier contains the minimum necessary tokens. These minimum identifiers provide information about whether a fault event has occurred, which is used for fault event diagnosis. The minimum identifier is denoted by M. m This indicates that the corresponding unobservable sequence represents all possible paths that enable fault transitions, which in a flexible manufacturing system manifests as a sequence of operations that can reflect all possible causes of failure. The method for calculating the minimum identifier of the transition is shown in Algorithm 1, and the algorithm's flow is as follows: Figure 2 Presentation:

[0050] Algorithm 1: Minimal Identifier Calculation Method

[0051] Input: Label Petri net G = (N, M0, E, λ)

[0052] Output: Minimal set of identifiers M m and the corresponding transition sequence

[0053] (1) First, select a change analysis t from the set of observable changes. i ;

[0054] (2) In response to this change, locate its preceding repository p. i This change i The enabling token value is n. i Set the token values ​​of other locations to 0 to obtain a minimal identifier M1, and add M1 to set M. m And record the path t i ;

[0055] (3) If the preceding warehouse is p i There exists an unobservable preceding change t j Then continue to locate the preceding change t of the preceding warehouse. jIf the preceding transition is observable, proceed to step (1); if the preceding transition is not observable, continue locating forward to the preceding library p of the preceding transition. j Let the token value that enables this transition be n. j Set the token values ​​of other locations to 0, thus obtaining another minimal identifier M2. Add M2 to set M. m And record the path t j ti;

[0056] (4) Repeat step (3) until all its preceding transitions are observable transitions. Then return to step (1), that is, replace other uncalculated observable transitions to find the path and minimum identifier.

[0057] (5) Finally, after all transitions have been calculated, output the minimal identifier set M. m .

[0058] C-designed fault diagnostic tool:

[0059] Based on the structure of the original Petri net and the minimal identifier, a fault diagnostic tool was designed. The logical approach is as follows:

[0060] First, it's important to clarify that the original Petri net system and its corresponding diagnostic Petri net have similar structures, but the diagnostic net does not contain unobservable transitions. The following four points illustrate the basic principles of diagnostic net construction:

[0061] (1) The diagnostic tool’s collection of locations (excluding fault locations) is the same as the original network’s collection of locations, and the initial token number corresponds to the original network’s initial identifier;

[0062] (2) A new fault location is added to the diagnostic tool, located after the transition representing the fault path. The initial token number is 0, and there is no subsequent transition for the fault location.

[0063] (3) Based on the minimal identifier, the transition set of the diagnostic Petri net is inferred, where each transition can represent a path corresponding to a certain observable transition in the original net (i.e. the transition sequence output in Algorithm 1).

[0064] (4) Fault transitions are newly added to the Petri net of the diagnostic tool. Fault transitions and transitions representing fault paths share the same preceding location, and the preceding location and the following location of fault transitions are the same location.

[0065] (5) The directed arcs of the Petri net of the diagnostic tool are determined by the minimum identifier and its corresponding strain transition.

[0066] During system operation, once a token or fault transition is enabled in the fault database of the diagnostic tool, it indicates that a fault has occurred in the original network. Thus, this invention can monitor the system's operating status in real time and promptly determine whether a fault has occurred through the fault diagnostic tool. Algorithm 2 demonstrates the basic steps of constructing the diagnostic tool:

[0067] Algorithm 2: Petri Net Construction Algorithm for Diagnostics

[0068] Input: System Petri net G = (N, M0, E, λ), where N = (P, T, Pre, Post)

[0069] Output: Fault Diagnostic Tool N D =(P D ,T D ,Pre D Post D M D0 E D ,λ D )

[0070] (1) Initialization, let P D =P. Let T D Pre D Post D M D0 E D and λ D Empty.

[0071] (2) For each p∈P D M D0 =M0.

[0072] (3) Update observable transitions: Based on the minimum identifiers and corresponding transition sequences obtained from Algorithm 1, generate the transition set of the diagnostic tool. For each transition sequence, generate a corresponding observable transition t. i , where i is the transition sequence, let t i The labels of t are consistent with the labels of observable sequences in i, and all t are... i Add to set T D .

[0073] (4) Update the current Pre D With Post D The direction of a directed arc is determined by the non-zero elements in the minimal identifier. For a transition t... i Let t be the library corresponding to the non-zero element in the minimal identifier corresponding to path i. i The preceding location is set to be consistent with the subsequent location of the observable transition in path i in the original Petri net system, and the directed arc weights are all 1.

[0074] (5) Add fault database p f For i, t includes fault transitions. i , let t i The post-location library is the faulty library p f Its initial token is 0, and it has no subsequent transitions, t i to p f There exists a directed arc with a weight of 1.

[0075] (6) Add fault transition t f For i, t includes fault transitions. i Cause fault transition t f Pre-reservation warehouse and t i The preceding library is consistent, and the fault transition t f The subsequent repository is also its preceding repository, let t f The weight of the associated directed arc is 1.

[0076] Online fault detection:

[0077] During the operation of a flexible manufacturing system, by observing events that have occurred, the current state of the corresponding tagged Petri net system is inferred, and the state of the constructed diagnostic Petri net is consistent with the state of the original tagged Petri net system. For example, if this invention observes that an event e has occurred, the diagnostic tool needs to find the corresponding transition sequence (which may not be unique), calculate and infer the corresponding current state (which may have multiple states), and determine whether a fault has occurred.

[0078] (1) If, among all possible reachable states, the fault library is p f If a token exists, then this invention can determine that a fault must have occurred.

[0079] (2) If there exists at least one reachable state such that the fault library has p f If a fault transition is enabled, then this invention can determine that a fault may occur.

[0080] (3) If there is no reachable state such that the fault library has p f If a token is generated, then it is determined that no fault has occurred.

[0081] In this way, the system can achieve online fault detection, discover and handle system faults in real time, and avoid faults from having a greater impact on the production process. Moreover, the advantage of this method is that when the system state space is huge, the complexity of its diagnostic tool will not increase accordingly, because this method uses network structure-based analysis, rather than traditional reachability-based analysis.

[0082] The invention will be further illustrated below with reference to a specific embodiment:

[0083] Assume that the flexible manufacturing system of this invention contains 6 key devices, represented as a set of places P = {p1, p2, p3, p4, p5, p6} in a Petri net model, and 6 key operations, represented as a set of transitions T = {t1, t2, t3, t4, t5, t6}. Here, t1 is an operation that may lead to failure, t2, t3, and t6 are observable transitions, and t1, t4, and t5 are unobservable transitions. The initial state is M0 = [1, 0, 0, 0, 0, 0]. T This indicates that at the start of production, only device p1 has one product to be processed. Based on this information, a Petri network model can be performed on this flexible manufacturing system, such as... Figure 3 As shown:

[0084] The Pre and Post matrices of this system are as follows:

[0085]

[0086] Next, for observable transitions and fault transitions in the system, the minimum identifiers of observable transitions and fault transitions are calculated according to Algorithm 1 and Algorithm 2.

[0087] Here, we take the observable transition t2 as an example to illustrate the calculation process: In the established Petri network, the preceding place of transition t2 is p2. Therefore, when the token value in place p2 is greater than 1, transition t2 can be enabled. Thus, a minimal identifier for transition t2 is found as: [0,1,0,0,0,0]. T Next, we examine the preceding transition t1 of the preceding place p2. According to the rule, if transition t1 is observable, we stop; if t1 is not observable, we move the token in p2 to the preceding place p1 of t1. Thus, we obtain the second minimal identifier of transition t2: [1,0,0,0,0,0] T The search continues forward, but at this point it has been exhausted, and Algorithm 1 stops calculating for transition t2. Therefore, transition t2 has two minimum identifiers. Following this algorithm, we can continue to apply it to t3 and t6 to obtain all the minimum identifiers of the system. The final results are shown in Table 1.

[0088] The present invention is now used to construct a fault diagnostic tool N. D And perform online fault detection. Construct a fault diagnostic tool N based on Algorithm 2. D For each observable transition t2, t3, t6, create a corresponding new transition t. t2 , t t3 , t t6 For fault transitions, create a new transition t t1All transitions of the diagnostic Petri net are shown in Table 1. The final diagnostic Petri net is as follows: Figure 4 As shown, where λ represents empty.

[0089] Table 1 Summary of Minimal Identifiers and Changes in Fault Diagnostics

[0090]

[0091] Online fault detection: This step requires estimating the current state based on observations. For example, if the invention observes that event e has occurred, then the invention needs to find the corresponding operation t, decrement the product count of the input step of t by 1, and increment the product count of the output step by 1. Then, the invention needs to determine whether to launch an operation that might cause a fault based on possible states. If, among all possible states, there exists a state that makes a step P that might cause a fault occur... f There is a product (that is, P) f If the token value in the repository is not 0, then this invention can determine that a fault has definitely occurred. If there exists a possible state such that step P, which may result in a fault, is possible. f If a token value is present, or if operation t4, which may lead to a failure, is enabled, then this invention can determine that a failure may occur. If, among all possible states, there is no state that allows a step P, which may lead to a failure, to do so... f If a token value is available, then this invention can determine that no fault has occurred.

[0092] For example, in Figure 4 In the diagnostic tool shown, assuming that the present invention observes the occurrence of event a, the corresponding transition path in the fault diagnostic tool might be t. t1t2 or t t4t5t6 or t t4t6 However, only the triggered transition is t. t1t2 Only then will it be directed to the subsequent fault database. f Adding a token causes a failure to occur. If the trigger is t... t4t5t6 or t t4t6 The fault database p f No token is generated. Since only one of the three paths contains a fault, the judgment at this point is "fault may occur".

[0093] If, after observing event a, the occurrence of event b is also observed, then the fault diagnostic tool can determine that the sequence of transitions that occurred must be t. t1t2 t t3 This transition path includes fault transitions, which means that the fault database contains p f By adding a token, it can be determined that a fault has definitely occurred. This example clearly illustrates the effectiveness of this method.

[0094] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Various modifications and variations can be made to the invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the scope of the claims of the invention.

Claims

1. An online fault detection method for flexible manufacturing systems based on labeled Petri nets, characterized in that, include: S1: Construct a labeled Petri net model; Specifically: Based on the workflow and state transition rules of the flexible manufacturing system, construct the corresponding labeled Petri net model; S2: Calculate the minimum identifier and corresponding unobservable sequence for each observable transition in the labeled Petri net model; step S2 specifically includes the following sub-steps: S21. The labeled Petri net is a quadruple G = (N, M0, E, λ). It is a Petri net system, N = (P, T, Pre, Post), where P represents an m-dimensional finite set of places, P = {p1,…,p m }, p1, p m Let T denote a place; let T denote an n-dimensional finite set of transitions, T = {t1,…, t}. n }, t1, t n Indicates change; Pre: P×T→ And Post: P×T→ These are m×n dimensional input and output matrices, used to represent the relationship between each repository and the transition. Let E represent the set of non-negative integers; E corresponds to the label set, and λ: T→E∪{ε} represents the mapping relationship between transitions and labels. A transition is configured as a label contained in E or is assigned an empty label ε; and depending on the label, the transition set is divided into two disjoint subsets T = T o ∪T u T o It is an observable set of changes, T o = {t∈T | λ(t) ∈ E}, T u It is an unobservable set of changes, T u = {t∈T |λ(t) ∈ ε}; S22. Select a transition t from the set of observable transitions. i Perform analysis; S23. In response to this change, locate its preceding repository p. i This change i The enabling token value is n. i Set the token values ​​of other locations to 0 to obtain a minimal identifier M1, and add M1 to set M. m And record the path t i ; S24. If the preceding warehouse is p i There exists an unobservable preceding change t j Then, we continue to locate the unobservable preceding changes t of the preceding warehouse. j If t j If the preceding transition is observable, proceed to step S22; otherwise, continue locating forward to transition t. j Pre-warehouse p j , causing the change t j The enabling token value is n. j Set the token values ​​of other locations to 0, thus obtaining another minimal identifier M2. Add M2 to set M. m And record the path t j t i ; S25. Repeat step S24 until all its preceding transitions are observable transitions. At this point, return to step S22, that is, replace other uncalculated observable transitions to search for paths and minimum identifiers. S26. After all transitions have been calculated, output the minimal identifier set M. m ; S3: Based on the minimal identifiers and unobservable sequences obtained in step S2, construct a new Petri net, namely the diagnostic Petri net, using the original labeled Petri net as the basic model. S4: During the operation of the flexible manufacturing system, the current state of the diagnostic Petri net system constructed in step S3 is inferred by observing the events, so as to determine whether a fault has occurred based on the current state.

2. The online fault detection method for flexible manufacturing systems based on tag Petri nets according to claim 1, characterized in that, In step S1, devices and resources are represented as places in the Petri net, and operations on devices and resources are represented as transitions in the Petri net. The number of devices and resources corresponds to the number of tokens in the Petri net, and the transitions of device states correspond to the changes in the identifiers generated by the transitions in the Petri net.

3. The online fault detection method for flexible manufacturing systems based on tag Petri nets according to claim 2, characterized in that, Step S3 specifically includes the following steps: S31. Initialization, let P D = P; Let T D Pre D Post D M D0 E D and λ D Empty; S32. For each p ∈ P D M D0 = M0; S33. Update observable transitions: Based on the minimum identifier and corresponding transition sequence obtained in step S2, generate the transition set of the diagnostic tool; for each transition sequence, generate a corresponding observable transition t. i , where i is the transition sequence, let t i The labels of t are consistent with the labels of observable sequences in i, and all t are... i Add to set T D ; S34, Update the current Pre D With Post D The direction of a directed arc is determined by the non-zero elements in the minimal identifier; for a transition t i Let t be the library corresponding to the non-zero element in the minimal identifier corresponding to path i. i The preceding location is set to be consistent with the subsequent location of the observable transition in path i in the original Petri net system, and the directed arc weights are all 1. S35, Add fault database p f For i, t includes fault transitions. i , let t i The post-location library is the faulty library p f Its initial token is 0, and it has no subsequent transitions, t i to p f There exists a directed arc with a weight of 1. S36, Add fault transition t f For i, t includes fault transitions. i Cause fault transition t f Pre-reservation warehouse and t i The preceding library is consistent, and the fault transition t f The subsequent repository is also its preceding repository, let t f The weight of the associated directed arc is 1; S37. The final Petri net representation of the diagnostic tool is: N D =(P D , T D Pre D Post D M D0 E D , λ D ).

4. The online fault detection method for flexible manufacturing systems based on tag Petri nets according to claim 3, characterized in that, Step S4 specifically includes the following three cases: (1) If, among all possible reachable states, in the fault library p f If a token exists, then a fault must have occurred. (2) If there exists at least one reachable state such that the fault library has p f If a fault transition is enabled, then it is determined that a fault may occur. (3) If there is no reachable state such that the fault library has p f If a token is generated, then it is determined that no fault has occurred.