A controller-based task scheduling method, system, device and storage medium

By adopting task classification and prioritization mechanisms in chemical plants and scheduling tasks according to power supply conditions, the challenge of sub-controller task scheduling when power supply is unstable is solved and production efficiency and safety are improved.

CN118519408BActive Publication Date: 2024-09-20TONGLU COUNTY POWER SUPPLY CO OF STATE GRID ZHEJIANG ELECTRIC POWER CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410978675.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-09-20
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

When the power supply in a chemical plant is unstable, the task classification and prioritization of sub-controllers cannot be effectively handled, affecting the normal operation of the production process.

Method used

By analyzing the production area and task characteristics of the chemical plant, the task classification and prioritization mechanism is adopted, the emergency response mechanism is triggered according to the power supply situation, and the integer planning algorithm and the minimum power priority algorithm are used for task scheduling to ensure the continuous operation of the production process.

Benefits of technology

It improves the production efficiency and operational safety of chemical plants, enhances the ability to respond to emergencies, and ensures the continued stability of the production process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118519408B
    Figure CN118519408B
Patent Text Reader

Abstract

The present invention relates to the technical field of task scheduling, and discloses a controller-based task scheduling method, system, device and storage medium, including: when an emergency response mechanism is triggered, according to the task priority and regional priority, the task importance score of each independent task is calculated, and quantitative sorting is performed; according to the power supply warning level, the task classification ratio is determined, and the independent tasks in the quantitative sorting are divided into key tasks and non-key tasks; the classification results are sent to the corresponding sub-controller, so that the sub-controller adopts different task scheduling algorithms to plan and schedule independent tasks of different classifications. The present invention effectively optimizes the production process of a chemical plant by managing the priority of tasks and regions, ensuring the continuous operation of the production process and production safety. The present invention not only improves production efficiency, but also enhances the ability to respond to emergencies, and significantly improves the overall operating efficiency and production safety of the chemical plant.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of task scheduling, and in particular to a controller-based task scheduling method, system, device and storage medium. Background Art

[0002] In the production process of a chemical plant, the sub-controllers in each area undertake different key tasks. Some sub-controllers need to independently undertake certain tasks, that is, the sub-controllers directly calculate and process the source data, reduce data transmission with the main controller, and reduce the burden on the main controller. These contents are closely related to the importance and characteristics of the region. In actual production, it is necessary to reasonably prioritize the work tasks of the sub-controllers according to the importance and work characteristics of each region. However, when the power supply of a chemical plant is unstable, such as a power outage, the work tasks of the sub-controllers face new challenges, especially the work tasks undertaken independently. The instability or interruption of power supply will directly affect the normal operation of the sub-controllers in each area and the corresponding regional functions cannot be satisfied. At this time, the classification and priority sorting of the work tasks of the sub-controllers cannot be simply determined based on the original importance and characteristics, but need to comprehensively consider the impact of power supply interruptions on each area and tasks. However, conventional task scheduling methods cannot effectively cope with task scheduling under unstable power supply conditions. Summary of the invention

[0003] In order to solve the above technical problems, the present invention provides a controller-based task scheduling method, system, device and storage medium, which can deeply analyze the characteristics of each area and task based on the power supply situation, and realize rapid response and accurate decision-making of task scheduling through task classification and priority sorting mechanism.

[0004] In a first aspect, the present invention provides a controller-based task scheduling method, the method comprising:

[0005] Analyze the production areas and corresponding production processes of the chemical plant, determine the regional priority of each production area, and the task priority of the independent tasks corresponding to the sub-controllers in each production area;

[0006] Determine whether the power supply is stable. If not, trigger the emergency response mechanism. Otherwise, execute the normal response mechanism.

[0007] When the emergency response mechanism is triggered, the task importance scores of each independent task are calculated and quantitatively ranked according to the task priority and the regional priority;

[0008] Determine a task classification ratio according to the power supply warning level, and divide the independent tasks in the quantitative ranking into key tasks and non-key tasks according to the task classification ratio;

[0009] The classification results are sent to the corresponding sub-controllers so that the sub-controllers use different task scheduling algorithms to plan and schedule independent tasks of different categories. The key tasks are planned and scheduled using an integer programming algorithm, and the non-key tasks are planned and scheduled using a minimum power priority algorithm.

[0010] Furthermore, the step of determining whether the power supply is stable, if not, triggering the emergency response mechanism, otherwise, executing the normal response mechanism also includes:

[0011] When executing the normal response mechanism, a cross-weight algorithm is used to calculate the cross-priority of the independent task according to the task priority and the area priority, and the independent task is divided into a key task and a non-key task according to the cross-priority;

[0012] The key tasks are transmitted to the main controller in sequence, so that the main controller adopts a priority-based preemptive scheduling algorithm to plan and schedule the key tasks;

[0013] The non-key tasks are sent to corresponding sub-controllers, so that the sub-controllers plan and schedule the non-key tasks according to the process sequence of the non-key tasks in the production process.

[0014] Furthermore, the step of analyzing the production areas and corresponding production processes of the chemical plant to determine the regional priority of each production area and the task priority of the independent tasks corresponding to the sub-controllers in each production area includes:

[0015] Based on the digital twin model of the production area of ​​the chemical plant, the production process of each production area is analyzed to determine the key nodes of the production process, the sub-controllers corresponding to the key nodes, and the production tasks corresponding to the sub-controllers;

[0016] According to the preset regional indicators, the regional importance scores of each production area are calculated, and the regional importance scores are sorted to obtain the regional priority of each production area;

[0017] The multi-dimensional data of the production tasks are subjected to association and cluster analysis to determine the independent tasks corresponding to each sub-controller, and the priority of each independent task is calculated to obtain the task priority of each independent task in the production area.

[0018] Furthermore, the step of enabling the sub-controller to use different task scheduling algorithms to plan and schedule independent tasks of different categories includes:

[0019] When the independent task is a key task, the first planning model is constructed with the task importance as the optimization target, the available power, the equipment startup power and the task priority as the constraint conditions, and the branch and bound method is used to solve it to obtain the optimal task execution plan, and the optimal task execution plan is converted into an execution instruction for issuance and execution;

[0020] When the independent task is a non-critical task, a greedy strategy is used to select independent tasks with sufficient remaining power and minimum power demand for execution until the power is insufficient or all independent tasks are scheduled.

[0021] Furthermore, the step of enabling the sub-controller to plan and schedule the non-key tasks according to the process sequence of the non-key tasks in the production process includes:

[0022] Taking the earliest task start time as the optimization target, and taking the task sequence, equipment capacity and human resources as constraints, the second planning model is constructed and solved using a heuristic algorithm to obtain the optimal task execution sequence.

[0023] According to the optimal task execution order, the non-critical tasks are sequentially inserted into the corresponding priority task ready queue.

[0024] Furthermore, after the step of determining the key nodes of the production process, the sub-controllers corresponding to the key nodes, and the production tasks corresponding to the sub-controllers, the method further includes:

[0025] According to the connection relationship, communication capability and interaction information of the corresponding production equipment between the sub-controllers of the chemical plant, a sub-controller network distribution model is constructed;

[0026] Based on the sub-controller network distribution model, the association rules between each sub-controller and the key nodes are mined, and the efficiency contribution of each sub-controller to the current production project is calculated by using data envelopment analysis method;

[0027] The sub-controllers whose efficiency contribution is lower than a threshold are analyzed to generate a list of problems to be optimized, and a multi-objective optimization algorithm is used to solve them to obtain the optimal parameter configuration of the sub-controllers.

[0028] Furthermore, after the step of obtaining the task priority of each independent task in the production area, the method further includes:

[0029] Taking minimizing the total processing time and total delay time as the optimization goal, and taking task priority, resource capacity and process constraints as constraints, a third planning model based on task scheduling is established, and the optimal scheduling solution is obtained by solving it according to the heuristic algorithm.

[0030] Match the task scheduling scheme with the production area layout, build an AOE network flow model based on task allocation, and solve it based on the maximum flow and minimum cost path to obtain the optimal execution sequence of independent tasks in the production area;

[0031] Based on the digital twin model, the task priority and the optimal execution sequence are simulated, verified and dynamically adjusted.

[0032] In a second aspect, the present invention provides a task scheduling system based on a controller, the system comprising:

[0033] A priority calculation module is used to analyze the production areas and corresponding production processes of the chemical plant, determine the regional priority of each production area, and the task priority of the independent tasks corresponding to the sub-controllers in each production area;

[0034] The power supply judgment module is used to judge whether the power supply is stable. If not, the emergency response mechanism is triggered; otherwise, the normal response mechanism is executed;

[0035] An emergency response module, for calculating the task importance score of each independent task and performing quantitative sorting according to the task priority and the regional priority when the emergency response mechanism is triggered;

[0036] Determine a task classification ratio according to the power supply warning level, and divide the independent tasks in the quantitative ranking into key tasks and non-key tasks according to the task classification ratio;

[0037] The classification results are sent to the corresponding sub-controllers so that the sub-controllers use different task scheduling algorithms to plan and schedule independent tasks of different categories. The key tasks are planned and scheduled using an integer programming algorithm, and the non-key tasks are planned and scheduled using a minimum power priority algorithm.

[0038] In a third aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0039] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0040] The present invention provides a controller-based task scheduling method, system, device and storage medium. The present invention deeply analyzes the characteristics of each area and task based on the power supply situation, and can achieve optimized management of the production process of the chemical plant through task classification and priority sorting mechanism to ensure the continuous operation of the production process. The present invention can not only improve production efficiency, but also enhance the response capability to emergency situations, and significantly improve the overall operation efficiency and production safety of the chemical plant. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 is a flowchart of a task scheduling method based on a controller in an embodiment of the present invention;

[0042] Figure 2 is a schematic diagram of the structure of a task scheduling system based on a controller in an embodiment of the present invention;

[0043] Figure 3 It is a diagram of the internal structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] See also Figure 1 , a controller-based task scheduling method is proposed in a first embodiment of the present invention, which includes steps S10 to S50:

[0046] Step S10, analyzing the production areas and corresponding production processes of the chemical plant, determining the regional priority of each production area, and the task priority of the independent tasks corresponding to the sub-controllers in each production area;

[0047] Step S20, determining whether the power supply is stable, if not, triggering the emergency response mechanism, otherwise, executing the normal response mechanism;

[0048] Step S30, when the emergency response mechanism is triggered, the task importance score of each independent task is calculated according to the task priority and the regional priority, and quantitative ranking is performed;

[0049] Step S40, determining a task classification ratio according to the power supply warning level, and dividing the independent tasks in the quantitative sorting into key tasks and non-key tasks according to the task classification ratio;

[0050] Step S50, sending the classification results to the corresponding sub-controllers, so that the sub-controllers use different task scheduling algorithms to plan and schedule independent tasks of different categories, wherein the key tasks are planned and scheduled using an integer programming algorithm, and the non-key tasks are planned and scheduled using a minimum power priority algorithm.

[0051] The present invention is a method for scheduling and controlling the work tasks of multiple sub-controllers in each production area during the production process of a chemical plant. In actual production, it is necessary to reasonably prioritize the work tasks of the sub-controllers according to the importance and work characteristics of each area. However, when the power supply is unstable or there is a power outage, the classification and priority ranking of the work tasks of the sub-controllers cannot be simply determined based on the original importance and characteristics, but requires a comprehensive consideration of the impact of the power outage on each area and task. Therefore, the present invention first needs to determine the priority of each production area and the independent tasks undertaken by each sub-controller in the area. The specific steps include:

[0052] Step S101, based on the digital twin model of the production area of ​​the chemical plant, analyzing the production process of each production area, determining the key nodes of the production process, the sub-controllers corresponding to the key nodes, and the production tasks corresponding to the sub-controllers;

[0053] Step S102, calculating the regional importance score of each production area according to the preset regional index, sorting the regional importance scores, and obtaining the regional priority of each production area;

[0054] Step S103, performing association and cluster analysis on the multi-dimensional data of the production tasks, determining the independent tasks corresponding to each sub-controller, and calculating the priority of each independent task to obtain the task priority of each independent task in the production area.

[0055] In this embodiment, first, a digital twin model based on each production area of ​​the chemical plant is established. Specifically, three-dimensional modeling software and VR / AR and other technologies are used to perform high-fidelity modeling of equipment, logistics, layout and other elements of the production area to form a visual, interactive and analyzable digital twin environment, which provides data support and decision-making basis for subsequent process identification, task allocation, priority assessment and other links; secondly, according to the functional attributes and process requirements of the production area, hierarchical analysis method and flow chart modeling and other methods are used to sort out the production processes of each area, and identify the key nodes and decision points in the process. Specifically, through a comprehensive analysis of the production layout and process flow of the chemical plant, the production area is divided into different functional modules such as raw material storage area, reaction device area, separation and purification area, and product storage area, and based on the production process characteristics and material flow, a production area association diagram is constructed to quantify the logistics intensity and information interaction frequency between regions. The analytic hierarchy process is used to construct an indicator system and judgment matrix, conduct expert scoring and consistency testing, and combine statistical analysis of key performance indicators such as production efficiency, energy consumption level, safety risks, etc. to form a quantitative assessment result of process importance and identify the key nodes of the production process in each production area. Then, based on the data from the equipment management system and the MES system, determine the sub-controller corresponding to each key node and the specific tasks it is responsible for.

[0056] Regarding the calculation of regional priorities of production areas, in this embodiment, the importance score of each production area is calculated through preset regional indicators to form a regional priority list. The regional indicators include safety level, production efficiency, impact on total output, etc. Specifically, through the data collection interface of the production execution system MES and the manufacturing operation management system MOM, the real-time production data of each production area is obtained, including equipment conditions, material consumption, energy use, product output, etc., and the data is connected to the industrial big data platform, and distributed message queues such as Kafka are used to realize parallel processing and real-time transmission of data, ensuring low latency and high throughput of data.

[0057] The collected production data is preprocessed and feature engineered. Noise data and outliers are removed through data cleaning and data standardization. Data from different sources and formats are converted into a unified feature vector. The Z-score normalization method is used to make the data dimensionless and eliminate the dimensional differences between different indicators, which facilitates subsequent comprehensive evaluation and comparative ranking.

[0058] The metadata of each production area is obtained from the domain expert knowledge base and equipment ledger system, including the process section, key equipment list, safety level, environmental protection requirements, etc., and the safety level of each area is qualitatively evaluated to build a safety evaluation index system including risk level, protection measures, emergency plans, etc. At the same time, the equipment comprehensive efficiency OEE data and energy utilization rate data of each area are obtained from the equipment operation and maintenance management system and energy management system as input features for subsequent cluster analysis.

[0059] Granger causality test and production function model DEA are used to quantitatively study the dynamic causal relationship and elasticity coefficient between the key indicators of the production area and the total output, and evaluate the marginal contribution rate of each area to the total output. On the basis of causal analysis, the secondary and tertiary indicator layers are refined for the first-level indicators such as safety risk, production efficiency, energy utilization, and output contribution. The analytic hierarchy process AHP is used to calculate the weight coefficients of indicators at all levels through pairwise comparison matrix and judgment matrix consistency test, forming a pyramid-shaped comprehensive evaluation index system, and obtaining the comprehensive importance score of each production area. The importance score is used to automatically divide the importance level of the production area using unsupervised learning algorithms such as K-means clustering, so as to serve as the regional priority of the production area.

[0060] Regarding the calculation of the task priority of independent tasks, in this embodiment, the independent tasks corresponding to each sub-controller are determined through the correlation analysis of multi-dimensional data. Specifically, correlation analysis and clustering analysis are performed on multi-dimensional data such as process parameters, material properties, and equipment status of production tasks. A density-based clustering algorithm such as OPTICS is used to adaptively identify task clustering structures of arbitrary shapes by setting density thresholds and minimum number of points. The clustering quality is evaluated through indicators such as silhouette coefficient and DBI to form several independent task sets, which belong to different sub-controllers.

[0061] After identifying independent tasks, the hierarchical analysis method is used to construct a task priority evaluation index system. From the dimensions of task urgency, importance, resource consumption, etc., a judgment matrix is ​​formed through expert scoring and pairwise comparison. The eigenvalue method is used to calculate the indicator weights and conduct a consistency test. The weighted comprehensive scoring method is used to calculate the priority score of each task to form a task priority vector, that is, the task priority of each independent task is obtained.

[0062] The present invention divides the control and scheduling strategies of the controller into two types: emergency response strategy and normal response strategy. The triggering of these two strategies is determined based on the stability of the power supply of the chemical plant. Therefore, the present invention needs to evaluate the stability of the electrical supply. In a preferred embodiment, the present invention deploys an online power quality monitoring device in the power management system to perform real-time sampling of parameters such as voltage, current, and frequency of the power supply line, and performs statistical analysis in accordance with the IEC61000-4-30ClassA standard. When the voltage deviation exceeds ±10% of the rated value, the frequency deviation exceeds ±0.5Hz of the rated value, and the total harmonic distortion rate exceeds 5%, it is determined that the power supply is unstable, and the emergency response mechanism will be triggered.

[0063] The core of the emergency response mechanism in this embodiment is to divide the independent tasks of the sub-controller according to their importance, and adopt different planning and scheduling strategies for important tasks and non-important tasks. In addition, since the emergency response mechanism is executed under unstable power supply or even power outage conditions, the classification of the importance of independent tasks also needs to consider the power stability of the current area.

[0064] Specifically, firstly, according to the regional priority and task priority, the TOPSIS multi-attribute decision model is adopted to construct an evaluation model with task importance as the decision-making target. The importance weights of task attributes are objectively assigned through the entropy weight method, the Euclidean distance between the task and the positive and negative ideal solutions is calculated, and the comprehensive importance score of the task is obtained by the ratio of the positive distance to the total distance, and the quantitative ranking of the task importance is generated; then the fuzzy control theory is introduced to establish a fuzzy rule base of the power stability warning level and the task classification ratio, and the task classification ratio under different warning levels is calculated through the membership function, and the center of gravity defuzzification method is used to generate an adaptive task classification threshold curve. For example, a triangular membership function can be used to set 25 IF-THEN rules, the input variables are voltage deviation, frequency deviation, and harmonic content, and the output variable is the key task ratio. The center of gravity defuzzification method is used to obtain a ratio threshold curve that changes continuously from 30% to 70%.

[0065] In addition, a two-way control mechanism for task execution feedback and warning level adjustment can be established. According to feedback indicators such as task completion rate and energy consumption excess rate, the fuzzy rule base and classification threshold can be dynamically optimized to achieve adaptive optimization of classification strategies.

[0066] Of course, a simpler classification method can also be used, that is, different classification ratios are set in advance according to different power supply warning levels. When the power supply is unstable, the classification ratio is directly selected according to the issued warning level, and the tasks in the quantitative sorting are divided into key tasks and non-key tasks according to the selected classification ratio. The specific classification method can be flexibly selected according to the actual situation, and will not be described one by one here.

[0067] The task classification results will be sent to the corresponding sub-controllers, that is, each sub-controller can know the task type of the independent task it undertakes, and then for different task types, the sub-controller will use different algorithms for planning and scheduling. The specific planning and scheduling steps include:

[0068] Step S501, when the independent task is a key task, taking the task importance as the optimization target, taking the available power, the equipment startup power and the task priority as the constraint conditions, constructing a first planning model, using the branch and bound method to solve, obtaining the optimal task execution plan, and converting the optimal task execution plan into an execution instruction for issuing and executing;

[0069] Step S502, when the independent task is a non-critical task, a greedy strategy is used to select an independent task with a minimum power requirement and sufficient remaining power to execute until the power is insufficient or all independent tasks are scheduled.

[0070] In this embodiment, for key tasks, the sub-controller models its scheduling problem as a 0-1 integer programming model, namely the first planning model, with task importance as the optimization goal, and available power, equipment startup power, task priority, etc. as constraints. The branch and bound method is used to search for the optimal task execution plan, and the global optimal or approximate optimal solution is converted into a task execution sequence and equipment control instructions, which are sent to the execution unit to achieve priority protection of key tasks.

[0071] For non-key tasks, the sub-controller uses the minimum power priority algorithm for scheduling. The algorithm is chosen because it is proved to be optimal under power constraints based on theoretical analysis and counterexample construction. Specifically, through the greedy strategy, each time the task with the minimum power demand that can be satisfied by the remaining power is selected for execution until the power is insufficient or all tasks are scheduled, and the optimal scheduling plan for non-key tasks is obtained. This embodiment executes as many non-key tasks as possible on the basis of ensuring key tasks, thereby improving equipment utilization and production efficiency.

[0072] In a specific embodiment, the actual production process of a chemical plant is analyzed, and the independent tasks of the sub-controller are classified under the condition of unstable power supply. For the scheduling of 20 key tasks, the first planning model is constructed based on 220 decision variables and 180 constraints. The CPLEX solver is used to search for the optimal solution within 0.5s, thereby shortening the total scheduling time by 15% and increasing the equipment utilization rate by 10%. The greedy strategy traverses 60 non-key tasks in ascending order according to the power demand to solve the packing problem. Under the power constraint of 120kWh, the solution time is 0.1s, and 50 tasks are successfully scheduled, which executes 15% more tasks than the commonly used first-come, first-served algorithm.

[0073] When the power supply is stable, the normal response mechanism will be executed. Under this mechanism, independent tasks still need to be classified. Key tasks will be planned and scheduled by the main controller, and non-key tasks will be planned and scheduled by the sub-controller. The specific steps include:

[0074] Step S60, when executing the normal response mechanism, a cross-weight algorithm is used to calculate the cross-priority of the independent task according to the task priority and the area priority, and the independent task is divided into a key task and a non-key task according to the cross-priority;

[0075] Step S70, transmitting the key tasks to the main controller in sequence, so that the main controller adopts a priority-based preemptive scheduling algorithm to plan and schedule the key tasks;

[0076] Step S80: Send the non-key task to the corresponding sub-controller, so that the sub-controller plans and schedules the non-key task according to the process sequence of the non-key task in the production process.

[0077] In this embodiment, a power quality monitoring device is deployed on the power supply line to collect parameters such as voltage, current, frequency, and power, and statistical analysis is performed in accordance with the IEC61000-4-30 standard to calculate indicators such as voltage deviation, frequency deviation, and harmonic distortion rate. When all indicators are within the threshold range, the power supply is determined to be stable.

[0078] The task classification under the stable power supply state adopts the classification method based on cross-priority. Specifically, the regional priority score of each region is extracted from the regional priority list, and the task priority score of each task is extracted from the task priority list within the region. The two priority scores are weighted and summed according to the preset weight coefficient to obtain the cross-priority score of the task, forming a comprehensive quantitative indicator of the priority of the regional dimension and the task dimension. Then, according to the preset ratio, for example, when the preset ratio is 20%, the independent tasks corresponding to the first 20% of the cross-priority score sequence are regarded as key tasks, and the rest are non-key tasks.

[0079] In a preferred embodiment, the cross-priority scores of the tasks are normalized, and the minimum-maximum normalization method is used to map the scores to the interval [0, 1] to eliminate dimensional and order-of-magnitude differences, thereby obtaining standardized task priorities. A quick sorting algorithm is then used to recursively partition and sort the tasks in order of priority from high to low, to facilitate classification and selection of tasks.

[0080] In addition, in order to maintain the stability of sorting, a timestamp attribute is added to each task object to record the original order of the task. In the partitioning process of quick sorting, when the priority is the same, the tasks are sorted in the order of the timestamps to ensure that the relative order of the tasks with the same priority remains unchanged. The sorted list of key tasks is stored in the priority_queue container of STL in order from high to low priority. The container is implemented with a maximum heap. At the same time, the unordered_map container is used to realize the fast mapping of task ID and priority queue iterator, so as to achieve efficient update of task status. The real-time transmission protocol RTSP is used to transmit the key tasks in the task priority queue to the main controller in sequence. In addition, the priority and deadline fields are added to the transmission message, and in the transmission scheduling module, according to the real-time requirements of the task, the priority-based dynamic weighted round-robin (DWRR) algorithm is used to give priority to the transmission of high-priority and time-out task data, so as to improve the real-time and reliability of transmission.

[0081] After the main controller receives the key task, it adds the task to the ready queue and uses the priority-based preemptive scheduling algorithm RateMonotonic (RM) to perform planning and scheduling. Specifically, the static priority of the task is determined according to the period and priority of the task, and it is scheduled in order from high to low priority. When a high-priority task arrives, the context information of the currently running task is saved through the context switching mechanism, and the execution is switched to the high-priority task until the high-priority task is completed or preempted by a higher-priority task. The priority, running status, context information and other attributes of the task are recorded in the task control block (TCB), and the scheduler schedules and switches tasks according to these attributes.

[0082] In order to further improve the flexibility of task scheduling, a task scheduling mechanism is introduced to abstract complex business processes into a series of interdependent task nodes, and describe the dependencies and execution order between tasks through a directed acyclic graph (DAG). The task scheduling engine dynamically generates and optimizes task execution plans based on the priority, dependency, resource requirements and other attributes of the task, and collaboratively completes the distribution, execution, monitoring and exception handling of tasks through the task scheduler and resource manager, thereby realizing the automated scheduling and management of task processes. In addition, machine learning algorithms can be introduced to extract the key features and laws of task scheduling and resource allocation through the analysis and mining of historical task data and system logs, and use them to guide the dynamic optimization of scheduling algorithms and strategies to achieve adaptive and intelligent task scheduling.

[0083] In a specific embodiment, under the condition of stable power supply, for 100 independent tasks in 10 production areas of a chemical plant, the area priority score area_score and the task priority score task_score are read from Redis, and the cross priority score of each task is calculated by the weighted sum formula score=0.6area_score+0.4task_score, where the weight coefficient of the area priority is set to 0.6, the weight coefficient of the task priority is set to 0.4, and the minimum-maximum normalization formula is used:

[0084] normalized_score=(score-min_score) / (max_score-min_score)

[0085] Normalize the scores to the interval [0, 1]. Then use the three-way quick sort algorithm, use the normalized scores as sorting keys, recursively sort the tasks by partition, and select the top 20% of tasks as key tasks, and the rest as non-key tasks.

[0086] To ensure the stability of sorting, a long timestamp attribute is added to the task object of the key task to record the task creation time. In the quick sort partition comparison, if the scores are the same, the timestamp size is compared. The sorted task list is sent to priority_queue <Task,vector <task>,greater <task>>Storage, implement priority comparison based on normalized scores. Use unordered_map <string,pair<int,double> >Record the task ID, priority, score and other attributes to achieve task information query in O(1) time. Use RTSP protocol to serialize the task object into JSON format, encapsulate it in the SETUP request message of RTSP, and transmit it to the main controller.

[0087] In the transmission scheduling module, the DWRR algorithm is used to set four priority queues with score ranges of [0.8, 1.0], [0.6, 0.8], [0.4, 0.6], and [0, 0.4], respectively, and the weight ratio is 8:4:2:1. Each time the queue is dequeued, the task transmission is selected from the high priority queue according to the weight ratio to ensure the priority transmission of high priority tasks. After receiving the task, the master creates a task control block TCB, which contains attributes such as task ID, priority, status, and context, and inserts it into the ready queue. The RM scheduling algorithm is used to calculate the priority of the task according to the request cycle and priority of the task, and the priority bitmap is used to implement task selection with O(1) time complexity. When a high priority task arrives, the task context is saved by recording the register values ​​of the current task such as the program counter PC and stack pointer SP, and the task switching is performed. The DAG-based task scheduling engine uses an adjacency list to represent task dependencies, generates a task execution sequence through a topological sorting algorithm, and uses the earliest start time first (ESDF) algorithm for task scheduling. During the task execution process, the resource usage, start and end time, priority and other attributes of the task are collected, a sample data set is constructed, and the XGBoost algorithm is used for training to generate a task running time prediction model. When a new task is submitted, a prediction is made and the predicted time is used as the input basis for scheduling to achieve adaptive optimization of scheduling.

[0088] When the power supply is stable, a power stability signal and the corresponding non-critical tasks are sent to the sub-controller. The sub-controller will plan the tasks according to the process sequence of the non-critical tasks in the production process. The specific planning steps include:

[0089] Step S801, taking the earliest task start time as the optimization target, taking the task sequence, equipment capacity and human resources as constraints, constructing a second planning model, and using a heuristic algorithm to solve it, to obtain the optimal task execution sequence;

[0090] Step S802: insert the non-critical tasks into the corresponding priority task ready queue in sequence according to the optimal task execution order.

[0091] In this embodiment, after receiving the power stability signal, the sub-controller accesses the production management system, obtains the production process, extracts the process sequence relationship of non-key tasks, forms a task dependency graph, calculates the earliest start time and the latest end time of the task through the critical path method, and combines the process constraints and resource requirements of the task to build an optimization model for task scheduling, that is, the second planning model. Heuristic algorithms, such as genetic algorithms, particle swarm optimization algorithms, etc., are used to optimize the earliest start time of the task, and the order constraints, equipment capacity constraints, human resource constraints, etc. between tasks are used as constraints to search for the optimal task execution order that meets the constraints, and form a scheduling plan for non-key tasks. According to the optimal scheduling plan obtained by heuristic optimization, the tasks are inserted into the task ready queues of different priorities in the optimal order, as the initial state of the multi-level feedback queue scheduling, and the sub-controller performs scheduling and execution of non-key tasks according to the multi-level feedback queue.

[0092] In a preferred embodiment, during the task execution process, the sub-controller can adaptively adjust the priority and time slice of the task according to the dynamic characteristics of the task and the system load, and take into account the real-time and fairness of the task on the basis of ensuring the optimal scheduling order, thereby improving the overall efficiency of the system. In addition, the sub-controller can also monitor the energy consumption level and load status of the equipment in real time, classify and manage the equipment according to the energy efficiency level and energy consumption level of the equipment, reasonably configure tasks, and control energy consumption from the source. When the energy consumption of the equipment exceeds the preset threshold or the load rate exceeds 80%, the energy consumption and load warning is triggered, and measures such as task migration and dynamic frequency modulation are taken to reduce the impact on production while ensuring the safety of electricity use.

[0093] In a preferred embodiment, after determining the production tasks corresponding to each sub-controller, the present invention further includes:

[0094] According to the connection relationship, communication capability and interaction information of the corresponding production equipment between the sub-controllers of the chemical plant, a sub-controller network distribution model is constructed;

[0095] Based on the sub-controller network distribution model, the association rules between each sub-controller and the key nodes are mined, and the efficiency contribution of each sub-controller to the current production project is calculated by using data envelopment analysis method;

[0096] The sub-controllers whose efficiency contribution is lower than a threshold are analyzed to generate a list of problems to be optimized, and a multi-objective optimization algorithm is used to solve them to obtain the optimal parameter configuration of the sub-controllers.

[0097] In this embodiment, the basic information of each sub-controller in the chemical plant is obtained, including the type, function, location, etc. of the sub-controller, and the connection relationship between them is analyzed to determine the communication protocol and communication capability between the sub-controllers, and the interaction information between the sub-controllers and the corresponding production equipment is obtained, such as the data type and frequency of the interaction. The obtained sub-controller information is preprocessed and feature extracted to convert it into data features required for network modeling, such as controller node attributes, communication link attributes, etc. Based on the extracted data features, network modeling tools such as Petri nets and directed graphs are used to establish a sub-controller network distribution model of the chemical plant. The model reflects the connection relationship and communication capability between the sub-controllers, as well as the interaction between the sub-controllers and the production equipment.

[0098] The real-time database of the production execution system is accessed through the OPCUA protocol to obtain the status information, control instructions and other data of the sub-controller, and the historical data interface of the manufacturing information system is called through WebService to obtain data such as abnormal records. The acquired data is cleaned and preprocessed, and based on the sub-controller network distribution model, the correlation matrix between the sub-controller and the key nodes of the production process is calculated through time series analysis and association rule mining to reveal the role of the controller in process scheduling.

[0099] Then, the efficiency contribution of each sub-controller to the current production project is evaluated through data envelopment analysis. Specifically, for sub-controllers with high correlation, their control logic and algorithm complexity are deeply analyzed. The state machine model is constructed by identifying the input and output variables of the controller, defining the state transition conditions, and describing the state actions. Code review and static analysis methods are used to evaluate the code quality and performance bottlenecks of the controller. By designing test scenarios and conducting dynamic simulations, the impact of sub-controllers on process stability and product quality is evaluated.

[0100] Based on production plans and order requirements, the task volume and bottleneck resources of each production link are counted, the influence of the sub-controller is quantified as the input weight in the data envelopment analysis method, and the decision-making unit and efficiency frontier are constructed. An input-oriented CCR model is established and converted into a linear programming model to calculate the relative efficiency value of the sub-controller and evaluate its contribution to the efficiency of the current production project.

[0101] Preset thresholds or clustering anomaly analysis methods can be used to determine sub-controllers with lower efficiency contributions. Combined with domain knowledge and expert experience, the contradictions and conflicts can be determined, such as the trade-off between control frequency and control accuracy, the balance between communication delay and data volume, etc., to form a list of problems to be optimized. For conflicting problems, multi-objective optimization algorithms such as NSGA-II are used to construct a fitness function that includes indicators such as control performance, communication efficiency, and resource utilization, and search for the optimal solution set of controller parameter configuration.

[0102] In another preferred embodiment, after obtaining the task priority of each independent task in the production area, the present invention further includes:

[0103] Taking minimizing the total processing time and total delay time as the optimization goal, and taking task priority, resource capacity and process constraints as constraints, a third planning model based on task scheduling is established, and the optimal scheduling solution is obtained by solving it according to the heuristic algorithm.

[0104] Match the task scheduling scheme with the production area layout, build an AOE network flow model based on task allocation, and solve it based on the maximum flow and minimum cost path to obtain the optimal execution sequence of independent tasks in the production area;

[0105] Based on the digital twin model, the task priority and the optimal execution sequence are simulated, verified and dynamically adjusted.

[0106] In this embodiment, independent tasks in the production area are analyzed, including refining the dependencies such as time constraints, resource constraints, and process constraints between tasks, and modeling and analysis are performed using tools such as Gantt charts and critical path methods. On this basis, minimizing the total processing time and the total delay time is taken as the optimization goal, and task priority, resource capacity, process constraints, etc. are taken as constraints. A multi-objective mixed integer programming model for task scheduling, that is, the third programming model, is established. Heuristic algorithms such as εLP-MOEA and decomposition-based multi-objective evolutionary algorithms are used to solve the problem, generate a Pareto optimal solution set, and select the optimal scheduling plan in combination with decision maker preferences or utility function evaluation.

[0107] Then, the task scheduling plan is matched with the production area layout. By constructing an AOE network flow model for task allocation, taking the regional equipment processing capacity as the edge capacity limit and the task transfer time as the edge weight, the Edmonds-Karp algorithm is used to solve the maximum flow, and the Dijkstra shortest path algorithm is used to solve the minimum cost path, the optimal execution sequence of independent tasks in the region is formed, and the transfer cost and waiting time of tasks between regions are minimized.

[0108] In addition, the task priority list and execution path can be simulated, verified and dynamically adjusted. Specifically, the discrete event simulation technology is used to monitor the abnormal conditions and resource conflicts in the task execution process in real time in the digital twin environment. Combined with the real-time scheduling algorithm and dynamic optimization algorithm, the task priority and execution path are adjusted and optimized online to improve production efficiency and product quality. The rule-based task decomposition method is adopted to decompose the production tasks into a series of atomic operations and action sequences according to the process requirements, equipment capabilities, material properties, etc. of the tasks. Through the instruction mapping table and translation algorithm, the scheduling instructions are converted into instruction codes that can be recognized and executed by the controller, such as G code, PLC ladder diagram, etc.

[0109] The controller-based task scheduling method provided by the present invention comprehensively considers the impact of the stability of power supply on various production areas and production tasks, and provides task scheduling decisions under different power supply conditions through a mechanism for classifying and prioritizing independent tasks of sub-controllers, effectively optimizing the production process of the chemical plant and ensuring the continuous operation of the production process and production safety. The present invention not only improves production efficiency through priority management of tasks and areas, but also enhances the ability to respond to emergencies, thereby significantly improving the overall operating efficiency and production safety of the chemical plant.

[0110] See also Figure 2 Based on the same inventive concept, a controller-based task scheduling system is proposed in a second embodiment of the present invention, comprising:

[0111] The priority calculation module 10 is used to analyze the production areas and corresponding production processes of the chemical plant, determine the regional priority of each production area, and the task priority of the independent tasks corresponding to the sub-controllers in each production area;

[0112] The power supply determination module 20 is used to determine whether the power supply is stable. If not, the emergency response mechanism is triggered. Otherwise, the normal response mechanism is executed.

[0113] The emergency response module 30 is used to calculate the task importance score of each independent task and perform quantitative sorting according to the task priority and the regional priority when the emergency response mechanism is triggered;

[0114] Determine a task classification ratio according to the power supply warning level, and divide the independent tasks in the quantitative ranking into key tasks and non-key tasks according to the task classification ratio;

[0115] The classification results are sent to the corresponding sub-controllers so that the sub-controllers use different task scheduling algorithms to plan and schedule independent tasks of different categories. The key tasks are planned and scheduled using an integer programming algorithm, and the non-key tasks are planned and scheduled using a minimum power priority algorithm.

[0116] The technical features and technical effects of the controller-based task scheduling system proposed in the embodiment of the present invention are the same as those of the method proposed in the embodiment of the present invention, and are not described in detail here. Each module in the above-mentioned controller-based task scheduling system can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0117] In addition, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0118] See also Figure 3 , an internal structure diagram of a computer device in an embodiment, the computer device can specifically be a terminal or a server. The computer device includes a processor, a memory, a network interface, a display, a camera and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a controller-based task scheduling method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0119] It can be understood by those skilled in the art that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computing device may include more or fewer components than shown in the figure, or combine certain components, or have the same component arrangement.

[0120] In addition, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.

[0121] In summary, an embodiment of the present invention proposes a controller-based task scheduling method, system, device and storage medium. The method determines the regional priority of each production area and the task priority of the independent tasks corresponding to the sub-controllers in each production area by analyzing the production areas and corresponding production processes of a chemical plant; determines whether the power supply is stable, and if not, triggers the emergency response mechanism, otherwise, executes the normal response mechanism; when the emergency response mechanism is triggered, calculates the task importance score of each independent task according to the task priority and the regional priority, and performs quantitative sorting; determines the task classification ratio according to the power supply warning level, and divides the independent tasks in the quantitative sorting into key tasks and non-key tasks according to the task classification ratio; sends the classification results to the corresponding sub-controller, so that the sub-controller adopts different task scheduling algorithms to plan and schedule independent tasks of different categories, wherein the key tasks are planned and scheduled using an integer programming algorithm, and the non-key tasks are planned and scheduled using a minimum power priority algorithm. The present invention comprehensively considers the impact of the stability of power supply on various production areas and production tasks, and provides task scheduling decisions under different power supply conditions by classifying and prioritizing the independent tasks of the sub-controllers, effectively optimizing the production process of the chemical plant and ensuring the continuous operation of the production process and production safety. The present invention not only improves production efficiency through priority management of tasks and areas, but also enhances the ability to respond to emergencies, thereby significantly improving the overall operating efficiency and production safety of the chemical plant.

[0122] Each embodiment in this specification is described in a progressive manner, and the same or similar parts of each embodiment can be directly referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. It should be noted that the technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0123] The above-mentioned embodiments only express several preferred implementation modes of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in the technical field, several improvements and substitutions can be made without departing from the technical principles of the present invention, and these improvements and substitutions should also be regarded as the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be based on the protection scope of the claims.< / task> < / task>

Claims

1. A controller-based task scheduling method, characterized in that: include: Analyze the production areas and corresponding production processes of the chemical plant, determine the regional priority of each production area, and the task priority of the independent tasks corresponding to the sub-controllers in each production area; Determine whether the power supply is stable. If not, trigger the emergency response mechanism. Otherwise, execute the normal response mechanism. When the emergency response mechanism is triggered, the task importance scores of each independent task are calculated and quantitatively ranked according to the task priority and the regional priority; Determine a task classification ratio according to the power supply warning level, and divide the independent tasks in the quantitative ranking into key tasks and non-key tasks according to the task classification ratio; The classification results are sent to the corresponding sub-controllers so that the sub-controllers use different task scheduling algorithms to plan and schedule independent tasks of different categories. The key tasks are planned and scheduled using an integer programming algorithm, and the non-key tasks are planned and scheduled using a minimum power priority algorithm.

2. The controller-based task scheduling method according to claim 1, characterized in that: The step of determining whether the power supply is stable, if not, triggering the emergency response mechanism, otherwise, executing the normal response mechanism also includes: When executing the normal response mechanism, a cross-weight algorithm is used to calculate the cross-priority of the independent task according to the task priority and the area priority, and the independent task is divided into a key task and a non-key task according to the cross-priority; The key tasks are transmitted to the main controller in sequence, so that the main controller adopts a priority-based preemptive scheduling algorithm to plan and schedule the key tasks; The non-key tasks are sent to corresponding sub-controllers, so that the sub-controllers plan and schedule the non-key tasks according to the process sequence of the non-key tasks in the production process.

3. The controller-based task scheduling method according to claim 1, characterized in that: The step of analyzing the production areas and corresponding production processes of the chemical plant to determine the regional priority of each production area and the task priority of the independent tasks corresponding to the sub-controllers in each production area includes: Based on the digital twin model of the production area of ​​the chemical plant, the production process of each production area is analyzed to determine the key nodes of the production process, the sub-controllers corresponding to the key nodes, and the production tasks corresponding to the sub-controllers; According to the preset regional indicators, the regional importance scores of each production area are calculated, and the regional importance scores are sorted to obtain the regional priority of each production area; The multi-dimensional data of the production tasks are subjected to association and cluster analysis to determine the independent tasks corresponding to each sub-controller, and the priority of each independent task is calculated to obtain the task priority of each independent task in the production area.

4. The controller-based task scheduling method according to claim 1, characterized in that: The steps of enabling the sub-controller to use different task scheduling algorithms to plan and schedule independent tasks of different categories include: When the independent task is a key task, the first planning model is constructed with the task importance as the optimization target, the available power, the equipment startup power and the task priority as the constraint conditions, and the branch and bound method is used to solve it to obtain the optimal task execution plan, and the optimal task execution plan is converted into an execution instruction for issuance and execution; When the independent task is a non-critical task, a greedy strategy is used to select independent tasks with sufficient remaining power and minimum power demand for execution until the power is insufficient or all independent tasks are scheduled.

5. The controller-based task scheduling method according to claim 2, characterized in that: The step of enabling the sub-controller to plan and schedule the non-key tasks according to the process sequence of the non-key tasks in the production process includes: Taking the earliest task start time as the optimization target, and taking the task sequence, equipment capacity and human resources as constraints, the second planning model is constructed and solved using a heuristic algorithm to obtain the optimal task execution sequence. According to the optimal task execution order, the non-critical tasks are sequentially inserted into the corresponding priority task ready queue.

6. The controller-based task scheduling method according to claim 3, characterized in that: After the step of determining the key nodes of the production process, the sub-controllers corresponding to the key nodes, and the production tasks corresponding to the sub-controllers, the method further includes: According to the connection relationship, communication capability and interaction information of the corresponding production equipment between the sub-controllers of the chemical plant, a sub-controller network distribution model is constructed; Based on the sub-controller network distribution model, the association rules between each sub-controller and the key nodes are mined, and the efficiency contribution of each sub-controller to the current production project is calculated by using data envelopment analysis method; The sub-controllers whose efficiency contribution is lower than a threshold are analyzed to generate a list of problems to be optimized, and a multi-objective optimization algorithm is used to solve them to obtain the optimal parameter configuration of the sub-controllers.

7. The controller-based task scheduling method according to claim 3, characterized in that: After the step of obtaining the task priority of each independent task in the production area, the method further includes: Taking minimizing the total processing time and total delay time as the optimization goal, and taking task priority, resource capacity and process constraints as constraints, a third planning model based on task scheduling is established, and the optimal scheduling solution is obtained by solving it according to the heuristic algorithm. Match the task scheduling scheme with the production area layout, build an AOE network flow model based on task allocation, and solve it based on the maximum flow and minimum cost path to obtain the optimal execution sequence of independent tasks in the production area; Based on the digital twin model, the task priority and the optimal execution sequence are simulated, verified and dynamically adjusted.

8. A controller-based task scheduling system, characterized in that: include: A priority calculation module is used to analyze the production areas and corresponding production processes of the chemical plant, determine the regional priority of each production area, and the task priority of the independent tasks corresponding to the sub-controllers in each production area; The power supply judgment module is used to judge whether the power supply is stable. If not, the emergency response mechanism is triggered; otherwise, the normal response mechanism is executed; An emergency response module, for calculating the task importance score of each independent task and performing quantitative sorting according to the task priority and the regional priority when the emergency response mechanism is triggered; Determine a task classification ratio according to the power supply warning level, and divide the independent tasks in the quantitative ranking into key tasks and non-key tasks according to the task classification ratio; The classification results are sent to the corresponding sub-controllers so that the sub-controllers use different task scheduling algorithms to plan and schedule independent tasks of different categories. The key tasks are planned and scheduled using an integer programming algorithm, and the non-key tasks are planned and scheduled using a minimum power priority algorithm.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.