Method for determining data of cross-referenced tasks of a plc

By introducing a locking mechanism, a counter, and a task load prediction module into the PLC system, combining hash functions and a pre-cache layer, and utilizing Kalman filtering and particle filtering algorithms, the data instability and communication jitter problems in PLC multi-task cross-reference data operations are solved, data certainty and accuracy are achieved, and the system's adaptability and operational efficiency are improved.

CN120256131BActive Publication Date: 2025-10-10BEIJING ASTRONAUTICS JUHENG SYST INTEGRATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510713163.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-10-10
Estimated Expiration
2045-05-30

AI Technical Summary

Technical Problem

PLC has data instability and communication jitter problems in multi-task cross-reference data operations. Traditional methods cannot accurately calculate and process system communication jitter, resulting in data misreference and failure to meet industrial control requirements.

Method used

A locking mechanism, counter, and task load prediction module are used for cycle timing. Combined with hash functions and pre-caching layers, Kalman filtering and particle filtering algorithms are used for jitter estimation and compensation. Shadow registers and pre-caching layers are set, and a dynamic task priority evaluation and adjustment mechanism is used to ensure data certainty and accuracy.

Benefits of technology

It improves the certainty and accuracy of the PLC system in multi-task cross-reference data operations, enhances the system's adaptability under different load and jitter conditions, ensures data integrity and consistency, and improves system operation efficiency.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The application discloses a PLC multi-task cross-reference deterministic data method, including setting a locking mechanism, a counter and a task load prediction module, the task load prediction module collects multi-dimensional data and adjusts the locking parameter through neural network algorithm analysis. The data cache is triggered by calculating the preset period number, and a shadow register and a pre-cache layer are arranged, combined with a hash function, a hash value is calculated and feature information is recorded during storage, and reading is checked in advance. There is an adaptive jitter compensation mechanism combined with two filtering algorithms. The pre-cache layer stores data according to time correlation. The counter has a double counting mode to deal with task exceptions. There is also a task priority dynamic evaluation adjustment and a history record library. The hash function has a data redundancy check mechanism. The locking mechanism includes a temporary locking interval, and the jitter time adopts a multi-dimensional statistical method. The application guarantees data determinacy, accuracy and improves system efficiency from multiple aspects, and enhances the adaptive capacity of the system to jitter under different operating states.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of PLC application, and in particular to a method for PLC multi-task cross-reference deterministic data. BACKGROUND

[0002] In the field of modern industrial automation control, PLC (Programmable Logic Controller) is widely used in the control and management of various production processes. With the increasing complexity of industrial systems, PLC often needs to handle multiple tasks at the same time, which involves multi-task cross-reference data operation.

[0003] There are usually multiple tasks in a common PLC, assuming task 1 and task 2. Task 1 will reference task 2 data for calculation in its own task cycle, and task 2 will also reference task 1 data for calculation in its own task cycle. However, task 1 and task 2 of the system run independently. Since task 1 references task 2 data, it requires that task 2 data refresh is stable and periodic. For example, if task 1 is a 1ms cycle and task 2 is a 4ms cycle, the reference mode of task 2 will be greatly jittered and cannot be accurately calculated.

[0004] In addition, in terms of data caching and referencing, the data caching structure of the traditional method is simple. There is no concept of pre-caching layer, and data directly enters a single caching structure (similar to traditional caching of shadow registers). This lacks efficiency in data organization and management, and in terms of dealing with system communication jitter, the traditional PLC multi-task data processing method uses a relatively simple way to handle system communication jitter. Based on limited historical experience or fixed statistical parameters, the size of the data cache delay is determined without precise jitter estimation and compensation mechanism, which can easily lead to unstable and incorrect data references and cannot meet the work requirements of PLC applications. Therefore, a method for PLC multi-task cross-reference deterministic data is proposed. SUMMARY

[0005] The present application provides the following technical solution: a method for PLC multi-task cross-reference deterministic data, comprising the following steps:

[0006] S1: setting a locking mechanism in the task cycle integer multiple interval;

[0007] S2: setting a counter and a task load prediction module, counting the number of cycles for task 1 and task 2, and predicting data through the task load prediction module, and adjusting the related parameters of the locking mechanism in advance according to the prediction results;

[0008] S3: when the time reaches the preset number of cycles, directly trigger or delay trigger the corresponding data buffer; S4: set a shadow register and a pre-buffer layer for storing data at the time of triggering, and at the same time, combine the hash function to calculate the hash value of the data when the data is stored in the shadow register, and store it together with the data, and calculate the hash value of the data again before the data is read and referenced, and compare it with the stored hash value;

[0009] S5: lock the data in the shadow register before the next data read reference to ensure that the data is not refreshed again;

[0010] S6: determine the reasonable delay size by counting the jitter time of system communication to ensure the deterministic correspondence of the latched data, and establish an adaptive jitter compensation mechanism, and use Kalman filtering algorithm and other dynamic filtering techniques to estimate and compensate the jitter in real time.

[0011] Preferably, the working mode of the task load prediction module is that when the task load prediction module is predicting data, it collects detailed data information of task 1 and task 2 in the past multiple cycles, including but not limited to the size of data processed each time, data type, data processing complexity and multi-dimensional information of resource occupation, and comprehensively analyzes these multi-dimensional data through neural network algorithm, and when predicting that the task load is about to change, if the predicted task load increases, the lock period can be shortened in advance or the counting frequency of the counter can be increased, and if the predicted task load decreases, the lock period can be appropriately extended or the counting frequency can be reduced.

[0012] Preferably, in addition to using Kalman filtering algorithm, the adaptive jitter compensation mechanism also uses particle filtering algorithm for real-time estimation and compensation of jitter, so that at the initial stage of system operation, Kalman filtering algorithm and particle filtering algorithm are started at the same time, Kalman filtering algorithm is based on the linear state space model of the system to preliminarily estimate the jitter, and particle filtering algorithm can better handle the nonlinear system condition, the results of the two algorithms are weighted and fused, and the weight is dynamically adjusted according to the current running state of the system.

[0013] Preferably, the data storage in the pre-buffer layer is classified according to the time correlation of the data, and the data that will be referenced at the same time in the near future is divided into the same category, and when judging the time correlation of the data, the task cycle law of task 1 and task 2, the use frequency of the data in different task cycles and the time interval of the data generation are comprehensively considered.

[0014] Preferably, when the data is stored in the shadow register, the hash function not only calculates the hash value of the data but also synchronously records some characteristic information of the data. These characteristics include the source identifier of the data and the generation timestamp of the data. Before the data is read and referenced, not only the hash value is compared, but also the characteristic information of the data is checked at the same time. If the hash value is consistent but the characteristic information does not match, it is also determined that the data is abnormal.

[0015] Preferably, the counter has dual counting modes, one is a normal counting mode, which counts according to the actual cycles of Task 1 and Task 2; the other is an emergency counting mode, which automatically switches to the emergency counting mode when the system detects an abnormal situation in Task 1 or Task 2, such as when the task execution time exceeds a certain proportion of the normal cycle.

[0016] Preferably, a dynamic evaluation and adjustment mechanism of task priority is added in step S2. For the priority management of Task 1 and Task 2, in addition to dynamically adjusting the priority according to the real-time importance, urgency and data accuracy requirements of the task, a priority history record library is also established. This record library will record the priority changes of each task in different time periods and the corresponding data references and processing results. By analyzing the data in the history record library, the future priority adjustment strategy can be optimized.

[0017] Preferably, in addition to being set within an interval of integer multiples of the task cycle, the locking mechanism is also provided with a temporary locking interval. When the system detects that the amount of data interaction between Task 1 and Task 2 suddenly increases or the importance of the data increases significantly in a short period of time, the temporary locking interval is started. Within the temporary locking interval, it can be triggered immediately according to the real-time situation of the data interaction without waiting for the preset number of cycles. At the same time, the data latch within the temporary locking interval has a higher priority and can take precedence over the operation of the normal locking interval, thereby ensuring the deterministic reference of data in special data interaction situations.

[0018] Preferably, the hash function introduces a data redundancy check mechanism in addition to comparing the data feature information. When the data is stored in the shadow register, redundant data is generated according to a specific redundancy algorithm and stored together with the original data. Before the data is read and referenced, the data is checked using the redundancy check algorithm. If the redundancy check fails, even if the hash value and the data feature information are correct, it is determined that there is a problem with the data.

[0019] Preferably, in step S6, a multi-dimensional statistical method is used to calculate the statistics of the system communication jitter time. In addition to calculating the average value and variance of the system communication jitter time, the distribution law of the jitter time is also synchronously analyzed, and the parameters of the adaptive jitter compensation mechanism are adjusted according to the distribution law of the jitter time.

[0020] In summary, compared with the prior art, the present invention provides a method for PLC multi-task cross-reference deterministic data, which has the following beneficial effects:

[0021] 1. The present invention uses a task load prediction module combined with a neural network algorithm to perform data prediction, and can adjust the relevant parameters of the locking mechanism in advance according to changes in the task load. This helps ensure that the locking mechanism adapts to changes in the task load, guarantees the determinism of data references, and improves the system's ability to cope with different load conditions. Secondly, the adaptive jitter compensation mechanism combines Kalman filtering and particle filtering algorithms, and dynamically adjusts weights to more accurately estimate and compensate for jitter in real time, ensuring the deterministic correspondence of latched data and enhancing the system's adaptability to jitter under different operating conditions.

[0022] 2. The present invention can classify and store data according to its time correlation by setting up a pre-cache layer, thereby improving the efficiency of data transfer from the pre-cache layer to the shadow register, thereby ensuring the certainty of data reference. At the same time, by recording partial feature information of the data through a hash function and introducing a data redundancy check mechanism, data integrity is guaranteed from multiple dimensions. When reading and referencing data, data anomalies can be more comprehensively detected, ensuring data accuracy and certainty.

[0023] 3. The present invention uses the dual counting mode of the counter to quickly respond to task anomalies. By switching to the emergency counting mode to deal with risks, the certainty of data reference in special circumstances is guaranteed. The dynamic assessment and adjustment mechanism of task priorities and the establishment of a priority history record library help optimize the priority adjustment strategy, ensuring data certainty while improving the overall operating efficiency of the system.

[0024] 4. The present invention can flexibly trigger data caching in special data interaction situations through the temporary locking interval setting in the locking mechanism, ensuring the deterministic reference of data. At the same time, the system communication jitter time adopts a multi-dimensional statistical method, and the adaptive jitter compensation mechanism parameters can be adjusted according to the jitter time distribution law, further ensuring the determinism of the latched data. DETAILED DESCRIPTION

[0025] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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 making creative efforts are within the scope of protection of the present invention.

[0026] The present invention provides a technical solution, a method for PLC multi-task cross-reference deterministic data,

[0027] The following steps are involved:

[0028] S1: Set up a locking mechanism within an integer multiple of the task cycle, and set a temporary locking interval within the locking mechanism. The temporary locking interval can be activated when the system detects a sudden increase in the amount of data interaction between Task 1 and Task 2 or a significant increase in the importance of the data in a short period of time. Within the temporary locking interval, the data cache is triggered more flexibly and can be triggered immediately based on the real-time situation of data interaction without waiting for the preset number of cycles. At the same time, data latching within the temporary locking interval has a higher priority and can take precedence over operations in the normal locking interval, thereby ensuring deterministic data reference in special data interaction situations;

[0029] S2: A counter is set up with a dual counting mode and a task load prediction module inside, and the cycle number of task 1 and task 2 is timed. At the same time, data prediction is performed through the task load prediction module, and the relevant parameters of the locking mechanism are adjusted in advance according to the prediction results. The working method of the task load prediction module is that when the task load prediction module performs data prediction, detailed data information of task 1 and task 2 in the past multiple cycles is collected, including but not limited to the multi-dimensional information of the data size, data type, complexity of data processing and resource occupancy of each task, and these multi-dimensional data are comprehensively analyzed through the neural network algorithm. When it is predicted that the task load is about to change, if the task load is predicted to increase, the locking cycle can be shortened in advance or the counting frequency of the counter can be increased. If the task load is predicted to decrease, the locking cycle can be appropriately extended or the counting frequency can be reduced.

[0030] The counter has two counting modes: one is the normal counting mode, which counts according to the actual cycle of Task 1 and Task 2; the other is the emergency counting mode. When the system detects an abnormal situation in Task 1 or Task 2, such as when the task execution time exceeds a certain percentage of the normal cycle, it automatically switches to the emergency counting mode.

[0031] The normal counting mode of the counter is:

[0032] First, the system defaults to normal counting mode. In this mode, the counter counts according to the actual cycles of Task 1 and Task 2. This means that the counter will gradually increase the count value based on the normal cycle lengths preset for Task 1 and Task 2. For example, if the normal cycle of Task 1 is 10 time units and the normal cycle of Task 2 is 15 time units, the counter will count the two tasks separately according to this cycle rhythm. During normal operation, the counter continues to work in this normal counting mode, and cooperates with other modules (such as the task load prediction module, etc.) to time the task cycle. This timing result will be used for subsequent operations such as data cache triggering to ensure the determinism of data references. For example, when the timing reaches the preset number of cycles (this preset number of cycles is based on the counting result in the normal counting mode), the corresponding data cache operation will be triggered;

[0033] The specific process of automatically switching to emergency counting mode is as follows:

[0034] The system will continuously monitor the execution of Task 1 and Task 2. When an abnormality is detected in Task 1 or Task 2, it will trigger the switch from normal counting mode to emergency counting mode. Once an abnormality is detected, the counter will automatically switch to emergency counting mode. In emergency counting mode, the counter's counting speed is accelerated. This accelerated counting speed is to more quickly adapt to the data processing needs under abnormal task conditions. For example, if the count is 1 time per second in normal counting mode, it may be 3 times per second in emergency counting mode or the counting speed may be accelerated according to specific preset rules;

[0035] S3: When the timing reaches the preset number of cycles, the corresponding data cache is directly triggered or delayed;

[0036] S4: Set up a shadow register and a pre-cache layer to store the data at the time of triggering. At the same time, in combination with the hash function, the hash value of the data is calculated when the data is stored in the shadow register and stored together with the data. Before the data is read and referenced, the hash value of the data is calculated again and compared with the stored hash value. The data storage in the pre-cache layer is classified according to the time correlation of the data. Data that will be referenced simultaneously in the near future is divided into the same category. When judging the time correlation of the data, the task cycle regularity of task 1 and task 2, the frequency of data use in different task cycles, and the time interval between data generation are comprehensively considered.

[0037] When the hash function stores data in the shadow register, in addition to calculating the hash value of the data, it also records some of the data's characteristic information. These characteristics include the data's source identifier and the data's generation timestamp. Before reading and referencing the data, it not only compares the hash value but also verifies the data's characteristic information. If the hash values ​​match but the characteristic information does not match, the data is considered abnormal.

[0038] At the same time, the hash function introduces a data redundancy check mechanism in addition to comparing the data feature information. When the data is stored in the shadow register, redundant data is generated according to a specific redundancy algorithm and stored together with the original data. Before the data is read and referenced, the data is verified using the redundancy check algorithm. If the redundancy check fails, even if the hash value and data feature information are correct, it is determined that there is a problem with the data.

[0039] The specific process of the data redundancy verification mechanism is as follows:

[0040] First, when data is to be stored in the shadow register (this timing is when the timing reaches the preset number of cycles to trigger the data cache and the data is about to be stored in the shadow register), the data is in a pending state and is ready for the redundant data generation operation;

[0041] Subsequent operations are performed according to a specific redundancy algorithm pre-set by the system. This specific redundancy algorithm is specifically designed for the PLC multi-task cross-reference deterministic data method to ensure data integrity and determinism. Although the specific algorithm is not mentioned in this paragraph, it is the basic rule of the entire process;

[0042] The original data to be stored in the shadow register is calculated according to the selected redundancy algorithm. For example, if the redundancy algorithm is based on parity check, each bit of the original data may be calculated, and the parity of the number of 1s in the original data may be used as the redundant data. If it is based on the cyclic redundancy check (CRC) algorithm, the original data will be treated as a polynomial and calculated using a specific generator polynomial to obtain a fixed-length remainder as the redundant data.

[0043] Integrate the generated redundant data with the original data. This integration may be a simple append operation, such as adding the redundant data to the end of the original data or a specific position. For example, if the original data is 101011, the generated redundant data is 01;

[0044] Finally, the integrated data, including the original data and redundant data, is stored in the shadow register. In the shadow register, this data will be stored until the next data read and reference operation. At the same time, the hash function will calculate the hash value of this integrated data and record some characteristic information of the data (such as source identifier and generation timestamp), which will be stored together in the shadow register. In this way, before the data is read and referenced, multi-dimensional data verification can be performed, including hash value comparison, characteristic information verification, and redundancy check, to ensure the accuracy and certainty of the data;

[0045] S5: Before the next data read reference, lock the data in the shadow register to ensure that the data is no longer refreshed;

[0046] S6: By statistically analyzing the jitter time of system communications, a reasonable delay size is determined to ensure that the latched data has a deterministic correspondence. On this basis, an adaptive jitter compensation mechanism is established, and dynamic filtering technologies such as the Kalman filter algorithm are used to estimate and compensate for jitter in real time. In addition to using the Kalman filter algorithm, the adaptive jitter compensation mechanism also combines the particle filter algorithm for real-time jitter estimation and compensation. In the initial stage of system operation, the Kalman filter algorithm and the particle filter algorithm are simultaneously activated. The Kalman filter algorithm makes a preliminary estimate of jitter based on the system's linear state space model, while the particle filter algorithm can better handle nonlinear systems. The results of the two algorithms are weighted and fused, and the weights are dynamically adjusted based on the current operating state of the system. Multi-dimensional statistical methods are used to calculate the jitter time of system communications. In addition to statistically analyzing the mean and variance of the jitter time of system communications, the jitter time distribution pattern is also analyzed. The parameters of the adaptive jitter compensation mechanism are adjusted based on the jitter time distribution pattern.

[0047] Secondly, step S2 adds a dynamic assessment and adjustment mechanism for task priorities. For the priority management of Task 1 and Task 2, in addition to dynamically adjusting the priorities based on the real-time importance and urgency of the tasks and the requirements for data accuracy, a priority history library is also established. This library records the changes in the priority of each task in different time periods, as well as the corresponding data references and processing results. By analyzing the data in the history library, future priority adjustment strategies can be optimized.

[0048] The specific process of the dynamic evaluation and adjustment mechanism of task priorities is as follows:

[0049] First, when performing data prediction, the task load prediction module collects detailed data information from Task 1 and Task 2 over multiple past cycles. This information includes multi-dimensional information such as the amount of data processed by each task, the type of data, the complexity of data processing, and resource usage. Next, a neural network algorithm performs a comprehensive analysis of this collected multi-dimensional data. Based on the inherent relationships and patterns between this data, the neural network algorithm assesses the real-time importance, urgency, and data accuracy requirements of the tasks. For example, if a task's data volume and processing complexity suddenly increase, while also requiring high data accuracy, the importance and urgency of this task may be judged as high. Finally, based on the results of this comprehensive analysis, the priorities of Task 1 and Task 2 are dynamically adjusted. If the importance and urgency of a task increase, its priority is increased; conversely, if the importance and urgency of a task decrease, its priority is decreased. For example, if Task 1 originally had a medium priority, but analysis reveals a sharp increase in data volume and extremely high data accuracy requirements, Task 1's priority may be raised to high.

[0050] The specific operation process of the priority history library is as follows:

[0051] First, the priority history database records each task's priority changes over different time periods, along with the corresponding data references and processing results. For example, at time t1, Task 1's priority is raised from low to medium. At this point, data references are made from cache A, and the processing result is the successful completion of a specific operation. This information is recorded in the priority history database. Second, the system regularly analyzes the data in the priority history database. This analysis includes the impact of different priority changes on data references and processing results, such as observing metrics like task execution efficiency and data accuracy at different priorities. For example, it examines whether Task 1 consistently completes data processing faster and with higher accuracy when it is prioritized, or whether it experiences data processing delays when it is prioritized. Finally, by analyzing the data in the history database, future priority adjustment strategies can be optimized. If inappropriate priority adjustments are found to lead to data processing issues in certain cases, the adjustment strategy can be revised. For example, if it is found that frequently adjusting Task 2's priority to high does not improve overall data processing efficiency but instead causes data reference issues for other tasks, the priority adjustment strategy can be adjusted to avoid unnecessary priority increases.

[0052] This solution uses a task load prediction module combined with a neural network algorithm for data prediction. It can adjust the relevant parameters of the locking mechanism in advance according to changes in the task load, helping to ensure that the locking mechanism adapts to changes in the task load, guaranteeing the determinism of data references, and improving the system's ability to cope with different load conditions. Secondly, the adaptive jitter compensation mechanism combines Kalman filtering and particle filtering algorithms, and dynamically adjusts weights to more accurately estimate and compensate for jitter in real time, ensuring the deterministic correspondence of latched data and enhancing the system's adaptability to jitter under different operating conditions.

[0053] This solution can classify and store data according to the time correlation of the data through the pre-cache layer set up, which can improve the efficiency of data transfer from the pre-cache layer to the shadow register, thereby ensuring the certainty of data reference. At the same time, through the introduction of hash functions to record partial feature information of the data and the data redundancy verification mechanism, the integrity of the data is guaranteed from multiple dimensions. When reading and referencing data, data anomalies can be detected more comprehensively to ensure the accuracy and certainty of the data.

[0054] This solution can respond quickly to task anomalies through the dual counting mode of the counter, deal with risks by switching to the emergency counting mode, and ensure the certainty of data references in special circumstances. The dynamic evaluation and adjustment mechanism of task priorities and the establishment of a priority history record library help optimize the priority adjustment strategy, thereby improving the overall operation efficiency of the system while ensuring data certainty.

[0055] This solution uses the temporary lock interval setting in the locking mechanism to flexibly trigger data caching in special data interaction situations to ensure deterministic data reference. The added system communication jitter time adopts a multi-dimensional statistical method, and the adaptive jitter compensation mechanism parameters can be adjusted according to the jitter time distribution law to further ensure the determinism of the latched data.

[0056] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.

[0057] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

Claims

1. A method for cross-referencing deterministic data in PLC multi-tasks, characterized in that: The following steps are involved: S1: Set up a locking mechanism within the integer multiple of the task period, and set a temporary locking interval within the locking mechanism; S2: Set up a counter and a task load prediction module to count the cycles of Task 1 and Task 2. At the same time, the task load prediction module performs data prediction and adjusts the relevant parameters of the locking mechanism in advance based on the prediction results. A dual counting mode is also set inside the counter. The counter has two counting modes: one is the normal counting mode, which counts according to the actual cycle of Task 1 and Task 2; the other is the emergency counting mode. When the system detects an abnormal situation in Task 1 or Task 2, that is, the task execution time exceeds a certain proportion of the normal cycle, it automatically switches to the emergency counting mode. S3: When the timing reaches the preset number of cycles, the corresponding data cache is directly triggered or delayed; S4: Set up a shadow register and pre-cache layer to store the data when triggered. At the same time, combine the hash function to calculate the hash value of the data when the data is stored in the shadow register and store it together with the data. Before the data is read and referenced, the hash value of the data is calculated again and compared with the stored hash value. S5: Before the next data read reference, lock the data in the shadow register to ensure that the data is no longer refreshed; S6: By counting the jitter time of system communication and determining the delay size, we ensure that the latched data has a deterministic correspondence. On this basis, we establish an adaptive jitter compensation mechanism and use the Kalman filter algorithm to estimate and compensate for jitter in real time.

2. The method for PLC multi-task cross-reference deterministic data according to claim 1, characterized in that: The working method of the task load prediction module is as follows: when the task load prediction module is performing data prediction, it collects detailed data information of Task 1 and Task 2 in the past multiple cycles, including but not limited to multi-dimensional information of the amount of data processed by each task, data type, complexity of data processing and resource occupancy, and performs a comprehensive analysis of these multi-dimensional data through a neural network algorithm. When it is predicted that the task load is about to change, that is, the task load is predicted to increase, the locking period can be shortened in advance or the counting frequency of the counter can be increased. If the task load is predicted to decrease, the locking period can be appropriately extended or the counting frequency can be reduced.

3. The method for PLC multi-task cross-reference deterministic data according to claim 1, characterized in that: In addition to utilizing the Kalman filter algorithm, the adaptive jitter compensation mechanism also combines the particle filter algorithm for real-time jitter estimation and compensation. This allows both the Kalman filter algorithm and the particle filter algorithm to be started simultaneously at the initial stage of system operation. The Kalman filter algorithm makes a preliminary estimate of jitter based on the system's linear state space model, while the particle filter algorithm can better handle nonlinear system conditions. The results of the two algorithms are weighted and fused, with the weights dynamically adjusted based on the current operating state of the system.

4. The method for PLC multi-task cross-reference deterministic data according to claim 1, characterized in that: The data storage in the pre-cache layer is classified according to the time correlation of the data, and the data that will be referenced simultaneously in the near future are divided into the same category. When judging the time correlation of the data, the task cycle rules of task 1 and task 2, the frequency of use of data in different task cycles, and the time interval between data generation are comprehensively considered.

5. The method for PLC multi-task cross-reference deterministic data according to claim 1, characterized in that: When data is stored in the shadow register, the hash function not only calculates the hash value of the data but also synchronously records some characteristic information of the data, including the source identifier of the data and the timestamp of the data generation. Before reading and referencing the data, not only the hash value but also the characteristic information of the data is compared. When the hash values ​​are consistent but the characteristic information does not match, it is also determined that the data is abnormal.

6. The method for PLC multi-task cross-reference deterministic data according to claim 1, characterized in that: In step S2, a dynamic evaluation and adjustment mechanism of task priorities is added to the PLC multi-tasking system. For the priority management of Task 1 and Task 2, in addition to dynamically adjusting the priorities according to the real-time importance, urgency and data accuracy requirements of the tasks, a priority history library is also established. The priority history library records the priority changes of each task in different time periods and the corresponding data references and processing results. By analyzing the data in the history library, the future priority adjustment strategy can be optimized.

7. The method for PLC multi-task cross-reference deterministic data according to claim 1, characterized in that: The temporary lock interval can be started when the system detects that the amount of data interaction between task 1 and task 2 suddenly increases or the importance of the data increases significantly in a short period of time. Within the temporary lock interval, it can be triggered immediately according to the real-time situation of the data interaction without waiting for the preset number of cycles. At the same time, the data latch in the temporary lock interval has a higher priority and can take precedence over the operation of the normal lock interval, thereby ensuring the deterministic reference of data in special data interaction situations.

8. The method for PLC multi-task cross-reference deterministic data according to claim 1, characterized in that: The hash function not only compares the data feature information but also introduces a data redundancy check mechanism. When data is stored in the shadow register, redundant data is generated according to a specific redundancy algorithm and stored together with the original data. Before the data is read and referenced, the data is checked using the redundancy check algorithm. If the redundancy check fails, even if the hash value and data feature information are correct, it is determined that there is a problem with the data.

9. The method for PLC multi-task cross-reference deterministic data according to claim 1, characterized in that: In step S6, a multi-dimensional statistical method is used to calculate the jitter time of system communication. In addition to calculating the average value and variance of the jitter time of system communication, the distribution pattern of the jitter time is also analyzed synchronously. The parameters of the adaptive jitter compensation mechanism are adjusted according to the distribution pattern of the jitter time.

Citation Information

Patent Citations

  • Multi-task time sequence execution method and system based on cache locks

    CN105550028A

  • Task management system and method

    CN112162969A