A method for monitoring the operating state of a digital controller
By improving the sample entropy algorithm, the similar tolerance threshold is adaptively adjusted, combined with the degree of noise interference and the correlation of traffic data, the operating status of the digital controller is monitored in real time, and the problems of low accuracy of abnormal detection and late reporting are solved, achieving the effect of timely detection of abnormalities.
Patent Information
- Application Number
- CN202510329127.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-03-20
AI Technical Summary
In the prior art, the abnormal detection results of the digital controller are low in accuracy and cannot detect abnormal situations in time, resulting in late reporting.
By improving the sample entropy algorithm, the degree of noise interference is introduced from adapting to adjust the similar tolerance threshold, calculating the utilization sequence sample entropy of the digital controller, combining the correlation between utilization and flow data, and monitoring the operating status of the digital controller in real time.
It improves the accuracy of abnormal detection, can promptly detect abnormal situations in the digital controller, and prevent safety accidents.
Smart Images

Figure CN119847125B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly relates to a method for monitoring the operating state of a digital controller. Background Art
[0002] With the development of intelligent manufacturing, more and more industrial processes rely on precise and efficient computing and control. As a core component of industrial automation, the operating state of a digital controller directly affects the reliability and stability of equipment. The operating state of a digital controller is usually reflected by its utilization rate. The more complex the change of the utilization rate within a period of time, the greater the possibility that there are potential risks in the digital controller, and the higher the possibility of failure. It is necessary to be vigilant and take measures to ensure the high reliability of the equipment.
[0003] With the rapid development of computer technology and anomaly detection algorithms, good results have been achieved in monitoring the operating state of digital controllers using anomaly detection algorithms. Among them, the sample entropy algorithm is a metric method for evaluating the complexity of time series data and can be used for anomaly detection. This is because abnormal data usually increases the complexity of time series data. Therefore, by calculating the complexity of time series data using sample entropy, the abnormal situation of the time series data can be reflected, and then the monitoring of the operating state of the digital controller can be realized. Specifically, the sample entropy algorithm includes the following steps: constructing multiple subsequences with a length of m based on the time series data; calculating the Chebyshev distance between any subsequence and other subsequences, obtaining the ratio of the number of Chebyshev distances less than the similarity tolerance threshold to the total number, and calculating the mean value of the corresponding ratios of all subsequences as the similarity mean; constructing multiple subsequences with a length of m + 1 based on the time series data and repeating the previous step; taking the difference between the natural logarithm of the similarity mean of the subsequences with a length of m and the natural logarithm of the similarity mean of the subsequences with a length of m + 1 as the sample entropy. The larger the sample entropy, the higher the complexity of the time series data and the higher the possibility of the existence of abnormal data.
[0004] However, when collecting usage rate data, due to electromagnetic interference in the industrial environment, it will affect the normal collection of utilization rate data, resulting in inaccurate utilization rate data. When calculating the Chebyshev distance between two subsequences, noise will affect the accuracy of the result, and then reduce the accuracy of the final sample entropy, that is, the accuracy of the anomaly detection result is low. Moreover, the existing sample entropy algorithm can only determine whether there is an anomaly in the time series data through the complexity of the time series data, and cannot locate at which moment the abnormal data occurs. Therefore, it is impossible to detect anomalies in time, resulting in late reporting. Summary of the Invention
[0005] The present invention provides a method for monitoring the operating state of a digital controller, aiming to solve the technical problems of low accuracy of abnormal detection results and inability to detect abnormal situations in a timely manner in the prior art.
[0006] The method for monitoring the operating state of the digital controller of the present invention includes the following steps:
[0007] Obtain the utilization rate of the digital controller at different times;
[0008] Use the sample entropy algorithm to calculate the sample entropy of the utilization rate sequence at any moment and its previous moment, where the utilization rate sequence is the utilization rate within a preset time period before the corresponding moment; The utilization rate sequence is the utilization rate within a preset time period before the corresponding moment utilization rate;
[0009] Among them, the sample entropy algorithm includes an improved similarity tolerance threshold, which is positively correlated with the initial similarity tolerance threshold and the noise interference degree of the subsequence group; the subsequence group includes any two equal-length subsequences in the utilization rate sequence; the noise interference degree is positively correlated with the prominence degree of the subsequence group and negatively correlated with the correlation between the utilization rate of the subsequence and the corresponding flow data; the prominence degree is positively correlated with the Chebyshev distance between the two subsequences in the subsequence group, negatively correlated with the mean value of the Chebyshev distances of all subsequence groups, and negatively correlated with the average distance of the subsequence group; the average distance is the mean value of the absolute values of the differences between the corresponding utilization rates of the two subsequences in the subsequence group;
[0010] Calculate the abnormal degree of the utilization rate at any moment. When the abnormal degree is greater than the threshold, it is determined that the utilization rate at this moment is abnormal, and an alarm is given and the corresponding device is controlled to stop running;
[0011] Among them, the abnormal degree is the product of the normalized value of the difference between the sample entropies of the utilization rate sequences at any moment and its previous moment and the normalized value of the difference between the mean values of the utilization rate sequences corresponding to any moment and its previous moment. utilization rate sequence and the mean value of the utilization rate sequences corresponding to any moment and its previous moment utilization rate sequence.
[0012] In the above solution, by calculating the noise interference degree of the subsequence group, the corresponding improved similarity tolerance threshold is obtained, which can avoid the problem that the sample entropy calculated due to noise interference is inaccurate, and thus the abnormal situation of the operating state of the digital controller cannot be accurately judged. Moreover, by obtaining the abnormal degree of the utilization rate at any moment, the operating state of the digital controller can be monitored in real time.
[0013] Preferably, the improved similarity tolerance threshold is:
[0014] ;
[0015] In the formula, For the of the moment The utilization rate sequence The improved similarity tolerance threshold for subsequence groups, For the of the moment The utilization rate sequence The noise interference degree of the subsequence groups is is the initial similarity tolerance threshold, is the standard normalization function.
[0016] In the above scheme, the improved similarity tolerance threshold is adaptively increased according to the noise interference degree of the subsequence group, thereby solving the problem of inaccurate sample entropy calculation.
[0017] Preferably, the noise interference degree is:
[0018] ;
[0019] In the formula, For the of the moment The utilization rate sequence The noise interference degree of the subsequence groups is For the of the moment The utilization rate sequence The prominence of the subsequence groups, For the of the moment The utilization rate sequence The first subsequence The correlation between utilization and corresponding traffic data, The natural constant The exponential function of base .
[0020] In the above scheme, the prominence of the subsequence group and the The correlation between the utilization rate and the corresponding flow data characterizes the degree of noise interference, thereby avoiding the problem of inaccurate calculation of the degree of noise interference due to flow data.
[0021] Preferably, the protrusion degree is:
[0022] ;
[0023] In the formula, For the the prominence of the sub-sequence group at the [[[ID=]]]-th moment in the utilization rate sequence, is the Chebyshev distance between two sub-sequences in the sub-sequence group at the [[[ID=]]]-th moment in the utilization rate sequence, is the average distance of the sub-sequence group at the [[[ID=]]]-th moment in the utilization rate sequence, is the total number of sub-sequence groups in the utilization rate sequence at the [[[ID=]]]-th moment, and [[[ID=]]] is the standard normalization function.
[0024] In the above solution, the prominence is characterized by the difference between the Chebyshev distance between two sub-sequences in the sub-sequence group and the average distance of the sub-sequence group, as well as the difference from the mean value of the Chebyshev distances of all sub-sequence groups, making the calculation result more accurate and preventing the influence caused by accidental errors.
[0025] Preferably, the correlation is:
[0026] ;
[0027] In the formula, is the correlation between the utilization rate of the [[[ID=]]]-th sub-sequence and the corresponding flow data in the [[[ID=]]]-th sub-sequence group at the [[[ID=]]]-th moment in the utilization rate sequence, is the time difference between the maximum value of the utilization rate of the [[[ID=]]]-th sub-sequence and the maximum value of the corresponding flow data in the [[[ID=]]]-th sub-sequence group at the [[[ID=]]]-th moment in the utilization rate sequence, is the absolute value of the difference in the number of extreme points between the utilization rate of the [[[ID=]]]-th sub-sequence and the corresponding flow data in the [[[ID=]]]-th sub-sequence group at the [[[ID=]]]-th moment in the utilization rate sequence, [[[ID=]]] is a preset parameter, , and [[[ID=]]] is an exponential function with the natural constant as the base.
[0028] In the above solution, by calculating The difference between the time corresponding to the maximum value of the utilization rate and the time corresponding to the maximum value of the corresponding traffic data, and the difference between the number of extreme points of the utilization rate and the number of extreme points of the corresponding traffic data can characterize the correlation between the utilization rate and the corresponding traffic data.
[0029] Preferably, the correlation is:
[0030] ;
[0031] In the formula, is the th moment of the correlation between the utilization rate of the th subsequence group in the utilization rate sequence and the corresponding traffic data of the th subsequence, is the utilization rate of the th moment of the th subsequence group in the utilization rate sequence and the th subsequence, is the utilization rate of the th moment of the th subsequence group in the utilization rate sequence, is the corresponding traffic data of the th subsequence group in the utilization rate sequence and the th subsequence, is the th subsequence, is the Pearson correlation coefficient function.
[0032] In the above solution, the correlation is characterized by the Pearson correlation coefficient, which makes the calculation simple, has a small amount of calculation, and is intuitive and easy to interpret.
[0033] Preferably, the sample entropy algorithm is used to calculate the sample entropy of the utilization rate sequence at the corresponding moment, including the following steps: Based on the utilization rate sequence, obtain multiple subsequences with a preset length;
[0034] Calculate the Chebyshev distance between any subsequence and the subsequence group formed by the remaining subsequences, obtain the ratio of the number of subsequence groups with a Chebyshev distance less than the corresponding improved similarity tolerance threshold to the total number of subsequence groups, and calculate the mean value of the corresponding ratios of all subsequences as the similarity mean value;
[0035] Obtain multiple subsequences with a length of the preset length plus 1 again, and repeat the previous step;
[0036] Take the difference between the natural logarithm of the similarity mean value of the multiple subsequences with the preset length and the natural logarithm of the similarity mean value of the multiple subsequences with a length of the preset length plus 1 as the Sample entropy of the utilization rate sequence.
[0037] Preferably, the acquisition frequency of the utilization rate is 1 time per second.
[0038] Preferably, the initial similarity tolerance threshold is the product of a preset coefficient and the standard deviation of each utilization rate in the utilization rate sequence; the value range of the preset coefficient is [0.10, 0.25].
[0039] Preferably, the value range of the threshold is [0.7, 0.8].
[0040] The beneficial effects are as follows:
[0041] The solution of the present invention obtains an improved similarity tolerance threshold by introducing the degree of noise interference, which can avoid the problem that the Chebyshev distance between two subsequences is too large due to noise interference, affecting the accuracy of the calculated sample entropy, and further can accurately judge the abnormal situation of the operating state of the digital controller. Moreover, by comparing the sample entropy of the utilization rate sequence at any moment and its previous moment and the mean value of the corresponding utilization rate sequence, the abnormal degree of the utilization rate at any moment can be obtained, and further the real-time monitoring of the operating state of the digital controller can be realized. Description of the Drawings
[0042] Figure 1 is a step flowchart of the method for monitoring the operating state of the digital controller according to the embodiment of the present invention. Detailed Embodiment
[0043] The embodiments described below with reference to the drawings are exemplary and are intended to explain the present invention and should not be construed as limiting the present invention.
[0044] As Figure 1 shown, the present invention provides a method for monitoring the operating state of a digital controller, including the following steps:
[0045] S1. Obtain the utilization rate of the digital controller at different times.
[0046] In this step, the utilization rate reflects the degree to which the digital controller is occupied by the program within a period of time, indicating the workload situation within a certain time period. The more complex the change of the utilization rate within a period of time, the more it indicates The greater the possibility of abnormal utilization, the greater the possibility of potential risks in the digital controller and the higher the possibility of failure. Utilization rate is calculated and analyzed to monitor the operating status of the digital controller.
[0047] It can be obtained by inputting corresponding instructions through the operating system of the digital controller. Utilization rate. The operating system of the digital controller is System, you can enter " "or" "Command to view Of course, the operating system of the digital controller can also be system. The collection frequency of utilization is 1 time per second. Of course, the collection frequency can be adjusted as needed.
[0048] S2, use the sample entropy algorithm to calculate any moment and its previous moment The sample entropy of the utilization sequence, The utilization sequence is the preset time before the corresponding moment. Utilization rate.
[0049] In this step, the sample entropy algorithm belongs to the prior art and is a method for measuring the complexity of time series. The complexity of a time series is evaluated by calculating the probability of a new pattern in the time series. The higher the sample entropy, the higher the complexity of the time series, and the greater the possibility that the time series contains abnormal data. Therefore, the sample entropy algorithm can be used to calculate the probability of a new pattern in a time series. The sample entropy of utilization rate reflects the size of sample entropy during that period of time. The complexity of utilization rate. When the sample entropy is greater than the set value, it is considered that the The utilization rate contains abnormal data, which enables the operating status of the digital controller to be monitored.
[0050] The sample entropy algorithm is used to calculate the corresponding time The specific steps of utilizing the sample entropy of the rate sequence are as follows:
[0051] S21, based on Utilize the rate sequence to obtain multiple subsequences of preset length;
[0052] In this step, the preset duration is set to Seconds, that is The utilization sequence is before any time Seconds Utilization. The preset length is set to , that is, the subsequence includes continuous moment Utilization rate. From the utilization rate sequence, sub - sequences can be obtained. Among them, can be set to 150, can be set to 20. Of course, the preset duration and preset length can be adjusted according to needs.
[0053] S22. Calculate the Chebyshev distance between any sub - sequence and the sub - sequence groups formed by the remaining sub - sequences, obtain the ratio of the number of sub - sequence groups with Chebyshev distance less than the corresponding improved similarity tolerance threshold to the total number of sub - sequence groups, and calculate the average value of all sub - sequence corresponding ratios as the similarity average value.
[0054] In this application, the sub - sequence group is composed of any two equal - length sub - sequences in the utilization rate sequence, and the sub - sequence is composed of utilization rates at consecutive moments.
[0055] The purpose of this step is to calculate the similarity average value between sub - sequences with a preset length of in the utilization rate sequence, and specifically includes the following steps:
[0056] S221. Calculate the Chebyshev distance between any sub - sequence and the sub - sequence groups formed by the remaining sub - sequences.
[0057] Among them, the Chebyshev distance is the maximum value of the absolute values of the differences between the corresponding utilization rates of the two sub - sequences in the sub - sequence group, representing the maximum distance between the two sub - sequences.
[0058] S222. Obtain the ratio of the number of sub - sequence groups with Chebyshev distance less than the corresponding improved similarity tolerance threshold to the total number of sub - sequence groups. This step also includes the following steps:
[0059] S2221. Obtain the initial similarity tolerance threshold.
[0060] In the prior art, the initial similarity tolerance threshold is an empirical value, generally taking 0.10 to 0.25 times the standard deviation of each utilization rate in the utilization rate sequence. Preferably, in this application, the initial similarity tolerance threshold is 0.20 times the standard deviation of each utilization rate in the utilization rate sequence.
[0061] If the Chebyshev distance between the two sub - sequences in the sub - sequence group is less than the initial similarity tolerance threshold, it is considered that the similarity between the two sub - sequences in the sub - sequence group is relatively high. However, in an industrial environment, there are noises such as electromagnetic interference and mechanical vibration, which will affect the normal acquisition of the utilization rate, resulting in the acquired The utilization rate is inaccurate. Due to the existence of noise, the degree of chaos of the utilization rate in the subsequence increases, which in turn makes the Chebyshev distance between two subsequences in the calculated subsequence group too large, resulting in the Chebyshev distance being greater than the initial similarity tolerance threshold. The sample entropy algorithm will consider that the similarity between the two subsequences in the subsequence group is low. That is to say, in the prior art, due to the existence of noise, the calculation of the Chebyshev distance between two subsequences in the subsequence group will be affected, and finally the calculation result of the sample entropy is inaccurate, and the operation state monitoring of the digital controller cannot be well realized. The reason for the above problem is noise interference. Therefore, an improved similarity tolerance threshold can be obtained according to the degree of noise interference of the subsequence group to solve the problem of inaccurate sample entropy calculation.
[0062] S2222. Obtain the degree of noise interference of the subsequence group.
[0063] The degree of noise interference is positively correlated with the prominence of the subsequence group and negatively correlated with the correlation between the utilization rate and the corresponding traffic data of the subsequence. It can be understood that the greater the prominence of the subsequence group, the greater the influence of noise interference on the subsequence group, and the greater the degree of noise interference of the subsequence group. In addition, some real large utilization rates and those affected by noise interference will be relatively similar. Then, these real large utilization rates will also cause a large degree of noise interference during calculation, and cannot truly reflect the influence of noise interference, resulting in inaccurate calculation results. And there is a strong correlation between the utilization rate and the corresponding traffic data. This is because when the traffic data increases, these traffic data need to be processed, including receiving, parsing, protocol processing, encryption / decryption, etc. of the traffic data, and the corresponding utilization rate will also increase accordingly. Therefore, when there is a strong correlation between the utilization rate and the corresponding traffic data, it indicates that the high utilization rate is caused by a large amount of processed traffic data, which is real data and not caused by noise interference. Therefore, the corresponding degree of noise interference is also smaller. Therefore, this step also needs to obtain the prominence of the subsequence group and the correlation between the utilization rate of the subsequence and the corresponding traffic data. Specifically, this step further includes the following steps:
[0064] First, obtain the prominence of the subsequence group.
[0065] The prominence degree is positively correlated with the Chebyshev distance between two subsequences in a subsequence group, negatively correlated with the mean value of the Chebyshev distances of all subsequence groups, and negatively correlated with the average distance of the subsequence group. Among them, the average distance is the mean value of the absolute values of the utilization rate differences corresponding to two subsequences in the subsequence group. This is because the larger the Chebyshev distance between two subsequences, the farther the distance between the two subsequences, and the more prominent the corresponding subsequence group. Specifically, the prominence degree is: wherein the mean value of the absolute values of the utilization rate differences. This is because the larger the Chebyshev distance between two subsequences, the farther the distance between the two subsequences, and the more prominent the corresponding subsequence group. Specifically, the prominence degree is:
[0066] ;
[0067] In the formula, is the prominence degree of the th moment in the utilization rate sequence for the th subsequence group, is the Chebyshev distance between two subsequences in the th moment in the utilization rate sequence for the th subsequence group, is the average distance of the th moment in the utilization rate sequence for the th subsequence group, is the total number of subsequence groups in the th moment in the utilization rate sequence, is the standard normalization function.
[0068] In this step, each subsequence is continuously obtained by sliding a sliding window with a preset length on the utilization rate sequence with a step size of 1. The first subsequence and the second subsequence form the first subsequence group, and the first subsequence and the third subsequence form the second subsequence group,..., and the first subsequence and the th subsequence form the th subsequence group. The second subsequence and the first subsequence form the th subsequence group, and the second subsequence and the third subsequence form the th subsequence group,..., and the th subsequence and the th subsequence form the th subsequence group. Then, in the th subsequence group, . In this application, the definitions of subsequences at other positions and the th subsequence group are the same as those here.
[0069] In this step, the prominence of the subsequence group is characterized not only by the difference between the Chebyshev distance of two subsequences in the subsequence group and the average distance of the subsequence group, but also by the difference between the Chebyshev distance of two subsequences in the subsequence group and the mean value of the Chebyshev distances of all subsequence groups to represent the credibility. This can take into account the situations of other subsequence groups, prevent the influence caused by accidental errors, and make the calculation results more accurate.
[0070] Secondly, obtain the utilization rate and the correlation of the corresponding traffic data.
[0071] The higher the correlation between the utilization rate and the corresponding traffic data, the more similar the change trends of the two sets of data. In this step, the smaller the difference between the corresponding moments of the maximum value of the utilization rate and the maximum value of the corresponding traffic data, the smaller the difference between the number of extreme points of the utilization rate and the number of extreme points of the corresponding traffic data, indicating that the change trends of the utilization rate and the corresponding traffic data are more similar, and the higher the correlation between the two. Specifically, the correlation is:
[0072] ;
[0073] In the formula, is the correlation between the utilization rate of the subsequence group and the corresponding traffic data at the th moment in the th subsequence group in the utilization rate sequence, is the time difference between the maximum value of the utilization rate and the maximum value of the corresponding traffic data in the subsequence group at the th moment in the utilization rate sequence, is the absolute value of the difference between the number of extreme points of the utilization rate and the number of extreme points of the corresponding traffic data in the subsequence group at the th moment in the is a preset parameter, is the exponential function with the natural constant as the base. Among them, the purpose of setting the preset parameter is to prevent and One of the data is 0, which affects the calculation of the other data.
[0074] In this step, by calculating the difference between the time corresponding to the maximum value of the utilization rate and the time corresponding to the maximum value of the corresponding flow data, and the difference between the number of extreme points of the utilization rate and the number of extreme points of the corresponding flow data in the subsequence, it can reflect the similarity of the change trends of the utilization rate and the corresponding flow data, and further characterize the correlation between the two. In some alternative embodiments, the correlation can also be represented by the Pearson correlation coefficient between the utilization rate of the subsequence and the corresponding flow data. Specifically, the correlation is:
[0075] In some alternative embodiments, the correlation can also be represented by the Pearson correlation coefficient between the utilization rate of the subsequence and the corresponding flow data. Specifically, the correlation is:
[0076] ;
[0077] In the formula, is the correlation between the utilization rate of the subsequence in the subsequence group and the corresponding flow data at the th time in the utilization rate sequence of the subsequence group, is the utilization rate of the subsequence in the subsequence group at the th time in the utilization rate sequence of the subsequence group, is the corresponding flow data of the subsequence in the subsequence group at the th time in the utilization rate sequence of the subsequence group, and
[0078] is the Pearson correlation coefficient function.
[0079] In some other alternative embodiments, the correlation can also be calculated by using the algorithm between the utilization rate of the subsequence and the corresponding flow data. The algorithm (Dynamic Time Warping) is an algorithm for calculating the similarity of two time series. It finds the optimal alignment path through dynamic programming to calculate the "distance" between the two sequences.
[0080] Finally, obtain the noise interference degree of the subsequence group.
[0081] The degree of noise interference is:
[0082] ;
[0083] In the formula, is the degree of noise interference of the th subsequence group in the utilization rate sequence at the th moment, is the degree of prominence of the th subsequence group in the utilization rate sequence at the th moment, is the correlation between the th subsequence in the th subsequence group in the utilization rate sequence at the th moment and the corresponding flow data, is the exponential function with the natural constant as the base In this step, the degree of noise interference of the subsequence group is characterized not only by the degree of prominence of the subsequence group, but also corrected by the correlation between the utilization rate of the subsequences in the subsequence group and the corresponding flow data, so that the calculation result is more accurate and can avoid the problem that a relatively large true utilization rate is misjudged as being affected by noise interference due to the increase in flow data, resulting in an overestimated calculated degree of noise interference.
[0084]
[0085]
[0086] S2223. Obtain the improved similarity tolerance threshold.
[0087]
[0088] The improved similarity tolerance threshold is positively correlated with both the initial similarity tolerance threshold and the degree of noise interference of the subsequence group. This is because the greater the degree of noise interference of the subsequence group, the larger the calculation result of the Chebyshev distance between the two subsequences in the subsequence group. In order to prevent it from being greater than the initial similarity tolerance threshold due to noise interference, it is necessary to increase the initial similarity tolerance threshold to obtain the improved similarity tolerance threshold. Specifically, the improved similarity tolerance threshold is:
[0087] ;
[0088] In the formula, is the improved similarity tolerance threshold of the th subsequence group in the utilization rate sequence at the th moment, is the th moment, The noise interference degree of the th subsequence group in the utilization rate sequence, is the initial similarity tolerance threshold, and
[0089] is the standard normalization function.
[0090] In this step, by using the initial similarity tolerance threshold and the noise interference degree of the subsequence group, the improved similarity tolerance threshold corresponding to the subsequence group is obtained. Since the improved similarity tolerance threshold adaptively increases relative to the initial similarity tolerance threshold, it can solve the problem that the Chebyshev distance between two subsequences in the subsequence group is too large due to noise interference, making the final sample entropy calculation accurate.
[0091] S2224. Calculate the ratio of the number of subsequence groups with a Chebyshev distance less than the corresponding improved similarity tolerance threshold to the total number of subsequence groups, and calculate the mean value of the corresponding ratios of all subsequences as the similarity mean value.
[0092] ;
[0093] In the formula, is the th moment of the similarity mean value of all subsequences with a preset length of in the utilization rate sequence, is the th moment of the ratio of the number of the th subsequence with a preset length of in the utilization rate sequence to the number of subsequence groups whose Chebyshev distance from the remaining subsequences is less than the corresponding improved similarity tolerance threshold, is the total number of subsequence groups, is the length of the utilization rate sequence, which is also the preset duration in step S21.
[0094] S23. Obtain multiple subsequences with a preset length plus 1 again, and repeat step S22.
[0095] In this step, with as the new preset length of the subsequence, step S22 is executed again, and can be obtained, that is, the th moment of the similarity mean value of all subsequences with a preset length of in the utilization rate sequence. The calculation process of this step is the same as that of step S22 and will not be elaborated here.
[0096] S24, taking the difference between the natural logarithm of the mean of multiple subsequences of the preset length and the natural logarithm of the mean of multiple subsequences of the preset length plus 1 as the corresponding Sample entropy of the utilization series.
[0097] Then the sample entropy is:
[0098] ;
[0099] In the formula, For the of the moment The sample entropy of the utilization sequence, For the of the moment The preset length of the utilization sequence is The similarity mean of all subsequences of For the of the moment The preset length of the utilization sequence is The similarity mean of all subsequences of The natural constant The logarithmic function of the base.
[0100] The sample entropy calculated in this step represents the of the moment The complexity of the utilization sequence. If the complexity is greater than the threshold, it means that the There are abnormal data in the utilization sequence, but it is impossible to locate the time when the abnormal data occurs, so the abnormality cannot be discovered in time, resulting in late reporting. Therefore, it is also necessary to determine the The abnormal degree of utilization rate makes it easy to detect abnormalities in time.
[0101] S3, calculate any moment The abnormal degree of utilization. When the abnormal degree is greater than the threshold, the If there is an abnormality in utilization, an alarm will be issued and the corresponding equipment will be controlled to stop running.
[0102] The degree of abnormality is the difference between any moment and the previous moment. The normalized difference between the sample entropy of the utilization sequence and the value corresponding to any moment and the previous moment The product of the normalized values of the difference in the mean of the utilization sequence. Specifically, the abnormality degree is:
[0103] ;
[0104] In the formula, For the of the moment The degree of abnormal utilization, is the sample entropy of the utilization rate sequence at the th moment, and is the sample entropy of the utilization rate sequence at the th moment, and is the mean value of each utilization rate in the utilization rate sequence at the th moment, and is the mean value of each utilization rate in the utilization rate sequence at the th moment, and is the standard normalization function.
[0105] In this step, by calculating the difference between the sample entropy of the utilization rate sequence at any moment and that at its previous moment, it can reflect whether there is a mutation in the utilization rate sequence at the corresponding moment. The greater the difference between the sample entropies of the two, the greater the mutation. To reflect whether the mutation is an increase or a decrease, then according to the difference between the mean values of each utilization rate in the utilization rate sequence at any moment and that at its previous moment, a judgment is made. The greater the difference between the mean values of the two, the greater the mutation of increase. Through the calculation formula of the abnormal degree, the abnormal degree of the utilization rate at any moment can be obtained. utilization rate in the utilization rate sequence at any moment and that at its previous moment, a judgment is made. The greater the difference between the mean values of the two, the greater the mutation of increase. Through the calculation formula of the abnormal degree, the abnormal degree of the utilization rate at any moment can be obtained.
[0106] The value range of the threshold is [0.7, 0.8]. Preferably, the value of the threshold is 0.75. Of course, the size of the threshold can also be adjusted as needed.
[0107] In this step, when it is determined that there is an abnormality in the utilization rate, by alarming and controlling the corresponding device to stop running, it can remind the staff to check in time, ensure production safety, and prevent safety accidents from occurring. The corresponding device is the device controlled by the digital controller.
[0108] In the method for monitoring the running state of the digital controller of the present invention, by calculating the prominence degree of the subsequence group in the utilization rate sequence, the utilization rate of the subsequence, and the correlation between the corresponding flow data, the noise interference degree is obtained, and then the improved similarity tolerance threshold is obtained, which can avoid the problem that the Chebyshev distance between two subsequences in the subsequence group is too large due to noise interference, thereby affecting the accuracy of the sample entropy, making the final calculation of the sample entropy accurate, and then accurately judging the abnormal situation of the running state of the digital controller. Moreover, by comparing the sample entropy of the utilization rate sequence at any moment and that at its previous moment By obtaining the mean of the utilization rate sequence, the degree of abnormality of the utilization rate can be determined at any given moment, and whether the utilization rate is abnormal can be used to monitor the operating state of the digital controller in real time, promptly detect abnormal situations, and avoid late reporting.
[0109] Although this specification has shown and described multiple embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many variations, modifications, and alternative forms will occur to those skilled in the art without departing from the spirit and scope of the present invention. It should be understood that various alternatives to the embodiments of the present invention described herein may be employed in practicing the present invention.
Claims
1. A method for monitoring the operating state of a digital controller, characterized in that, It includes the following steps: Obtain the utilization rates of the digital controller at different times; calculate the sample entropy of the utilization rate sequence at any time and its previous time using the sample entropy algorithm, where the utilization rate sequence is the utilization rate within a preset time length before the corresponding time; among them, the sample entropy algorithm includes an improved similarity tolerance threshold, which is positively correlated with the initial similarity tolerance threshold and the noise interference degree of the subsequence group; the subsequence group includes any two subsequences of equal length in the utilization rate sequence; the noise interference degree is positively correlated with the prominence degree of the subsequence group and negatively correlated with the correlation between the utilization rate and the corresponding flow data of the subsequence; the prominence degree is positively correlated with the Chebyshev distance between the two subsequences in the subsequence group, negatively correlated with the mean value of the Chebyshev distances of all subsequence groups, and negatively correlated with the average distance of the subsequence group; the average distance is the mean value of the absolute values of the differences in the utilization rates corresponding to the two subsequences in the subsequence group. Calculate the abnormal degree of utilization rate at any moment. When the abnormal degree is greater than the threshold, it is determined that the utilization rate at this moment is abnormal, and an alarm is issued and the corresponding device is controlled to stop running. Among them, the abnormal degree is the value obtained by normalizing the difference between the sample entropy of the utilization rate sequences at any moment and its previous moment and the value obtained by normalizing the difference between the means of the utilization rate sequences corresponding to any moment and its previous moment multiplied by each other; Calculating the sample entropy of the CPU utilization rate sequence at the corresponding moment by using the sample entropy algorithm includes the following steps: Based on the CPU utilization rate sequence, obtaining multiple subsequences with a preset length; Calculating the Chebyshev distance between any subsequence and the subsequence group formed by the remaining subsequences, obtaining the ratio of the number of subsequence groups with the Chebyshev distance less than the corresponding improved similarity tolerance threshold to the total number of subsequence groups, and calculating the mean value of the corresponding ratios of all subsequences as the similarity mean; Obtaining multiple subsequences with a length of the preset length plus 1 again, and repeating the previous step; Taking the difference between the natural logarithm of the similarity mean of multiple subsequences with a preset length and the natural logarithm of the similarity mean of multiple subsequences with a length of the preset length plus 1 as the sample entropy of the CPU utilization rate sequence.
2. The method for monitoring the operating state of a digital controller according to claim 1, characterized in that, The improved similarity tolerance threshold is: ; In the formula, is the improved similarity tolerance threshold of the th subsequence group in the utilization rate sequence at the th moment, is the degree of noise interference of the th subsequence group in the utilization rate sequence at the th moment, is the initial similarity tolerance threshold, is the standard normalization function.
3. The method for monitoring the operating state of a digital controller according to claim 1, characterized in that The degree of noise interference is: ; In the formula, is the degree of noise interference of the th subsequence group in the utilization rate sequence at the th moment, is the prominence degree of the th subsequence group in the utilization rate sequence at the th moment, is the correlation between the th subsequence group and the th subsequence in the utilization rate sequence at the th moment, and the corresponding traffic data, is the th subsequence in the th subsequence group in the utilization rate sequence at the th moment, is an exponential function with the natural constant as the base.
4. The method for monitoring the operating state of a digital controller according to claim 1, characterized in that The degree of prominence is: ; In the formula, is the prominence of the th subsequence group in the utilization rate sequence at the th moment, is the Chebyshev distance between two subsequences in the th subsequence group in the utilization rate sequence at the th moment, is the average distance of the th subsequence group in the utilization rate sequence at the th moment, is the total number of subsequence groups in the utilization rate sequence at the th moment, is the th moment, is the total number of subsequence groups in the utilization rate sequence, is the standard normalization function.
5. The method for monitoring the operating state of a digital controller according to claim 1, characterized in that The correlation is: ; Wherein, is the correlation between the utilization rate and the corresponding traffic data of the nth subsequence in the mth subsequence group in the utilization rate sequence at the kth moment; is the time difference between the moment of the maximum value of the utilization rate and the moment of the maximum value of the corresponding traffic data of the nth subsequence in the mth subsequence group in the utilization rate sequence at the kth moment; is the absolute value of the difference between the number of extreme points of the utilization rate and the number of extreme points of the corresponding traffic data of the nth subsequence in the mth subsequence group in the utilization rate sequence at the kth moment; is a preset parameter; is an exponential function with the natural constant e as the base. 6. The method for monitoring the operating state of the digital controller according to claim 1, wherein The correlation is: ; In the formula, is the correlation between the utilization rate and the corresponding traffic data of the nth sub-sequence group in the utilization rate sequence at the mth sub-sequence, is the utilization rate of the nth sub-sequence group in the utilization rate sequence at the mth sub-sequence, is the traffic data corresponding to the nth sub-sequence group in the utilization rate sequence at the mth sub-sequence, and is the Pearson correlation coefficient function.
7. The method for monitoring the operating state of a digital controller according to claim 1, characterized in that, The collection frequency of the utilization rate is once per second.
8. The method for monitoring the operating state of a digital controller according to claim 1, characterized in that, The initial similarity tolerance threshold is the product of a preset coefficient and each standard deviation of the utilization rates in the utilization rate sequence; the value range of the preset coefficient is [0.10, 0.25].
9. The method for monitoring the operating state of a digital controller according to claim 1, characterized in that, The value range of the threshold is [0.7, 0.8].
Citation Information
Patent Citations
Tool damage monitoring method based on numerical control machine tool spindle load signal
CN113909997A
Wind speed prediction method and system based on CEEMD-SE-EWT double decomposition and ARIMA combined prediction
CN117633446A