Cooperative Scheduling Methods for Motion Control and Logic Control in Industrial Real-Time Control Systems
By using a non-cooperative game theory model and deep reinforcement learning algorithms, resource allocation in industrial real-time control systems is dynamically adjusted, solving the problems of priority inversion and resource deadlock in traditional scheduling methods. This achieves efficient task collaborative scheduling and improves system stability and resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG DEYUAN INTELLIGENT MFG TECH CO LTD
- Filing Date
- 2026-05-14
- Publication Date
- 2026-06-30
Smart Images

Figure CN122308309A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial automation control, specifically relating to a method for coordinated scheduling of motion control and logic control in industrial real-time control systems. Background Technology
[0002] With the rapid development of industrial automation and intelligent manufacturing technologies, real-time control systems are increasingly widely used in precision machining, robot collaboration, and flexible production lines, becoming the core foundation for ensuring high-precision operation and complex task coordination of industrial equipment. In modern industrial scenarios, control systems not only need to maintain high-frequency, deterministic execution of motion trajectory commands, but also need to respond in real time to various sudden logical tasks from sensors and host computers. This diversity of task attributes requires the system to have extremely high resource scheduling capabilities, efficiently coordinating computing resources to meet the stringent real-time and reliability requirements of different tasks.
[0003] Coordinated scheduling of motion control and logic control is a key technological direction for improving the overall performance of control systems. Motion control tasks are typically periodic, hard real-time tasks, while logic control tasks are mostly aperiodic, event-driven tasks. Given limited processor resources, how to construct a scientific scheduling mechanism to balance the resource competition between these two tasks directly affects not only the synchronization accuracy and control cycle of the motion axes, but also the response speed and system stability of the entire control chain under complex operating conditions.
[0004] Traditional scheduling methods are mostly based on static rules with fixed priorities or preset time slices. When faced with a sudden surge in logical interruptions, they struggle to flexibly adjust the allocation of computing resources, easily leading to priority inversion phenomena such as low-priority tasks blocking high-priority instructions, and even severe system resource deadlocks. Furthermore, existing technologies lack real-time perception and forward-looking prediction of system load, failing to effectively suppress computational jitter caused by multi-task concurrency, resulting in decreased determinism in the control cycle. In addition, traditional scheduling models are often limited by linear logical analysis, making it difficult to handle complex dynamic game relationships between tasks, leading to inefficient resource allocation and an inability to achieve global optimization. Summary of the Invention
[0005] The purpose of this invention is to provide a method for coordinated scheduling of motion control and logic control in industrial real-time control systems, which can solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the technical solution adopted by this invention is: a method for coordinated scheduling of motion control and logic control in an industrial real-time control system, comprising the following specific steps: Step 1: Real-time acquisition of the operating status parameters of the industrial control system, including the resource usage of the central processing unit, the network communication congestion status, and the urgency characteristics of various tasks in the task queue. Step 2: Based on the obtained running state parameters, construct a non-cooperative game model between the motion control task and the logic control task, define the game participants as the motion control execution unit and the logic control execution unit, and establish the corresponding payoff function; Step 3: Configure a deep reinforcement learning intelligent scheduling agent, take the running state parameters as input, extract features through a deep neural network, and predict the system gain under different scheduling decisions; Step 4: Based on the output of the deep reinforcement learning intelligent scheduling agent, dynamically adjust the time slice weight ratio and execution priority order of the motion control task and the logic control task so that the system state tends to Nash equilibrium. Step 5: Execute scheduling instructions and monitor the stability of the control cycle. Based on the execution feedback, correct the internal parameters of the deep reinforcement learning intelligent scheduling agent in real time to complete closed-loop scheduling control.
[0007] Preferably, in step 1, obtaining the resource usage of the central processing unit includes: real-time collection of the load percentage of each core of the multi-core processor within a preset statistical period through the system kernel monitoring module. The load percentage is obtained by calculating the ratio of the processor's active execution time to the total clock cycle time. Simultaneously, step 1 also includes real-time monitoring of the central processing unit's cache hit rate and bus bandwidth utilization to identify potential processing bottlenecks caused by resource contention.
[0008] Preferably, in step 1, obtaining the network communication congestion status specifically includes: real-time statistics of the data frame drop rate, data packet round-trip delay, and network jitter value in the industrial Ethernet fieldbus. The data packet round-trip delay is obtained by embedding a high-precision timestamp in the data packet and calculating the difference between the sending time and the acknowledgment time. When the data frame drop rate exceeds a preset threshold, the system automatically increases the urgency characteristic of the communication task.
[0009] Preferably, in step 1, obtaining the urgency characteristics of various tasks in the task queue includes: for motion control tasks, calculating their time sensitivity weight based on the deviation between the current axis position and the target trajectory; For logic control tasks, the task is divided into multiple urgency levels based on the level of the event triggering source and the preset response time limit. The urgency features are encoded into multi-dimensional feature vectors, which serve as inputs to subsequent game theory models and deep reinforcement learning networks.
[0010] Preferably, in step 2, the process of constructing a non-cooperative game model includes: defining the motion control task as the first party in the game, whose strategy space is to strive for a longer fixed execution time slice to ensure control accuracy; The logic control task is defined as the second party in a game, whose strategy space involves requesting a higher interrupt priority to ensure real-time event response. The payoff function is designed as the sum of the gain value of system stability and the loss value caused by task latency.
[0011] Preferably, in step 2, the established revenue function for the motion control execution unit is proportional to the determinism of the control cycle; that is, the smaller the jitter value of the control cycle, the higher the corresponding revenue value. For the logic control execution unit, its value is inversely proportional to the task response latency; that is, the shorter the time from event triggering to task completion, the higher the corresponding payoff value. The goal of the game is to find a set of scheduling parameters such that neither party can obtain a higher total payoff by unilaterally changing its own strategy without changing the other party's strategy, thus reaching a Nash equilibrium.
[0012] Preferably, in step 3, the deep reinforcement learning intelligent scheduling agent adopts an architecture combining a deep target network and an evaluation network. The deep neural network includes an input layer, multiple hidden layers, and an output layer. The input layer receives a normalized vector of running state parameters. The hidden layers employ a fully connected layer structure and apply a non-linear activation function for feature mapping. This non-linear activation function determines the activation state of neurons based on the positive or negative characteristics of the input values.
[0013] Preferably, in step 3, predicting the system gain under different scheduling decisions includes: extracting data pairs of historical states, actions, rewards, and the next state from a preset historical storage space through an experience replay mechanism. The reward function is defined as a weighted combination of the negative value of motion control precision deviation and the negative value of logic control response time. When the system exhibits priority inversion or resource deadlock tendency, the reward function outputs a very large negative value as a penalty, guiding the intelligent scheduling agent to avoid such decisions.
[0014] Preferably, in step 4, dynamically adjusting the time slice weight ratio specifically includes: selecting the action with the highest probability value as the scheduling strategy for the current period based on the probability distribution output by the intelligent scheduling agent. This strategy is implemented by modifying the scheduling algorithm parameters of the real-time operating system. Preferably, the dynamic adjustment also includes dynamically expanding or shrinking the exclusive time window of the motion control task based on the current total system load. When the system load is low, more idle time slices are reserved for the logic control task. When the system load approaches the preset limit, priority is given to ensuring the hard real-time execution of motion control tasks.
[0015] Preferably, in step 4, the operation of dynamically adjusting the execution priority order includes: using a multi-level feedback queue scheduling mechanism to temporarily elevate logic control tasks with high urgency to the same priority as motion control tasks. To prevent low-priority tasks from being unable to obtain processor resources for extended periods, the method also includes an automatic priority elevation mechanism based on task dwell time; that is, when the waiting time of a logic control task in the queue exceeds a predetermined threshold, its priority is forcibly elevated until it completes execution.
[0016] Preferably, in step 5, monitoring the stability of the control cycle includes: recording the start and end times of each motion control cycle using a high-precision hardware timer, and calculating the absolute difference between the actual cycle length and the preset theoretical cycle length. This absolute difference is defined as control jitter. When the control jitter exceeds a preset allowable range for multiple consecutive cycles, the system triggers a safety warning and switches the scheduling mode to a preset static priority protection mode to ensure the safe operation of the core motion axis.
[0017] Preferably, in step 5, the real-time correction of the internal parameters of the intelligent scheduling agent includes minimizing the deviation between the predicted reward and the actual observed reward using gradient descent. The internal parameters include the weight values and bias terms of each neuron connection in the neural network. Through continuous iterative updates, the intelligent scheduling agent can adapt to different industrial operating conditions, including equipment start-up and shutdown, sudden load changes, and network environment fluctuations.
[0018] Preferably, the motion control and logic control collaborative scheduling method in the industrial real-time control system further includes a global deadlock detection step. This deadlock detection step analyzes the resource request relationship graph between tasks in real time. When a loop waiting is detected, the scheduling management module forcibly releases the logic control task with the longest resource occupation time and reallocates computing resources, thus avoiding system crashes caused by resource contention at the physical level.
[0019] Preferably, the method further includes a preprocessing step for the sensor data, wherein the preprocessing includes using a median filtering algorithm to remove impulse noise from the sensor-acquired data. The median filtering algorithm sorts the sampled values within a sliding window of a preset length and selects the value at the middle position as the filtering result. The processed sensor data, used as input for the logic control task, can reduce the scheduling overhead caused by invalid logic triggers.
[0020] Preferably, the motion control and logic control collaborative scheduling method in the industrial real-time control system is applied to the field of multi-axis collaborative robot control. By collaboratively scheduling the drive control tasks of each axis with the robot's obstacle avoidance logic tasks, high-precision trajectory tracking of the robot in complex dynamic environments is achieved. Each motion axis of the multi-axis collaborative robot is equipped with an absolute encoder to feed back real-time position status parameters to the system.
[0021] Preferably, the method further integrates a system load prediction module based on Long Short-Term Memory (LSTM) networks. This load prediction module analyzes the temporal characteristics of historical load data to predict peak task concurrency within a predetermined time period. The intelligent scheduling agent adjusts the resource reservation scheme in advance based on the prediction results, achieving proactive resource scheduling and further reducing the negative impact of multi-task concurrency on the motion control cycle.
[0022] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention, by introducing a non-cooperative game theory model and a deep reinforcement learning algorithm, breaks the rigid constraint of fixed priorities in traditional scheduling, and achieves dynamic optimization of resource allocation for motion control and logic control tasks. This mechanism can adjust the scheduling strategy in real time according to the system's operating status, improving the response speed of logic control tasks while ensuring the hard real-time performance of motion control, and solving the problems of priority inversion and resource deadlock under complex operating conditions.
[0023] 2. This invention utilizes the predictive capabilities of artificial intelligence to perceive system load and task urgency, achieving refined management of the control cycle. By dynamically adjusting time slice weights and priority sequences, this invention significantly reduces computational jitter caused by multi-task concurrency, improving the determinism and stability of the industrial control system. When faced with a sudden surge of logical interruptions, the system exhibits strong adaptive capabilities, ensuring the reliability of overall operation.
[0024] 3. The closed-loop scheduling mechanism constructed in this invention combines real-time monitoring and parameter correction, enabling the scheduling agent to continuously learn and adapt to changing industrial environments. By combining system gain maximization with Nash equilibrium, this invention achieves optimal resource utilization under limited computing resources, providing solid technical support for applications with stringent real-time requirements, such as precision machining and intelligent collaborative robots. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of the overall technical solution architecture of the present invention; Figure 2 This is a schematic diagram of the data flow in the motion control and logic control collaborative scheduling method of the industrial real-time control system in this invention; Figure 3This is a schematic diagram of the core principle framework of collaborative scheduling based on a non-cooperative game model and a deep reinforcement learning intelligent scheduling agent in this invention. Figure 4 This is a flowchart illustrating the logical flow of dynamically adjusting the time slice weight ratio and execution priority order in this invention. Figure 5 This is a schematic diagram illustrating the principle of closed-loop correction and stability monitoring of intelligent scheduling agent parameters based on execution feedback in this invention. Detailed Implementation
[0026] Example 1: Please refer to the appendix Figure 1 To be continued Figure 5 To make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to specific embodiments.
[0027] In the fields of industrial automation and precision manufacturing, real-time control systems have stringent requirements for the determinism and response speed of task scheduling. This invention proposes a collaborative scheduling method for motion control and logic control in industrial real-time control systems. By integrating non-cooperative game theory and deep reinforcement learning mechanisms, it achieves dynamic and optimal allocation of computing resources among tasks of different natures. Specifically, the collaborative scheduling method for motion control and logic control in industrial real-time control systems includes the following steps: In step 1, the system acquires the operating status parameters of the industrial control system in real time. These operating status parameters serve as the basic data source for scheduling decisions and encompass hardware resource utilization, communication link status, and the attribute characteristics of the task itself.
[0028] Specifically, obtaining the CPU's resource usage is a core step in assessing the system's computational load. This embodiment uses a system kernel monitoring module to collect the load percentage of each computing core in the multi-core processor within a preset statistical period in real time. The calculation of the load percentage does not use algebraic notation but is described as follows: divide the processor's active execution time by the total clock cycle time; the resulting ratio is the load percentage of that core. To ensure data accuracy, the kernel monitoring module directly reads the processor's task switching logs and the residence time of idle processes, obtaining the true active duration through difference calculations. Furthermore, step 1 also includes real-time monitoring of the CPU's cache hit rate and bus bandwidth utilization. The cache hit rate is obtained by dividing the difference between the total number of cache access requests and the number of cache misses by the total number of access requests; this parameter reflects whether the current task switching has caused frequent memory swapping. The bus bandwidth utilization is obtained by comparing the total amount of data transmitted on the bus per unit time with the bus's theoretical maximum transmission capacity, used to identify potential processing bottlenecks caused by resource contention.
[0029] In step 1, obtaining the network communication congestion status is crucial for the real-time bus system. This embodiment uses real-time statistics to measure the data frame drop rate, packet round-trip delay, and network jitter in the industrial Ethernet fieldbus. The packet round-trip delay is obtained as follows: a high-precision timestamp with nanosecond-level accuracy is embedded in the data packet to be sent. After the receiver confirms the data packet, the current time is recorded, and the difference between the current time and the embedded timestamp is calculated. The network jitter value is defined as the absolute value of the standard deviation or bias between the round-trip delays of multiple consecutive data packets. When the data frame drop rate exceeds a preset packet loss threshold, the system determines that there is congestion or electromagnetic interference in the current network environment and automatically increases the urgency of communication-related tasks to ensure that critical control messages can pass through the network protocol stack with priority.
[0030] In step 1, the urgency features of various tasks in the task queue are obtained. For motion control tasks, the system calculates their time sensitivity weight based on the deviation between the current axis position and the target trajectory. Specifically, the encoder feedback position of the current axis is subtracted from the ideal position generated by the preset trajectory generation algorithm. The larger the absolute difference, the higher the lag of the motion control task, and its time sensitivity weight increases linearly. For logic control tasks, the system classifies tasks into multiple different urgency levels based on the level of the event trigger source and the preset response time limit requirements, such as emergency alarm level, routine monitoring level, and background log level. The urgency features are encoded into multi-dimensional feature vectors, which consist of position deviation components, response time limit components, and task priority components, and serve as inputs to subsequent game theory models and deep reinforcement learning networks.
[0031] Step 1 also includes a preprocessing step for the sensor data. This preprocessing employs a median filtering algorithm to remove impulse noise from the sensor data. The median filtering algorithm operates as follows: within a sliding window of a preset length (e.g., selecting a length of 5 or 7 sampling points), the sampled values within the window are sorted in ascending order, and the value at the middle position is selected as the final filtering result for that window. This method effectively filters out sampling glitches caused by inverter interference or other high-frequency noise. The processed sensor data, used as input for logic control tasks, effectively reduces invalid logic triggers caused by erroneous logic judgments, thus lowering unnecessary scheduling overhead in the system.
[0032] In step 2, based on the acquired operating state parameters, a non-cooperative game model between the motion control task and the logic control task is constructed. In this step, the game participants are defined as the motion control execution unit and the logic control execution unit, and corresponding payoff functions are established.
[0033] The process of constructing a non-cooperative game model is described in detail as follows: the motion control task is defined as the first party in the game, and its strategy space is defined as striving for longer, continuous and fixed execution time slices, in order to ensure the determinism of the control cycle and the control accuracy. The logic control task is defined as the second party in a game, with its policy space defined as the opportunity to request higher interrupt priority and random access to CPU resources, aiming to ensure real-time response to sudden logical events. The two parties engage in a non-cooperative game under resource constraints, where each party's decision affects the other's resource allocation.
[0034] In step 2, the established payoff function is the core evaluation metric of the game theory model. For the motion control execution unit, the value of its payoff function is directly proportional to the determinism of the control cycle. By calculating the deviation between the actual execution cycle and the ideal execution cycle, the reciprocal or negative correlation function of this deviation is the payoff component. The smaller the jitter value of the control cycle, that is, the closer the actual cycle is to the theoretical value, the higher the corresponding payoff value. For the logic control execution unit, the value of its payoff function is inversely proportional to the task response delay. The shorter the time span from the triggering time of the logic event to the completion time of the logic task, the higher the payoff value obtained by the logic control execution unit.
[0035] The payoff function is further designed as the sum of the gain from system stability and the loss from task latency. The goal of the game is to find a set of optimal scheduling parameters through iterative search. In this state, neither party can gain a higher total payoff by unilaterally changing its own resource allocation strategy (such as requesting more time slices or higher priority) without changing the other party's strategy.
[0036] In step 3, a deep reinforcement learning intelligent scheduling agent is configured. This agent acts as the intelligent brain of the system, mapping complex operational state parameters to optimal scheduling decisions.
[0037] The deep reinforcement learning intelligent scheduling agent employs an architecture combining a deep target network and an evaluation network to improve the stability of the learning process. The deep neural network specifically includes an input layer, multiple hidden layers, and an output layer. The input layer receives a normalized vector of running state parameters; the normalization process maps various parameters (such as CPU utilization, network latency, etc.) to a numerical range between 0 and 1. The hidden layers use a fully connected layer structure, with neurons interconnected between layers, each connection assigned a specific weight value. In the hidden layers, a non-linear activation function is applied for feature mapping. This non-linear activation function determines the activation state of neurons based on the positive or negative characteristic of the input value; for example, when the input value is greater than 0, the output equals the input, and when the input value is less than or equal to 0, the output is 0. This structure enables the network to capture the characteristics of complex non-linear systems.
[0038] In step 3, the system gain under different scheduling decisions is predicted. This process includes extracting data pairs of historical states, actions, rewards, and the next state from a pre-set historical storage space through an experience replay mechanism. The deep neural network, by learning from this historical data, can predict the system gain that may be obtained after taking a specific scheduling action (such as adjusting the time slice ratio) in the current state. The reward function is defined as a weighted combination of the negative value of motion control precision deviation and the negative value of logic control response time. Specifically, if a scheduling decision leads to an increase in the deviation of the motion trajectory or a slowdown in the logic response, the reward function will output a small value. In particular, when the system experiences priority inversion (i.e., a low-priority task blocking a high-priority task for a long time) or resource deadlock tendency, the reward function is given a very large negative value as a penalty, forcibly guiding the intelligent scheduling agent to avoid such high-risk decisions.
[0039] This invention also integrates a system load prediction module based on a Long Short-Term Memory (LSTM) network. This load prediction module analyzes the temporal characteristics of historical load data to identify periodic load fluctuations in industrial production processes. For example, in the work cycle of a collaborative robot, a large amount of visual processing logic may occur concurrently during certain time periods. The LSM network can predict the peak concurrency of tasks within a predetermined future time period. Based on this prediction, the intelligent scheduling agent reserves a buffer in advance in the resource allocation scheme, achieving proactive resource scheduling and further reducing the negative impact of multi-task concurrency on the motion control cycle.
[0040] In step 4, the time slice weight ratio and execution priority order of motion control tasks and logic control tasks are dynamically adjusted based on the output of the deep reinforcement learning intelligent scheduling agent.
[0041] The specific operation of dynamically adjusting the time slice weight ratio is as follows: Based on the action probability distribution output by the intelligent scheduling agent, the scheduling action with the highest probability value is selected as the strategy for the current cycle. This strategy is implemented by directly modifying the scheduler parameters of the real-time operating system. The dynamic adjustment also includes dynamically expanding or shrinking the exclusive time window of motion control tasks based on the current total system load. When the system load is low, the scheduling agent automatically reduces the redundant waiting time of motion control tasks, allocating more idle time slices to logic control tasks to improve the overall system throughput. When the system load approaches a preset upper limit (e.g., total processor utilization exceeds 90%), the scheduling agent will enforce a hard real-time priority strategy, prioritizing the protection of the exclusive time window of motion control tasks from encroachment, ensuring the safe operation of core motion axes.
[0042] In step 4, the dynamic adjustment of execution priority order includes utilizing a multi-level feedback queue scheduling mechanism. Under this mechanism, the system maintains multiple ready queues with different priority gradients. For logic control tasks with high urgency (such as safety obstacle avoidance signals and emergency stop logic), the scheduling agent temporarily elevates them to the highest priority, equivalent to motion control tasks, ensuring they receive processor resources at the next clock tick. To prevent low-priority tasks (such as non-critical status monitoring logs) from starving due to prolonged lack of processor resources, the method also includes an automatic priority promotion mechanism based on task dwell time. Specifically, when the waiting time of a logic control task in the ready queue exceeds a predetermined time threshold, the system forcibly elevates its priority level until it receives processor resources and completes execution. This mechanism ensures the fairness and robustness of the system under extreme operating conditions.
[0043] In step 5, scheduling instructions are executed and the stability of the control cycle is monitored. Based on the execution feedback, the internal parameters of the deep reinforcement learning intelligent scheduling agent are corrected in real time to complete the closed-loop scheduling control.
[0044] The stability of the monitoring and control cycle is achieved through a high-precision hardware timer. The system records the start and end times of each motion control cycle and calculates the actual cycle length. The actual cycle length is subtracted from the preset theoretical cycle length, and the absolute difference is defined as control jitter. When the control jitter exceeds a preset tolerance range (e.g., exceeding 5% of the theoretical cycle) for multiple consecutive cycles (e.g., 5 or 10 consecutive cycles), the system immediately triggers a safety warning. At this time, the system switches the scheduling mode from the dynamic deep reinforcement learning mode to the preset static priority protection mode. In the static priority mode, the motion control task has absolute execution preemption rights to ensure the safe operation of the core motion axis in the event of severe environmental fluctuations or algorithm malfunctions.
[0045] In step 5, the internal parameters of the intelligent scheduling agent are corrected in real time. This process employs gradient descent to minimize the deviation between the predicted reward and the actual observed reward. Specifically, after each scheduling cycle ends and actual performance feedback is obtained, the system calculates the loss function, which is the square of the difference between the predicted reward and the actual reward. By calculating the gradient of the loss function with respect to the parameters of the neural network, the weights and biases of each neuron in the neural network are updated in the opposite direction of the gradient. This online learning mechanism enables the intelligent scheduling agent to continuously adapt to changing industrial conditions over time, including but not limited to the start-up and shutdown of process equipment, sudden changes in mechanical load, and fluctuations in the industrial network environment.
[0046] The motion control and logic control collaborative scheduling method in the industrial real-time control system also includes a global deadlock detection step. This deadlock detection step identifies potential risks by analyzing the resource request relationship graph between tasks in real time. Specifically, a directed graph is constructed where nodes represent tasks or system resources (such as mutexes, memory blocks, and peripheral interfaces), and edges represent the resource occupancy or request relationships between tasks. The scheduling management module continuously monitors this graph for closed loops. When a loop is detected, a deadlock tendency is determined. At this point, the scheduling management module intervenes, forcibly releasing the logic control task with the longest resource occupancy time and relatively low priority, reclaiming its occupied resources, and reallocating them to the high-priority motion control task that is currently blocked. This intervention mechanism physically avoids system crashes caused by resource contention.
[0047] As a specific application scenario, the collaborative scheduling method described in this invention is applied to the field of multi-axis collaborative robot control. In this application, the robot not only needs to perform high-precision path tracking, but also needs to process obstacle avoidance logic tasks from LiDAR or depth cameras in real time. By collaboratively scheduling the drive control tasks of each motion axis with the robot's obstacle avoidance logic tasks, the system can achieve high-precision trajectory tracking in complex dynamic environments. Each motion axis of the multi-axis collaborative robot is equipped with an absolute encoder, which feeds back real-time position status parameters to the scheduling system with microsecond-level synchronization accuracy, providing accurate reward evaluation basis for the game model.
[0048] Example 2: Based on Example 1, this example further refines the engineering implementation details of feature extraction and decision generation in deep reinforcement learning networks.
[0049] In step 1, obtaining the CPU resource usage also includes monitoring the context switching frequency. The context switching frequency is defined as the number of times the operating system kernel switches between processes or threads per unit of time. When this frequency exceeds a preset alarm threshold, it means that the system has incurred excessive scheduling overhead. The deep reinforcement learning agent will use this as a negative feedback signal and reduce unnecessary switching by increasing the continuous execution time slice length of the motion control task.
[0050] In step 3, for the deep neural network structure, the number of hidden layers is set to no less than 3, and the number of neurons in each layer is dynamically configured according to the total number of tasks to be processed. For example, when the number of concurrent tasks in the system increases, the network enhances its feature representation ability by activating more spare neuron nodes. The nonlinear activation function is implemented using a piecewise linear approach: when the input variable is greater than 0, the output is equal to the input variable multiplied by a scaling factor of 1. When the input variable is less than or equal to 0, the output is always 0. This method reduces the computational burden on the embedded processor while ensuring nonlinear mapping capability.
[0051] In step 3, the experience replay mechanism employs a priority sampling strategy. Unlike randomly extracting historical data, this embodiment allocates sampling weights based on the magnitude of the reward bias in the historical data. Reward bias refers to the absolute value of the difference between the actual observed reward and the network's predicted return. The larger the absolute value of the difference, the more learning value the historical experience contains (i.e., the network's understanding of the state is insufficient), and therefore it is assigned a higher sampling probability. In this way, the intelligent scheduling agent can converge to the optimal strategy more quickly.
[0052] In step 4, the process of dynamically adjusting the time slice weight ratio involves the micro-management of the real-time operating system clock tick. The system alters the execution window duration allocated to specific tasks by modifying the interrupt load value of the hardware timer. For example, during motion control task execution, the system temporarily masks non-urgent logical interrupts, forming a protected execution time window. Once the motion control command is issued, the system immediately unlocks the interrupt mask, allowing the logical control task to perform concurrent processing within the remaining statistical period.
[0053] In step 4, the automatic promotion mechanism for the multi-level feedback queue is set based on the task's deadline requirements. For example, for a logical task requiring a response within 10 milliseconds, the priority promotion trigger threshold is set to 5 milliseconds. If the task remains in the queue for more than 5 milliseconds without receiving an execution opportunity, its priority will be promoted every 1 millisecond until it reaches the same preemption level as a real-time task.
[0054] In step 5, a dynamic learning rate decay mechanism is introduced when real-time correcting the internal parameters of the intelligent scheduling agent. In the initial stage of system operation, a larger learning rate constant is used to achieve rapid capture of environmental characteristics. As the system stabilizes and the prediction error continues to decrease, the learning rate constant decays according to a preset ratio (e.g., decreasing by 5% every 1000 iterations). This textually described decay logic ensures that the algorithm has better fine-tuning capabilities in later stages, avoiding oscillations near the optimal solution.
[0055] Furthermore, the global deadlock detection in this embodiment employs bidirectional verification using a resource allocation table and a task waiting list. When a task requests a currently occupied peripheral resource (such as a bus controller), the system first checks whether the current holder of that resource is waiting for another resource held by the requesting task. If this mutually exclusive waiting chain forms a closed loop, the scheduling module will forcibly terminate the logical task according to the minimum loss principle. The minimum loss principle means: comparing the decrease in the benefit function of canceling different tasks, and selecting the task with the smallest decrease for reset or suspension.
[0056] In the application scenario of this embodiment, besides collaborative robots, this method is also widely used in five-axis CNC machining centers. During high-speed cutting, the real-time nature of motion control tasks directly affects the surface roughness of the workpiece. Simultaneously, logical tasks such as tool breakage monitoring and coolant pressure monitoring also require timely responses. This invention dynamically balances these two types of tasks during machining, ensuring both cutting accuracy and machine tool operational safety.
[0057] Example 3: This example focuses on describing the extended implementation scheme of the present invention in a distributed industrial control environment, as well as the robustness enhancement measures in the face of extreme network fluctuations.
[0058] In a distributed environment, the operational status parameters obtained in step 1 are extended to multiple control devices. Through industrial Ethernet, the master control unit acquires the CPU load and task queue status of subordinate units in real time. Network congestion monitoring incorporates statistics on the forwarding delay of key switch nodes in the network topology. This forwarding delay is obtained by recording the elapsed time of data packets at the ingress and egress ports of the switches and calculating the difference. When the forwarding delay of a node increases, the scheduling decision in step 4 automatically transfers some logical processing tasks from congested areas to redundant nodes with relatively abundant computing resources.
[0059] To obtain the urgency feature in step 1, this embodiment introduces fuzzy evaluation logic. The urgency of a task is divided into four semantic levels: extremely high, high, medium, and low. Each level corresponds to a specific numerical range; for example, extremely high corresponds to 0.9 to 1.0. The urgency vector includes not only the task's own time limit but also a coefficient indicating the task's relevance to system security.
[0060] In step 3, to address the scheduling of large-scale distributed tasks, the deep reinforcement learning intelligent scheduling agent employs a multi-agent collaborative learning architecture. Each control unit runs a local scheduling agent, and the agents collaborate by exchanging their internal state parameter vectors. When predicting system gain, not only the gain of the current node is considered, but also the impact on the task execution of neighboring nodes is taken into account. A cooperation factor is added to the reward function, which is proportional to the stability of the control cycle of neighboring nodes.
[0061] In step 4, when dynamically adjusting the time slice weight ratio, the system will perform pre-compensation based on the future trend output by the load prediction module. If it is predicted that a large amount of sensor data will flood in within the next 500 milliseconds (such as an increase in sampling tasks due to increased conveyor belt speed), the intelligent scheduling agent will reduce the execution limit of logical tasks in each current control cycle in advance to accumulate resource credit for future computing peaks.
[0062] In step 4, an emergency channel is added to the multi-level feedback queue. This channel is specifically used to handle core system heartbeat messages and emergency stop signals. Tasks entering this channel have absolute, non-maskable preemption rights. Upon receiving a signal from this channel, the scheduler immediately saves the context and jumps to execution after the machine cycle of the current instruction execution ends, unaffected by the time slice weights in the game theory model. This serves as a hard safety guarantee for this invention under extreme operating conditions.
[0063] In step 5, monitoring the stability of the control cycle also includes monitoring the clock synchronization accuracy. In a distributed system, the consistency of the time base of each node is the basis for collaborative scheduling. This embodiment records the synchronization deviation value under the PTP protocol (Precise Time Protocol). If the deviation value exceeds a preset microsecond threshold, it is determined that the determinism of the current system can no longer be maintained. At this time, the correction logic in step 5 will trigger a global time base calibration action and temporarily freeze the parameter updates of the deep neural network until time synchronization returns to normal.
[0064] Furthermore, in the preprocessing stage of step 1, this embodiment also introduces a trend extraction algorithm based on exponentially weighted moving average. This algorithm smooths the collected bus bandwidth utilization by calculating the weighted sum of the current sampled value and the smoothed value at the previous moment (the sum of the weights is 1), filtering out random fluctuations caused by short-term burst communication, and providing a more stable and valuable load indicator for the game model.
[0065] The method in this embodiment is applied to an intelligent assembly line consisting of more than ten collaborative robots. During the overall operation of the production line, the motion scheduling of each robot and the logical control commands of the production line (such as tooling and fixture switching, material arrival signals) achieve global optimal matching.
[0066] Example 4: This example details the specific implementation of the present invention on a heterogeneous computing platform (such as a heterogeneous architecture of a central processing unit and a field-programmable gate array).
[0067] In step 1, acquiring the operating status parameters of the industrial control system includes obtaining the execution status of the hard core logic at the field-programmable gate array (FPGA). Since the FPGA handles high-speed pulse output and hardware-level interlocking logic, its execution status is fed back to the core monitoring module at the central processing unit (CPU) via specific hardware status registers. These status parameters include the utilization rate of the hardware task pipeline and the pulse width deviation of specific trigger signals.
[0068] In step 2, the constructed non-cooperative game model treats hardware-accelerated logic as a special resource participant. Here, the policy space includes not only time slices and priorities, but also migration strategies for tasks between the software execution environment and the hardware-accelerated environment. A hardware utilization gain is added to the payoff function; this gain increases when logic tasks can be migrated from the CPU to the FPGA for execution, reducing CPU load and shortening response time.
[0069] In step 3, a hardware performance descriptor component is added to the input layer of the deep reinforcement learning agent. When predicting the system gain under different scheduling decisions, the network evaluates the computational speedup resulting from offloading a certain logical control task to the hardware. A power consumption weight component is added to the reward function, prioritizing the task allocation scheme with lower power consumption while meeting real-time requirements, thereby reducing computational uncertainty caused by frequency reduction by decreasing the processor's thermal power consumption.
[0070] In step 4, the dynamic adjustment operation is further extended to the dynamic assignment of task execution carriers. When the intelligent scheduling agent outputs an action indicating that a certain high-frequency logical task should be executed by hardware, the scheduler will call the hardware abstraction layer interface to send the logical descriptor of the task to the execution engine on the hardware side. At the same time, in order to coordinate with the execution on the hardware side, the system will dynamically adjust the size of the data buffer that interacts with the central processing unit.
[0071] In step 5, monitoring the stability of the control cycle specifically involves monitoring the consistency of the hardware feedback cycle. Since hardware logic typically exhibits higher determinism, jitter in the hardware cycle usually indicates a hardware-level failure in the underlying physical link or clock source. At this point, the closed-loop correction logic triggered in step 5 attempts to switch redundant clock paths and simultaneously corrects the evaluation weights regarding hardware reliability in the neural network.
[0072] Regarding the sensor data preprocessing in step 1, this embodiment implements a parallel median filter bank in hardware. This filter bank can simultaneously sort and select the median of encoder data from multiple motion axes, with a fixed processing latency of a constant hardware cycle, independent of system software load. This hardened preprocessing mechanism provides high-purity, low-latency input signals for subsequent deep reinforcement learning agents.
[0073] Finally, the method of this embodiment has been applied to a semiconductor precision die bonder. Die bonders are required to complete pick-up, alignment, and placement operations within extremely short cycles, with motion control frequencies reaching several kilohertz. Simultaneously, the system needs to process image triggering logic from a high-magnification vision system in real time.
[0074] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.
Claims
1. A method for coordinated scheduling of motion control and logic control in industrial real-time control systems, characterized in that, Includes the following steps: Step 1: Real-time acquisition of the operating status parameters of the industrial control system, including the resource usage of the central processing unit, the network communication congestion status, and the urgency characteristics of various tasks in the task queue. Step 2: Based on the obtained running state parameters, construct a non-cooperative game model between the motion control task and the logic control task, define the game participants as the motion control execution unit and the logic control execution unit, and establish the corresponding payoff function; Step 3: Configure a deep reinforcement learning intelligent scheduling agent, take the running state parameters as input, extract features through a deep neural network, and predict the system gain under different scheduling decisions; Step 4: Based on the output of the deep reinforcement learning intelligent scheduling agent, dynamically adjust the time slice weight ratio and execution priority order of the motion control task and the logic control task so that the system state tends to Nash equilibrium. Step 5: Execute scheduling instructions and monitor the stability of the control cycle. Based on the execution feedback, correct the internal parameters of the deep reinforcement learning intelligent scheduling agent in real time to complete closed-loop scheduling control.
2. The method for coordinated scheduling of motion control and logic control in an industrial real-time control system according to claim 1, characterized in that, In step 1, obtaining the resource usage of the central processing unit includes: collecting the load percentage of each core of the multi-core processor in real time within a preset statistical period through the system kernel monitoring module; The load percentage is obtained by calculating the ratio of the processor's active execution time to the total clock cycle time; Meanwhile, step 1 also includes real-time monitoring of the CPU's cache hit rate and bus bandwidth utilization. The cache hit rate is obtained by dividing the difference between the total number of cache access requests and the number of cache misses by the total number of access requests. The bus bandwidth utilization rate is obtained by statistically analyzing the ratio of the total amount of data transmitted on the bus per unit time to the theoretical maximum transmission capacity of the bus, and is used to identify processing bottlenecks caused by resource contention.
3. The method for coordinated scheduling of motion control and logic control in an industrial real-time control system according to claim 1, characterized in that, In step 1, obtaining the network communication congestion status includes: real-time statistics of data frame drop rate, data packet round-trip delay, and network jitter value in the industrial Ethernet fieldbus; The round-trip delay of the data packet is obtained by embedding a high-precision timestamp with nanosecond-level accuracy into the data packet to be sent, and after the receiver confirms the data packet, recording the current time and calculating the difference between the current time and the embedded timestamp. The network jitter value is defined as the absolute value of the deviation between the round-trip delays of multiple consecutive data packets; When the data frame drop rate exceeds the preset packet loss threshold, the system determines that there is congestion in the current network environment and automatically increases the urgency of communication-related tasks.
4. The method for coordinated scheduling of motion control and logic control in an industrial real-time control system according to claim 1, characterized in that, In step 1, obtaining the urgency characteristics of various tasks in the task queue includes: for motion control tasks, subtracting the encoder feedback position of the current axis from the ideal position generated by the preset trajectory generation algorithm, and using the resulting absolute difference as the basis for calculating the time sensitivity weight. The larger the absolute difference, the higher the time sensitivity weight of the motion control task. For logic control tasks, based on the level of the event triggering source and the preset response time limit requirements, the tasks are divided into emergency alarm level, regular monitoring level and background log level. The urgency feature is encoded as a multi-dimensional feature vector consisting of a positional deviation component, a response time limit component, and a task priority component, and serves as the input to the non-cooperative game model and the deep reinforcement learning intelligent scheduling agent.
5. The method for coordinated scheduling of motion control and logic control in an industrial real-time control system according to claim 1, characterized in that, The specific process of step 2 includes: defining the motion control task as the first party in the game, whose strategy space is to strive for a longer, continuous and fixed execution time slice; The logic control task is defined as the second party in the game, whose strategy space is the opportunity to request a higher interrupt priority and to randomly access central processing unit resources. The benefit function is designed as the sum of the gain value of system stability and the loss value caused by task delay; For a motion control execution unit, the value of its revenue function is proportional to the determinism of the control cycle. The determinism of the control cycle is obtained by calculating the deviation between the actual execution cycle and the ideal execution cycle. The smaller the deviation, the higher the revenue value. For a logic control execution unit, the value of its revenue function is inversely proportional to the task response delay, which is the time span from the triggering time of the logic event to the completion time of the logic task.
6. The method for coordinated scheduling of motion control and logic control in an industrial real-time control system according to claim 1, characterized in that, In step 3, the deep reinforcement learning intelligent scheduling agent adopts an architecture that combines a deep target network and an evaluation network. The deep neural network includes an input layer, multiple hidden layers, and an output layer; The input layer receives a normalized running state parameter vector. The normalization process maps each parameter to a numerical range between zero and one. The hidden layer adopts a fully connected layer structure, with neurons in the layers interconnected and weights assigned to each other. In the hidden layer, a non-linear activation function is applied for feature mapping. When the input value is greater than zero, the output of the non-linear activation function is equal to the input value multiplied by a scaling factor of one, and when the input value is less than or equal to zero, the output is always zero.
7. The method for coordinated scheduling of motion control and logic control in an industrial real-time control system according to claim 1, characterized in that, In step 3, predicting the system gain under different scheduling decisions includes: extracting data pairs of historical states, actions, rewards, and the next state from a preset historical storage space through an experience replay mechanism; The reward function is defined as a weighted combination of the negative value of the motion control accuracy deviation and the negative value of the logic control response time; When the system experiences a priority inversion phenomenon where a low-priority task blocks a high-priority task for an extended period, or when resource deadlock tendencies occur, the reward function is assigned a very large negative value as a penalty, guiding the deep reinforcement learning intelligent scheduling agent to avoid such decisions.
8. The method for coordinated scheduling of motion control and logic control in an industrial real-time control system according to claim 1, characterized in that, In step 4, dynamically adjusting the time slice weight ratio includes: selecting the scheduling action with the highest probability value as the strategy for the current period based on the action probability distribution output by the deep reinforcement learning intelligent scheduling agent, which is achieved by modifying the scheduler parameters of the real-time operating system. At the same time, the exclusive time window of motion control tasks is dynamically expanded or contracted according to the current total load of the system. When the system load is below a preset threshold, reduce the redundant waiting time of motion control tasks and allocate idle time slices to logic control tasks; When the system load approaches the preset limit, i.e., the total CPU utilization exceeds 90%, a hard real-time priority strategy is executed to ensure that the exclusive time window of motion control tasks is not encroached upon.
9. The method for coordinated scheduling of motion control and logic control in an industrial real-time control system according to claim 1, characterized in that, In step 4, the operation of dynamically adjusting the execution priority order includes: using a multi-level feedback queue scheduling mechanism to temporarily elevate logic control tasks with high urgency to the highest priority, the same as motion control tasks; At the same time, an automatic priority promotion mechanism based on task dwell time is established. When the waiting time of a certain logical control task in the ready queue exceeds the predetermined time threshold, its priority level is forcibly promoted until it obtains central processing unit resources and completes execution. The time threshold is set based on the task's deadline requirement. For logical tasks that require a response within ten milliseconds, the priority increase trigger threshold is five milliseconds. If the task remains in the ready queue for more than five milliseconds without being executed, its priority increases by one level every millisecond.
10. The method for coordinated scheduling of motion control and logic control in an industrial real-time control system according to claim 1, characterized in that, Step 5 specifically includes: recording the start and end times of each motion control cycle using a high-precision hardware timer, calculating the absolute difference between the actual cycle length and the preset theoretical cycle length, and defining the absolute difference as control jitter; When the control jitter exceeds 5% of the theoretical cycle within five consecutive cycles, a safety warning is triggered, and the scheduling mode is switched from the dynamic deep reinforcement learning mode to the preset static priority protection mode. Step 5 also includes using gradient descent to minimize the deviation between the predicted reward and the actual observed reward, and correcting the weight values and bias terms of each neuron connection in the deep neural network in real time. The method also includes a global deadlock detection step, which analyzes resource request relationships by constructing a directed graph consisting of task nodes and resource nodes. When a closed loop is detected in the graph, a deadlock tendency is determined, and the scheduling management module forcibly releases the logical control task with the longest resource occupation time and the lowest priority.