A Production Scheduling and Control Method Based on Industrial Edge Gateway
By constructing task sequences, detecting timing deviations and resolving conflicts at the industrial edge gateway, and combining equipment status for resource-constrained scheduling, the micro-deadlock problem caused by timing drift and out-of-order instructions in multi-category small-batch production is solved, thereby improving the stability of production scheduling and the utilization rate of resources.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LANJING TECH (NANJING) CO LTD
- Filing Date
- 2026-04-14
- Publication Date
- 2026-06-30
AI Technical Summary
In multi-category, small-batch production scenarios, when industrial edge gateways connect to cloud scheduling systems, millisecond-level timing drift and instruction out-of-order superposition caused by network jitter and differences in edge caching strategies lead to micro-deadlock phenomena, which existing methods cannot effectively solve.
By collecting device status data at the industrial edge gateway, constructing task sequences and marking logical timestamps, detecting timing deviations and resolving potential conflicts, constructing executable windows for dependency verification and conflict resolution, and combining device status for resource constraint scheduling, local scheduling and feedback correction are achieved.
It effectively avoids micro-deadlock and throughput fluctuations, improves the stability of production scheduling and resource utilization, adapts to changes in equipment load, and optimizes the scheduling process.
Smart Images

Figure CN122308301A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial production scheduling and control technology, and specifically to a production scheduling and control method based on an industrial edge gateway. Background Technology
[0002] In industrial settings with multi-product, small-batch production, equipment connects to a cloud-based scheduling system via an industrial edge gateway. Due to network jitter and differences in edge caching strategies, a "hidden rearrangement" problem can easily occur, involving millisecond-level timing drift and out-of-order instruction. When multiple workstations collaborate and there are cross-device process dependencies, out-of-order instructions can trigger premature or delayed execution at local workstations, causing semi-finished products to repeatedly occupy positions or idle within a short time window. This can lead to a rare but severe "micro-deadlock" phenomenon, manifested as a sudden drop in throughput despite no obvious faults in the overall production line, which is difficult to reproduce and locate. Existing methods often rely on unified cloud scheduling and simple retries, making it difficult to mitigate the micro-deadlock risk caused by the coupling of out-of-order and timing drift at the edge. Summary of the Invention
[0003] The purpose of this invention is to provide a production scheduling and control method based on an industrial edge gateway to address the shortcomings in the prior art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a production scheduling and control method based on an industrial edge gateway, comprising: S100 collects real-time status data and process dependencies of each production equipment, constructs task sequences and their sequential constraints, generates an initial scheduling queue, and marks each task with a logical timestamp τ and a dependency set D. S200 unifies the access of scheduling commands from the cloud and local area at the industrial edge gateway, establishes an out-of-order detection queue based on τ and D, calculates the timing deviation Δτ for incoming commands and marks potential conflict identifier C to obtain an extended queue; S300: Based on Δτ and C in the extended queue, construct an executable window W on the edge side, and perform dependency verification and conflict resolution on the tasks within the window to generate a rearranged candidate execution sequence S, in which only tasks that satisfy D and whose Δτ is within the threshold are retained. S400, for sequence S, applies load constraints and resource consumption prediction to each task in combination with the real-time status of the device, forms a constraint scheduling model, and calculates the execution priority P of each task; S500, based on M and P, performs local scheduling and command issuance at the edge gateway, while delaying and rolling back tasks that do not meet the conditions, and updating the extended queue; S600 will perform feedback and write back the updated extended queue to correct τ and Δτ, iteratively update W and M, and output a stable production scheduling result.
[0005] Preferably, step S100 specifically includes the following steps: S110 collects data from each production device based on the industrial edge gateway, obtains the device operating status parameters and corresponding process identification information, and performs time synchronization calibration to form a unified time reference. S120: Based on the process identification information, the process dependency relationship between each production task is parsed, a task dependency graph is constructed, and the dependency paths are topologically sorted to generate an ordered task sequence. S130, assign a logical timestamp to each task in the ordered task sequence based on the unified time base, and generate a corresponding dependency set according to the task dependency graph; S140, map the logical timestamp and dependency set to the ordered task sequence to form an initial scheduling queue.
[0006] Preferably, step S200 specifically includes the following steps: S210, the scheduling instructions from the cloud and local machine are cached in order of arrival time, and the task identifier corresponding to each scheduling instruction is extracted. Based on the task identifier, the logical timestamp and dependency set in the initial scheduling queue are matched to form a set of instructions with constraint information. S220, the instruction set is compared sequentially according to the logical timestamp, the difference between the actual arrival time of each scheduling instruction and its logical timestamp is calculated, the difference is defined as the timing deviation, and the scheduling instructions are classified according to a preset deviation threshold to form an out-of-order detection queue. S230, in the out-of-order detection queue, the predecessor task of each scheduling instruction is checked according to the dependency set. When there is a scheduling instruction that does not satisfy the dependency relationship, the corresponding potential conflict identifier is marked. S240, the timing deviation and potential conflict identifiers are written into the corresponding scheduling instruction and rearranged according to the updated order to obtain the extended queue.
[0007] Preferably, step S300 specifically includes the following steps: S310, based on the timing deviation and potential conflict identifier of each scheduling instruction in the extended queue, sort them in order of timing deviation from smallest to largest, and select scheduling instructions that continuously meet the preset window length condition to construct an edge-side executable window. The window length is obtained by statistically analyzing the number of historically stable executed tasks and taking their average value. S320, within the executable window on the edge side, read the dependency set of the scheduling instructions one by one, perform a predecessor task completion status check on each task, and eliminate scheduling instructions whose dependency relationship is not satisfied to obtain a preliminary screening sequence. S330, perform conflict resolution processing on the scheduling instructions marked with potential conflict identifiers in the preliminary screening sequence, specifically by delaying and rearranging conflicting tasks based on timing deviation priority, and updating their positional relationship in the sequence; S340, rearranges the scheduling instructions after dependency verification and conflict resolution in the updated order, retaining only tasks whose dependency sets are satisfied and whose timing deviations are within the preset threshold range, and generates a rearranged candidate execution sequence.
[0008] Preferably, step S320 specifically includes the following steps: S321, read the dependency set of each scheduling instruction in the executable window on the edge side one by one, and map the completion status of the predecessor task in the dependency set to a Boolean variable, where the completion status is recorded as a true value and the incomplete status is recorded as a false value; S322, construct the corresponding Boolean constraint expression based on the dependency set. The Boolean constraint expression adopts conjunctive normal form and connects the Boolean variables of all predecessor tasks through logical AND operation to form task dependency determination conditions. S323, perform satisfiability evaluation on the Boolean constraint expression, and perform logical operations by substituting the actual completion state of the current predecessor task one by one. When the operation result is true, it is determined that the dependency is satisfied; when the operation result is false, it is determined that the dependency is not satisfied. S324, Based on the satisfiability solution result, retain the scheduling instructions that satisfy the dependency relationship and remove the scheduling instructions that do not satisfy the dependency relationship, thereby forming a preliminary screening sequence.
[0009] Preferably, step S400 specifically includes the following steps: S410: Obtain the real-time operating status parameters of the device corresponding to each task in the sequence, and extract the device load ratio, available resource capacity and current execution queue length to construct the status mapping relationship between tasks and devices; S420, Apply load constraints to each task based on the state mapping relationship, compare the device load ratio with the preset load limit, filter the set of tasks that meet the load constraint conditions, and calculate the resource consumption required for task execution; S430, Based on the resource consumption required for the task execution and the current available resource capacity of the device, a resource consumption prediction model is constructed. The resource consumption prediction model uses a sliding time window to statistically analyze historical task resource consumption data and uses a weighted average method to predict the resource consumption trend of the current task. S440, Based on the load constraint results and resource occupancy prediction results, a constraint scheduling model is constructed, and the execution priority is calculated according to the resource matching degree and load adaptability degree of the task to obtain the execution priority of each task.
[0010] Preferably, step S500 specifically includes the following steps: S510, based on the constraint scheduling model and execution priority, sorts the tasks in the candidate execution sequence from high to low execution priority, and selects the tasks that meet the load constraints and resource consumption prediction conditions to generate a local execution sequence; S520, generate scheduling instructions one by one according to the order of the local execution sequence, issue instructions according to the state mapping relationship of the device corresponding to the task, and record the instruction issuance time and execution feedback information at the same time. S530, for tasks that have not entered the local execution sequence, delay and rollback processing is performed according to the type of condition they do not meet. When a task does not meet the condition due to insufficient resource usage, it is delayed to the next scheduling cycle. When a task does not meet the condition due to unmet dependency, it is rolled back to the corresponding dependency position in the extended queue. S540 updates the task order in the extended queue based on the feedback information of the executed tasks and the results of delay and rollback processing, and recalculates the timing deviation and potential conflict indicators of the relevant tasks, thereby forming an updated extended queue.
[0011] Preferably, step S600 specifically includes the following steps: S610 integrates the execution feedback information with the updated extended queue, corrects the logical timestamp of the corresponding task based on the actual execution time and completion status of the task in the execution feedback, and recalculates the timing deviation. S620 updates the executable window on the edge side based on the corrected logical timestamp and timing deviation, recounts the number of tasks that meet the timing deviation threshold, and dynamically adjusts the window range. S630, based on the updated extended queue and edge-side executable window, iteratively corrects the constraint scheduling model, the iterative correction including updating resource occupancy prediction data and load constraint parameters; S640, based on the iteratively updated edge-side executable window and constraint scheduling model, outputs the final scheduling sequence that satisfies the dependency relationship and resource constraints, thereby obtaining a stable production scheduling result.
[0012] The technical effects and advantages provided by the present invention in the above technical solution are as follows: 1. Compared to existing technologies, this invention addresses the implicit scheduling anomalies caused by the superposition of timing drift and instruction out-of-order delivery in industrial edge environments. By introducing logical timestamp correction, dynamic calculation of timing deviations, and a dependency consistency determination method based on Boolean constraint expressions, it achieves fine-grained control over task execution order. By constructing executable windows and performing local scheduling at the edge, it effectively avoids the response lag problem caused by traditional centralized scheduling in the cloud under unstable network conditions. This ensures strict satisfaction of task dependencies even under millisecond-level timing disturbances, significantly reducing the probability of micro-deadlocks and throughput fluctuations.
[0013] 2. This invention constructs a resource occupancy prediction model and a dynamic iterative update mechanism for load constraint parameters, enabling scheduling decisions to adapt to changes in equipment load and resource fluctuations in real time. Furthermore, it combines execution feedback to perform closed-loop correction of logical timestamps and timing deviations, achieving adaptive optimization of the scheduling process. This method not only improves the stability and continuity of scheduling results but also enhances resource utilization and production cycle consistency in complex multi-workstation collaborative scenarios. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0015] Figure 1 This is a flowchart of a production scheduling and control method based on an industrial edge gateway according to the present invention.
[0016] Figure 2 This is a flowchart of the extended queue update method of the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] For examples, please refer to Figure 1 , 2 As shown in this embodiment, a production scheduling and control method based on an industrial edge gateway includes: S100 collects real-time status data and process dependencies of each production equipment, constructs task sequences and their sequential constraints, generates an initial scheduling queue, and marks each task with a logical timestamp τ and a dependency set D.
[0019] In step S110, the specific implementation process of data acquisition from each production device based on the industrial edge gateway is as follows: First, connections are established one by one according to the device communication address, and the current operating status parameters of each production device are read. The operating status parameters include the current task identifier, process progress value, device load ratio, and operating status flag. Simultaneously, the process identifier information corresponding to the current task is read from the device's internal storage area. The process identifier information is a unique code used to characterize the processing process type and sequence. Subsequently, time synchronization calibration processing is performed on the acquired data. Specifically, the local clock of the industrial edge gateway is used as a unified time reference. The reception time of each data item is recorded, and the time offset value between the device's reported time and the unified time reference is calculated. The time offset value is compensated and corrected to obtain the device data under the unified time reference, thereby forming a time-consistent device status data set.
[0020] In step S120, the specific process of parsing the process dependencies between production tasks based on the process identifier information is as follows: First, a process flow rule table is pre-established, which records the sequential relationship between each process identifier in the form of directed relation pairs; then, the collected task identifiers are mapped one by one to the process flow rule table to construct a task dependency graph, where each task is a node in the graph and the dependency relationship between tasks is a directed edge; next, a topological sort is performed on the task dependency graph, specifically: the in-degree value of each node is counted, the node with an in-degree of zero is selected as the starting node, it is added to the sorting sequence and removed from the graph, and the in-degree value of its successor node is updated. The above process is repeated until all nodes are sorted, thereby obtaining an ordered task sequence that satisfies the dependency constraints.
[0021] In step S130, the method for assigning logical timestamps to each task in the ordered task sequence based on the unified time base is as follows: First, the initial time value is determined to be the current time in the unified time base; then, a fixed time step is calculated. The fixed time step is calculated by statistically analyzing the execution time of similar historical tasks, calculating the average execution time using the arithmetic mean method, and using this average execution time as the time step; subsequently, logical timestamps are assigned to each task in the order of the ordered task sequence, wherein the logical timestamp of the next task is equal to the logical timestamp of the previous task plus the fixed time step; simultaneously, a dependency set is generated for each task based on the task dependency graph, the dependency set including the task identifiers of all direct predecessor tasks and their corresponding logical timestamps.
[0022] In step S140, the specific process of mapping the logical timestamp and dependency set to the ordered task sequence to form an initial scheduling queue is as follows: First, a structured record item is constructed for each task, the record item including task identifier, logical timestamp, and dependency set; then, according to the ordered task sequence obtained by topological sorting, all record items are arranged in sequence to form a linear queue structure; in this linear queue structure, each task is explicitly marked with its logical timestamp and dependency set, so that each task in the queue has both time constraint and dependency constraint attributes, thereby forming an initial scheduling queue for subsequent scheduling control.
[0023] The S200 performs unified access to scheduling commands from the cloud and local area at the industrial edge gateway. It establishes an out-of-order detection queue based on τ and D, calculates the timing deviation Δτ for incoming commands and marks potential conflict identifiers C to obtain an extended queue.
[0024] In step S210, the specific implementation process for unified access of scheduling instructions from the cloud and local machine is as follows: First, an instruction cache sequence is established according to the time order of the scheduling instructions arriving at the industrial edge gateway, and the actual arrival time of each scheduling instruction is recorded; then, the task identifier is parsed from each scheduling instruction, and the logical timestamp and dependency set of the corresponding task are retrieved from the initial scheduling queue based on the task identifier; the logical timestamp and dependency set are embedded into the corresponding scheduling instruction to form an instruction set with time constraints and dependency constraints, thereby providing basic data for subsequent time series analysis.
[0025] In step S220, the specific implementation process of comparing the order of the instruction set according to the logical timestamp is as follows: First, for each scheduling instruction, the difference between its actual arrival time and the corresponding logical timestamp is calculated, and this difference is defined as the timing deviation; then, a deviation threshold is constructed. The deviation threshold is calculated by: statistically analyzing the timing deviations of historical scheduling instructions, selecting the most recent fixed number of deviation values using a sliding window method, calculating their average value and standard deviation, and using the sum of the average value and standard deviation as the deviation threshold; then, the timing deviation of each scheduling instruction is compared with the deviation threshold. If the timing deviation is greater than the deviation threshold, it is determined to be an abnormal instruction; otherwise, it is determined to be a normal instruction; based on the determination result, the scheduling instructions are reordered according to the size of the timing deviation to form an out-of-order detection queue.
[0026] In step S230, the specific implementation process of dependency verification in the out-of-order detection queue is as follows: First, the scheduling instructions in the out-of-order detection queue are read one by one, and their dependency sets are extracted; then, the status of each predecessor task in the dependency set is verified, specifically: the completion flag of the corresponding predecessor task is retrieved in the current execution record; if all predecessor tasks have been completed, the dependency is determined to be satisfied; if any predecessor task has not been completed, the dependency is determined to be unsatisfactory; for scheduling instructions whose dependency is unsatisfactory, a potential conflict flag is assigned, and the corresponding uncompleted predecessor task flag is recorded for subsequent processing.
[0027] In step S240, the specific implementation process of writing the timing deviation and potential conflict identifier into the corresponding scheduling instruction and forming an extended queue is as follows: First, add a timing deviation field and a potential conflict identifier field to the data structure of each scheduling instruction; then, write the timing deviation obtained in step S220 and the potential conflict identifier obtained in step S230 into the corresponding fields respectively; then, rearrange all scheduling instructions based on timing deviation as the primary sorting criterion and potential conflict identifier as the secondary sorting criterion, with priority given to retaining scheduling instructions with smaller timing deviations and no potential conflict identifiers; finally, an extended queue containing complete time information and conflict information is formed for subsequent scheduling decision processing.
[0028] S300: Based on Δτ and C in the extended queue, construct an executable window W on the edge side, and perform dependency verification and conflict resolution on the tasks within the window to generate a rearranged candidate execution sequence S, in which only tasks that satisfy D and whose Δτ is within the threshold are retained.
[0029] In step S310, the specific implementation process of constructing an edge-side executable window based on the extended queue is as follows: First, read the timing deviation and potential conflict identifier of each scheduling instruction in the extended queue, and sort them according to the timing deviation value from smallest to largest to form an ordered instruction sequence; then, determine the window length. The calculation method of the window length is as follows: select a set of tasks that have been continuously and stably executed in the historical operation process, count the number of tasks in the set, calculate the average value using the arithmetic mean method, and use the average value as the window length; then, starting from the starting position of the sorted instruction sequence, select scheduling instructions that continuously meet the window length to construct an edge-side executable window, thereby limiting the subsequent processing range.
[0030] In step S320, the specific implementation process of dependency verification within the edge-side executable window is as follows: First, assume that a scheduling instruction corresponds to a task Tk, whose dependency set is Dk={T1, T2, T3}, where T1, T2, and T3 are the predecessor tasks of this task; read the completion status of each predecessor task from the execution record, for example: T1 completed, T2 not completed, T3 completed; map the above status to Boolean variables, denoted as x1=1, x2=0, x3=1, where the value 1 represents the completed state and the value 0 represents the incomplete state. Subsequently, construct the Boolean constraint expression Fk, expressed in conjunctive normal form as: Fk=x1∧x2∧x3, and further perform satisfiability calculation by substituting the corresponding Boolean variables into the expression, obtaining: Fk=1∧0∧1=0; since the calculation result is 0, it indicates that the Boolean constraint expression is not true, that is, the dependency relationship of task Tk is not satisfied, and the scheduling instruction should be removed from the current edge-side executable window. For another task Tm, its dependency set is Dm={T4, T5}. If the corresponding completion status is T4 completed and T5 completed, then it is mapped to y1=1, y2=1, and the corresponding Boolean constraint expression is: Fm=y1∧y2=1∧1=1. When the calculation result is 1, the dependency relationship is satisfied, and the scheduling instruction is retained. In the actual calculation process, the Boolean expression of each task can be uniformly represented as: Fi=∧(j=1→n)xj; where xj represents the completion status of the j-th predecessor task, and n is the number of predecessor tasks in the dependency set; when Fi=1, the task is retained, and when Fi=0, the task is removed. Through the above calculation method based on Boolean constraint expressions, the dependency relationship can be quickly determined, thereby forming a preliminary screening sequence.
[0031] In step S330, the specific implementation process of conflict resolution for the preliminary screening sequence is as follows: First, identify scheduling instructions marked with potential conflict identifiers in the preliminary screening sequence; then, construct a timing deviation priority ranking rule, which is defined as: the smaller the timing deviation value, the higher the priority; then, for scheduling instructions with conflicts, perform delayed rearrangement processing according to the priority, specifically: move the scheduling instructions with lower priority to the end of the sequence, and maintain the order structure that satisfies the dependency relationship during the movement; after each position adjustment, re-verify the dependency relationship of the affected adjacent scheduling instructions to ensure that the adjusted sequence still satisfies the dependency constraint, thereby completing the conflict resolution.
[0032] In step S340, the specific implementation process for generating the rearranged candidate execution sequence is as follows: First, the scheduling instruction sequence after conflict resolution is traversed again to extract the dependency set and timing deviation of each scheduling instruction; then, a timing deviation threshold is constructed. The timing deviation threshold is calculated by statistically analyzing the timing deviation data of historically executed tasks, calculating their average value and standard deviation, and using the sum of the average value and standard deviation as the threshold; then, the timing deviation of the current scheduling instruction is compared with the threshold, and scheduling instructions with timing deviations exceeding the threshold are eliminated, while scheduling instructions whose dependency sets are satisfied are retained; finally, the retained scheduling instructions are rearranged according to the updated order to form the rearranged candidate execution sequence for subsequent scheduling execution.
[0033] S400, for sequence S, applies load constraints and resource occupancy predictions to each task based on the real-time status of the equipment, forms a constraint scheduling model, and calculates the execution priority P of each task.
[0034] In step S410, the specific implementation process of obtaining the real-time operating status parameters of the device corresponding to each task in the sequence is as follows: First, traverse each task in the candidate execution sequence and locate its corresponding execution device according to the task identifier; then, read the device load ratio, available resource capacity, and current execution queue length from the device's current running record, where the device load ratio is defined as the ratio of the current resource usage to the device's total resource capacity, and the available resource capacity is defined as the device's total resource capacity minus the currently allocated resource amount; then, associate the task identifier with the various status parameters of the corresponding device to form a state mapping relationship between the task and the device, providing basic data for subsequent load constraints and resource calculations.
[0035] In step S420, the specific implementation process of applying load constraints to each task based on the state mapping relationship is as follows: First, a load upper limit threshold is set. The load upper limit threshold is obtained by statistically analyzing the load ratio data of the equipment during the historical stable operation phase. Specifically, a set of load ratios without abnormal states in historical operation is selected, their average value is calculated, and the average value is multiplied by a preset safety factor to obtain the load upper limit threshold. Then, the current equipment load ratio is compared with the load upper limit threshold. When the equipment load ratio is less than or equal to the load upper limit threshold, it is determined that the task meets the load constraint condition. Next, the resource consumption required for task execution is calculated according to the process parameters corresponding to the task. The resource consumption is obtained by statistically analyzing the resource consumption data of similar tasks in history and taking their average value. Finally, a set of tasks that meet the load constraint condition is selected.
[0036] In step S430, the specific implementation process of constructing the resource consumption prediction model is as follows: First, a sliding time window is established, the length of which is obtained by statistically analyzing the historical task execution cycles and taking their average value; then, resource consumption data of historical tasks are collected within the sliding time window, including processing time and resource consumption; next, the historical data is weighted, with weights decreasing in chronological order, and data closer to the current time having higher weights; based on this, the weighted average value is calculated as the predicted resource consumption of the current task, thereby forming a resource consumption prediction model to describe the resource change trend during task execution.
[0037] In step S440, the specific implementation process of constructing the constraint scheduling model and calculating the execution priority is as follows: First, the set of tasks that meet the load constraints and the corresponding predicted resource occupancy are combined to form the input data in the constraint scheduling model; then, the execution priority calculation rules are defined, which include two indicators: resource matching degree and load adaptability degree. The resource matching degree is defined as the ratio of the difference between the available resource capacity of the device and the predicted resource occupancy of the task, and the load adaptability degree is defined as the ratio of the difference between the upper limit threshold of the load and the current load ratio of the device; then, the above two indicators are normalized and weighted and summed according to preset weights to obtain the execution priority value of each task; finally, the tasks are sorted according to the execution priority value as the basis for subsequent scheduling and execution.
[0038] S500, based on M and P, performs local scheduling and command issuance at the edge gateway, while delaying and rolling back tasks that do not meet the conditions, and updating the extended queue.
[0039] In step S510, the specific implementation process of generating a local execution sequence based on the constraint scheduling model and execution priority is as follows: First, the execution priority value of each task in the candidate execution sequence is read and sorted from high to low according to the execution priority to form a priority ordered sequence; then, the priority ordered sequence is traversed one by one, and each task is substituted into the constraint scheduling model for constraint verification. The constraint verification includes load constraint conditions and resource occupation prediction conditions; when a task satisfies both load constraint conditions and resource occupation prediction conditions, the task is added to the local execution sequence; when a task does not satisfy either constraint condition, it is not added to the local execution sequence for the time being, thereby obtaining a local execution sequence that satisfies the scheduling conditions.
[0040] In step S520, the specific implementation process of issuing execution instructions for the local execution sequence is as follows: First, according to the task order in the local execution sequence, corresponding scheduling instructions are generated one by one. The scheduling instructions include task identifier, execution start time, and target device identifier. Then, according to the task-device state mapping relationship established in step S410, the scheduling instructions are sent to the corresponding devices. During the instruction sending process, the issuance time of each scheduling instruction is recorded, and execution feedback information is collected after the device completes execution. The execution feedback information includes task completion flag and actual execution time, thereby forming a complete execution record.
[0041] In step S530, the specific implementation process for delaying and rolling back tasks that have not entered the local execution sequence is as follows: First, identify the tasks in the candidate execution sequence that have not been selected into the local execution sequence and analyze the specific types of conditions that have not been met; when a task fails to meet the conditions because the predicted resource usage value is greater than the available resource capacity of the device, the task is marked as a delayed task, and its logical timestamp is increased by a preset delay step, which is obtained by statistically analyzing the average interval time of historical scheduling cycles; when a task fails to meet the conditions because the dependency relationship is not met, the task is marked as a rolled-back task, and according to the position of the predecessor task in its dependency set, the task is re-inserted into the extended queue after the corresponding predecessor task, thereby ensuring the correctness of the dependency order.
[0042] In step S540, the specific implementation process of updating the extended queue is as follows: First, the execution feedback information obtained in step S520 is written into the corresponding task record to update the task completion status; then, the tasks marked as delayed and rollback in step S530 are rewritten into the extended queue and sorted according to their updated logical timestamps and positional relationships; then, the timing deviation of each task is recalculated in the updated extended queue, which is obtained by comparing the difference between the current time of the task and the logical timestamp, and the dependency check is re-executed to update the potential conflict identifier; finally, the updated extended queue is formed to provide input data for the next round of scheduling.
[0043] S600 will perform feedback and write back the updated extended queue to correct τ and Δτ, iteratively update W and M, and output a stable production scheduling result.
[0044] In step S610, the specific implementation process of fusing the execution feedback information with the updated extended queue is as follows: First, the actual execution time and completion status of each task in the execution feedback information are read one by one and matched with the corresponding tasks in the updated extended queue; then, the logical timestamp of each task is corrected, specifically: based on the original logical timestamp, the difference between the actual execution time and the logical timestamp is used as the correction amount, and the logical timestamp is added or subtracted for adjustment; then, the timing deviation is recalculated based on the corrected logical timestamp, and the timing deviation is defined as the difference between the current time and the corrected logical timestamp; through the above process, the dynamic correction of the time parameters is realized, making the scheduling data closer to the actual execution situation.
[0045] In step S620, the specific implementation process of updating the edge-side executable window based on the corrected logical timestamp and timing deviation is as follows: First, the timing deviation threshold is recalculated. The timing deviation threshold is obtained by statistically analyzing the timing deviation data of all tasks in the most recent scheduling cycles. Specifically, the average value and standard deviation of the data set are calculated, and the sum of the average value and standard deviation is used as the new timing deviation threshold. Then, a set of tasks with timing deviations less than or equal to the timing deviation threshold is selected from the updated extended queue. Next, the number of tasks in the set is counted, and the number is used as the window length to truncate the extended queue, thereby dynamically adjusting the range of the edge-side executable window so that the window always covers the stable task interval.
[0046] In step S630, the specific implementation process of iteratively correcting the constraint scheduling model is as follows: First, based on the updated extended queue and edge-side executable window, the device resource occupancy data and device load ratio data corresponding to each task are collected again; then, the resource occupancy prediction model is updated, specifically by adding the resource consumption data in the latest round of execution feedback to the sliding time window and removing the earliest data to keep the window length unchanged, and then recalculating the weighted average to update the resource occupancy prediction results; at the same time, the load constraint parameters are corrected, specifically by re-statistically collecting the load ratio data of the device under stable operating conditions and updating the load upper limit threshold; through the above process, the dynamic iterative update of the constraint scheduling model is realized.
[0047] In step S640, the specific implementation process of outputting a stable production scheduling result is as follows: First, based on the updated edge-side executable window and constraint scheduling model, the execution priority of all current candidate tasks is recalculated; then, the tasks are sorted from high to low according to their execution priority, and the dependency set and resource constraints are verified in turn to select the task set that meets all constraints; then, the task set is sorted according to the sorting result to form a final scheduling sequence, and the corresponding execution time and equipment allocation relationship are recorded; finally, the final scheduling sequence is output as a stable production scheduling result to guide the next stage of production execution.
[0048] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A production scheduling and control method based on an industrial edge gateway, characterized in that: include: S100 collects real-time status data and process dependencies of each production equipment, constructs task sequences and their sequential constraints, generates an initial scheduling queue, and marks each task with a logical timestamp τ and a dependency set D. S200 unifies the access of scheduling commands from the cloud and local area at the industrial edge gateway, establishes an out-of-order detection queue based on τ and D, calculates the timing deviation Δτ for incoming commands and marks potential conflict identifier C to obtain an extended queue; S300: Based on Δτ and C in the extended queue, construct an executable window W on the edge side, and perform dependency verification and conflict resolution on the tasks within the window to generate a rearranged candidate execution sequence S, in which only tasks that satisfy D and whose Δτ is within the threshold are retained. S400, for sequence S, applies load constraints and resource consumption prediction to each task in combination with the real-time status of the device, forms a constraint scheduling model, and calculates the execution priority P of each task; S500, based on M and P, performs local scheduling and command issuance at the edge gateway, while delaying and rolling back tasks that do not meet the conditions, and updating the extended queue; S600 will perform feedback and write back the updated extended queue to correct τ and Δτ, iteratively update W and M, and output a stable production scheduling result.
2. The production scheduling and control method based on an industrial edge gateway according to claim 1, characterized in that: S100 specifically includes the following steps: S110 collects data from each production device based on the industrial edge gateway, obtains the device operating status parameters and corresponding process identification information, and performs time synchronization calibration to form a unified time reference. S120: Based on the process identification information, the process dependency relationship between each production task is parsed, a task dependency graph is constructed, and the dependency paths are topologically sorted to generate an ordered task sequence. S130, assign a logical timestamp to each task in the ordered task sequence based on the unified time base, and generate a corresponding dependency set according to the task dependency graph; S140, map the logical timestamp and dependency set to the ordered task sequence to form an initial scheduling queue.
3. The production scheduling and control method based on an industrial edge gateway according to claim 1, characterized in that: S200 specifically includes the following steps: S210, the scheduling instructions from the cloud and local machine are cached in order of arrival time, and the task identifier corresponding to each scheduling instruction is extracted. Based on the task identifier, the logical timestamp and dependency set in the initial scheduling queue are matched to form a set of instructions with constraint information. S220, the instruction set is compared sequentially according to the logical timestamp, the difference between the actual arrival time of each scheduling instruction and its logical timestamp is calculated, the difference is defined as the timing deviation, and the scheduling instructions are classified according to a preset deviation threshold to form an out-of-order detection queue. S230, in the out-of-order detection queue, the predecessor task of each scheduling instruction is checked according to the dependency set. When there is a scheduling instruction that does not satisfy the dependency relationship, the corresponding potential conflict identifier is marked. S240, the timing deviation and potential conflict identifiers are written into the corresponding scheduling instruction and rearranged according to the updated order to obtain the extended queue.
4. The production scheduling and control method based on an industrial edge gateway according to claim 1, characterized in that: S300 specifically includes the following steps: S310, based on the timing deviation and potential conflict identifier of each scheduling instruction in the extended queue, sort them in order of timing deviation from smallest to largest, and select scheduling instructions that continuously meet the preset window length condition to construct an edge-side executable window. The window length is obtained by statistically analyzing the number of historically stable executed tasks and taking their average value. S320, within the executable window on the edge side, read the dependency set of the scheduling instructions one by one, perform a predecessor task completion status check on each task, and eliminate scheduling instructions whose dependency relationship is not satisfied to obtain a preliminary screening sequence. S330, perform conflict resolution processing on the scheduling instructions marked with potential conflict identifiers in the preliminary screening sequence, specifically by delaying and rearranging conflicting tasks based on timing deviation priority, and updating their positional relationship in the sequence; S340, rearranges the scheduling instructions after dependency verification and conflict resolution in the updated order, retaining only tasks whose dependency sets are satisfied and whose timing deviations are within the preset threshold range, and generates a rearranged candidate execution sequence.
5. The production scheduling and control method based on an industrial edge gateway according to claim 4, characterized in that: S320 specifically includes the following steps: S321, read the dependency set of each scheduling instruction in the executable window on the edge side one by one, and map the completion status of the predecessor task in the dependency set to a Boolean variable, where the completion status is recorded as a true value and the incomplete status is recorded as a false value; S322, construct the corresponding Boolean constraint expression based on the dependency set. The Boolean constraint expression adopts conjunctive normal form and connects the Boolean variables of all predecessor tasks through logical AND operation to form task dependency determination conditions. S323, perform satisfiability evaluation on the Boolean constraint expression, and perform logical operations by substituting the actual completion state of the current predecessor task one by one. When the operation result is true, it is determined that the dependency is satisfied; when the operation result is false, it is determined that the dependency is not satisfied. S324, Based on the satisfiability solution result, retain the scheduling instructions that satisfy the dependency relationship and remove the scheduling instructions that do not satisfy the dependency relationship, thereby forming a preliminary screening sequence.
6. The production scheduling and control method based on an industrial edge gateway according to claim 1, characterized in that: The S400 specifically includes the following steps: S410: Obtain the real-time operating status parameters of the device corresponding to each task in the sequence, and extract the device load ratio, available resource capacity and current execution queue length to construct the status mapping relationship between tasks and devices; S420, Apply load constraints to each task based on the state mapping relationship, compare the device load ratio with the preset load limit, filter the set of tasks that meet the load constraint conditions, and calculate the resource consumption required for task execution; S430, Based on the resource consumption required for the task execution and the current available resource capacity of the device, a resource consumption prediction model is constructed. The resource consumption prediction model uses a sliding time window to statistically analyze historical task resource consumption data and uses a weighted average method to predict the resource consumption trend of the current task. S440, Based on the load constraint results and resource occupancy prediction results, a constraint scheduling model is constructed, and the execution priority is calculated according to the resource matching degree and load adaptability degree of the task to obtain the execution priority of each task.
7. The production scheduling and control method based on an industrial edge gateway according to claim 1, characterized in that: The S500 specifically includes the following steps: S510, based on the constraint scheduling model and execution priority, sorts the tasks in the candidate execution sequence from high to low execution priority, and selects the tasks that meet the load constraints and resource consumption prediction conditions to generate a local execution sequence; S520, generate scheduling instructions one by one according to the order of the local execution sequence, issue instructions according to the state mapping relationship of the device corresponding to the task, and record the instruction issuance time and execution feedback information at the same time. S530, for tasks that have not entered the local execution sequence, delay and rollback processing is performed according to the type of condition they do not meet. When a task does not meet the condition due to insufficient resource usage, it is delayed to the next scheduling cycle. When a task does not meet the condition due to unmet dependency, it is rolled back to the corresponding dependency position in the extended queue. S540 updates the task order in the extended queue based on the feedback information of the executed tasks and the results of delay and rollback processing, and recalculates the timing deviation and potential conflict indicators of the relevant tasks, thereby forming an updated extended queue.
8. The production scheduling and control method based on an industrial edge gateway according to claim 1, characterized in that: The S600 specifically includes the following steps: S610 integrates the execution feedback information with the updated extended queue, corrects the logical timestamp of the corresponding task based on the actual execution time and completion status of the task in the execution feedback, and recalculates the timing deviation. S620 updates the executable window on the edge side based on the corrected logical timestamp and timing deviation, recounts the number of tasks that meet the timing deviation threshold, and dynamically adjusts the window range. S630, based on the updated extended queue and edge-side executable window, iteratively corrects the constraint scheduling model, the iterative correction including updating resource occupancy prediction data and load constraint parameters; S640, based on the iteratively updated edge-side executable window and constraint scheduling model, outputs the final scheduling sequence that satisfies the dependency relationship and resource constraints, thereby obtaining a stable production scheduling result.