Scripted dynamic scheduling system, method, computer device 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.
Patent Information
- Application Number
- CN202610008052.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-06
- Publication Date
- 2026-03-20
- Estimated Expiration
- 2046-01-06
AI Technical Summary
Existing MES/MOM systems suffer from rigid scheduling logic, long update cycles, slow response, and high system coupling in high-security network isolation environments, making it difficult to meet the requirements of flexible adjustment and high reliability in production sites.
A script-based dynamic scheduling system is adopted, which uses the Lua script engine to decouple business algorithms from the underlying architecture, implements a dynamic mapping mechanism by mapping the ISA-95 object model, uses a network gateway for data transfer, and achieves secure and flexible updates of the scheduling algorithm through dynamic hot loading and seamless switching modules.
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 improving response efficiency and system flexibility.
Smart Images

Figure CN121456887B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a system, a method, a computer device and a storage medium for realizing dynamic optimization of discrete manufacturing production scheduling conforming to the ISA-95 standard in a high-safety-level physically isolated network environment such as aerospace, and belongs to the technical field of industrial internet and manufacturing execution system (MES / MOM). BACKGROUND
[0002] In the field of high-end discrete manufacturing such as aerospace and military electronics, the production site faces strict network security control. The network architecture is usually divided into a park network and an industrial control network, and is isolated through a physical gate, and data exchange must comply with the one-way ferry and approval process.
[0003] The existing MES / MOM system has the following disadvantages in such an environment:
[0004] Scheduling logic is rigid and conflicts with production agility: Discrete manufacturing (such as engine testing and precision assembly) has complex processes and a high incidence of exceptions, and the scheduling algorithm needs to respond frequently to changes in the state of people, machines, and materials on site. However, traditional MES hardcodes this logic in compiled host programs such as C++ and C#, making it difficult to adjust flexibly.
[0005] Long change period and serious response lag: Any minor modification to the scheduling logic requires recompilation, packaging, and deployment of the MES server. Since it involves the core program of the industrial control network, the process must include code security scanning, hierarchical administrative approval, downtime maintenance, and gate ferry, which takes several weeks and cannot meet the rapidly changing needs of the production site.
[0006] High system coupling and risk of easy spread: 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 high-reliability manufacturing systems.
[0007] Therefore, there is an urgent need for a technical solution to safely and flexibly update ISA-95 production scheduling logic in a network isolated environment without modifying the main program binary file or stopping. SUMMARY
[0008] Therefore, the application provides a scripted dynamic scheduling system, method, computer device and storage medium. By introducing a script engine (such as Lua) as a logic carrier, the application embodiments realize the decoupling of business algorithms and underlying architecture, establish a dynamic mapping mechanism based on the ISA-95 object model, and realize hot updating and safe execution of scheduling algorithms in a strictly restricted network environment, solving the technical problems of long update period, high deployment cost, and difficulty in responding to agile production of the MES system in a network isolated environment in the prior art.
[0009] The first aspect of the embodiments of the present application discloses a scripted dynamic scheduling system, which comprises: a resource modeling module, configured to be responsible for resource modeling conforming to the ISA-95 standard, and to map the object model conforming to the ISA-95 standard into a data structure readable and writable by a scripting language based on reflection or binding technology; a script engine, configured to execute scheduling algorithms and rule judgments; a data ferry module, configured to transmit scheduling script files as logical loads between a campus network and an industrial control network based on a network gateway; a dynamic hot loading and non-inductive switching module, configured to set a file listener to monitor a specified directory, and when a new scheduling script file is detected through the file listener, destroy a currently running script engine instance and call a new instance corresponding to the new scheduling script file and conforming to preset conditions when the next scheduling period comes, so that a manufacturing execution system service does not need to be restarted.
[0010] In some embodiments, the mapping relationship comprises: mapping the device and its capabilities into a read-only resource table in the script, and mapping the personnel and their qualifications into a personnel capability table in the script; injecting the process segment and the material batch into the script context; injecting the real-time production state into the script global environment, calculating a work order sequence and returning it to a host program to drive execution.
[0011] In some embodiments, the dynamic hot loading and non-inductive switching module comprises: a hot update detection module, configured to detect whether there is a new scheduling script file in response to a scheduling trigger event, and to perform byte compilation and encryption signature verification on the new scheduling script file when an update is detected; a logic management module, configured to switch the current scheduling logic to the logic defined by the new scheduling script file after the compilation and verification pass; an execution module, configured to inject real-time production data and run the current scheduling logic determined by the logic management module; a guarantee module, configured to monitor the running of the current scheduling logic, and to roll back the real-time production data to the verified historical scheduling logic when the running times out or an error occurs; and an instruction module, configured to convert the output of the scheduling logic into production instructions when the scheduling logic runs successfully.
[0012] In some embodiments, the execution module and / or the guarantee module run on a sandboxed secure execution environment.
[0013] In some embodiments, a Lua virtual machine is used as a script interpreter of the script engine, and the standard library functions of the Lua virtual machine are limited, and only the mathematical library, the string library and the application program interface for accessing the manufacturing data model are reserved.
[0014] The second aspect of the embodiment discloses a scripted dynamic scheduling method, which is implemented based on the scripted dynamic scheduling system of the above embodiment and is specifically executed by an MES server of a deployed industrial control network. The method comprises the following steps: defining an object model conforming to the ISA-95 standard; integrating a script engine; registering a host object to a script state machine through a binding mechanism; based on a secure isolation gateway, obtaining a script file written in a park network, putting the script file into a specified directory and calling the script engine to execute, wherein the script file is encrypted and signed in the park network.
[0015] In some embodiments, the object model of the ISA-95 standard comprises: a device object comprising running state, production capacity value and calibration state attributes; a material batch object comprising quantity, quality inspection state and current location attributes; and a work order object comprising priority, deadline and required capacity reference attributes.
[0016] In some embodiments, before the step of calling the script engine to execute, the method further comprises the following steps: 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 a current scheduling thread and switching the current scheduling logic to the logic defined by the new script file; and the step of calling the script engine to execute comprises the following step: when the next production beat arrives, calling a sandboxed script engine to execute a scheduling algorithm based on the logic defined by the new script file and real-time injected ISA-95 data objects; if the new script file fails to compile or verify, capturing error information and recording logs through a daemon thread, and loading an old instance that has passed verification from a cache to continue execution.
[0017] The third aspect of the embodiment discloses a computer readable storage medium, which comprises a stored program, wherein the program controls a processor of a device to execute the scripted dynamic scheduling method of the above embodiment when the program is running.
[0018] The fourth aspect of the embodiment discloses a computer device, which comprises a processor and a memory; wherein the memory stores a computer program, and the computer program is adapted to be loaded by the processor and execute the scripted dynamic scheduling method of the above embodiment.
[0019] Compared with the prior art, the embodiment has the following beneficial effects:
[0020] (1) Improving response efficiency: the update of the scheduling algorithm does not need to go through the lengthy process of "compilation-approval-release", and the script file is used as configuration data to flow, and the update cycle is shortened from the "weekly / monthly" level to the "hourly / minute" level.
[0021] (2) Guarantee system stability and compliance: the host program (binary file) remains unchanged, and there is no need to repeat the software network security evaluation. Logical changes are limited to the sandbox and will not cause system crashes.
[0022] (3) Reduce operation and maintenance costs: solve the problem of synchronization of aerospace park network and industrial control network code. Developers write scripts and test in the park network and directly distribute them to the industrial control network for operation.
[0023] (4) Standardized interoperability: interface design based on ISA-95 standard makes scheduling scripts universal and independent of specific underlying database structure. BRIEF DESCRIPTION OF DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings from the structures shown in the drawings without creative labor.
[0025] Figure 1 A scene diagram of a scripted dynamic scheduling system provided by an embodiment of the present application.
[0026] Figure 2 A schematic diagram of ISA-95 object mapping provided by an embodiment of the present application.
[0027] Figure 3 A flowchart of a dynamic scheduling method provided by an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.
[0029] It should be noted that the terms "first", "second", and the like in the description and in the claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device including a series of steps or units does not necessarily have to be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0030] Embodiment 1:
[0031] Figure 1 A scenario diagram of a scripted dynamic scheduling system provided by an embodiment of the present application. As shown in the figure, the scenario shows the overall topology of the MES system based on Lua script hot update, specifically including: a park network, in which a developer completes the writing and logic verification of a scheduling algorithm in a development environment, and generates a.lua script file in pure text format. A secure isolation boundary, through which one-way data import is achieved by a physical or optical gate. The script file, as a data carrier of non-executable binary code, enters the industrial control network after whitelist verification. An industrial control network, in which an MES server is deployed. Among them, the host program is responsible for bottom layer resource management and hardware interaction, and the Lua engine runs as an embedded submodule to transfer the incoming scheduling script. The file monitoring service monitors the script directory in real time, and once a new file is found, the dynamic loading mechanism of the host program is triggered. Figure 1
[0032] In some embodiments, an embodiment of the present application provides a scripted dynamic scheduling system, which comprises: a resource modeling module, which is responsible for resource modeling conforming to the ISA-95 standard, and maps the object model conforming to the ISA-95 standard to a data structure readable and writable by a script language based on reflection or binding technology; a script engine, which is used to execute scheduling algorithms and rule judgments; a data transfer module, which is used to transfer scheduling script files as logical payloads between a park network and an industrial control network based on a network gate; a dynamic hot loading and non-inductive switching module, which is used to set a file listener to monitor a specified directory, and when a new scheduling script file is detected through the file listener, a currently running script engine instance is destroyed and a new instance corresponding to the new scheduling script file and conforming to preset conditions is called when the next scheduling period comes, so that the manufacturing execution system service does not need to be restarted.
[0033] The resource modeling module described above is part of the host program module, which mainly instantiates objects. In the embodiment, the host program module is developed using a compiled language such as C++ / C# / Java, and is responsible for system underlying resource management, database interaction, network communication, and resource modeling conforming to the ISA-95 standard. This part is relatively static and long-term resident after high-level security approval.
[0034] The script engine described above embeds a lightweight script interpreter in the host program, which is responsible for executing specific scheduling algorithms and rule judgments. In the embodiment, the lightweight scripting language Lua is used as the script interpreter.
[0035] The data ferry channel described above uses scripts as pure text files as "logical payloads" to be ferried through the gateway. In the embodiment, Lua scripts are used as pure text files.
[0036] In the dynamic hot loading and non-inductive switching mechanism described above, the host program sets up a file listener or trigger interface. When a new scheduling script (such as a.lua file) is ferried through the gateway to the specified directory, the system automatically destroys the old script engine instance (such as Lua State) at the next scheduling period, loads the new script, and realizes "millisecond-level" logic switching, so that the MES / MOM service does not need to be restarted.
[0037] In some embodiments, the mapping relationship includes: mapping the device and its capabilities to a read-only resource table in the script, mapping the personnel and their qualifications to a personnel capability table in the script; injecting the process segment and the material lot into the script context; injecting the real-time production state into the script global environment, calculating the job order sequence and returning it to the host program to drive execution.
[0038] The host program module has an object-script mapping mechanism based on ISA-95. It can be understood that the host program maps the core object model conforming to the ISA-95 standard into a script language readable and writable data structure through reflection or binding technology. The specific mapping relationship includes: resource model mapping: mapping EquipmentClass (device class) and EquipmentCapability (device capability) to a read-only resource table in the script, and mapping Person (personnel) and their qualifications to a personnel capability table. Production model mapping: injecting ProcessSegment (process segment) and MaterialLot (material lot) into the script context for process path judgment. Input / output mapping: inject real-time production state into the script global environment; serialize the JobOrder (job order) sequence generated by the script calculation and return it to the host program to drive execution.
[0039] As Figure 2As shown, the data mapping mechanism between the compiled host program and the interpreted script engine is demonstrated, which specifically includes: the host layer: C++ / C# / Java class instances conforming to the ISA-95 standard are defined, such as Equipment (device) and JobOrder (job order), which are statically typed in memory. The interface layer: the interface layer (such as sol2) is responsible for type conversion. The methods (such as CheckAvailability) and properties of the host objects are exposed to the script environment through the reflection mechanism. The script layer: in the Lua virtual machine, the host objects are mapped to dynamic Table or Userdata. The script can directly read the device state in the ResourcePool, or modify the ordering of the InputOrders, without worrying about the underlying memory management.
[0040] In some embodiments, as Figure 3 As shown, the dynamic hot loading and no-sense switching module includes: a hot update detection module, configured to detect whether there is a new scheduling script file in response to a scheduling trigger event, and perform byte compilation and encryption signature verification on the new scheduling script file when an update is detected; a logic management module, configured to switch the current scheduling logic to the logic defined by the new scheduling script file after the compilation and verification pass; an execution module, configured to inject real-time production data and run the current scheduling logic determined by the logic management module; a guarantee module, configured to monitor the running of the current scheduling logic, and when the running times out or an error occurs, roll back the real-time production data to the verified historical scheduling logic; and an instruction module, configured to convert the output of the scheduling logic to production instructions when the scheduling logic runs successfully.
[0041] Here, "compilation" refers to script compilation (compiled into byte files, not binary files), and the purpose of compilation is to verify correctness and improve script execution efficiency.
[0042] The script file carries, stores, and encodes the logic. When the script engine reads and parses the file, the logic is "read", and the logic is loaded into memory. The instance is the real-time dynamic and executable avatar of the logic when the logic runs in memory. The reference refers to the file reference (i.e., the scheduling logic script reference from the old script file to the new script file).
[0043] The execution module and the guarantee module are mainly used to run the instance.
[0044] In some embodiments, the execution module and / or the guarantee module run on a sandboxed secure execution environment.
[0045] In some embodiments, the Lua virtual machine serves as a script interpreter of the script engine, and standard library functions of the Lua virtual machine are limited, leaving only mathematical libraries, string libraries, and application programming interfaces for accessing manufacturing data models.
[0046] For the security requirements of the industrial control network, when the host program initializes the script engine (such as the Lua virtual machine), the standard library (OS, IO, Debug, etc.) is trimmed, and only mathematical operations, string processing, and specific ISA-95 business APIs are retained. Notably, even if the script contains malicious code, it cannot perform file reading and writing or network connections, thereby ensuring the security of the industrial control host. At the same time, an execution fuse and automatic rollback mechanism are established. The host program sets CPU time slice quotas and memory and instruction number limits for the script execution thread. Once the script execution times out or a runtime error occurs, the host program immediately forcibly terminates the sandbox process, automatically rolls back to the last version of the verified scheduling logic, and triggers an exception alarm to the management end, ensuring the continuity of production business.
[0047] In some embodiments, the embodiments of the present application provide a scripted dynamic scheduling method, which is implemented based on the above-mentioned embodiments of the scripted dynamic scheduling system and is executed by the MES service end deployed in the industrial control network. The method comprises: defining an object model conforming to the ISA-95 standard; integrating a script engine; registering host objects to a script state machine through a binding mechanism; 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 for execution, wherein the script file is encrypted and signed in the campus network.
[0048] In some embodiments, the object model of the ISA-95 standard comprises: a device object including running state, production capacity value, and calibration state attributes; a material batch object including quantity, quality inspection state, and current location attributes; and a work order object including priority, deadline, and required capacity reference attributes.
[0049] In some embodiments, as shown in Figure 3 Before the calling of the script engine for execution, the method further comprises: 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 by the new script file; and the calling of the script engine for execution comprises: when the next production beat arrives, calling the sandboxed script engine to execute a scheduling algorithm based on the logic defined by the new script file and real-time injection of ISA-95 data objects; if the new script file fails to compile or verify, capturing error information and recording logs through a daemon thread, and loading an old instance that has passed verification from a cache to continue execution.
[0050] In another embodiment, the old instance can be replaced by the old scheduling logic, and the executable instance is generated in combination with the new data.
[0051] As shown in Figure 3 The dynamic scheduling method flow for network isolation environment is shown, which specifically includes:
[0052] Step 1. Trigger mechanism: triggered by production events (such as new order placement) to trigger scheduling request.
[0053] Step 2. Hot update detection: the system first checks whether there is an update in the script storage directory. If there is, load the new script and perform digital signature verification (to prevent tampering). After verification, seamlessly replace the current logical reference; if verification fails or there is no update, use the old logic.
[0054] Step 3. Sandbox execution:
[0055] Step 3.1. Data injection: inject the current device state, material set information, etc. ISA-95 object into the Lua environment.
[0056] Step 3.2. Logic operation: execute the script in a restricted sandbox to avoid illegal system calls.
[0057] Step 3.3. Result generation: the script outputs the optimized job sequence.
[0058] Step 4. Execution output: the host program parses the data structure returned by the script to drive the underlying device or publish tasks to the workshop board.
[0059] This embodiment takes the MES scheduling scene of an aero-engine test plant as an example:
[0060] Step 1: Build a host environment that meets the ISA-95 standard.
[0061] Deploy the MES server developed based on C++ on the industrial control network. The system defines an object model that strictly follows the ISA-95 Part 2 (Enterprise-Control System Integration) standard. For example:
[0062] (1) Define the Equipment (Equipment) object: contains OperationalState (operational state), ProductionCapacity (production capacity value) and CalibrationStatus (calibration status) attributes;
[0063] (2) Define MaterialLot object: contains Quantity, Status, and Location attributes.
[0064] (3) Define JobOrder object: contains Priority, DueTime, and RequiredCapability references.
[0065] Step 2: Integrate Lua engine with interface bindings.
[0066] The MES server integrates the sol2 library. At initialization, the host object is registered to the Lua state machine through the binding mechanism.
[0067] C++ code example (pseudo code):
[0068] sol::state lua;
[0069] / / Only open basic security library
[0070] lua.open_libraries(sol::lib::base, sol::lib::table, sol::lib::string, sol::lib::math, sol::lib::package)
[0071] / / Bind device manager instance
[0072] lua["DeviceMgr"] = &equipmentManagerInstance;
[0073] / / Define ISA-95 compliant scheduling result structure
[0074] lua.new_usertype <joborder>("JobOrder", "Priority", &JobOrder::priority,...);
[0075] Step 3: Write the scheduling policy script in the plant network.
[0076] The developer writes ScheduleRule_v2.lua in the plant network based on the urgency of the new test task.
[0077] Lua script example (pseudo code):
[0078] -- Traverse all pending job orders
[0079] for i, order in ipairs(InputOrders) do
[0080] -- If the job order is "Model-X" and the device "TestBench-A" is idle
[0081] if order.Type == "Model-X" and DeviceMgr.GetStatus("TestBench-A") =="IDLE" then
[0082] -- Check if the device capability meets the job process requirement (Capability Match)
[0083] if DeviceMgr.CheckCapability("TestBench-A", order.ProcessSegment.RequiredCapability) then
[0084] order.Priority = 99
[0085] order.ScheduledStartTime = os.time() + 60 -- Set the scheduled start time
[0086] end
[0087] -- Assign to TestBench-A
[0088] order.AssignedResource = "TestBench-A"
[0089] end
[0090] end
[0091] return InputOrders
[0092] Step 4: Secure handoff and hot update.
[0093] (1) The script file is checked for syntax and MD5 signature on the park network.
[0094] (2) The ScheduleRule_v2.lua is transferred to the / Rules / directory of the MES server on the industrial network through a secure handoff system such as a secure isolation gateway, optical disc, or authorized mobile storage medium.
[0095] (3) The file monitoring thread of the MES server detects file changes and locks the current scheduling thread after verifying the signature.
[0096] Step 5: Execution and feedback.
[0097] 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 the preset threshold (e.g., 500 milliseconds), the new scheduling rules take effect immediately, and high-priority engine test tasks are assigned to available test bench stations. 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" (last known good) from the cache for execution, ensuring that the on-site equipment does not stop. The entire process does not require restarting the MES service, and the on-site operation terminal is not aware.
[0098] Embodiment 2:
[0099] The embodiments of the present application also provide a computer device, comprising: a memory storing an executable program; and a processor configured to run the program, wherein the program, when running, performs the method in each of the embodiments of the present application.
[0100] The memory described above can refer to a device inside a computer for storing data and programs, and can include a memory, a hard disk, etc., wherein the memory can be used for temporarily storing programs and data that are running, the hard disk can be used for long-term storage of programs and data, the memory can be used for 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.
[0101] Embodiment 3:
[0102] The embodiments of the present application further provide a computer readable storage medium comprising a stored executable program, wherein the computer readable storage medium controls the device where the computer readable storage medium is located to execute the method in each of the embodiments of the present application when the executable program is executed.
[0103] The computer storage medium mentioned above can refer to a medium for storing certain discontinuous physical quantities in a computer memory, and the computer storage medium mainly includes semiconductor, magnetic core, magnetic drum, magnetic tape, laser disc, etc.
[0104] Embodiment 4:
[0105] The embodiments of the present application further provide a computer program product comprising a computer program, which, when executed by a processor, implements the method in each of the embodiments of the present application.
[0106] The computer program product mentioned above can refer to a software program that has been written, tested and released, and can run on a computer or other device. The computer program product can include application programs, operating systems, tool software, etc., and is used to implement specific functions or solve specific problems.
[0107] Embodiment 5:
[0108] The embodiments of the present application further provide a computer program product comprising a non-volatile computer readable storage medium for storing a computer program, which, when executed by a processor, implements the method in each of the embodiments of the present application.
[0109] The non-volatile computer readable storage medium mentioned above can refer to a medium for storing data, and the non-volatile computer readable storage medium can keep the data from being lost when power is off. It can be used to store long-term saved data such as operating systems, application programs and user files. The non-volatile storage medium can include hard disk drives, solid state drives, optical discs and flash memory storage devices, etc.
[0110] Embodiment 6:
[0111] The embodiments of the present application further provide a computer program, which, when executed by a processor, implements the method in each of the embodiments of the present application.
[0112] 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.
[0113] 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.
[0114] 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.
[0115] 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.
[0116] 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.
[0117] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0118] The above only describes the preferred embodiments of the present application. It should be noted that those skilled in the art can make several improvements and refinements without departing from the principles of the present application, and these improvements and refinements should also be considered as the protection scope of the present application.< / 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 been verified 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
Application program hot update method and device, equipment and medium
CN115328523A
Lua encryption and decryption method applied to extension program
CN117610033A