Distributed plasma control system health component modeling method based on colored petri net

By adopting a healthy component modeling method based on non-ferrous Petri network in distributed plasma control systems, the problems of system modeling complexity, deadlock and resource competition are solved, and a more efficient, stable and reliable system design is achieved.

CN120046391AInactive Publication Date: 2025-05-27HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510209567.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-05-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In distributed real-time control systems, especially plasma control systems, they face the problems of modeling complexity, deadlock and resource competition, resulting in unstable system design, poor real-time and fault tolerance, and insufficient scalability.

Method used

The healthy component modeling method of distributed plasma control system based on non-ferrous Petri Network (CPN) is adopted. By defining the relationship between the CPN and element mapping in the distributed system, resource transfer and task scheduling relationships are constructed, deadlocks and resource conflicts are identified and avoided, and the real-time and fault tolerance of the system are enhanced.

Benefits of technology

It improves the modeling accuracy and flexibility of healthy components of distributed plasma control system, identify and avoid deadlocks and resource conflicts in advance, enhances the real-time and fault tolerance of the system, and improves the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120046391A_ABST
    Figure CN120046391A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of nuclear fusion Tokamak device control systems, in particular to a distributed plasma control system health component modeling method based on a colored petr network. According to the technical scheme, the method comprises the following steps: defining a mapping relation between CPN and each element in a health component of the distributed plasma control system; establishing a resource transmission and task scheduling relationship in the system through the characteristics of the places and the transition basic elements; determining system requirements, and establishing a complete system by using the constructed basic elements and modules; different parts of the system are separated and recombined, the operation conditions of the system in different states and operation modes are analyzed, and the conditions of possible competition and deadlock of the system are eliminated. According to the method, the problems of modeling complexity, resource conflict and insufficient real-time performance in a complex distributed real-time control system in the prior art are effectively solved, and a brand new solution is provided for optimization and stable operation of health components of the plasma control system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of control systems for nuclear fusion tokamak devices, and particularly to a method for modeling healthy components of a distributed plasma control system based on colored Petri nets. Background Art

[0002] Distributed real-time control systems are widely used in fields with high-precision and high-reliability requirements such as industrial automation, smart grids, robot control, and plasma control systems (PCS). Especially in plasma control systems, which involve real-time monitoring and control of devices such as tokamaks, it is necessary to ensure that the system can maintain high efficiency, stability, and security during multi-task parallel execution, resource scheduling, and data transmission. As the scale and complexity of the system increase, distributed real-time control systems face the following key problems:

[0003] Complexity of system modeling: Distributed real-time control systems often contain multiple subsystems, devices, and control modules, and efficient communication and coordination are required between the modules. In plasma control systems, precise interaction is needed between different control units. And healthy components, as an important part of them, undertake the functions of real-time monitoring and health assessment of the system operation state, including the collection, analysis, and storage of health information and process information sent by other servers, and presenting the results to the user interface in real time. These functions require that healthy components can not only efficiently process server health-related data, but also maintain good interaction and coordination with other subsystems. Therefore, how to accurately model the relationships between subsystems, data flows, control flows, and the relationship between healthy components and the overall operation of the system is a complex and challenging technical problem. Traditional modeling methods are difficult to effectively express the concurrency, asynchrony, and dynamic changes of resources of the system, which easily leads to unstable system design.

[0004] Deadlock and resource competition problems: In distributed control systems, concurrent execution of tasks may lead to resource sharing conflicts and deadlock problems. In plasma control systems, this problem is particularly prominent. For example, healthy components need to frequently access the database to store health information and process information during operation, while other tasks may access the same resources simultaneously, resulting in resource competition and conflicts. If this situation is not properly handled, problems such as system freezing, data loss, or abnormal operation may occur. Therefore, in the system design stage, identifying and avoiding potential deadlocks and resource conflicts between healthy components and other subsystems is an important factor in ensuring the reliability and stability of the system.

[0005] The disadvantages of the prior art are mainly reflected in the following aspects:

[0006] Limited modeling ability: Traditional modeling methods often struggle to effectively represent concurrency, asynchrony, and dynamic resource changes in distributed systems. For complex real-time control systems, especially applications like the health components of plasma control systems, traditional modeling methods cannot clearly and accurately describe the interaction relationships and their dynamic changes among various subsystems and modules in the system.

[0007] Insufficient deadlock and resource contention detection: Existing methods cannot effectively prevent and detect deadlock and resource contention problems in the system. In a distributed system, the concurrent execution of tasks can easily lead to conflicts over shared resources, resulting in system deadlocks or abnormal functionality. Existing solutions often rely on manual inspections or local optimizations and lack systematic and automated analysis tools.

[0008] Poor real-time performance and fault tolerance: Traditional modeling methods for control systems usually lack sufficient dynamic adjustment capabilities and cannot effectively adapt to changes that occur during the actual operation of the system. Behaviors such as resource scheduling and parallel task execution in the system often cannot be effectively predicted and optimized using existing methods, leading to potential instability or inefficiency during operation.

[0009] Poor scalability: Most existing technologies lack the ability to scale to large, complex, and dynamic distributed control systems. As the system scale increases, existing methods often become difficult to handle, thus affecting the overall performance of the system.

[0010] In summary, this application proposes a modeling method for the health components of a distributed plasma control system based on colored Petri nets. Summary of the Invention

[0011] The objective of the present invention is to address the problem in the background art of how to identify and avoid these potential deadlocks and resource conflicts during the design phase of a distributed real-time control system, and to propose a modeling method for the health components of a distributed plasma control system based on colored Petri nets.

[0012] The technical solution of the present invention: A modeling method for the health components of a distributed plasma control system based on colored Petri nets, comprising the following steps:

[0013] S1. Define the mapping relationship between the CPN and each element in the health components of the distributed plasma control system;

[0014] S2. Construct the transfer of resources and task scheduling relationships in the system through the characteristics of basic elements such as places and transitions;

[0015] S3. Determine the system requirements and establish a complete system using the basic elements and modules constructed above;

[0016] S4. Separate different parts of the system, reorganize them, analyze the system's operation in different states and operating modes, and eliminate possible competition and deadlock situations in the system;

[0017] S5. Edit a program and implement the system according to the problems found in the modeling and the proposed solutions.

[0018] Optionally, in the above-mentioned S1, the corresponding relationships between CPN and the elements of the distributed plasma control system health components include:

[0019] Places correspond to different states of the system, including the availability, processing status, storage status, and display status of health data.

[0020] Transitions correspond to changes in system states or the occurrence of events, including data transmission, data processing, and database occupancy;

[0021] Tokens correspond to data, information, threads, and database resources in the system. The existence of a token indicates that the data or information in that state is available or being processed;

[0022] Token colors. Tokens of different colors represent different independent resources;

[0023] Directed arcs correspond to the transition paths from one state to another, connecting places and transitions;

[0024] Weights correspond to the resources that need to be used or consumed during state transitions;

[0025] Legal areas correspond to the states where the system can operate normally without resource contention or deadlock;

[0026] Deadlock areas correspond to the states where a certain resource of the system is occupied and cannot be released, resulting in the system being unable to operate normally.

[0027] Optionally, in the above-mentioned S2, it specifically includes the following steps:

[0028] Exclusive resources: Lock the database table to ensure that only one process can access the resource at the same time, avoiding resource conflicts. When the identifier is passed from P1 to the back, it can only be passed to one of P2 or P3, indicating that the resource is exclusive to a certain thread or subsystem;

[0029] Shared resources: Share memory data and allow multiple processes to access and use the resources simultaneously through a parallel access structure. When the identifier is passed from P1 to the back, both P2 and P3 can obtain the identifier.

[0030] Collaborative working resources adopt a structure where input places of different colors are connected to a transition. Only when all input tokens are available can the transition be triggered. When storing data, the data storage process can only occur when both the data on the thread and the database table are available. That is, only when both P1 and P2 have tokens can P3 have a token.

[0031] Optionally, in S3, it includes the health components of the plasma control system.

[0032] The plasma control system needs to subscribe to the health information and process information sent by other servers, then store them in the database and send them to the web page for display. At the same time, the historical health information and process information in the database can also be retrieved and displayed on the web page. According to the flow of resources during operation, the subscribed and published messages and database resources are divided into different types of resources, and the resource attributes are marked with different colors. Combining the system status and data relationships, a CPN is constructed to comprehensively describe the operation process of the health components, so as to accurately reflect their dynamic behavior.

[0033] Optionally, in S4, it specifically includes the following steps:

[0034] S401. Analyze the resource preemption situation, including the health components, only focus on the subnet for message data transmission in the model, and select a publish-subscribe tool like ZeroMQ with a queue mechanism to implement message transmission to avoid resource preemption.

[0035] S402. Analyze the deadlock situation, focus on the subnet of the database part, set that all servers must lock the health data table first and then the process data table to form a CPN simulation model to ensure that deadlocks no longer occur.

[0036] Optionally, when implementing the health components, the publish-subscribe tool uses ZeroMQ with a queue mechanism, and the access order of the database is also fixed to lock the health data table first and then the process data table.

[0037] Compared with the prior art, the present application includes at least one of the following beneficial technical effects:

[0038] Improve modeling accuracy: Utilize the powerful modeling ability of CPN to accurately describe the concurrent tasks, resource competition, and dynamic behavior of control signals in the system, thereby enhancing the modeling accuracy and flexibility of the health components of the distributed plasma control system.

[0039] Identify deadlocks and resource conflicts in advance: By introducing the concepts of "legal area" and "deadlock area", effectively prevent resource competition and deadlock problems, and ensure that potential system freezes and data loss risks can be discovered and avoided during the system design stage.

[0040] Enhance real-time performance and fault tolerance: By dynamically adjusting and optimizing resource allocation and task scheduling, enhance the real-time performance and fault tolerance of the system, ensuring that the system can always maintain efficient and stable operation when facing concurrent execution of different tasks.

[0041] Improve system stability and reliability: Provide intuitive modeling tools for designers to help optimize system design, discover potential problems in advance, and thus significantly improve the stability, reliability, and adaptability of the plasma control system.

[0042] The present invention effectively solves the problems of modeling complexity, resource conflicts, and insufficient real-time performance faced by the prior art in complex distributed real-time control systems, and provides a new solution for the optimization and stable operation of healthy components of the plasma control system. Brief Description of the Drawings

[0043] Figure 1 CPN expression diagrams for different resource types;

[0044] Figure 2 CPN simulation diagrams for the storage and interface display of publish-subscribe messages of healthy components of the plasma control system;

[0045] Figure 3 Preemption diagrams for publish-subscribe healthy messages of multiple servers;

[0046] Figure 4 Non-preemption diagrams for publish-subscribe healthy messages of multiple servers;

[0047] Figure 5 CPN simulation diagrams for the storage and interface display of publish-subscribe messages with deadlocks; Figure 1 ;

[0048] Figure 6 CPN simulation diagrams for the storage and interface display of publish-subscribe messages without deadlocks; Figure 2 ;

[0049] Figure 7 Program timing diagrams designed according to the model after modeling. Detailed Implementation Modes

[0050] The technical solutions of the present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0051] Embodiment

[0052] Based on the excellent modeling ability of CPN, the present invention proposes a method for modeling healthy components of a distributed plasma control system based on colored Petri nets, which is used to analyze the possible risks in the system. By using the basic structure of CPN, this method can effectively describe and simulate each interaction process in the distributed control system, including the communication between multiple servers and the user interface, the collection, analysis, and decision-making processes of server health data. By defining places, transitions, tokens, and arcs, the model can accurately capture the dynamic behaviors of concurrent task execution and resource competition in the system.

[0053] Step 1: Define the mapping relationship between CPN and each element in the healthy components of the distributed plasma control system.

[0054] In the present invention, there is a clear mapping relationship between CPN and each element in the healthy components of the distributed plasma control system, which is specifically as follows:

[0055] Table 1 Corresponding relationship between CPN and each element in the healthy components of the distributed plasma control system

[0056]

[0057]

[0058] As shown in Table 1, places represent various states in the system, such as the data of a certain process being available or a certain resource being idle; transitions correspond to the triggering of events in the system, such as storing data in the database. Tokens of different colors represent different resources in the system, including data, information, processes, or database tables. This structure can effectively capture the dynamic processes of concurrent behavior, resource competition, and state transition. The consumption and transfer of resources can be represented by directed arcs and weights. For example, when storing data, it involves the transfer of data and the occupation of database tables, and at this time, the weights are the amount of data transferred and the number of tables occupied. The normal operating state of the system (without resource contention or deadlock) is called the legal area, while the state where resources are occupied and cannot be released, resulting in the system being unable to continue running, is called deadlock. Through this mapping relationship, the present invention can accurately express and simulate various behaviors in the plasma control system, providing strong support for system risk analysis, deadlock detection, and resource optimization.

[0059] Step 2: Further construct the relationship of resource transfer and task scheduling in the system by using the characteristics of the basic elements of places and transitions.

[0060] This patent introduces the modeling methods of shared resources and exclusive resources in the distributed system into the CPN model. By defining places and transitions of different resource types, it accurately simulates the resource competition and concurrent task execution processes in the system asFigure 1 Specifically, exclusive resources (such as locked database tables) are like Figure 1 (a), ensuring that only one process can access the resource at the same time and avoiding resource conflicts. Therefore, when the Token is passed backward from P1, it can only be passed to one of P2 or P3, indicating that the resource is exclusive to a certain thread or subsystem. Shared resources (such as shared memory data) are represented by a parallel access structure like Figure 1 (b), allowing multiple processes to access and use the resource simultaneously. Therefore, when the Token is passed backward from P1, both P2 and P3 can obtain the Token. In addition, for resources that require collaborative operations such as Figure 1 (c), this patent adopts a structure where different - colored input places are connected to a transition. The transition will only be triggered when all input Tokens are available. For example, when storing data, the process of data storage can only occur when both the data on the thread and the database table are available, that is, only when both P1 and P2 have Tokens can P3 have a Token. By adding judgment conditions on the output arc of the transition, this patent further controls the flow of Tokens, simulating the process of different processes requesting and using resources. This method effectively differentiates the transfer methods of resources, can comprehensively capture the dynamic behaviors of concurrent execution and resource competition, thus providing an efficient modeling and analysis tool for system designers, optimizing system resource management, and enhancing the stability and reliability of distributed control systems.

[0061] The third step is to determine the system requirements and use the basic elements and modules constructed above to establish a complete system.

[0062] Taking the healthy components of a plasma control system as an example, the plasma control system needs to subscribe to the health information and process information sent by other servers, then store them in the database and send them to the web - side for display. At the same time, the historical health information and process information in the database can also be retrieved and displayed on the web - side. CPN can use Tokens of different colors to represent different resource types in the system. Therefore, the messages sent by server subscriptions and the data tables in the database can be regarded as different resources and represented by Tokens of different colors. Figure 2 The figure shows the process of the server sending the subscribed messages to the web - side and the database after receiving them. The blue transitions, places, and arcs in the figure are the channels for message passing, and the Tokens represent different message data such as health information and process information; the magenta transitions, places, and arcs represent the occupancy of the database tables; and the green transitions are the intersection points of different resources. To pass through the green transitions, two conditions, namely the availability of the data table and the availability of the message data, need to be met simultaneously. Through this kind of intersection transition, CPN can simulate the scenario where different types of resources in the control system affect each other and work collaboratively. Specifically:

[0063] P1: The data subscribed by the server is available;

[0064] P2: The data of the interface data forwarding thread is available;

[0065] P3: The interface displays health data and process data;

[0066] P4: The data of the health data storage thread is available;

[0067] P5: The database health data is available;

[0068] P6: The interface displays health data;

[0069] P7: The data of the process data storage thread is available;

[0070] P8: The database process data is available;

[0071] P9: The interface displays process data;

[0072] P10: The database health data table is available;

[0073] P11: The database health data table is occupied;

[0074] P12: The database process data table is available;

[0075] P13: The database process data table is occupied;

[0076] T1: Distribute the subscribed data to each thread, including the interface data forwarding thread, the health message storage thread, and the process message storage thread. Add a judgment condition on the output arc of T1 to simulate the process of different message data being transmitted to different threads;

[0077] T2: Send the health data and process data to the web page through websocket;

[0078] T3: Send the health data to the web page through websocket;

[0079] T4: Send the process data to the web page through websocket;

[0080] T5: Occupy the health data table and store the health data;

[0081] T6: Occupy the process data table and store the process data;

[0082] T7: After storage, release the health data table;

[0083] T8: After storage, release the process data table.

[0084] From Figure 2It can be seen that in the initial state, there are five Tokens in P1, which respectively represent five message data, among which three are health messages and two are process messages; P10 and P12 each have one Token indicating that the health data table and the process data table are available. In each simulation cycle, P1 transfers one Token into T1, indicating that the system has received the subscribed messages. After the simulation is completed, P3 has five Tokens, indicating that all the data is displayed in real time on the web page; P6 has three Tokens, and P9 has two Tokens, indicating that three health messages and two process messages can be retrieved from the database respectively and displayed on the web page; P10 and P12 each have one Token indicating that the data tables return to the idle state after being used. From the above simulation, it can be seen that the health component modeling method of the distributed plasma control system based on CPN in this patent can simulate the collaborative operation of various resources during system operation.

[0085] Fourthly, separate, reorganize different parts of the system, analyze the operation of the system in different states and operating modes, and eliminate the possible competition and deadlock situations in the system.

[0086] Since the colored petri net can separate different colored parts into independent subnets for analysis, therefore, the message data transmission part and the database part of the above system can be separated, reorganized according to different scenarios, analyze the possible competition and deadlock situations in the system, and after proposing solutions, use CPN to model again to verify whether the problem is solved.

[0087] Taking the health component as an example, only focus on the subnet of message data transmission in the model. Since the health data uses the publish-subscribe mode through Ethernet to achieve data transmission between servers, and at the same time, the health data of multiple servers may be ready for health information and can be subscribed, so there may be a situation of resource preemption at this time, resulting in the message subscriber being unable to receive all the messages as Figure 3 shown.

[0088] In Figure 3 , two transitions P1 and P2 respectively represent that the health data messages of server 1 and server 2 are available, the transition T1 represents that a server subscribes to this message, and P3 represents that the subscriber has received this data. From Figure 3 , it can be seen that P1 and P2 each have two Tokens, however, P3 finally only received two Tokens, indicating that resource preemption has occurred. To solve this problem, a publish-subscribe tool with a queue mechanism such as ZeroMQ can be selected to implement message transmission, and the subsequent CPN simulation results are as Figure 4 shown.

[0089] Different from Figure 3 , Figure 4The model adds place P4 and transitions T2 and T3. T2 represents a message entering the queue, P4 represents a message waiting in the queue, and T3 represents a message leaving the queue and entering the server that subscribes to the message. From the simulation results, it can be seen that the final subscriber received all the data. Through the above modeling analysis, it can be found in the design stage that the tool used for publishing and subscribing messages needs to have a queue mechanism to avoid preemption problems.

[0090] In addition, focus on the subnet of the database part. At the same time, there may be multiple health monitoring servers requesting the database to store health information and process watchdog information, and storing the data in different tables of the database. In this scenario, a deadlock problem may occur: when two servers process data simultaneously, server 1 first locks the health data table, while server 2 locks the process data table, and then both parties try to obtain the table that the other party has locked. Server 1 needs to access table two to store process data, while server 2 needs to access table one to store health data. Since the two servers are waiting for each other to release the lock, this will cause the system to fall into a deadlock and unable to continue executing operations. The relevant CPN modeling is as Figure 5 shown.

[0091] Specifically:

[0092] P1: The database health data table is available;

[0093] P2: The database health data table is occupied by server 1;

[0094] P3: The database health data table is occupied by server 2;

[0095] P4: The database process data table is available;

[0096] P5: The database process data table is occupied by server 1;

[0097] P6: The database process data table is occupied by server 2;

[0098] P7: The health data storage thread data is available;

[0099] P8: The process data storage thread data is available;

[0100] T1: Server 1 occupies the health data table and stores health data;

[0101] T2: Server 2 occupies the health data table and stores health data;

[0102] T3: The health data table is released;

[0103] T4: Server 1 occupies the process data table and stores process data;

[0104] T5: Server 1 occupies the process data table and stores process data;

[0105] T6: The process data table is released;

[0106] As Figure 5 shown, at the beginning, place one Token each at P1, P7, P8, and P4 to simulate the process of two servers requesting the database to store data. Eventually, there are two Tokens in P3 and P5 and the process cannot continue, indicating that a deadlock has occurred. To solve the possible deadlock problem in the database, it is set that all servers must first lock the health data table and then the process data table, forming a CPN simulation model as Figure 6 shown. The definitions of most transitions and places are the same as Figure 5 . However, to reflect the sequentiality, P9: Server 1 has locked the health data table and can operate on the process data table and P10: Server 2 has locked the health data table and can operate on the process data table are added. In this way, only when there are Tokens in P9 and P10 can the Token in P4 be passed to P5 or P6, ensuring that the locking of the process data table must occur after the locking of the health data table. Through simulation, it is found that no deadlock occurs anymore.

[0107] Through the above steps, through CPN modeling, programmers of algorithms or components can discover preemption and deadlock problems in the system during the design phase and optimize them. The optimized system can also prove through modeling that it no longer has the previous problems.

[0108] The fifth step is to edit a program to implement the system according to the problems found in the above modeling and the proposed solutions.

[0109] Taking the health component as an example, when implementing the health component, the publish - subscribe tool uses ZeroMq with a queue mechanism. At the same time, the access order of the database is also fixed to lock the health data table first and then the process data table.

[0110] The method for modeling the health component of the distributed plasma real - time control system based on CPN proposed by the present invention aims to solve the technical problems in aspects such as modeling, scheduling, resource management, and fault diagnosis of existing distributed control systems through the powerful concurrency, dynamics, and fault - tolerance advantages of the CPN model. Especially in the plasma control system and its various components, in the face of complex real - time data interaction and task scheduling between multiple control units, this method can effectively identify potential problems and optimize the system design during the design phase of the system and algorithm.

[0111] Specifically, the CPN - based modeling method can:

[0112] Modeling Concurrent and Asynchronous Behaviors: By defining tokens of different colors in CPN to represent various resources and tasks in healthy components, the concurrent task execution and resource competition situations of the system can be accurately modeled. In the healthy components of the plasma control system, these resources include subscribed healthy information flows, process information, database tables, and data flows interacting with the web client, etc. Using colored tokens to distinguish different resources and tasks can clearly describe the behaviors and relationships of healthy components when concurrently processing healthy information and process information, storing data, and interacting with other subsystems, thus helping to optimize resource scheduling and task execution, and improving the operation efficiency and stability of healthy components.

[0113] Deadlock and Resource Conflict Detection: By simulating the resource occupation and task execution processes of healthy components in a colored Petri net and combining the concepts of "legal region" and "deadlock region" of CPN, problems that may lead to resource competition and deadlocks can be detected in advance. In healthy components, tasks such as subscribing information, database writing, and web client data pushing may simultaneously request shared resources (such as database tables), resulting in resource conflicts. If not handled in a timely manner, it may cause delayed storage or loss of healthy data, thereby affecting the health assessment results of the system. Through modeling and simulation, this method can effectively detect and prevent potential risks during the operation of healthy components, providing guarantee for the real-time performance and reliability of the system.

[0114] The creativity of the present invention lies in the first application of CPN to the modeling and optimization of healthy components in a distributed plasma real-time control system. The complexity of the plasma control system in aspects such as real-time data flow, resource scheduling, and parallel execution of control tasks makes it difficult for traditional modeling methods to effectively handle. By utilizing the concurrent modeling ability and color mechanism of CPN, the present invention can accurately express dynamic behaviors such as concurrent execution, resource competition, and task scheduling in the system, effectively avoid problems such as deadlocks and resource conflicts, and enhance the accuracy and stability of the control system.

[0115] The novelty of the present invention lies in the combination of the color mechanism of CPN with the specific requirements of healthy components in the plasma control system, and the proposal to use tokens of different colors to represent various resources, tasks, and control signals in the system. This method effectively improves the accuracy and flexibility of system modeling. By introducing the concepts of "legal region" and "deadlock region" into the CPN model, potential deadlocks and resource conflicts in the system can be intuitively identified. This novel analysis method can prevent and solve potential problems in actual operation during the design stage.

[0116] From a practical perspective, the CPN-based modeling method can provide an efficient and intuitive tool for the design and optimization of plasma control systems and their components. Especially when facing multi-task parallel execution and resource competition, through the accurate modeling of concurrent tasks and resources, it can help designers optimize task scheduling, discover and avoid deadlocks and resource conflicts in advance, thereby improving the stability, reliability, and real-time performance of the system. This method is not only applicable to the field of plasma control but can also be extended to other distributed real-time control systems, with high practical value.

[0117] The present invention proposes a CPN-based modeling method for healthy components of a distributed plasma control system, aiming to solve the key technical problems faced by plasma control systems during multi-task parallel execution, resource scheduling, and data transmission. Traditional modeling methods are difficult to effectively address the complexity, dynamics, and real-time requirements of distributed systems, while CPN, with its powerful concurrency, dynamics, and fault tolerance, can accurately express issues such as resource competition, task scheduling, and concurrent execution in the system. This method effectively models concurrent and asynchronous behaviors by defining Tokens of different colors to represent various resources and tasks in the system, helping to identify and optimize the interactions between control units. At the same time, through the concepts of "legal area" and "deadlock area", resource competition and deadlock problems can be discovered in advance, thus ensuring the stability and reliability of the system. Compared with traditional modeling methods, the present invention can effectively prevent potential risks during the design stage, improve the efficiency and adaptability of the system, and has strong creativity, novelty, and practicality.

[0118] The above specific embodiments are merely several alternative embodiments of the present invention. Based on the technical solution of the present invention and the relevant inspirations of the above embodiments, those skilled in the art can make various alternative improvements and combinations to the above specific embodiments.

Claims

1. A distributed plasma control system health component modeling method based on colored petri nets, characterized in that: The following steps are involved: S1. Define the mapping relationship between CPN and each element in the distributed plasma control system health component; S2, build the resource transfer and task scheduling relationship in the system through the characteristics of the basic elements of the library and transition; S3. Determine system requirements and build a complete system using the basic elements and modules built above; S4. Separate and reorganize different parts of the system, analyze the operation of the system in different states and operating modes, and eliminate possible competition and deadlock in the system; S5. Edit the program and implement the system based on the problems discovered and solutions proposed by modeling.

2. According to claim 1, a distributed plasma control system health component modeling method based on colored petri nets is characterized in that: In S1, the corresponding relationship between CPN and the elements of the distributed plasma control system health component includes: The library corresponds to different states of the system, including the availability, processing status, storage status, and display status of health data. Transitions correspond to changes in system status or the occurrence of events, including data transmission, data processing, and database occupancy; Token, corresponding to the data, information, thread, and database resources in the system. The existence of the token indicates that the data or information in this state is available or being processed; Token color: Tokens of different colors represent different independent resources. Directed arcs correspond to transition paths from one state to another, connecting places and transitions; Weight, corresponding to the resources needed or consumed when the state changes; Legal zone, the corresponding system can operate normally without resource grabbing or deadlock; Deadlock area corresponds to a state in which a certain resource of the system is occupied and cannot be released, causing the system to be unable to operate normally.

3. According to claim 1, a distributed plasma control system health component modeling method based on colored petri nets is characterized in that: The S2 specifically includes the following steps: Exclusive resources, lock the database table, ensure that only one process can access the resource at the same time, avoid resource conflicts. When the identifier is passed from P1 to P2 or P3, it can only be passed to one of P2 or P3, indicating that the resource is exclusively occupied by a thread or subsystem. Shared resources, shared memory data, allow multiple processes to access and use resources simultaneously through parallel access structures. When the identifier is passed from P1 to P3, both P2 and P3 can obtain the identifier. Collaborative work resources use a transition structure connected by different color input libraries. The transition will be triggered only when all input identifiers are available. When storing data, the data storage process can only be performed when the data on the thread and the database table are available, that is, P3 can only have an identifier when P1 and P2 have identifiers.

4. According to claim 1, a distributed plasma control system health component modeling method based on colored petri nets is characterized in that: The S3, including the plasma control system health components, The plasma control system health component needs to subscribe to the health information and process information sent by other servers, then store it in the database and send it to the web page for display. At the same time, the historical health information and process information in the database can also be retrieved on the web page for display. According to the flow of resources during operation, the subscribed and published messages and database resources are divided into different types of resources, and resource attributes are identified by different colors. Combined with the system status and data relationship, CPN is constructed to comprehensively describe the operation process of healthy components, thereby accurately reflecting their dynamic behavior.

5. The method for modeling healthy components of a distributed plasma control system based on a colored petri net according to claim 1, characterized in that: The S4 specifically includes the following steps: S401. Analyze resource preemption, including health components, focus only on the subnet for message data transmission in the model, and select a publish-subscribe tool with a queue mechanism such as ZeroMQ to implement message transmission and avoid resource preemption. S402, analyze the deadlock situation, pay attention to the subnet of the database part, set all servers to lock the health data table first, and then lock the process data table, form a CPN simulation model, and ensure that deadlock does not occur again.

6. A distributed plasma control system health component modeling method based on colored petri net according to claim 5, characterized in that: When implementing the health component, the publish-subscribe tool uses ZeroMQ with a queue mechanism, and the access order of the database is fixed to lock the health data table first and then the process data table.