A method for monitoring the load of a plc and related devices
By training load prediction and dynamic optimization models, PLC task parameters are dynamically adjusted, which solves the shortcomings of static threshold alarms in PLC load monitoring, realizes accurate monitoring and intelligent control of PLC load, and avoids production interruptions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAN THERMAL POWER RES INST CO LTD
- Filing Date
- 2026-02-25
- Publication Date
- 2026-06-09
AI Technical Summary
Existing PLC load monitoring technology relies on static threshold alarms, which makes it difficult to prevent system crashes caused by task backlog and resulting in production interruptions.
By using a trained load prediction model and a dynamic optimization model, load prediction and optimization are performed based on real-time data, and relevant parameters of PLC tasks are dynamically adjusted.
It enables precise monitoring and intelligent control of PLC load, avoids task backlog and execution timeout, and improves production continuity and equipment reliability.
Smart Images

Figure CN122173275A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial automation control technology, and more specifically to a PLC load monitoring method, a PLC load monitoring device, an electronic device, and a computer-readable storage medium. Background Technology
[0002] Programmable Logic Controllers (PLCs) are the core control units of industrial automation control systems. They undertake key tasks such as executing periodic control instructions, acquiring non-periodic data, and interlocking and protecting equipment. They are widely used in many fields such as automobile manufacturing, chemical production, power dispatching, and rail transportation.
[0003] In complex industrial scenarios, a single PLC often needs to process dozens or even hundreds of different tasks in parallel. These tasks range from millisecond-level response safety interlocking tasks to second-level data acquisition tasks. Resource competition and scheduling coordination between tasks directly affect the PLC's operating efficiency and control accuracy. Therefore, accurate monitoring and intelligent control of the PLC's load status are crucial for ensuring the continuity of industrial production, reducing equipment failure rates, and optimizing operation and maintenance efficiency.
[0004] However, most existing monitoring technologies rely on static threshold alarms. When the PLC task load increases sharply, static alarms are delayed and it is difficult to prevent system crashes caused by task backlog, resulting in production interruptions.
[0005] Therefore, a new technical solution is urgently needed to solve the above-mentioned technical problems. Summary of the Invention
[0006] This application is made in view of the above-mentioned problems. According to one aspect of this application, a PLC load monitoring method is provided, comprising: Obtain real-time data during PLC task execution; Real-time data is input into the trained load prediction model to output real-time prediction results; The real-time prediction results are input into the dynamic optimization model to output the optimization results; Based on the optimization results, update the relevant parameters of the PLC task.
[0007] Optionally, the method further includes: Based on real-time data, a task feature model is constructed to obtain standardized task data, which includes task feature labels and resource usage matrix.
[0008] Optionally, based on real-time data, a task feature model is constructed, including: Based on real-time scheduling logs, standardized log data is generated, where real-time data includes real-time scheduling logs; Based on standardized log data, determine the task type of the PLC task; Generate a list of task metadata and a resource usage dataset; Based on the task metadata list and resource usage dataset, task feature labels and resource usage matrices are generated.
[0009] Optionally, the update frequency of the resource occupancy matrix is synchronized with the scheduling cycle of the PLC tasks.
[0010] Optionally, real-time data is input into a trained load prediction model to output real-time prediction results, including: Real-time data and external environmental variable data are preprocessed to generate a preprocessed dataset; The preprocessed dataset is input into the trained load prediction model, which calculates the task load trend curve within a preset time period based on historical data patterns, and outputs real-time prediction results.
[0011] Optionally, the real-time prediction results are input into the dynamic optimization model to output optimization results, including: Compare the real-time prediction results with preset thresholds, and execute the corresponding scheduling strategy based on the comparison results; To adjust the schedule, target tasks are filtered according to task priority to generate task schedule adjustment instructions.
[0012] Optionally, the method further includes: The user interface includes a real-time prediction result display area and an abnormal alarm information display area. The user interface is also used to display the load details of the corresponding task in response to the user's query command.
[0013] Secondly, a PLC load monitoring device is also provided, comprising: The data acquisition module is used to acquire real-time data during PLC task execution; The prediction module is used to input real-time data into the trained load prediction model to output real-time prediction results; The optimization module is used to input real-time prediction results into the dynamic optimization model to output optimization results; The update module is used to update the relevant parameters of the PLC task based on the optimization results.
[0014] Thirdly, an electronic device is also provided, comprising: At least one processor; At least one memory for storing at least one program; When at least one program is executed by at least one processor, the at least one processor implements the PLC load monitoring method as described above.
[0015] Fourthly, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the PLC load monitoring method described above.
[0016] Based on the above technical solution, a trained load prediction model can predict load changes within a preset timeframe using real-time data, achieving dynamic load prediction and proactively mitigating the risk of exceeding limits. Furthermore, the automated process of dynamically optimizing the model and updating PLC parameters eliminates the need for manual task scheduling adjustments by maintenance personnel. The time from instruction generation to execution is significantly faster than manual adjustments, avoiding the risk of human error. This method, through real-time prediction and dynamic optimization, stably controls the PLC load within safe thresholds, preventing task backlog and execution timeouts.
[0017] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description
[0018] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0019] Figure 1 A schematic flowchart of a PLC load monitoring method according to an embodiment of this application is shown; Figure 2 A schematic block diagram of a PLC load monitoring device according to an embodiment of this application is shown; Figure 3 A schematic block diagram of an electronic device according to one embodiment of this application is shown. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this application more apparent, exemplary embodiments according to this application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein. Based on the embodiments of this application described herein, all other embodiments obtained by those skilled in the art without inventive effort should fall within the protection scope of this application.
[0021] In order to at least partially solve the above-mentioned technical problems, an embodiment of this application provides a method for identifying myocardial motion abnormalities. Figure 1 A schematic flowchart of a PLC load monitoring method 100 according to an embodiment of this application is shown. Figure 1 As shown, method 100 may include, but is not limited to, the following steps S110, S120, S130 and S140.
[0022] Step S110: Obtain real-time data during PLC task execution.
[0023] For example, the following technical solution can be implemented through a PLC task load monitoring system, where the monitoring system can include an edge computing layer, a transmission layer, a cloud analysis layer, and an application layer. Specifically, data acquisition can be achieved through monitoring units deployed locally on the PLC (such as PLC extended monitoring modules or supporting industrial gateways). Real-time data during PLC task execution can include task execution status data, resource usage data, and real-time scheduling logs. Task execution status data can include the real-time execution status of each PLC task (e.g., normal execution, execution timeout, waiting for resources), task start timestamp, and current task execution duration. Resource usage data can include the real-time consumption of core resources by each PLC task, including CPU utilization (percentage), memory utilization (percentage), communication bandwidth utilization (percentage), and the overall remaining resources of the PLC (e.g., remaining CPU computing power, remaining memory space). The monitoring unit establishes a real-time connection with the PLC through standard communication interfaces (e.g., Ethernet interface, RS485 interface), following the PLC's common data interaction protocols (e.g., Modbus, Profinet). The data acquisition frequency can be set and synchronized with the PLC task scheduling cycle (e.g., if the PLC task scheduling cycle is 100ms, then the data acquisition frequency is set to 100ms / time), ensuring that the acquired data can reflect the dynamic load changes of the task in real time. Optionally, the monitoring unit can also perform preliminary verification on the acquired raw data (e.g., removing obviously invalid values, such as CPU utilization > 100%) to ensure data accuracy before outputting real-time PLC task data for subsequent processes.
[0024] Step S120: Input real-time data into the trained load prediction model to output real-time prediction results.
[0025] Specifically, the load prediction model can be deployed in the cloud analytics layer. The cloud analytics layer and the edge computing layer are connected through a transport layer. The transport layer uses industrial Ethernet as the data transmission channel to transmit the encrypted task data from the edge computing layer to the cloud analytics layer in real time, ensuring the security and real-time performance of data transmission. The cloud analytics layer can also deploy a task database.
[0026] For example, the trained load prediction model can be a machine learning model trained based on historical PLC load data. The model type is adapted to the characteristics of time-series load data (such as Long Short-Term Memory networks, gradient boosting decision trees, etc.). The training process may include: collecting historical load data (including historical real-time data and historical task execution results) of the PLC under different production conditions (such as normal production, batch switching, and equipment maintenance), as well as data on external influencing factors under the corresponding conditions (such as production cycle time, number of equipment, and ambient temperature) to ensure the diversity and representativeness of the training data. Then, the historical data can be divided into training and test sets in a 7:3 ratio. The training set is used to train the model parameters (such as learning rate and number of hidden layer nodes), and the test set is used to verify the model accuracy. When the model's mean absolute error (MAE) is ≤, for example, 5% and the root mean square error (RMSE) is ≤, for example, 8%, the model is considered to have completed training. After the load prediction model is trained, the model first... First, the input real-time data is standardized (e.g., converting percentage data such as CPU utilization and memory utilization to the 0-1 range) to eliminate the impact of unit differences on the prediction results. Based on historical load change patterns (e.g., when production cycle speeds up, for every 10% increase in CPU load, it will increase by another 5% within the next 5 seconds) and real-time data characteristics, the model can calculate the PLC load trend within a preset time period (e.g., 5 seconds, 10 seconds, which can be set according to the needs of the industrial scenario). The prediction results can be presented as a load trend curve or a sequence of predicted key indicators, including at least the predicted resource utilization of a single task within the preset time period (e.g., the CPU utilization of task A in the next 5 seconds is 15%, 17%, 18%, 19%, 18%) and the predicted overall PLC load (e.g., the overall CPU load in the next 5 seconds is 60%, 63%, 65%, 68%, 66%), ensuring that the prediction results reflect the load changes of single tasks and the overall system.
[0027] Step S130: Input the real-time prediction results into the dynamic optimization model to output the optimization results.
[0028] For example, the model can pre-store safe load thresholds based on PLC hardware performance and industrial control requirements (e.g., overall CPU load rate safe threshold ≤ 85%, overall memory utilization safe threshold ≤ 90%). These thresholds can be adjusted by maintenance personnel according to the PLC model and production scenario. The model has built-in optimization strategies for different load prediction scenarios, such as extending the execution cycle of non-critical tasks when the predicted overall CPU load rate is about to exceed the safe threshold, and temporarily releasing unnecessary caches for a task when the predicted memory utilization of a task is about to exceed the limit. Optionally, the model can compare the predicted resource utilization of a single task and the predicted overall load with the preset safe load thresholds to determine whether there is a risk of overload. The model can match suitable strategies from the optimization strategy library and generate specific optimization instructions based on the type (e.g., CPU load exceeding the limit, memory load exceeding the limit) and degree (e.g., exceeding the threshold by 5%, exceeding the threshold by 10%) of the overload risk. For example, if it is predicted that the overall CPU load rate will rise from 83% to 88% in 3 seconds (exceeding the 85% safety threshold), the model generates an optimization instruction to extend the execution cycle of non-critical task B from 50ms to 100ms. The optimization instruction can include the target task identifier (such as the unique ID of task B), the type of optimization operation (such as extending the execution cycle or releasing the cache), optimization parameters (such as the extended execution cycle of 100ms), and the execution timing (such as immediate execution or delaying execution to the next task cycle), ensuring that the PLC can accurately parse and execute it.
[0029] Step S140: Based on the optimization results, update the relevant parameters of the PLC task.
[0030] For example, optimization instructions can be transmitted to the local monitoring unit of the PLC via an industrial communication channel. Upon receiving the optimization instruction, the monitoring unit can automatically parse the target task identifier, optimization operation type, and optimization parameters within the instruction. It can also verify the legality of the instruction (e.g., whether the target task exists and whether the optimization parameters comply with PLC system limitations) to prevent illegal instructions from causing PLC malfunctions. The monitoring unit writes the optimization parameters into the PLC's task scheduling system through the PLC's task configuration interface, updating the relevant parameters of the target task. For instance, for an optimization instruction that extends the execution cycle of task B to 100ms, the monitoring unit modifies the execution cycle configuration item for task B in the PLC, updating it from 50ms to 100ms. After the parameter update, the monitoring unit collects real-time data on the execution status of the target task (e.g., whether the actual execution cycle of task B has become 100ms) and the overall load change of the PLC (e.g., whether the overall CPU load rate has decreased), and feeds the verification results back to the dynamic optimization model. If the parameter update is successful and the load trend is as expected (e.g., the overall CPU load rate does not continue to rise), the updated parameters are maintained; if the update fails (e.g., the target task parameters cannot be modified) or the load does not improve, the dynamic optimization model regenerates optimization instructions (e.g., by changing to other non-critical tasks for adjustment) until the load is controlled within a safe range.
[0031] Based on the above technical solution, a trained load prediction model can predict load changes within a preset timeframe using real-time data, achieving dynamic load prediction and proactively mitigating the risk of exceeding limits. Furthermore, the automated process of dynamically optimizing the model and updating PLC parameters eliminates the need for manual task scheduling adjustments by maintenance personnel. The time from instruction generation to execution is significantly faster than manual adjustments, avoiding the risk of human error. This method, through real-time prediction and dynamic optimization, stably controls the PLC load within safe thresholds, preventing task backlog and execution timeouts.
[0032] Optionally, the method may further include: step S150, constructing a task feature model based on real-time data to obtain standardized task data, wherein the standardized task data includes task feature labels and resource usage matrix.
[0033] Traditional PLC load monitoring systems collect real-time data (such as task execution logs and resource usage data) in mostly unstructured or semi-structured formats, with inconsistent data fields and labels across different tasks. Furthermore, task resource usage data (CPU and memory usage) is stored independently of basic task information (type and priority), lacking a shared identifier. This makes it difficult for maintenance personnel to quickly pinpoint the current resource consumption of a high-priority task, resulting in extremely low data usability. In addition, different manufacturers and models of PLCs define task attributes differently, and the units of measurement for resource usage data are also inconsistent. Traditional monitoring technologies lack a unified data standardization mechanism, meaning that the collected real-time data is only compatible with specific PLCs and cannot be reused in multi-vendor PLC collaborative scenarios. This necessitates the development of separate data processing modules for different PLCs, increasing hardware costs and maintenance complexity.
[0034] Traditional monitoring technologies can only provide a macroscopic description of the overall PLC load (such as total CPU utilization and total memory usage), and cannot correlate it to specific tasks. When the overall PLC load is too high, maintenance personnel only know that the load is excessive, but cannot know which task is consuming a large amount of resources or whether the priority of that task can be adjusted. For example, in a chemical production scenario, if the overall CPU load of the PLC reaches 90%, traditional systems cannot distinguish whether the high load is caused by a high-priority safety interlock task or a low-priority background data acquisition task. This could lead to misjudgment and adjustment of critical tasks, potentially causing production safety risks.
[0035] For example, real-time data may include task scheduling log data and task resource usage data. The task scheduling log data may include: the execution record of each task output by the PLC, including at least a timestamp, a unique task identifier, and execution status. The task resource usage data may include: the real-time consumption of PLC core resources by each task, including at least CPU utilization, memory utilization, and communication bandwidth utilization, and each resource data entry must be bound to a corresponding unique task identifier and timestamp.
[0036] For example, firstly, all real-time data during PLC task execution is collected, including task execution records, resource usage data, and task configuration information. Basic fields such as task identifier, execution cycle, priority, and deadline are extracted from the real-time data. The task type is determined based on the task triggering method and execution cycle length in the real-time data. For example, the trend of resource usage over the past 5 minutes is statistically analyzed. All fields are integrated in a unified format to generate structured task feature tags. The tag format uses the standardized JSON format to ensure direct parsing and reuse.
[0037] For example, resource usage information from real-time data can be integrated into a standardized matrix based on a three-dimensional dimension of "task × time × resource," providing a clear and intuitive view of resource usage at different points in time. Specifically, all currently running PLC tasks are sorted in ascending order by task ID to obtain the task dimension, which serves as the row dimension of the resource usage matrix. The time dimension is used as the column dimension, with the time interval consistent with the real-time data acquisition frequency, including the 10 most recent consecutive time points by default to ensure coverage of recent resource usage status. The resource dimension serves as the value dimension of the resource usage matrix, specifically representing the utilization rate data of PLC core resources, including CPU utilization, memory utilization, and communication bandwidth utilization, all directly taken from real-time data without additional calculations or derivations. Integrating the generated task feature tags and the resource usage matrix forms complete standardized task data.
[0038] By constructing a task feature model, real-time data is structured, integrated, and standardized to generate standardized task data containing task feature tags and resource occupancy matrices. This transforms heterogeneous and fragmented real-time data into data resources with a unified format, clear meaning, and direct reusability, providing a solid data foundation for PLC load monitoring.
[0039] Optionally, step S150, based on real-time data, may include constructing a task feature model that includes: Step S151: Generate standardized log data based on real-time scheduling logs, wherein the real-time data includes real-time scheduling logs.
[0040] For example, the PLC local monitoring unit collects real-time scheduling logs at a frequency synchronized with the PLC task scheduling cycle, and parses the logs' original format—including field separators (such as "|", ",", "-"), field order (such as "timestamp-task ID-execution status" or "task ID-timestamp-execution status"), and data type (such as the timestamp format "YYYY-MM-DDHH:MM:SS.sss" or "MM / DD / YYYY HH:MM:SS"). Based on the IEC61131-3 international standard, the PLC local monitoring unit has a built-in "log format template library," which contains core fields such as timestamp, task ID, task type identifier, and execution status. After receiving the raw task scheduling logs output by the PLC, the monitoring unit automatically identifies the log format (such as by matching field separators and key fields) and performs field mapping and conversion according to the standard format in the template library, thereby generating standardized log data.
[0041] Optionally, log entries with abnormal formats (such as missing fields, timestamps outside a reasonable range, or invalid task IDs) can be removed. For non-mandatory but critical fields (such as task cycle and execution duration), they can be completed by associating with the PLC task configuration table or historical data. For example, logs missing the task ID field can be removed, and logs missing the execution status field can be completed by reverse engineering through subsequent task execution records.
[0042] Step S152: Determine the task type of the PLC task based on standardized log data.
[0043] For example, if standardized log data meets any of the following conditions, it is determined to be a periodic task: Condition 1: The task period field in the log has a valid value, and the timestamp interval of 3 or more consecutive logs is equal to the task period; Condition 2: The task cycle field is missing in the log, but the task has a preset execution cycle as found by querying the PLC task configuration table, and the timestamp interval of 5 or more consecutive logs matches the cycle.
[0044] Standardized log data is considered a non-periodic task if it meets any of the following conditions: Condition 1: The event trigger field in the log has a valid value, and the log timestamp has no fixed interval; Condition 2: The task cycle field in the log has no valid value, and the task in the PLC task configuration table is marked as an event-triggered type with no preset execution cycle.
[0045] Optionally, after the determination is completed, the historical logs can be used for backtracking verification: if a task is determined to be periodic, but there are 3 consecutive times in the historical logs where the timestamp interval deviates from the period by more than ±20%, recheck whether it is a temporary period adjustment; if a task is determined to be non-periodic, but logs with fixed intervals appear continuously, confirm whether it is a newly configured periodic task, and output the task type determination result after verification.
[0046] Step S153: Generate a task metadata list and a resource usage dataset.
[0047] For example, based on standardized log data, task type determination results, and PLC task configuration table, five core metadata items for each task are extracted and organized into a structured list, including: task ID, task type, execution cycle, priority, and deadline, thereby outputting a task metadata list.
[0048] Based on resource usage data, combined with the task ID and timestamp of standardized logs, a dataset is generated according to the following process: First, resource usage data with a deviation of ≤50ms from the standardized log timestamp is selected to ensure that the resource data is synchronized with the task execution status. The deviation can be as small as possible; the 50ms mentioned above is just an example. Second, a task type field is added to each piece of resource data to facilitate subsequent analysis of the resource consumption patterns of different types of tasks. Finally, correlation verification is performed to ensure that the task ID of each piece of resource data exists in the task metadata list, invalid resource data without corresponding tasks is removed, and the resource usage dataset is output.
[0049] Step S154: Based on the task metadata list and resource usage dataset, generate task feature labels and resource usage matrix.
[0050] Using the task ID as an index, the task metadata list is integrated with the corresponding fields in the resource usage dataset to generate task feature tags for each task. The tags are in key-value pair format and contain three types of information: basic attributes, resource usage, and real-time status. The real-time resource data in the resource usage dataset is then organized into a standardized matrix along a two-dimensional dimension of task ID × resource type.
[0051] Through a standardized process of format adaptation, data cleaning, and field completion, combined with the IEC 61131-3 standard template library, unified processing of PLC logs from different manufacturers is achieved. A dual-association mechanism of task ID and timestamp ensures precise binding of task metadata and resource usage data, guaranteeing that feature tags contain complete information on attributes, resources, and status, without any missing information. This accurate task feature tag and resource usage matrix can be directly used for fine-grained scenarios such as high-priority task resource usage analysis or periodic task load trend prediction, allowing for early prediction of execution timeout risks and providing data support for subsequent monitoring and optimization.
[0052] Optionally, the update frequency of the resource occupancy matrix is synchronized with the scheduling cycle of the PLC tasks. For example, the task scheduling cycle parameters in the PLC system configuration register can be read through the standard communication interface of the PLC local monitoring unit. At the end of each task scheduling cycle, the PLC can send a cycle completion signal to the local monitoring unit. This signal indicates that all tasks within the current scheduling cycle have been completed, the resource occupancy status has stabilized, and it is the optimal time to trigger a matrix update. Upon receiving the cycle completion signal, the monitoring unit immediately triggers the resource occupancy matrix update process. Each update automatically overwrites the old data while retaining historical data from the previous 10 updates for traceability. If a cycle completion signal is not received within a preset time (e.g., 10% of the scheduling cycle), the monitoring unit automatically initiates a timeout retry mechanism. After three failed retries, an update is forcibly triggered according to the original scheduling cycle, and a synchronization signal anomaly alarm is pushed to prevent data update interruption.
[0053] Therefore, the synchronous update mechanism avoids redundant data collection and storage caused by update frequencies exceeding the scheduling cycle, significantly improving system operating efficiency, especially suitable for multi-tasking, high-load PLC scenarios. Furthermore, at the end of each scheduling cycle, the matrix data is immediately refreshed to the latest state, avoiding misjudgments of resource occupancy status due to data lag, greatly improving data accuracy, and providing precise and real-time data support for subsequent fine-grained monitoring and optimization.
[0054] Optionally, step S120, which inputs real-time data into the trained load prediction model to output real-time prediction results, may include: Step S121: Preprocess the real-time data and external environmental variable data to generate a preprocessed dataset.
[0055] For example, external environmental variable data can represent external objective factors affecting PLC load changes. These factors are strongly correlated with the PLC's operating status and include, but are not limited to, power grid parameters (frequency, voltage fluctuations), PLC operating environment parameters (temperature, humidity), and production condition parameters (production cycle time, equipment start / stop status). External environmental variable data can be collected through industrial sensors, production management systems, etc., and each data point corresponds one-to-one with a real-time data timestamp. After standardizing the real-time data and external environmental variable data, removing outliers, and completing missing values, a unified dataset format can be formed to ensure compliance with the input requirements of the load prediction model.
[0056] Step S122: Input the preprocessed dataset into the trained load prediction model, so that the trained load prediction model can calculate the task load trend curve within a preset time period based on historical data patterns, and output the real-time prediction result.
[0057] The preprocessed dataset is input into the trained load prediction model. Based on the load-environment-time correlation learned during training, the model infers from the preprocessed dataset: if historical data shows that for every 0.5Hz decrease in grid frequency, the overall PLC CPU load rate increases by 3%, then when the real-time collected grid frequency drops from 50Hz to 49.5Hz, the model will incorporate this influencing factor into its prediction; if historical data shows that the load of periodic tasks increases linearly when the production cycle speeds up, then when the production parameters show that the cycle speed increases from 50 pieces / minute to 60 pieces / minute, the model will predict the load growth of that task according to the corresponding slope. This outputs the task load trend curve in a "time-load rate" line graph format, where the time dimension covers a preset future duration, such as 10 seconds, with the time step consistent with the PLC task scheduling cycle to ensure trend continuity. The indicator dimensions include at least the overall PLC CPU load rate, memory load rate, communication bandwidth load rate, and the predicted core resource utilization rate of high-priority tasks.
[0058] Therefore, by incorporating external influencing factors such as power grid parameters, ambient temperature, and production conditions into the prediction, the traditional model avoids the one-sidedness of only looking at internal data and can accurately capture load changes caused by environmental factors.
[0059] Optionally, the real-time prediction results are input into the dynamic optimization model to output optimization results, including: Compare the real-time prediction results with preset thresholds, and execute the corresponding scheduling strategy based on the comparison results; To adjust the schedule, target tasks are filtered according to task priority to generate task schedule adjustment instructions.
[0060] For example, multiple levels of thresholds can be preset, including safety thresholds, warning thresholds, and anomaly thresholds. Specifically, the safety threshold represents the upper limit of the load for stable PLC operation (e.g., CPU load rate 85%, memory load rate 90%), which is determined by the PLC hardware specifications and production scenario requirements; the warning threshold can be 80%-90% of the safety threshold (e.g., CPU load rate 75%-77.5%), used to initiate warning preparation in advance; the anomaly threshold can be 100%-110% of the safety threshold (e.g., CPU load rate 85%-93.5%), and is divided into minor anomalies (85%-90%) and severe anomalies (above 90%) according to the extent of exceeding the threshold. When the real-time prediction result is less than or equal to the warning threshold, keep the current task scheduling parameters unchanged and continuously monitor the load trend. When the warning threshold is less than the real-time prediction result and less than the safety threshold, display the warning prompt on the visualization platform and record the current resource occupancy status of high-priority tasks to reserve data for subsequent adjustments. When the safety threshold is less than the real-time prediction result and less than the anomaly threshold, only adjust low-priority tasks without interrupting task execution. Specifically, only select low-priority tasks (such as data acquisition and historical backup tasks), and prioritize tasks with relatively high resource occupancy and the least impact on production after adjustment (such as background data acquisition tasks, rather than real-time data backup tasks). When the real-time prediction result is greater than the anomaly threshold, prioritize adjusting low-priority tasks, and if necessary, suspend some non-critical auxiliary tasks to ensure the resource requirements of high-priority tasks. Specifically, first select low-priority tasks, and if the load still exceeds the threshold after adjustment, then select mid-priority non-core tasks (such as routine parameter statistics tasks). High-priority tasks (such as safety interlocking and precise control tasks) are prohibited from being adjusted.
[0061] Therefore, multi-level preset thresholds and differentiated strategies transform optimization from a single response to tiered prevention and control, avoiding over-adjustment or under-adjustment. Furthermore, by selecting target tasks according to "low → medium → high" priority, the risk of high-priority critical tasks being mistakenly adjusted is completely eliminated.
[0062] Optionally, the method further includes: displaying a user interface, wherein the user interface includes a real-time prediction result display area and an anomaly alarm information display area, and the user interface is also used to display the load details of the corresponding task in response to the user's query command.
[0063] For example, the application layer deploys a visual monitoring platform interface as the user interface, serving as the interaction medium between maintenance personnel and the PLC load monitoring system. The user interface can adopt a layout of a top navigation bar + left-side function area + middle main display area + right-side alarm area. The top navigation bar can include function entries such as the homepage (monitoring overview), load prediction, abnormal alarms, task details, and system settings, supporting quick switching; the left-side function area includes a task list (categorized by priority), query condition input boxes, and a time range selector; the middle main display area can display real-time prediction results, and after switching function entries, corresponding content can be displayed, such as an abnormal alarm list and task load details; the right-side alarm area can display currently unprocessed abnormal alarms.
[0064] Through an integrated interface design that displays real-time prediction results, presents abnormal alarm information, and queries task load details, the system makes monitoring data more intuitive, alarm information more prominent, and query operations more convenient. It is suitable for industrial scenarios such as chemical production, automobile manufacturing, and power dispatching, where maintenance personnel need to quickly grasp the operating status of PLCs.
[0065] According to a second aspect of this application, a PLC load monitoring device is also provided. Figure 2 A schematic block diagram of a PLC load monitoring device 200 according to one embodiment of this application is shown. Figure 2 As shown, the device 200 may include: The data acquisition module 210 is used to acquire real-time data during the operation of PLC tasks; The prediction module 220 is used to input real-time data into the trained load prediction model to output real-time prediction results; The optimization module 230 is used to input the real-time prediction results into the dynamic optimization model to output the optimization results; Update module 240 is used to update relevant parameters of PLC tasks based on optimization results.
[0066] According to a third aspect of this application, an electronic device is also provided. Figure 3 A schematic block diagram of an electronic device 300 according to one embodiment of this application is shown. Figure 3 As shown, the electronic device 300 may include: At least one processor 310; At least one memory 320 is used to store at least one program; When at least one program is executed by at least one processor 310, the at least one processor 310 implements the PLC load monitoring method as described above.
[0067] According to a fourth aspect of this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the PLC load monitoring method described above. The storage medium may, for example, include a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disc read-only memory (CD-ROM), a USB memory, or any combination of the above storage media. The computer-readable storage medium may be any combination of one or more computer-readable storage media.
[0068] Those skilled in the art can understand the specific implementation scheme and beneficial effects of the above-mentioned PLC load monitoring device, electronic device and computer-readable storage medium by reading the relevant description of the PLC load monitoring method. For the sake of brevity, they will not be described in detail here.
[0069] Although exemplary embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above exemplary embodiments are merely illustrative and are not intended to limit the scope of this application. Various changes and modifications can be made therein by those skilled in the art without departing from the scope and spirit of this application. All such changes and modifications are intended to be included within the scope of this application as claimed in the appended claims.
[0070] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0071] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed.
[0072] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0073] Similarly, it should be understood that, in order to streamline this application and aid in understanding one or more of the various inventive aspects, features of this application may sometimes be grouped together in a single embodiment, figure, or description thereof in the description of exemplary embodiments of this application. However, this approach should not be construed as reflecting an intention that the claimed application requires more features than are expressly recited in each claim. Rather, as reflected in the corresponding claims, its inventive point lies in solving the corresponding technical problem with features fewer than all features of a single disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of this application.
[0074] Those skilled in the art will understand that, apart from the mutual exclusion of features, all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or elements of any method or apparatus so disclosed may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0075] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of this application and form different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.
[0076] The various component embodiments of this application can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some modules in the PLC load monitoring device according to the embodiments of this application. This application can also be implemented as an apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such an implementation of this application can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0077] It should be noted that the above embodiments are illustrative of this application and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0078] The above description is merely a specific embodiment or illustration of the embodiments of this application. The scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. The scope of protection of this application shall be determined by the scope of the claims.
Claims
1. A PLC load monitoring method, characterized in that, include: Obtain real-time data during PLC task execution; The real-time data is input into the trained load prediction model to output real-time prediction results; The real-time prediction results are input into the dynamic optimization model to output the optimization results; Based on the optimization results, update the relevant parameters of the PLC task.
2. The monitoring method as described in claim 1, characterized in that, The method further includes: Based on the real-time data, a task feature model is constructed to obtain standardized task data, wherein the standardized task data includes task feature labels and a resource usage matrix.
3. The monitoring method as described in claim 2, characterized in that, The construction of the task feature model based on the real-time data includes: Based on the real-time scheduling log, standardized log data is generated, wherein the real-time data includes the real-time scheduling log; Based on the standardized log data, the task type of the PLC task is determined; Generate a list of task metadata and a resource usage dataset; Based on the task metadata list and the resource usage dataset, the task feature labels and the resource usage matrix are generated.
4. The monitoring method as described in claim 3, characterized in that, The update frequency of the resource occupancy matrix is synchronized with the scheduling cycle of the PLC task.
5. The monitoring method as described in claim 1, characterized in that, The step of inputting the real-time data into the trained load prediction model to output real-time prediction results includes: The real-time data and external environmental variable data are preprocessed to generate a preprocessed dataset; The preprocessed dataset is input into the trained load prediction model, so that the trained load prediction model calculates the task load trend curve within a preset time period based on historical data patterns, and outputs the real-time prediction result.
6. The monitoring method as described in claim 1, characterized in that, The step of inputting the real-time prediction results into the dynamic optimization model to output optimization results includes: The real-time prediction results are compared with preset thresholds to execute corresponding scheduling strategies based on the comparison results. To adjust the schedule, target tasks are filtered according to task priority to generate task schedule adjustment instructions.
7. The monitoring method as described in claim 1, characterized in that, The method further includes: The user interface includes a real-time prediction result display area and an abnormal alarm information display area. The user interface is also used to display the load details of the corresponding task in response to the user's query command.
8. A PLC load monitoring device, characterized in that, include: The data acquisition module is used to acquire real-time data during PLC task execution; The prediction module is used to input the real-time data into the trained load prediction model to output real-time prediction results; An optimization module is used to input the real-time prediction results into a dynamic optimization model to output optimization results; The update module is used to update the relevant parameters of the PLC task based on the optimization results.
9. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the PLC load monitoring method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the PLC load monitoring method as described in any one of claims 1-7.