Scripted dynamic scheduling system and method, computer equipment and storage medium

By adopting a scripted dynamic scheduling system in a high-security network isolation environment, and using the Lua script engine to decouple business algorithms from the underlying architecture, dynamic mapping and hot updates under the ISA-95 standard are achieved. This solves the problems of long scheduling logic update cycles and high deployment costs in network isolation environments for MES systems, and improves response efficiency and system stability.

CN121456887AActive Publication Date: 2026-02-03SHANGHAI DINGGE INFORMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202610008052.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-06
Publication Date
2026-02-03
Estimated Expiration
2046-01-06

AI Technical Summary

Technical Problem

Existing MES/MOM systems suffer from long scheduling logic update cycles, high deployment costs, and difficulty in responding to agile production needs in high-security network isolation environments. Furthermore, their high system coupling makes them prone to stability risks.

Method used

A script-based dynamic scheduling system is adopted, which uses the Lua script engine to decouple business algorithms from the underlying architecture. Dynamic mapping and hot updates are achieved by mapping the ISA-95 object model. Data is transferred using a network gateway. Combined with dynamic hot loading and seamless switching modules, the scheduling algorithm can be updated flexibly.

Benefits of technology

The scheduling update cycle has been shortened from the "week/month" level to the "hour/minute" level, ensuring system stability and compliance, reducing operation and maintenance costs, and enabling safe and flexible updates of scheduling logic without modifying the main program binary file or shutting down the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121456887A_ABST
    Figure CN121456887A_ABST
Patent Text Reader

Abstract

The invention discloses a scripted dynamic scheduling system and method, computer equipment and a storage medium, and the system comprises a resource modeling module which is used for carrying out the modeling of resources meeting the ISA-95 standard, and mapping an object model meeting the ISA-95 standard into a data structure which can be read and written by a script language based on a reflection or binding technology; the script engine is used for executing a scheduling algorithm and rule judgment; the data ferrying module is used for transmitting the scheduling script file between the park network and the industrial control network as a logic load based on a gatekeeper; the dynamic hot loading and non-inductive switching module is used for setting a file monitor to monitor a specified directory, when a new scheduling script file is detected through the file monitor and a next scheduling cycle arrives, destroying a currently running script engine instance and calling a new instance which conforms to a preset condition and corresponds to the new scheduling script file, and the service does not need to be restarted. The problems of long scheduling logic updating period, high deployment cost and difficulty in responding to agile production in related technologies are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to a system, method, computer equipment, and storage medium for dynamically optimizing discrete manufacturing production scheduling in high-security, physically isolated network environments such as aerospace, using script engine technology to comply with the ISA-95 standard. It belongs to the technical field of Industrial Internet and Manufacturing Execution System (MES / MOM). Background Technology

[0002] In high-end discrete manufacturing fields such as aerospace and military electronics, production sites face strict network security controls. Their network architecture is typically divided into campus networks and industrial control networks, isolated by physical gateways / optical barriers, and data exchange must follow a one-way transfer and approval process.

[0003] Existing MES / MOM systems have significant drawbacks in such environments: The contradiction between rigid scheduling logic and production agility: Discrete manufacturing (such as engine testing and precision assembly) involves complex processes and frequent anomalies, requiring scheduling algorithms to frequently respond to changes in the status of people, machines, and materials on-site. However, traditional MES systems hardcode this logic in compiled host programs such as C++ and C#, making it difficult to adjust flexibly.

[0004] The change cycle is long and the response is severely delayed: any minor modification to the scheduling logic requires recompiling, packaging, and deploying the MES server. Because it involves core industrial control network programs, the process must include code security scanning, hierarchical administrative approval, downtime maintenance, and network gateway switching, often taking several weeks, which cannot meet the rapidly changing needs of the production site.

[0005] The system is highly coupled, and risks are easily spread: the business logic is tightly coupled with the underlying architecture, and frequent updates to the main program can easily introduce stability risks, such as memory leaks and service crashes, making it difficult to meet the requirements of a high-reliability manufacturing system.

[0006] Therefore, there is an urgent need for a technical solution to securely and flexibly update the ISA-95 production scheduling logic in a network-isolated environment without modifying the main program binary file or shutting down the system. Summary of the Invention

[0007] In view of this, this application provides a scripted dynamic scheduling system, method, computer device, and storage medium. The embodiments of this application introduce a scripting engine (such as Lua) as a logic carrier to decouple business algorithms from the underlying architecture, establish a dynamic mapping mechanism based on the ISA-95 object model, and achieve hot updates and secure execution of scheduling algorithms in strictly constrained network environments. This solves the technical problems of long scheduling logic update cycles, high deployment costs, and difficulty in responding to agile production in existing MES systems under network isolation environments.

[0008] The first aspect of this application discloses a scripted dynamic scheduling system, comprising: a resource modeling module, used to model resources conforming to the ISA-95 standard, mapping object models conforming to the ISA-95 standard into data structures readable and writable by a scripting language based on reflection or binding technology; a script engine, used to execute scheduling algorithms and rule judgments; a data transfer module, used to transmit scheduling script files as logical payloads between the campus network and the industrial control network based on a network gateway; and a dynamic hot-loading and seamless switching module, used to set a file listener to monitor a specified directory, and when a new scheduling script file is detected by the file listener, when the next scheduling cycle arrives, destroying the currently running script engine instance and calling a new instance that meets preset conditions and corresponds to the new scheduling script file, thereby eliminating the need to restart the manufacturing execution system service.

[0009] In some embodiments, the mapping relationships include: mapping equipment and its capabilities to a read-only resource table within the script, mapping personnel and their qualifications to a personnel capability table within the script; injecting process segments and material batches into the script context; injecting real-time production status into the script's global environment; calculating work order sequences and returning them to the host program to drive execution.

[0010] In some embodiments, the dynamic hot loading and seamless switching module includes: a hot update detection module, used to detect the existence of a new scheduling script file in response to a scheduling trigger event, and to perform byte compilation and encrypted signature verification on the new scheduling script file when an update is detected; a logic management module, used to switch the current scheduling logic to the logic defined in the new scheduling script file after compilation and verification are successful; an execution module, used to inject real-time production data and run the current scheduling logic determined by the logic management module; a guarantee module, used to monitor the operation of the current scheduling logic, and to roll back the real-time production data to the verified historical scheduling logic when the operation times out or an error occurs; and an instruction conversion module, used to convert the output of the scheduling logic into production instructions when the scheduling logic runs successfully.

[0011] In some embodiments, the execution module and / or the safeguard module run in a sandboxed secure execution environment.

[0012] In some embodiments, the Lua virtual machine serves as the script interpreter for the script engine. The standard library functionality of the Lua virtual machine is limited, retaining only the math library, string library, and application programming interface for accessing the data model.

[0013] The second aspect of this application discloses a scripted dynamic scheduling method, implemented based on the scripted dynamic scheduling system of the above embodiments, specifically executed by an MES server deployed on an industrial control network. The method includes: defining an object model conforming to the ISA-95 standard; integrating a script engine; registering the host object to the script state machine through a binding mechanism; and, based on a security isolation gateway, obtaining a script file written in the campus network, placing it in a specified directory, and calling the script engine to execute it, wherein the script file is encrypted and signed in the campus network.

[0014] In some embodiments, the object model of the ISA-95 standard includes: equipment objects, including operating status, production capacity value and calibration status attributes; material batch objects, including quantity, quality inspection status and current location attributes; and work order objects, including priority, deadline and required capacity reference attributes.

[0015] In some embodiments, before the script engine is invoked, the process further includes: detecting file changes based on a file monitoring thread; when the file monitoring thread detects a file change, loading and compiling a new script file; if the new script file is successfully compiled and verified, locking the current scheduling thread and switching the current scheduling logic to the logic defined in the new script file; the invocation of the script engine includes: when the next production cycle arrives, invoking the sandboxed script engine to execute the scheduling algorithm based on the logic defined in the new script file and the real-time injected ISA-95 data object; if the new script file fails to compile or verify, capturing error information and logging it through a daemon thread, and loading a verified old instance from the cache to continue execution.

[0016] A third aspect of this application discloses a computer-readable storage medium comprising a stored program, wherein the program, when running, controls the execution of the scripted dynamic scheduling method of the above embodiments in the processor of the device.

[0017] A fourth aspect of this application discloses a computer device, the computer device including a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed by the scripted dynamic scheduling method of the above embodiments.

[0018] Compared with the prior art, the embodiments of this application have the following beneficial effects: (1) Improve response efficiency: The scheduling algorithm update does not need to go through the lengthy process of “compile-approval-release”. The script file is used as configuration data to flow, and the update cycle is shortened from “week / month” to “hour / minute”.

[0019] (2) Ensuring system stability and compliance: The host program (binary file) remains unchanged, eliminating the need for repeated software network access security assessments. Logical changes are confined within the sandbox and will not cause system crashes.

[0020] (3) Reduced operation and maintenance costs: It solves the problem of code synchronization between the aerospace park network and the industrial control network. Developers can write and test scripts on the park network and then distribute them directly to the industrial control network to run.

[0021] (4) Standardized interoperability: The interface design based on the ISA-95 standard makes the scheduling script universal and does not depend on a specific underlying database structure. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0023] Figure 1 This is a scenario diagram of a scripted dynamic scheduling system provided in an embodiment of this application.

[0024] Figure 2 This is a schematic diagram of an ISA-95 object mapping provided in an embodiment of this application.

[0025] Figure 3 A flowchart of a dynamic scheduling method provided in an embodiment of this application. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] Example 1: Figure 1 This is a scenario diagram of a scripted dynamic scheduling system provided in an embodiment of this application. Figure 1 As shown, this scenario demonstrates the overall topology of a MES system based on Lua script hot updates. Specifically, it includes: a campus network where developers write and validate scheduling algorithms, generating plain text .lua script files; a secure isolation boundary using physical gateways or optical gateways for unidirectional data import; script files, acting as non-executable binary code data carriers, entering the industrial control network (ICSN) after whitelist verification; and the ICSN where the MES server is deployed. The host program handles underlying resource management and hardware interaction, while the Lua engine runs the imported scheduling scripts as an embedded submodule. A file monitoring service monitors the script directory in real time, triggering the host program's dynamic loading mechanism upon detecting a new file.

[0029] In some embodiments, this application provides a scripted dynamic scheduling system, the system comprising: a resource modeling module, used to model resources conforming to the ISA-95 standard, mapping object models conforming to the ISA-95 standard into data structures readable and writable by a scripting language based on reflection or binding technology; a script engine, used to execute scheduling algorithms and rule judgments; a data transfer module, used to transmit scheduling script files as logical payloads between the campus network and the industrial control network based on a network gateway; and a dynamic hot-loading and seamless switching module, used to set a file listener to monitor a specified directory, and when a new scheduling script file is detected by the file listener, when the next scheduling cycle arrives, destroying the currently running script engine instance and calling a new instance that meets preset conditions and corresponds to the new scheduling script file, thereby eliminating the need to restart the manufacturing execution system service.

[0030] The aforementioned resource modeling module, as part of the host program module, primarily handles object instantiation. In this embodiment, the host program module is developed using a compiled language such as C++ / C# / Java and is responsible for underlying system resource management, database interaction, network communication, and resource modeling conforming to the ISA-95 standard. This part is relatively static and resides permanently after passing high-level security approval.

[0031] The aforementioned script engine embeds a lightweight script interpreter within the host program, responsible for executing specific scheduling algorithms and rule judgments. In this embodiment, the lightweight scripting language Lua is used as the script interpreter.

[0032] The aforementioned data transfer channel utilizes the characteristic that scripts are plain text files, serving as "logical payloads" for transfer through the network gateway. In this embodiment, Lua scripts are used as plain text files.

[0033] In the aforementioned dynamic hot-loading and seamless switching mechanism, the host program sets up a file listener or trigger interface. When a new scheduling script (such as a .lua file) is transferred to the designated directory through the network gateway, the system automatically destroys the old script engine instance (such as Lua State) in the next scheduling cycle and loads the new script, achieving "millisecond-level" logical switching, thus eliminating the need to restart the MES / MOM service.

[0034] In some embodiments, the mapping relationships include: mapping equipment and its capabilities to a read-only resource table within the script, mapping personnel and their qualifications to a personnel capability table within the script; injecting process segments and material batches into the script context; injecting real-time production status into the script's global environment; calculating work order sequences and returning them to the host program to drive execution.

[0035] The host program module features an ISA-95-based object-script mapping mechanism. This means the host program maps core object models conforming to the ISA-95 standard into script-readable and writable data structures using reflection or binding techniques. Specific mapping relationships include: Resource model mapping: Mapping EquipmentClass and EquipmentCapability to read-only resource tables within the script, and mapping Person and their qualifications to a personnel capability table. Production model mapping: Injecting ProcessSegment and MaterialLot into the script context for process path determination. Input / output mapping: Injecting real-time production status into the script's global environment; serializing the JobOrder generated by the script and returning it to the host program for execution.

[0036] like Figure 2The diagram illustrates the data mapping mechanism between the compiled host program and the interpreted script engine, specifically including: Host Layer: Defines C++ / C# / Java class instances conforming to the ISA-95 standard, such as Equipment and JobOrder. These objects are statically typed in memory. Interface Layer: The interface layer (e.g., sol2) is responsible for type conversion. It exposes the host object's methods (e.g., CheckAvailability) and properties to the script environment through reflection. Script Layer: In the Lua virtual machine, host objects are mapped to dynamic Tables or Userdata. Scripts can directly read device states from the ResourcePool or modify the order of InputOrders without needing to worry about underlying memory management.

[0037] In some embodiments, such as Figure 3 As shown, the dynamic hot loading and seamless switching module includes: a hot update detection module, used to detect the existence of a new scheduling script file in response to a scheduling trigger event, and to perform byte compilation and encrypted signature verification on the new scheduling script file when an update is detected; a logic management module, used to switch the current scheduling logic to the logic defined in the new scheduling script file after compilation and verification are successful; an execution module, used to inject real-time production data and run the current scheduling logic determined by the logic management module; a guarantee module, used to monitor the operation of the current scheduling logic, and to roll back the real-time production data to the verified historical scheduling logic when the operation times out or an error occurs; and an instruction conversion module, used to convert the output of the scheduling logic into production instructions when the scheduling logic runs successfully.

[0038] Here, "compiling" refers to compiling the script (compiling it into a byte file, not a binary file). The purpose of compilation is twofold: first, to verify its correctness, and second, to improve the script's execution efficiency.

[0039] Script files carry, store, and encode logic. When the script engine reads and parses the file, it "reads the logic" and loads it into memory. An instance is the real-time, dynamic, and executable embodiment of the logic running in memory. A reference refers to a file reference (i.e., a scheduling logic script reference pointing from an old script file to a new script file).

[0040] The execution module and the safeguard module are mainly used to run instances.

[0041] In some embodiments, the execution module and / or the safeguard module run in a sandboxed secure execution environment.

[0042] In some embodiments, the Lua virtual machine serves as the script interpreter for the script engine. The standard library functionality of the Lua virtual machine is limited, retaining only the math library, string library, and application programming interface for accessing the data model.

[0043] To address the security requirements of industrial control systems (ICS) networks, when initializing the script engine (such as a Lua virtual machine) in the host program, the standard library is trimmed (OS, IO, Debug, etc. libraries are disabled), retaining only mathematical operations, string processing, and specific ISA-95 business APIs. It is worth noting that even if the script contains malicious code, it cannot perform file read / write operations or network connections, thus ensuring the security of the ICS host. Simultaneously, an execution circuit breaker and automatic rollback mechanism are established. The host program sets CPU time slice quotas and memory and instruction count limits for script execution threads. Once a script execution times out or a runtime error occurs, the host program immediately and forcibly terminates the sandbox process, automatically rolls back to the previously validated scheduling logic, and triggers an exception alarm to the management end, ensuring that production business continuity is not affected.

[0044] In some embodiments, the present application provides a scripted dynamic scheduling method, implemented based on the scripted dynamic scheduling system of the above embodiments, specifically executed by the MES server deployed on the industrial control network. The method includes: defining an object model conforming to the ISA-95 standard; integrating a script engine; registering the host object to the script state machine through a binding mechanism; and, based on a security isolation gateway, obtaining the script file written in the campus network, placing it in a specified directory, and calling the script engine to execute it, wherein the script file is encrypted and signed in the campus network.

[0045] In some embodiments, the object model of the ISA-95 standard includes: equipment objects, including operating status, production capacity value and calibration status attributes; material batch objects, including quantity, quality inspection status and current location attributes; and work order objects, including priority, deadline and required capacity reference attributes.

[0046] In some embodiments, such as Figure 3 As shown, before the script engine is invoked, the process includes: detecting file changes based on a file monitoring thread; when the file monitoring thread detects a file change, loading and compiling a new script file; if the new script file is successfully compiled and verified, locking the current scheduling thread and switching the current scheduling logic to the logic defined in the new script file; the script engine is invoked to execute the process, including: when the next production cycle arrives, invoking the sandboxed script engine to execute the scheduling algorithm based on the logic defined in the new script file and the real-time injected ISA-95 data object; if the new script file fails to compile or verify, capturing error information and logging it through a daemon thread, and loading a verified old instance from the cache to continue execution.

[0047] In another embodiment, the old instance can be replaced with the old scheduling logic and combined with new data to generate an executable instance.

[0048] like Figure 3 The diagram illustrates the dynamic scheduling method for network isolation environments, specifically including: Step 1. Triggering mechanism: The scheduling request is triggered by a production event (such as a new order being placed).

[0049] Step 2. Hot Update Detection: The system first checks if there are any updates in the script storage directory. If so, the new script is loaded and its digital signature is verified (to prevent tampering). If the verification passes, the current logic reference is seamlessly replaced; if the verification fails or there are no updates, the old logic is used.

[0050] Step 3. Sandbox execution: Step 3.1. Data Injection: Inject the current equipment status, material kitting information, and other ISA-95 objects into the Lua environment.

[0051] Step 3.2. Logical Operations: Execute the script in a restricted sandbox to avoid illegal system calls.

[0052] Step 3.3. Result Generation: The script outputs the optimized job sequence.

[0053] Step 4. Execution Output: The host program parses the data structure returned by the script and drives the underlying devices or issues tasks to the workshop Kanban board.

[0054] This embodiment takes the MES scheduling scenario of an aero-engine testing plant as an example: Step 1: Build a host environment that conforms to the ISA-95 standard.

[0055] A C++-based MES server is deployed on the industrial control network. The system defines an object model that strictly adheres to the ISA-95 Part 2 (Enterprise-Control System Integration) standard. For example: (1) Define an Equipment object: containing OperationalState, ProductionCapacity, and CalibrationStatus properties; (2) Define a MaterialLot object: containing Quantity, Status, and Location attributes; (3) Define a JobOrder object: including Priority, DueTime and RequiredCapability.

[0056] Step 2: Integrate the Lua engine and bind the interface.

[0057] The MES server integrates the sol2 library. During initialization, the host object is registered to the Lua state machine through a binding mechanism.

[0058] C++ code example (pseudocode): sol::state lua; / / Only the basic security library is open lua.open_libraries(sol::lib::base, sol::lib::table, sol::lib::string,sol::lib::math, sol::lib::package) / / Bind Device Manager instance lua["DeviceMgr"] =&equipmentManagerInstance; / / Define the scheduling result structure that conforms to ISA-95 lua.new_usertype <joborder>("JobOrder", "Priority", &JobOrder::priority,...); Step 3: Write the scheduling policy script on the plant network.

[0059] Developers write ScheduleRule_v2.lua on the plant network based on the urgency of the new test task.

[0060] Lua script example (pseudo code): -- Traverse all pending orders for i, order in ipairs(InputOrders) do -- If the order is "Model-X" and the device "TestBench-A" is idle if order.Type == "Model-X" and DeviceMgr.GetStatus("TestBench-A") =="IDLE" then -- Check if the device capability meets the order process requirement (Capability Match) if DeviceMgr.CheckCapability("TestBench-A", order.ProcessSegment.RequiredCapability) then order.Priority = 99 order.ScheduledStartTime = os.time() + 60 -- Set the scheduled start time end -- Assign to TestBench-A order.AssignedResource = "TestBench-A" end end return InputOrders Step 4: Secure transfer and hot update.

[0061] (1) The script file is checked for syntax and MD5 signature on the plant network.

[0062] (2) ScheduleRule_v2.lua is transferred to the / Rules / directory of the MES server on the industrial control network through a secure isolation gateway, optical disc, or authorized mobile storage medium, etc.

[0063] (3) The file monitoring thread of the MES server detects file changes, locks the current scheduling thread after verifying the signature.

[0064] Step 5: Execution and feedback.

[0065] When the next production cycle arrives, the MES server calls lua. RunScriptFile ("ScheduleRule_v2. lua"). The host program starts a daemon thread to monitor the execution status. If the script successfully returns within a preset threshold (for example, 500 milliseconds), the new scheduling rule takes effect immediately, and the high-priority engine test task is preferentially assigned to the available test bench station. If the script execution times out or throws an exception, the daemon thread will capture the error, log it, and automatically load the old version of the scheduling logic marked as "Last_Known_Good" (the last known available) from the cache for execution, ensuring that the on-site equipment does not shut down. The entire process does not require restarting the MES service, and the on-site operation terminal is not aware.

[0066] Embodiment 2: The embodiment of the application further provides a computer device, comprising a memory storing an executable program, and a processor configured to run the program, wherein the program is configured to execute the method in the embodiments of the application when running.

[0067] The memory described above can refer to a device inside a computer for storing data and programs, and can include memory, hard disk, etc., wherein the memory can be used for temporarily storing programs and data being run, the hard disk can be used for long-term storage of programs and data, the memory can be used for enabling the computer to read and write data and execute programs; the processor described above can be responsible for executing instructions in the computer program and processing data, and can be responsible for controlling and executing various operations, including arithmetic operations, logical operations, data transmission, etc.

[0068] Embodiment 3: The embodiment of the application further provides a computer readable storage medium, which comprises a stored executable program, wherein the executable program is configured to control a device where the computer readable storage medium is located to execute the method in the embodiments of the application when running.

[0069] The computer storage medium described above can refer to a medium in a computer memory for storing certain discrete physical quantities, and the computer storage medium mainly includes semiconductor, magnetic core, magnetic drum, magnetic tape, laser disc, etc.; the stored program included in the computer readable storage medium can be a set of instructions that can be recognized and executed by a computer, and can run on an electronic computer to be an informationization tool meeting certain needs of people.

[0070] Embodiment 4: Embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the methods of various embodiments of the present invention.

[0071] The aforementioned computer program products can refer to software programs that have been written, tested, and released, and can run on computers or other devices. Computer program products can include application programs, operating systems, utility software, etc., used to achieve specific functions or solve specific problems.

[0072] Example 5: Embodiments of this application also provide a computer program product, including a non-volatile computer-readable storage medium for storing a computer program that, when executed by a processor, implements the methods in various embodiments of the present invention.

[0073] The aforementioned non-volatile computer-readable storage medium can refer to a medium for storing data. Non-volatile computer-readable storage media can retain data without loss when power is off and can be used to store long-term data, such as operating systems, applications, and user files. Non-volatile storage media can include hard disk drives, solid-state drives, optical disks, and flash memory storage devices, etc.

[0074] Example 6: Embodiments of this application also provide a computer program that, when executed by a processor, implements the methods described in the various embodiments of the present invention.

[0075] The aforementioned computer program can refer to a set of instructions used to tell the computer to perform specific tasks or operations. Computer programs can be written by programmers using specific programming languages ​​and can include algorithms, data structures, logic, and control flow. Computer programs can be used for a variety of purposes, including application software, operating systems, etc.

[0076] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0077] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0078] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0079] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0080] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0081] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.< / joborder>

Claims

1. A script-based dynamic scheduling system, characterized in that, include: The resource modeling module is responsible for modeling resources that conform to the ISA-95 standard. It maps object models that conform to the ISA-95 standard into data structures that can be read and written by scripting languages ​​based on reflection or binding techniques. The script engine is used to execute scheduling algorithms and rule judgments; The data transfer module is used to transmit scheduling script files as logical payloads between the campus network and the industrial control network based on the network gateway; The dynamic hot-loading and seamless switching module is used to set up a file listener to monitor a specified directory. When a new scheduling script file is detected by the file listener, the currently running script engine instance is destroyed and a new instance corresponding to the new scheduling script file that meets the preset conditions is called when the next scheduling cycle arrives, so as not to restart the manufacturing execution system service.

2. The scripted dynamic scheduling system according to claim 1, characterized in that, The mapping relationships include: Map the equipment and its capabilities to a read-only resource table within the script, and map the personnel and their qualifications to a personnel capability table within the script; Inject the process segment and material batch into the script context; The real-time production status is injected into the script's global environment, the work order sequence is calculated, and the result is returned to the host program to drive its execution.

3. The scripted dynamic scheduling system according to claim 1, characterized in that, The dynamic hot-loading and seamless switching module includes: The hot update detection module is used to respond to scheduling trigger events, detect whether there are new scheduling script files, and when an update is detected, perform byte compilation and encryption signature verification on the new scheduling script file; The logic management module is used to switch the current scheduling logic to the logic defined in the new scheduling script file after compilation and verification are successful. The execution module is used to inject real-time production data and run the current scheduling logic determined by the logic management module; The safeguard module is used to monitor the operation of the current scheduling logic and, in the event of a timeout or error, roll back the production data to the verified historical scheduling logic in real time. The instruction module is used to convert the output of the scheduling logic into production instructions when the scheduling logic runs successfully.

4. The scripted dynamic scheduling system according to claim 3, characterized in that, The execution module and / or the safeguard module run in a sandboxed secure execution environment.

5. The scripted dynamic scheduling system according to claim 1, characterized in that, The Lua virtual machine serves as the script interpreter for the script engine. The standard library functionality of the Lua virtual machine is limited, retaining only the math library, string library, and application programming interface for accessing the data models.

6. A script-based dynamic scheduling method, characterized in that, The system is based on the scripted dynamic scheduling system described in any one of claims 1 to 5, specifically executed by the MES server deployed on the industrial control network, including: Define an object model that conforms to the ISA-95 standard; Integrated script engine; The host object is registered to the script state machine through a binding mechanism; Based on the security isolation gateway, the script file written in the campus network is obtained, placed in the specified directory, and executed by the script engine. The script file is encrypted and signed in the campus network.

7. The scripted dynamic scheduling method according to claim 6, characterized in that, The object model of the ISA-95 standard includes: Equipment objects include operating status, production capacity value, and calibration status attributes; Material batch objects, including quantity, quality inspection status, and current location attributes; The work order object includes priority, deadline, and required capability reference attributes.

8. The scripted dynamic scheduling method according to claim 6, characterized in that, Before the script engine is invoked for execution, the following is also included: File changes are detected using a file monitoring thread; When the file monitoring thread detects a file change, it loads and compiles the new script file; If the new script file is compiled successfully and verified, the current scheduling thread is locked, and the current scheduling logic is switched to the logic defined in the new script file. The execution of the script engine includes: When the next production cycle arrives, the sandboxed script engine is invoked to execute the scheduling algorithm based on the logic defined in the new script file and the real-time injected ISA-95 data objects; If the new script file fails to compile or verify, the error message is captured and logged by the daemon thread, and the old instance that has passed verification is loaded from the cache to continue execution.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the scripted dynamic scheduling method as described in any one of claims 6 to 8.

10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the scripted dynamic scheduling method as described in any one of claims 6 to 8.

Citation Information

Patent Citations

  • Mapping method in the program testing system and program testing system

    CN101401075A

  • Application program hot update method and device, equipment and medium

    CN115328523A

  • Lua encryption and decryption method applied to extension program

    CN117610033A

  • Method and system for creating template scripts based container orchestrator

    KR101985635B1

  • Systems and methods of a script generation engine

    US20130339841A1