Flexible manufacturing workshop scheduling method and system of object Petri network based on JSON configuration
The object Petri net method configured via JSON solves the problem of high coupling between model and code in traditional Petri nets in flexible manufacturing systems. It enables flexible configuration and efficient scheduling of model logic, reduces development and maintenance costs, and improves the efficiency and interpretability of scheduling schemes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAQIAO UNIVERSITY
- Filing Date
- 2026-03-20
- Publication Date
- 2026-04-21
AI Technical Summary
Traditional Petri nets in flexible manufacturing systems suffer from high coupling between model and code, abstract state representation, large computational load, and difficulty in integration with physical systems, leading to development and maintenance difficulties and making it hard to generate efficient scheduling schemes.
The object Petri net method using JSON configuration defines the object Petri net model through multiple JSON files, implements a dynamic evolution program using object-oriented programming techniques, and integrates a scheduling algorithm on the model to directly access and manipulate the states of places, tokens, and transition objects for optimized calculations.
It enables model logic modifications without compilation, allows non-programming experts to participate in definition, provides intuitive state representation, facilitates integration with existing algorithms, reduces maintenance costs, and improves the efficiency and interpretability of scheduling schemes.
Smart Images

Figure CN121900741A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of flexible manufacturing systems, and in particular to a flexible manufacturing workshop scheduling method and system based on JSON-configured Petri nets. Background Technology
[0002] Petri nets are efficient mathematical models for describing concurrent, asynchronous distributed systems. Traditional Petri nets (including time-assigned and colored Petri nets) typically rely on operations of the association matrix (preceding matrix and postceding matrix) to simulate the network's operation, i.e., state evolution (transition activation), at the computer software implementation level. Specifically, the system's static structure (places, transitions, arcs) and dynamic tokens (token distribution) are encoded as matrices, and the network's operation is driven by matrix addition and comparison operations (such as determining whether the token vector M is greater than or equal to a column of the preceding matrix Pre). This approach has the following inherent drawbacks:
[0003] (1) It is not conducive to integration with upper-layer applications: the matrix-based simulation kernel outputs abstract identifier changes, which makes it difficult to directly interact with object-oriented scheduling algorithms, optimization modules or physical devices.
[0004] (2) High coupling between model and code: The topology of the network (locations, transitions and their connections) and the activation rules are hard-coded in the matrix operation logic. Any minor changes to the model require modification of the program and recompilation, which lacks flexibility.
[0005] (3) State representation abstraction: The tokens in the matrix are anonymous, undifferentiated integers that cannot directly correspond to and carry the rich attributes of physical world entities (such as AGV, robot, workpiece) (such as ID, type, position, speed, task status).
[0006] (4) Poor readability and maintainability: For complex workshop logistics systems, the correlation matrix is large and sparse, and the amount of computation also increases accordingly. It is extremely difficult to understand and debug the model logic by reading the code.
[0007] (5) It is not conducive to integration with physical systems: the matrix-based simulation kernel outputs abstract identity changes, which makes it difficult to perform intuitive and efficient data mapping and interaction with physical systems based on object or asset models.
[0008] Therefore, there is an urgent need in this field for a new method that can effectively control model complexity, efficiently generate high-quality scheduling schemes, and enhance the engineering feasibility of the system. Summary of the Invention
[0009] The purpose of this invention is to solve the problems in the prior art.
[0010] The technical solution adopted by this invention to solve its technical problem is: to provide a flexible manufacturing workshop scheduling method based on JSON-configured Petri nets, comprising the following steps:
[0011] For the logistics system of a flexible manufacturing workshop, an object Petri net model is defined through multiple JSON configuration files;
[0012] The dynamic evolution program of the Petri net model of the object is implemented using object-oriented programming techniques;
[0013] A scheduling algorithm is integrated on the Petri net model of the object. The scheduling algorithm directly accesses and manipulates the states of places, tokens and transition objects in the dynamic evolution program, performs optimization calculations and outputs a scheduling scheme.
[0014] Preferably, the logistics system for the flexible manufacturing workshop defines an object Petri net model through multiple JSON configuration files, specifically as follows:
[0015] The entire static structure and initial state of the Petri net model are defined through multiple JSON-formatted configuration files, including the sets of places, transitions, tokens, and the connections and attributes between them.
[0016] Preferably, the step of defining the Petri net model through multiple JSON configuration files includes:
[0017] Use the first JSON file to define all libraries, their connections, and attributes;
[0018] Use a second JSON file to define all initial tokens and their associated properties in their respective libraries;
[0019] All transitions and their input / output arcs are defined using a third JSON file, which contains semantic tags for matching or manipulating token attributes.
[0020] Preferably, in the first JSON file, the definition of each place includes: capacity attribute, latency attribute, preceding transition list and following transition list.
[0021] Preferably, in the second JSON file, the definition of each token includes: an identifier, an initial repository identifier, a wait time attribute, and a core attribute used to distinguish the physical entity type.
[0022] Preferably, in the third JSON file, the structure of the input and output arcs of each transition is defined as "place identifier: [list of semantic tags]", where the semantic tags are used to match the properties of the token object or as property operation instructions when the transition is triggered.
[0023] Preferably, the dynamic evolution program includes:
[0024] The file parsing module is used to read the JSON configuration file. The JSON parsing module reads the configuration file of the Petri net model of the object and dynamically creates the corresponding place objects, token objects and transition objects in memory.
[0025] The engine runs by iterating through all transition objects and checking whether the attributes of the token object in its input library match the semantic tags of the input arc to determine whether to trigger a transition; if so, it modifies the attributes of the token object and transfers it to the output library.
[0026] Preferably, the dynamic evolution program is driven entirely by the arcs with semantic tags defined in the third JSON file, and by constructing node classes, Petri net classes and asset object classes, there is no need to calculate or store the Petri net association matrix.
[0027] Preferably, the scheduling algorithm is a path search algorithm, which determines the current location of the corresponding physical entity by querying the location of token objects with specific attributes, and performs a search based on this location.
[0028] This invention also provides a flexible manufacturing workshop scheduling system based on JSON-configured Petri nets, comprising:
[0029] The modeling module defines Petri net models of objects through multiple JSON configuration files for the logistics system of flexible manufacturing workshops;
[0030] The configuration module uses object-oriented programming techniques to implement the dynamic evolution program of the Petri net model of the object;
[0031] The scheduling module integrates a scheduling algorithm on the Petri net model of the object. The scheduling algorithm directly accesses and manipulates the states of places, tokens and transition objects in the dynamic evolution program, performs optimization calculations and outputs a scheduling scheme.
[0032] The present invention has the following beneficial effects:
[0033] (1) Engineering and maintenance advantages: The model is configured using JSON files, realizing a "model-driven" development model. Modifications to the model logic do not require changes to or recompilation of the core program code; only the JSON file needs to be edited. This greatly improves development and debugging efficiency, reduces maintenance costs, and allows non-programming experts (such as process engineers) to participate in the definition and adjustment of the model.
[0034] (2) Strong state expression ability: Token becomes an object with attributes (such as AGV, robot), which can naturally and intuitively map physical entities, providing an ideal foundation for building digital twins.
[0035] (3) The triggering logic is intuitive and configurable: The input and output rules of the transition are defined in JSON through arcs with semantic tags, making the triggering logic clear, readable, easy to modify and extend.
[0036] (4) High practicality and easy integration and expansion: The object-oriented model representation makes it extremely easy to integrate existing search algorithms (such as Dijkstra and A*). The algorithm can directly interact with the model object without complex data conversion.
[0037] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments, but the present invention is not limited to the embodiments. Attached Figure Description
[0038] Figure 1 This is a flowchart illustrating the steps of a flexible manufacturing workshop scheduling method based on JSON-configured Petri nets, according to an embodiment of the present invention.
[0039] Figure 2 This is a flowchart illustrating a flexible manufacturing workshop scheduling method based on JSON-configured Petri nets according to an embodiment of the present invention.
[0040] Figure 3 This is a Petri net model of each sub-module in the logistics system of this invention embodiment;
[0041] Figure 4 A partial example of a JSON file defining places, tokens, and transitions in an embodiment of the present invention;
[0042] Figure 5 This is a flowchart of the main program of an embodiment of the present invention, showing the process of reading JSON files, initializing models, and calling the scheduling algorithm;
[0043] Figure 6 This is a schematic diagram of the structure of a flexible manufacturing workshop scheduling system based on JSON-configured Petri nets, according to an embodiment of the present invention. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0045] See Figure 1 and Figure 2 As shown in the figure, an embodiment of the present invention provides a flexible manufacturing workshop scheduling method based on JSON-configured Petri nets, which includes the following steps:
[0046] S101, for the logistics system of the flexible manufacturing workshop, defines the Petri net model of objects through multiple JSON configuration files;
[0047] S102, Using object-oriented programming technology, implement the dynamic evolution program of the Petri net model of the object;
[0048] S103, Integrate a scheduling algorithm on the Petri net model of the object. The scheduling algorithm directly accesses and manipulates the states of places, tokens and transition objects in the dynamic evolution program, performs optimization calculations and outputs a scheduling scheme.
[0049] Specifically, step S101 includes the following steps:
[0050] S1.1 Modular Modeling: Through file naming and structural design, it supports the modular definition and management of different functional subnets such as AGV road network and robotic arm workstation in the workshop logistics system, reducing the complexity of the overall model.
[0051] S1.2, Define objectified network elements: Define the token in the Petri net as a resource object (such as AGV, Workpiece) with a unique ID and dynamic attributes; define the place as a state class to contain and describe the state of the resource object; define the transition as an event class, whose triggering conditions and actions can be determined and operated based on the attributes of the resource object.
[0052] S1.3, Model configuration using JSON format: Create independent JSON configuration files to fully describe the object Petri net model. These files define:
[0053] Place definition file: Defines all places and their attributes, such as latency, capacity, type, and the crucial connection relationships "pre_arcs" (pre-arcs list) and "post_arcs" (post-arcs list), which define the static topology of the network;
[0054] Token definition file: Defines the initial state of the system, that is, the initial attributes and initial distribution of all Token objects. Each Token object contains attributes: initial location "inplace", waiting time "waiting_time", and key attributes "token_attribute", such as "agv" and "robot". This step completes the instantiation of anonymous Tokens, making them resource objects carrying specific semantics;
[0055] Transition definition file: Defines the triggering rules for each transition. Each transition is defined as a JSON object with the transition ID as the key and "pre_arcs" and "post_arcs" as values. Unlike the arc list in the place file, the arcs here are given semantic tags. These tags will be parsed into matching and manipulation rules for the input / output token object properties when the transition is triggered, which is the core of implementing the object-oriented triggering logic.
[0056] The triggering rules (triggering conditions and subsequent actions) for all transitions can be expressed as a judgment on the Token attributes in the preceding place and a modification of the Token attributes in the subsequent place.
[0057] Specifically, step S102 includes the following steps:
[0058] S2.1, develop a JSON parsing and object creation module. This module uses a JSON parsing library (such as rapidjson) to read the aforementioned JSON configuration file. Based on the file content, it dynamically creates corresponding C++ / Python class instances (such as objects of the Place, Transition, and Token classes) at runtime, and initializes the entire network model based on the connection relationships (pre_arcs, post_arcs) and initial state (inplace) in the JSON. This process completely replaces the step of manually constructing the correlation matrix in traditional methods.
[0059] S2.2, Design an object-oriented runtime engine. The core loop of the engine no longer performs matrix operations, but instead iterates through all Transition object instances. For each transition, the engine performs the following object-oriented operations:
[0060] The trigger condition is checked by accessing the collection of Token objects in the preceding Place object, and ensuring that the token_attribute matches the semantic rules defined on the arc label. This process is accomplished by directly accessing and judging object attributes, without the need for matrix comparison operations.
[0061] Execute the trigger action: If the condition is met, remove the qualified Token objects from the front Place, modify the attributes of these Token objects according to the rules (such as updating the AGV position and changing the workpiece state), and add them to the back Place object. This process is a direct operation on the collection of objects in memory, rather than matrix addition.
[0062] S2.3 enables state monitoring and output. The entire evolution process is monitored and recorded through direct access to the states of Place, Token, and Transition objects, facilitating debugging and data analysis.
[0063] Specifically, S103 involves the following steps: After completing model initialization (i.e., reading the library-defined files, token definition files, and transition definition files), advanced scheduling algorithms, such as the Dijkstra search algorithm, can be directly invoked on the instantiated Petri net object. This algorithm can directly query and manipulate the state of Place and Token objects in the net (e.g., obtaining the current position of all Tokens with the attribute "agv"), perform optimal path search, and generate the optimal transition activation sequence. This demonstrates the direct and efficient data interaction capability between the object-oriented model and the optimization algorithm. Finally, based on the obtained optimal transition activation sequence, the final scheduling instruction for the corresponding workshop logistics system is generated and issued to the physical equipment (AGVs, robotic arms, etc.) of the system for execution.
[0064] According to an embodiment of the logistics system of the present invention, S102 identifies resource objects including AGV vehicles (agv1, agv2), robotic arms (robot1, robot2), and workpieces (workpiece1, workpiece2, ...); these correspond to the token_attribute of a token object. A Petri net structure is designed, dividing the locations (e.g., waypoints, workstations, buffer zones) and transitions (e.g., movement completed, grabbing, placing), ultimately obtaining... Figure 3 The Petri net model shown.
[0065] See Figure 4The image shows a portion of the JSON configuration file. In `agv_way_place.json`, all locations are defined. For example, defining the path point "p6.4": `{"delay": 0, "capacity": 12, "pre_arcs": ["t6.2"], "post_arcs": ["t6.3"]}`. The initial state is defined in `agv_way_token.json`. For example, defining AGV1: `"token1": {"inplace": "p1", "waiting_time": 0, "token_attribute": "agv1"}`, and defining robotic arm 1: `"token4": {"inplace": "p6_1", "waiting_time": 0, "token_attribute": "robot1"}`. Here, `inplace` indicates the location of the token. In agv_way_trans.json, define critical job transitions, such as defining the transport job "t6.2": its pre_arcs requires a token from p6.3 with the tag "action_in"; its post_arcs will output "workpiece" to p6.4, "agv" to p6, and "robot" to p6.1. This defines "a transport operation of a workpiece jointly participated in by a robot and an AGV".
[0066] Specifically, step S102 uses C++ to create classes such as Place, Token, Transition, Node, and Petrinnet. See also... Figure 5 The main program flowchart includes:
[0067] Implement the functions in the read_json module to read the JSON file mentioned above and construct an object instance of the Petri net model.
[0068] Implement a Petri net execution engine that, in a loop, checks whether all Transition objects are excitationable (checks if their input Place contains a Token that meets the arc label requirements) and performs excitation operations (moving and modifying Token objects).
[0069] Specifically, S103 implements the `dijkstra_search()` method in the `Petrinet` class. This method accesses all `Place` and `Token` objects in the network and constructs a graph model. For example, by finding all `Token` objects with `token_attribute` set to "agv1", the current position of `AGV1` can be determined. Running the main program, the program first reads a JSON file to construct an objectified Petri net, then calls a search algorithm to calculate the optimal path (transition sequence) and outputs the results.
[0070] In this embodiment, Petri net simulation, which traditionally requires complex matrix operations, is transformed into parsing JSON configuration files and manipulating objects in memory, making the modeling, simulation, and optimization of complex scheduling models more intuitive, efficient, and easy to maintain.
[0071] See Figure 6 The diagram shown is a structural schematic of a flexible manufacturing workshop scheduling system based on JSON-configured Petri nets according to an embodiment of the present invention, including:
[0072] Modeling module 701 defines Petri net models of objects through multiple JSON configuration files for the logistics system of flexible manufacturing workshops;
[0073] Configuration module 702 uses object-oriented programming technology to implement the dynamic evolution program of the Petri net model of the object;
[0074] The scheduling module 703 integrates a scheduling algorithm on the Petri net model of the object. The scheduling algorithm directly accesses and manipulates the states of places, tokens and transition objects in the dynamic evolution program, performs optimization calculations and outputs a scheduling scheme.
[0075] This invention uses object-based Petri nets for modular system modeling, abandoning the traditional matrix operation-based simulation kernel. By objectifying network elements and configuring them via JSON files, the network elements (places, transitions, tokens) are fully objectified. Standardized JSON files define the model, achieving complete decoupling between model definition and the simulation program. This effectively controls the state space size and improves the model's intuitiveness, configurability, and system maintainability. Furthermore, by integrating scheduling and search algorithms (such as Dijkstra's algorithm and A*) based on the object-based model, scheduling decisions are executed, providing an efficient, flexible, and highly interpretable scheduling solution for complex workshop logistics systems.
[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A flexible manufacturing shop scheduling method based on JSON-configured Petri nets, characterized in that, Includes the following steps: For the logistics system of a flexible manufacturing workshop, an object Petri net model is defined through multiple JSON configuration files; The dynamic evolution program of the Petri net model of the object is implemented using object-oriented programming techniques; A scheduling algorithm is integrated on the Petri net model of the object. The scheduling algorithm directly accesses and manipulates the states of places, tokens and transition objects in the dynamic evolution program, performs optimization calculations and outputs a scheduling scheme.
2. The flexible manufacturing shop scheduling method based on JSON-configured Petri nets according to claim 1, characterized in that, The logistics system for the flexible manufacturing workshop is defined using a Petri net model through multiple JSON configuration files, specifically as follows: The entire static structure and initial state of the Petri net model are defined through multiple JSON-formatted configuration files, including the sets of places, transitions, tokens, and the connections and attributes between them.
3. The flexible manufacturing shop scheduling method based on JSON-configured Petri nets according to claim 1, characterized in that, The Petri net model, defined through multiple JSON configuration files, includes: Use the first JSON file to define all libraries, their connections, and attributes; Use a second JSON file to define all initial tokens and their associated properties in their respective libraries; All transitions and their input / output arcs are defined using a third JSON file, which contains semantic tags for matching or manipulating token attributes.
4. The flexible manufacturing shop scheduling method based on JSON-configured Petri nets according to claim 3, characterized in that, In the first JSON file, the definition of each place includes: capacity attribute, latency attribute, preceding transition list and following transition list.
5. The flexible manufacturing shop scheduling method based on JSON-configured Petri nets according to claim 3, characterized in that, In the second JSON file, the definition of each token includes: an identifier, the identifier of the initial library, a wait time attribute, and a core attribute used to distinguish the physical entity type.
6. The flexible manufacturing shop scheduling method based on JSON-configured Petri nets according to claim 3, characterized in that, In the third JSON file, the structure of the input and output arcs of each transition is defined as "place identifier: [list of semantic tags]", where the semantic tags are used to match the properties of the token object or as property operation instructions when the transition is triggered.
7. The flexible manufacturing shop scheduling method based on JSON-configured Petri nets according to claim 3, characterized in that, The dynamic evolution process includes: The file parsing module is used to read the JSON configuration file. The JSON parsing module reads the configuration file of the Petri net model of the object and dynamically creates the corresponding place objects, token objects and transition objects in memory. The engine runs by iterating through all transition objects and checking whether the attributes of the token object in its input library match the semantic tags of the input arc to determine whether to trigger a transition; if so, it modifies the attributes of the token object and transfers it to the output library.
8. The flexible manufacturing shop scheduling method based on JSON-configured Petri nets according to claim 7, characterized in that, The dynamic evolution program, whose activation logic is entirely driven by the arcs with semantic tags defined in the third JSON file, constructs node classes, Petri net classes, and asset object classes without needing to calculate or store the Petri net's correlation matrix.
9. The flexible manufacturing shop scheduling method based on JSON-configured Petri nets according to claim 1, characterized in that, The scheduling algorithm is a path search algorithm. It determines the current location of the corresponding physical entity by querying the location of token objects with specific attributes, and then performs a search based on this location.
10. A flexible manufacturing workshop scheduling system based on JSON-configured Petri nets, characterized in that, include: The modeling module defines Petri net models of objects through multiple JSON configuration files for the logistics system of flexible manufacturing workshops; The configuration module uses object-oriented programming techniques to implement the dynamic evolution program of the Petri net model of the object; The scheduling module integrates a scheduling algorithm on the Petri net model of the object. The scheduling algorithm directly accesses and manipulates the states of places, tokens and transition objects in the dynamic evolution program, performs optimization calculations and outputs a scheduling scheme.
Citation Information
Patent Citations
Manufacturing system colored Petri net model building method and system based on PDDL language
CN119718336A
Data Stream Model Transformation
US20250077206A1