Abnormal data discrimination method and device based on time series data analysis
By calculating neighborhood difference factor and adaptive smoothing parameters, combined with the mutual influence of phosphate concentration and temperature, the problem of low discrimination accuracy of abnormal data in traditional time series data analysis is solved, and higher discrimination accuracy is achieved.
Patent Information
- Application Number
- CN202510812695.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-06-18
AI Technical Summary
Traditional timing data analysis methods have low accuracy in the judgment of abnormal data, and are easily affected by environmental noise, resulting in large errors.
By calculating the degree of differential fluctuation, smoothing parameters and smoothing weights of neighborhood difference factors, initial segmentation points, and reference factor segments, we obtain adaptive smoothing parameters, and combine the mutual influence relationship between phosphate concentration and temperature to improve the accuracy of abnormal data judgment.
It improves the accuracy of abnormal data judgment, can better reflect the impact of multiple dimensions and data change trends, and reduces errors.
Smart Images

Figure CN120337103A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and device for discriminating abnormal data based on time series data analysis, belonging to the field of time series data analysis. Background Art
[0002] Time series data refers to a series of data points arranged in chronological order, which are usually collected at equal time intervals. Time series data analysis and prediction methods and systems have been widely applied in many fields, such as economic forecasting, weather forecasting, stock market analysis, energy demand forecasting, etc. With the rapid development of computer technology, time series data analysis and prediction have become a research hotspot.
[0003] Traditional methods usually use EWMA (Exponentially Weighted Moving-Average) to determine the smoothing coefficient for the mean of operation data in different time periods, and then perform real-time monitoring according to the smoothing coefficient. This method is easily affected by environmental noise, resulting in the smoothing coefficient determined by the traditional method not being able to well combine the changes in operation data, leading to a decrease in its accuracy and a large error in the final discrimination result of abnormal data. Summary of the Invention
[0004] The purpose of the present invention is to provide a method and device for discriminating abnormal data based on time series data analysis, so as to solve the problem of low accuracy in discriminating abnormal data in the prior art.
[0005] To achieve the above purpose, the present invention is implemented by adopting the following technical solutions:
[0006] In the first aspect, the present invention provides a method for discriminating abnormal data based on time series data analysis, including:
[0007] Obtain a phosphate concentration time series and a temperature time series whose collection time of the last data is the current moment, and the collection time of the phosphate concentration in the phosphate concentration time series corresponds one-to-one with the collection time of the temperature in the temperature time series;
[0008] Calculate a number of neighborhood difference factors according to the differences between adjacent phosphate concentrations in the phosphate concentration time series and adjacent temperatures in the temperature time series, arrange all the neighborhood difference factors into a neighborhood difference factor time series, calculate a number of initial segmentation points according to the change trends of the neighborhood difference factors before and after the neighborhood difference factors in the neighborhood difference factor time series, and divide the neighborhood difference factor time series into a number of reference factor segments according to the initial segmentation points;
[0009] Calculate the difference fluctuation degree of each reference factor segment according to the change differences between different neighborhood difference factors in the reference factor segment. Calculate the initial smoothing parameter of each reference factor segment according to the proportion of the difference fluctuation degree between the reference factor segment and the overall reference factor segment. Calculate the smoothing contribution degree of each reference factor segment according to the difference of the difference fluctuation degree between the reference factor segment and the overall reference factor segment and the length of the reference factor segment. Calculate the smoothing weight of each reference factor segment according to the proportion of the smoothing contribution degree between the reference factor segment and the overall reference factor segment. Calculate the adaptive smoothing parameter of the neighborhood difference factor time series according to the initial smoothing parameter and the smoothing weight;
[0010] Calculate the predicted value of the neighborhood difference factor according to the adaptive smoothing parameter, calculate the abnormal difference value based on the predicted value. If the abnormal difference value is greater than the preset fourth threshold, the phosphate concentration and temperature at the current moment are abnormal data.
[0011] Furthermore, calculate several neighborhood difference factors according to the difference situation between adjacent phosphate concentrations in the phosphate concentration time series and adjacent temperatures in the temperature time series, through the following formula:
[0012] ;
[0013] Wherein, represents the neighborhood difference factor between the th phosphate concentration and the th phosphate concentration, represents the th phosphate concentration, represents the th phosphate concentration, represents the th temperature, represents the th temperature, represents a preset hyperparameter, represents taking the absolute value.
[0014] Furthermore, calculate several initial segmentation points according to the change trend of the neighborhood difference factors before and after the neighborhood difference factor in the neighborhood difference factor time series, through the following method:
[0015] The data segment formed by all neighborhood difference factors between the neighborhood difference factor and the first neighborhood difference factor is denoted as the pre-neighborhood factor segment of the neighborhood difference factor. The data segment formed by the T1 neighborhood difference factors after the neighborhood difference factor is denoted as the post-neighborhood factor segment of the neighborhood difference factor. If the number of remaining neighborhood difference factors after the neighborhood difference factor is less than T1, the data segment formed by the remaining neighborhood difference factors after the neighborhood difference factor is denoted as the post-neighborhood factor segment of the neighborhood difference factor, where T1 is a preset first threshold.
[0016] Calculate the initial segmentation factor of the neighborhood difference factor through the following formula:
[0017] ;
[0018] Where represents the initial segmentation factor of the neighborhood difference factor, represents the mean value of all neighborhood difference factors in the pre-neighborhood factor segment of the neighborhood difference factor, represents the mean value of all neighborhood difference factors in the post-neighborhood factor segment of the neighborhood difference factor, represents the absolute value of the difference between the maximum neighborhood difference factor and the minimum neighborhood difference factor in the pre-neighborhood factor segment of the neighborhood difference factor, represents the absolute value of the difference between the maximum neighborhood difference factor and the minimum neighborhood difference factor in the post-neighborhood factor segment of the neighborhood difference factor, represents the DTW distance between the pre-neighborhood factor segment and the post-neighborhood factor segment of the neighborhood difference factor, represents taking the absolute value;
[0019] Obtain the initial segmentation factors of all neighborhood difference factors and perform linear normalization. Denote each linearly normalized initial segmentation factor as the initial segmentation degree.
[0020] Traverse all neighborhood difference factors until stopping traversing when encountering a neighborhood difference factor with an initial segmentation degree greater than T2 for the first time. Denote this neighborhood difference factor as an initial segmentation point, and denote the time series formed by all neighborhood difference factors after this initial segmentation point as the time series of factors to be processed for segmentation, where T2 is a preset second threshold.
[0021] In the time series of factors to be processed for segmentation, take the initial segmentation point that is before the neighborhood difference factor and closest to it in distance as the reference factor. Denote the data segment formed by all neighborhood difference factors between this reference factor and this neighborhood difference factor as the pre-segmentation neighborhood segment of this neighborhood difference factor. Then calculate the segmentation degree of the neighborhood difference factor through the following formula:
[0022] ;
[0023] Among them, represents the segmentation degree of the neighborhood difference factor, represents the mean value of all neighborhood difference factors in the pre-segmentation neighborhood segment of the neighborhood difference factor, represents the absolute value of the difference between the maximum neighborhood difference factor and the minimum neighborhood difference factor in the pre-segmentation neighborhood segment of the neighborhood difference factor, represents the DTW distance between the pre-segmentation neighborhood segment and the post-neighborhood factor segment of the neighborhood difference factor;
[0024] Record the neighborhood difference factors with a segmentation degree greater than T3 as the initial segmentation points, and obtain several initial segmentation points, where T3 is the preset third threshold;
[0025] Said dividing the neighborhood difference factor time series into several reference factor segments according to the initial segmentation points includes: recording the data segment composed of all neighborhood difference factors between any two adjacent initial segmentation points as the reference factor segment.
[0026] Furthermore, calculating the difference fluctuation degree of each reference factor segment according to the change difference between different neighborhood difference factors in the reference factor segment is carried out through the following formula:
[0027] ;
[0028] Among them, represents the difference fluctuation degree of the reference factor segment, represents the maximum value of all neighborhood difference factors in the reference factor segment, represents the minimum value of all neighborhood difference factors in the reference factor segment, represents the number of neighborhood difference factors in the reference factor segment, represents the th neighborhood difference factor in the reference factor segment, represents the mean value of all neighborhood difference factors in the reference factor segment, represents the th neighborhood difference factor in the reference factor segment, represents the th neighborhood difference factor in the reference factor segment, represents taking the absolute value.
[0029] Furthermore, calculating the initial smoothing parameter of each reference factor segment according to the proportion of the difference fluctuation degree between the reference factor segment and the overall reference factor segment is carried out through the following formula:
[0030] ;
[0031] Among them, represents the initial smoothing parameter of the reference factor segment, Indicates the degree of differential fluctuation of the reference factor segment, Indicates the number of reference factor segments, Indicates the Degree of differential fluctuation of the th reference factor segment.
[0032] Furthermore, the smooth contribution degree of each reference factor segment is calculated according to the difference in the degree of differential fluctuation between the reference factor segment and the overall reference factor segment and the length of the reference factor segment, through the following formula:
[0033] ;
[0034] Wherein, Indicates the smooth contribution degree of the reference factor segment, Indicates the initial smoothing parameter of the reference factor segment, Indicates the mean value of the initial smoothing parameters of all reference factor segments, Indicates the number of neighborhood difference factors in the reference factor segment, Indicates the exponential function with the natural constant as the base.
[0035] Furthermore, the smooth weight of each reference factor segment is calculated according to the proportion of the smooth contribution degree between the reference factor segment and the overall reference factor segment, through the following formula:
[0036] ;
[0037] Wherein, Indicates the smooth weight of the reference factor segment, Indicates the smooth contribution degree of the reference factor segment, Indicates the number of reference factor segments, Indicates the Degree of smooth contribution of the th reference factor segment.
[0038] Furthermore, the adaptive smoothing parameter of the neighborhood difference factor time series is calculated according to the initial smoothing parameter and the smooth weight, through the following formula:
[0039] ;
[0040] In the formula, Indicates the adaptive smoothing parameter of the neighborhood difference factor time series, Indicates the number of reference factor segments, Indicates the Initial smoothing parameter of the th reference factor segment, Indicates the Smooth weight of the th reference factor segment.
[0041] Further, calculating the anomaly difference value based on the predicted value includes: using the absolute value of the difference between the predicted value of the neighborhood difference factor and the neighborhood difference factor as the anomaly difference value.
[0042] In a second aspect, the present invention provides an abnormal data discrimination device based on time series data analysis, including:
[0043] A time series data acquisition module, configured to: acquire a phosphate concentration time series and a temperature time series whose acquisition times of the last data are both the current moment, and the acquisition times of the phosphate concentration in the phosphate concentration time series and the acquisition times of the temperature in the temperature time series correspond one by one;
[0044] A reference factor segment division module, configured to: calculate a plurality of neighborhood difference factors according to the differences between adjacent phosphate concentrations in the phosphate concentration time series and between adjacent temperatures in the temperature time series, arrange all the neighborhood difference factors into a neighborhood difference factor time series, calculate a plurality of initial segmentation points according to the change trends of the neighborhood difference factors before and after the neighborhood difference factors in the neighborhood difference factor time series, and divide the neighborhood difference factor time series into a plurality of reference factor segments according to the initial segmentation points;
[0045] An adaptive smoothing parameter calculation module, configured to: calculate the difference fluctuation degree of each reference factor segment according to the change differences between different neighborhood difference factors in the reference factor segment, calculate the initial smoothing parameter of each reference factor segment according to the proportion of the difference fluctuation degree between the reference factor segment and the overall reference factor segment, calculate the smoothing contribution degree of each reference factor segment according to the difference between the difference fluctuation degrees of the reference factor segment and the overall reference factor segment and the length of the reference factor segment, calculate the smoothing weight of each reference factor segment according to the proportion of the smoothing contribution degree between the reference factor segment and the overall reference factor segment, and calculate the adaptive smoothing parameter of the neighborhood difference factor time series according to the initial smoothing parameter and the smoothing weight;
[0046] An abnormal data discrimination module, configured to: calculate the predicted value of the neighborhood difference factor according to the adaptive smoothing parameter, calculate the anomaly difference value based on the predicted value, and if the anomaly difference value is greater than a preset fourth threshold, the phosphate concentration and temperature at the current moment are abnormal data.
[0047] Compared with the prior art, the beneficial effects achieved by the present invention are:
[0048] An abnormal data discrimination method and device based on time series data analysis provided by the present invention calculate initial segmentation points, and at the same time combine the mutual influence relationship between phosphate root concentration and temperature, which better reflects the influence of multiple dimensions on data; by calculating the initial smoothing parameter, it better reflects the importance of temperature and phosphate root concentration in the reference factor segment for the subsequent abnormal data discrimination result; by combining the extreme difference situation, continuous trend difference situation and the influence degree of local data on the overall data segment in different reference factor segments, the initial smoothing parameter and smoothing weight are obtained, and the adaptive smoothing parameter is comprehensively analyzed according to the initial smoothing parameter and smoothing weight to improve the accuracy of abnormal data discrimination. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flowchart of an abnormal data discrimination method based on time series data analysis corresponding to Embodiment 1. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0050] The present invention will be further described below with reference to the drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and cannot be used to limit the protection scope of the present invention.
[0051] Embodiment 1
[0052] As Figure 1 shown, this embodiment provides an abnormal data discrimination method based on time series data analysis, including:
[0053] Obtain a phosphate root concentration time series and a temperature time series whose collection time of the last data is the current moment, and the collection time of the phosphate root concentration in the phosphate root concentration time series corresponds one by one to the collection time of the temperature in the temperature time series;
[0054] Calculate a number of neighborhood difference factors according to the difference situation between adjacent phosphate root concentrations in the phosphate root concentration time series and adjacent temperatures in the temperature time series, arrange all the neighborhood difference factors into a neighborhood difference factor time series, calculate a number of initial segmentation points according to the change trend of the neighborhood difference factors before and after the neighborhood difference factors in the neighborhood difference factor time series, and divide the neighborhood difference factor time series into several reference factor segments according to the initial segmentation points;
[0055] Calculate the difference fluctuation degree of each reference factor segment according to the change differences between different neighborhood difference factors in the reference factor segment. Calculate the initial smoothing parameter of each reference factor segment according to the proportion of the difference fluctuation degree between the reference factor segment and the overall reference factor segment. Calculate the smoothing contribution degree of each reference factor segment according to the difference in the difference fluctuation degree between the reference factor segment and the overall reference factor segment and the length of the reference factor segment. Calculate the smoothing weight of each reference factor segment according to the proportion of the smoothing contribution degree between the reference factor segment and the overall reference factor segment. Calculate the adaptive smoothing parameter of the neighborhood difference factor time series according to the initial smoothing parameter and the smoothing weight.
[0056] Calculate the predicted value of the neighborhood difference factor according to the adaptive smoothing parameter, calculate the abnormal difference value based on the predicted value. If the abnormal difference value is greater than the preset fourth threshold, the phosphate concentration and temperature at the current moment are abnormal data.
[0057] The present invention calculates the initial segmentation points, and at the same time combines the mutual influence relationship between the phosphate concentration and the temperature, which better reflects the influence of multiple dimensions on the data. By calculating the initial smoothing parameter, it better reflects the importance of the temperature and phosphate concentration in the reference factor segment to the subsequent abnormal data discrimination result. By combining the extreme difference situation, continuous trend difference situation and the influence degree of local data on the overall data segment in different reference factor segments, the initial smoothing parameter and the smoothing weight are obtained, and the adaptive smoothing parameter is comprehensively analyzed according to the initial smoothing parameter and the smoothing weight to improve the accuracy of abnormal data discrimination.
[0058] Embodiment 2
[0059] In this embodiment, the synthesis scenario of iron phosphate is taken as an example. Iron phosphate is an important chemical substance and is used in many fields. In order to ensure the quality of iron phosphate products, it is necessary to monitor and analyze the operation data generated during the synthesis process of iron phosphate. The traditional method usually uses EWMA (Exponentially Weighted Moving-Average) to determine the smoothing coefficient for the mean of the operation data in different time periods, and then performs real-time monitoring according to the smoothing coefficient to achieve the discrimination of abnormal data. However, during the synthesis process of iron phosphate, the content of iron ions, phosphate ions and iron phosphate, as well as the environmental temperature, will have a great impact on the generated operation data, and the influence of the corresponding concentration and environmental temperature changes on the operation data is relatively complex, resulting in that the traditionally determined smoothing coefficient cannot well combine the change situation of the operation data, resulting in a reduction in its accuracy and a large error in the final monitoring and discrimination results. Therefore, this embodiment provides an abnormal data discrimination method based on time series data analysis.
[0060] This embodiment provides an abnormal data discrimination method based on time series data analysis, and its specific implementation includes the following steps:
[0061] Step S001: Collect the phosphate ion concentration time series and the temperature time series.
[0062] Install the temperature sensor and the ion-selective electrode in an empty synthesis pool in advance. Pour the solutions with iron oxyhydroxide and phosphate ion concentration of into the synthesis pool respectively. Record the temperature displayed on the temperature sensor every 1 second, and record the phosphate ion concentration displayed on the measuring instrument of the ion-selective electrode every 1 second for a total of 10 minutes. Each recorded phosphate ion concentration corresponds to a temperature recorded at the same time. Arrange all the recorded phosphate ion concentrations in ascending order of the recording time, and denote the arranged time series as the phosphate ion concentration time series. Arrange all the recorded temperatures in ascending order of the recording time, and denote the arranged time series as the temperature time series. Additionally, it should be noted that this embodiment takes the phosphate ion concentration of , a recording interval of 1 second, and a total recording duration of 10 minutes as an example for description. This embodiment does not specifically limit the concentration and volume of the single phosphate ion-containing solution, the recording interval, and the total recording duration. The recording interval and the total recording duration can be determined according to the specific implementation situation. Thus, the phosphate ion concentration time series and the temperature time series are obtained through the above method.
[0063] Step S002: Obtain a number of neighborhood difference factors based on the differences between adjacent phosphate ion concentrations in the phosphate ion concentration time series and adjacent temperatures in the temperature time series. Arrange all the neighborhood difference factors in ascending order of the recording time, and denote the arranged time series as the neighborhood difference factor time series. Obtain a number of initial segmentation points based on the change trends of the neighborhood difference factors within the front and back ranges of the neighborhood difference factors. Divide the neighborhood difference factor time series into several reference factor segments according to the initial segmentation points.
[0064] Step S002 is specifically implemented through the following steps:
[0065] In the actual process of synthesizing iron phosphate, the synthesis rate of iron phosphate is usually controlled by controlling the temperature and the content of raw materials for iron phosphate synthesis. Since the molecular structure of iron phosphate itself is not completely stable and temperature affects the activity of different molecules, a small part of the synthesized iron phosphate will decompose into raw materials during synthesis. Therefore, the synthesis process of iron phosphate is actually in a relatively dynamic equilibrium state, and the corresponding temperature and phosphate root concentration will fluctuate up and down within a certain range. Since different temperatures, different concentrations of phosphate roots, and iron phosphate will all affect its synthesis rate, the corresponding temperature and phosphate root concentration generally maintain good regularity within a small range. To reduce the error of monitoring and discrimination results, in this embodiment, by combining the changes in temperature and phosphate root concentration in different ranges, a neighborhood difference factor that can characterize the data of the main influencing dimension is obtained, and segmentation is performed according to the change trend before and after the neighborhood difference factor for subsequent analysis and processing.
[0066] The neighborhood difference factor is calculated by the following method: According to the difference between the th phosphate root concentration and the th phosphate root concentration, and the difference between the th temperature and the th temperature, calculate the neighborhood difference factor between the th phosphate root concentration and the th phosphate root concentration. Among them, the neighborhood difference factor between the th phosphate root concentration and the th phosphate root concentration is calculated by the following formula:
[0067] ;
[0068] Wherein, represents the neighborhood difference factor between the th phosphate root concentration and the th phosphate root concentration, represents the th phosphate root concentration, represents the th phosphate root concentration, represents the th temperature, represents the th temperature, represents a preset hyperparameter. In this embodiment, is preset to prevent the denominator from being 0, represents taking the absolute value. Among them, the neighborhood difference factor between the th phosphate root concentration and the th phosphate root concentration The larger it is, the more it indicates the The phosphate root concentration and the The more obvious the change trend difference between the phosphate root concentration and the temperature is between adjacent moments corresponding to the phosphate root concentration of the th phosphate root concentration and the th phosphate root concentration, the more likely it is that the th phosphate root concentration and the th phosphate root concentration do not belong to the same data segment, and the greater the formation rate of iron phosphate. Calculate the neighborhood difference factor of any two phosphate root concentrations, and poll all combinations of any two phosphate root concentrations until all neighborhood difference factors are calculated.
[0069] Arrange all the neighborhood difference factors in ascending order of the recording time, and the arranged time series is denoted as the neighborhood difference factor time series. Preset a number T1 of neighborhood difference factors. In this embodiment, T1 = 9 is taken as an example for description, and this embodiment is not specifically limited, and T1 can be determined according to specific implementation situations; taking any one neighborhood difference factor in the neighborhood difference factor time series as an example, the data segment composed of all neighborhood difference factors between the neighborhood difference factor and the first neighborhood difference factor is denoted as the pre-neighborhood factor segment of the neighborhood difference factor, and the data segment composed of the next T1 neighborhood difference factors after the neighborhood difference factor is denoted as the post-neighborhood factor segment of the neighborhood difference factor. Among them, if the number of remaining neighborhood difference factors after the neighborhood difference factor is less than the preset T1, then the data segment composed of the remaining neighborhood difference factors after the neighborhood difference factor is denoted as the post-neighborhood factor segment of the neighborhood difference factor; the pre-neighborhood factor segment of the first neighborhood difference factor is default to have only the first neighborhood difference factor.
[0070] Obtain the initial segmentation factor of the neighborhood difference factor according to the pre-neighborhood factor segment and the post-neighborhood factor segment of the neighborhood difference factor. Among them, the initial segmentation factor of the neighborhood difference factor is calculated by the following formula:
[0071] ;
[0072] Among them, represents the initial segmentation factor of the neighborhood difference factor, represents the mean value of all neighborhood difference factors in the pre-neighborhood factor segment of the neighborhood difference factor, represents the mean value of all neighborhood difference factors in the post-neighborhood factor segment of the neighborhood difference factor, represents the absolute value of the difference between the maximum neighborhood difference factor and the minimum neighborhood difference factor in the pre-neighborhood factor segment of the neighborhood difference factor, represents the absolute value of the difference between the maximum neighborhood difference factor and the minimum neighborhood difference factor in the post-neighborhood factor segment of the neighborhood difference factor, represents the DTW (Dynamic Time Warping) distance between the pre-neighborhood factor segment and the post-neighborhood factor segment of the neighborhood difference factor, It represents taking the absolute value. Among them, the larger the initial segmentation factor of the neighborhood difference factor, the more obvious the change in the neighborhood difference factors before and after this neighborhood difference factor, and the greater the possibility that this neighborhood difference factor is used as the first segmentation point. Obtain the initial segmentation factors of all neighborhood difference factors, perform linear normalization on all initial segmentation factors, and record each linearly normalized initial segmentation factor as the initial segmentation degree. It should be noted that the acquisition of the DTW distance is well-known content of the DTW dynamic time warping algorithm, which will not be elaborated in this embodiment.
[0073] Preset an initial segmentation degree threshold T2. In this embodiment, T2 = 0.7 is taken as an example for description, and this embodiment does not make specific limitations. T2 can be determined according to specific implementation situations; take the first neighborhood difference factor in the neighborhood difference factor time series as the starting point, with a step size of 1, and start traversing all neighborhood difference factors until the traversal stops when the initial segmentation degree of a neighborhood difference factor is greater than T2 for the first time, and record this neighborhood difference factor as an initial segmentation point, and record the time series composed of all neighborhood difference factors after this initial segmentation point as the time series of the to-be-processed segmented factor.
[0074] In the time series of the to-be-processed segmented factor, take each neighborhood difference factor as an example in turn. Take the initial segmentation point that is closest to this neighborhood difference factor and before it as the reference factor, and record the data segment composed of all neighborhood difference factors between this reference factor and this neighborhood difference factor as the pre-segmentation neighborhood segment of this neighborhood difference factor. Obtain the segmentation degree of this neighborhood difference factor according to the pre-segmentation neighborhood segment and the post-neighborhood factor segment of this neighborhood difference factor. The segmentation degree of the neighborhood difference factor is calculated by the following formula:
[0075] ;
[0076] Among them, represents the segmentation degree of the neighborhood difference factor, represents the mean value of all neighborhood difference factors in the pre-segmentation neighborhood segment of the neighborhood difference factor, represents the mean value of all neighborhood difference factors in the post-neighborhood factor segment of the neighborhood difference factor, represents the absolute value of the difference between the maximum neighborhood difference factor and the minimum neighborhood difference factor in the pre-segmentation neighborhood segment of the neighborhood difference factor, represents the absolute value of the difference between the maximum neighborhood difference factor and the minimum neighborhood difference factor in the post-neighborhood factor segment of the neighborhood difference factor, represents the DTW distance between the pre-segmentation neighborhood segment and the post-neighborhood factor segment of the neighborhood difference factor, It represents taking the absolute value. Among them, the greater the degree of segmentation of the neighborhood difference factor, the more obvious the change in the neighborhood difference factors before and after this neighborhood difference factor, indicating that the possibility of this neighborhood difference factor being used as a subsequent segmentation point is greater.
[0077] Preset a segmentation degree threshold T3. In this embodiment, T3 = 20 is taken as an example for description, and this embodiment does not make specific limitations, where T3 can be determined according to specific implementation situations; mark the neighborhood difference factors with a segmentation degree greater than T3 as initial segmentation points, and so on, to obtain all initial segmentation points. Denote the data segment formed by all neighborhood difference factors between any two adjacent initial segmentation points as a reference factor segment.
[0078] Thus, all reference factor segments are obtained through the above method.
[0079] Step S003: Obtain the difference fluctuation degree of each reference factor segment according to the change differences between different neighborhood difference factors in the reference factor segment; obtain the initial smoothing parameter of each reference factor segment according to the proportion of the difference fluctuation degree between the reference factor segment and the overall reference factor segment; obtain the smoothing contribution degree of each reference factor segment according to the difference in the difference fluctuation degree between the reference factor segment and the overall reference factor segment and the length of the reference factor segment; obtain the smoothing weight of each reference factor segment according to the proportion of the smoothing contribution degree between the reference factor segment and the overall reference factor segment; obtain the adaptive smoothing parameter of the neighborhood difference factor time series according to the initial smoothing parameter and the smoothing weight.
[0080] After segmenting the neighborhood difference factor time series to obtain different reference factor segments, the traditional EWMA (Exponentially Weighted Moving Average) algorithm usually directly uses the mean value within different data segments to determine the smoothing parameter; while in the iron phosphate synthesis scenario of this embodiment, due to the complex influence of the changes in concentration and environmental temperature on subsequent data, the smoothing parameter determined simply by using the mean value is obviously insufficient to handle the complex influence relationships in the scenario; for this reason, in this embodiment, by combining the extreme difference situations, continuous trend difference situations within different reference factor segments, and the influence degree of local data on the overall data segment, the initial smoothing parameter and the smoothing weight are obtained, and the adaptive smoothing parameter is comprehensively analyzed according to the initial smoothing parameter and the smoothing weight for subsequent abnormal monitoring and analysis processing.
[0081] Taking any one reference factor segment as an example, obtain the difference fluctuation degree of this reference factor segment according to the change differences between different neighborhood difference factors in this reference factor segment. Among them, the difference fluctuation degree of the reference factor segment is calculated by the following formula:
[0082] ;
[0083] Among them, Indicates the degree of differential fluctuation of the reference factor segment. Represents the maximum value of all neighborhood differential factors in the reference factor segment. Represents the minimum value of all neighborhood differential factors in the reference factor segment. Represents the number of neighborhood differential factors in the reference factor segment. Represents the th neighborhood differential factor in the reference factor segment. Represents the mean value of all neighborhood differential factors in the reference factor segment. Represents the th neighborhood differential factor in the reference factor segment. Represents the th neighborhood differential factor in the reference factor segment. Represents taking the absolute value. Among them, the greater the degree of differential fluctuation of the reference factor segment, the more drastic the changes in temperature and phosphate concentration within the reference factor segment.
[0084] Obtain the degree of differential fluctuation of all reference factor segments. Taking any one reference factor segment as an example, obtain the initial smoothing parameter of the reference factor segment according to the degree of differential fluctuation of all reference factor segments. The initial smoothing parameter of the reference factor segment is calculated by the following formula:
[0085] ;
[0086] Among them, Represents the initial smoothing parameter of the reference factor segment. Represents the degree of differential fluctuation of the reference factor segment. Represents the number of reference factor segments. Represents the th degree of differential fluctuation of the reference factor segment. Among them, the greater the initial smoothing parameter of the reference factor segment, the greater the error caused by the temperature and phosphate concentration within the reference factor segment to the subsequent monitoring and abnormal data discrimination results.
[0087] Obtain the initial smoothing parameters of all reference factor segments. Taking any one reference factor segment as an example, obtain the smoothing contribution degree of the reference factor segment according to the initial smoothing parameters of all reference factor segments. The smoothing contribution degree of the reference factor segment is calculated by the following formula:
[0088] ;
[0089] Among them, Represents the smoothing contribution degree of the reference factor segment. Represents the initial smoothing parameter of the reference factor segment. Represents the mean value of the initial smoothing parameters of all reference factor segments. Represents the number of neighborhood differential factors in the reference factor segment. represents the exponential function with the natural constant as the base; in this embodiment, functions are used to present the inverse proportional relationship and normalization processing. Implementers can select the inverse proportional function and normalization function according to the actual situation. Among them, the greater the smooth contribution degree of the reference factor segment, the closer the change trend of the reference factor segment is to the overall change trend of the neighborhood difference factor sequence.
[0090] Obtain the smooth contribution degree of all reference factor segments. Taking any one reference factor segment as an example, obtain the smooth weight of this reference factor segment according to the smooth contribution degree of all reference factor segments. The smooth weight of the reference factor segment is calculated by the following formula:
[0091] ;
[0092] Among them, represents the smooth weight of the reference factor segment, represents the smooth contribution degree of the reference factor segment, represents the number of reference factor segments, represents the th smooth contribution degree of the reference factor segment. Among them, the greater the smooth weight of the reference factor segment, the greater the importance of the temperature and phosphate concentration in this reference factor segment to the subsequent monitoring and abnormal data discrimination results.
[0093] Obtain the smooth weights of all reference factor segments. Obtain the adaptive smooth parameter of the neighborhood difference factor time series according to the initial smooth parameters and smooth weights of all reference factor segments. The adaptive smooth parameter of the neighborhood difference factor time series is calculated by the following formula:
[0094] ;
[0095] Among them, represents the adaptive smooth parameter of the neighborhood difference factor time series, represents the number of reference factor segments, represents the th initial smooth parameter of the reference factor segment, represents the th smooth weight of the reference factor segment.
[0096] So far, the adaptive smooth parameter of the neighborhood difference factor time series is obtained through the above method.
[0097] Step S004, perform abnormal data discrimination on the phosphate concentration and temperature according to the adaptive smooth parameter.
[0098] The temperature and phosphate root concentration collected are updated in real time. Based on the latest temperature and phosphate root concentration, the latest neighborhood difference factor is obtained. According to the latest neighborhood difference factor, the time series of neighborhood difference factors is updated in real time. The adaptive smoothing parameter of the latest neighborhood difference factor time series is obtained, and the latest adaptive smoothing parameter is used as the smoothing parameter. Based on the smoothing parameter, the predicted value of the latest neighborhood difference factor is obtained. The absolute value of the difference between the predicted value of the latest neighborhood difference factor and the latest neighborhood difference factor is used as the abnormal difference value. A threshold T4 for the abnormal difference value is preset. In this embodiment, T4 = 0.3 is taken as an example for description, and this embodiment does not make specific limitations. T4 can be determined according to specific implementation situations. If the abnormal difference value is greater than T4, the latest temperature and phosphate root concentration are recorded as abnormal data, and the monitoring device is warned. The process of obtaining the predicted value based on the smoothing parameter is the known content of the EWMA exponentially weighted moving average algorithm, which will not be elaborated in this embodiment.
[0099] Through the above steps, the abnormal data discrimination method based on time series data analysis is completed.
[0100] Embodiment 3
[0101] The present invention provides an abnormal data discrimination device based on time series data analysis, including:
[0102] A time series data acquisition module, configured to: acquire a phosphate root concentration time series and a temperature time series whose collection time of the last data is the current moment, and the collection time of the phosphate root concentration in the phosphate root concentration time series corresponds one by one to the collection time of the temperature in the temperature time series;
[0103] A reference factor segment division module, configured to: calculate a number of neighborhood difference factors according to the differences between adjacent phosphate root concentrations in the phosphate root concentration time series and adjacent temperatures in the temperature time series, arrange all the neighborhood difference factors into a neighborhood difference factor time series, calculate a number of initial segmentation points according to the change trends of the neighborhood difference factors before and after the neighborhood difference factors in the neighborhood difference factor time series, and divide the neighborhood difference factor time series into a number of reference factor segments according to the initial segmentation points;
[0104] An adaptive smoothing parameter calculation module, configured to: calculate the difference fluctuation degree of each reference factor segment according to the change difference between different neighborhood difference factors in the reference factor segment, calculate the initial smoothing parameter of each reference factor segment according to the proportion of the difference fluctuation degree between the reference factor segment and the overall reference factor segment, calculate the smoothing contribution degree of each reference factor segment according to the difference between the difference fluctuation degree between the reference factor segment and the overall reference factor segment and the length of the reference factor segment, calculate the smoothing weight of each reference factor segment according to the proportion of the smoothing contribution degree between the reference factor segment and the overall reference factor segment, and calculate the adaptive smoothing parameter of the neighborhood difference factor time series according to the initial smoothing parameter and the smoothing weight;
[0105] An abnormal data discrimination module, configured to: calculate the predicted value of the neighborhood difference factor according to the adaptive smoothing parameter, calculate the abnormal difference value based on the predicted value, and if the abnormal difference value is greater than a preset fourth threshold, the phosphate concentration and temperature at the current moment are abnormal data.
[0106] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
[0107] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for realizing the functions specified in Figure 1 one or more of the processes and / or blocks Figure 1 one or more of the blocks.
[0108] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device realizes the functions specified in Figure 1 one or more of the processes and / or blocks Figure 1 one or more of the blocks.
[0109] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are executed on the computer or other programmable apparatus to generate a computer-implemented process, thereby the instructions executed on the computer or other programmable apparatus provide steps for realizing the functions specified in one process or a plurality of processes and / or one block or a plurality of blocks in the flow Figure 1 one process or a plurality of processes and / or Figure 1 steps of the functions specified in one block or a plurality of blocks.
[0110] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the technical principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the protection scope of the present invention.
Claims
1. An abnormal data discrimination method based on time series data analysis, characterized in that, Including: Obtain the phosphate ion concentration time series and temperature time series where the acquisition time of the last data is the current moment, and the acquisition time of the phosphate ion concentration in the phosphate ion concentration time series corresponds one-to-one with the acquisition time of the temperature in the temperature time series; Calculate a number of neighborhood difference factors based on the differences between adjacent phosphate ion concentrations in the phosphate ion concentration time series and adjacent temperatures in the temperature time series, arrange all the neighborhood difference factors into a neighborhood difference factor time series, calculate a number of initial segmentation points based on the change trends of the neighborhood difference factors before and after the neighborhood difference factors in the neighborhood difference factor time series, and divide the neighborhood difference factor time series into a number of reference factor segments according to the initial segmentation points; Calculate the difference fluctuation degree of each reference factor segment according to the change differences between different neighborhood difference factors in the reference factor segment, calculate the initial smoothing parameter of each reference factor segment according to the proportion of the difference fluctuation degree between the reference factor segment and the overall reference factor segment, calculate the smoothing contribution degree of each reference factor segment according to the difference in the difference fluctuation degree between the reference factor segment and the overall reference factor segment and the length of the reference factor segment, calculate the smoothing weight of each reference factor segment according to the proportion of the smoothing contribution degree between the reference factor segment and the overall reference factor segment, and calculate the adaptive smoothing parameter of the neighborhood difference factor time series according to the initial smoothing parameter and the smoothing weight; Calculate the predicted value of the neighborhood difference factor according to the adaptive smoothing parameter, calculate the abnormal difference value based on the predicted value, and if the abnormal difference value is greater than a preset fourth threshold, the phosphate ion concentration and temperature at the current moment are abnormal data.
2. The abnormal data discrimination method based on time series data analysis according to claim 1, characterized in that The calculation of a number of neighborhood difference factors according to the differences between adjacent phosphate ion concentrations in the phosphate ion concentration time series and adjacent temperatures in the temperature time series is carried out through the following formula: ; Among them, represents the neighborhood difference factor between the -th phosphate root concentration and the -th phosphate root concentration, represents the -th phosphate root concentration, represents the phosphate root concentration, represents the -th temperature, represents the -th temperature, represents a preset hyperparameter, represents taking the absolute value.
3. The abnormal data discrimination method based on time series data analysis according to claim 1, wherein The calculation of a number of initial segmentation points according to the change trends of the neighborhood difference factors before and after the neighborhood difference factors in the neighborhood difference factor time series is carried out through the following method: Denote the data segment composed of all neighborhood difference factors between the neighborhood difference factor and the first neighborhood difference factor as the pre-neighborhood factor segment of the neighborhood difference factor, and denote the data segment composed of the T1 neighborhood difference factors after the neighborhood difference factor as the post-neighborhood factor segment of the neighborhood difference factor. If the number of remaining neighborhood difference factors after the neighborhood difference factor is less than T1, then denote the data segment composed of the remaining neighborhood difference factors after the neighborhood difference factor as the post-neighborhood factor segment of the neighborhood difference factor, where T1 is a preset first threshold; Calculate the initial segmentation factor of the neighborhood difference factor through the following formula: ; Among them, represents the initial segmentation factor of the neighborhood difference factor, represents the mean value of all neighborhood difference factors in the pre-neighborhood factor segment of the neighborhood difference factor, represents the mean value of all neighborhood difference factors in the post-neighborhood factor segment of the neighborhood difference factor, represents the absolute value of the difference between the maximum neighborhood difference factor and the minimum neighborhood difference factor in the pre-neighborhood factor segment of the neighborhood difference factor, represents the absolute value of the difference between the maximum neighborhood difference factor and the minimum neighborhood difference factor in the post-neighborhood factor segment of the neighborhood difference factor, represents the DTW distance between the pre-neighborhood factor segment and the post-neighborhood factor segment of the neighborhood difference factor, represents taking the absolute value; Obtain the initial segmentation factors of all neighborhood difference factors and perform linear normalization, and denote each linearly normalized initial segmentation factor as the initial segmentation degree; Traverse all the neighborhood difference factors until the traversal stops when the initial segmentation degree greater than T2 first appears for a neighborhood difference factor, and denote this neighborhood difference factor as an initial segmentation point, and denote the time series composed of all neighborhood difference factors after this initial segmentation point as the to-be-processed segmentation factor time series, where T2 is a preset second threshold; In the time series of segmentation factors to be processed, the initial segmentation point that is before the neighborhood difference factor and closest to the neighborhood difference factor in terms of distance is used as the reference factor. The data segment composed of all neighborhood difference factors between the reference factor and the neighborhood difference factor is denoted as the pre-segmentation neighborhood segment of the neighborhood difference factor. Then, the segmentation degree of the neighborhood difference factor is calculated through the following formula: ; Among them, represents the segmentation degree of the neighborhood difference factor, represents the mean value of all neighborhood difference factors in the pre-segmented neighborhood segment of the neighborhood difference factor, represents the absolute value of the difference between the maximum neighborhood difference factor and the minimum neighborhood difference factor in the pre-segmented neighborhood segment of the neighborhood difference factor, represents the DTW distance between the pre-segmented neighborhood segment and the post-neighborhood factor segment of the neighborhood difference factor; The neighborhood difference factors with a segmentation degree greater than T3 are denoted as initial segmentation points, obtaining several initial segmentation points, where T3 is a preset third threshold; Said dividing the neighborhood difference factor time series into several reference factor segments according to the initial segmentation points, including: denoting the data segment composed of all neighborhood difference factors between any two adjacent initial segmentation points as a reference factor segment.
4. The abnormal data discrimination method based on time series data analysis according to claim 1, characterized in that, Said calculating the difference fluctuation degree of each reference factor segment according to the change differences between different neighborhood difference factors in the reference factor segment, through the following formula: ; Among them, represents the difference fluctuation degree of the reference factor segment, represents the maximum value of all neighborhood difference factors in the reference factor segment, represents the minimum value of all neighborhood difference factors in the reference factor segment, represents the number of neighborhood difference factors in the reference factor segment, represents the th neighborhood difference factor in the reference factor segment, represents the mean value of all neighborhood difference factors in the reference factor segment, represents the th neighborhood difference factor in the reference factor segment, represents the th neighborhood difference factor in the reference factor segment, represents taking the absolute value.
5. The abnormal data discrimination method based on time series data analysis according to claim 1, characterized in that Said calculating the initial smoothing parameter of each reference factor segment according to the proportion of the difference fluctuation degree between the reference factor segment and the overall reference factor segment, through the following formula: ; Among them, represents the initial smoothing parameter of the reference factor segment, represents the degree of differential fluctuation of the reference factor segment, represents the number of reference factor segments, represents the degree of differential fluctuation of the 6. The abnormal data discrimination method based on time series data analysis according to claim 1, wherein Said calculating the smoothing contribution degree of each reference factor segment according to the difference in the difference fluctuation degree between the reference factor segment and the overall reference factor segment and the length of the reference factor segment, through the following formula: ; Among them, represents the smoothing contribution degree of the reference factor segment, represents the initial smoothing parameter of the reference factor segment, represents the mean value of the initial smoothing parameters of all reference factor segments, represents the number of neighborhood difference factors in the reference factor segment, represents the exponential function with the natural constant as the base.
7. The abnormal data discrimination method based on time series data analysis according to claim 1, characterized in that Said calculating the smoothing weight of each reference factor segment according to the proportion of the smoothing contribution degree between the reference factor segment and the overall reference factor segment, through the following formula: ; Among them, represents the smoothing weight of the reference factor segment, represents the smoothing contribution degree of the reference factor segment, represents the number of reference factor segments, represents the smoothing contribution degree of the 8. The method for discriminating abnormal data based on time series data analysis according to claim 1, wherein Said calculating the adaptive smoothing parameter of the neighborhood difference factor time series according to the initial smoothing parameter and the smoothing weight, through the following formula: ; In the formula, represents the adaptive smoothing parameter of the neighborhood difference factor time series, represents the number of reference factor segments, represents the initial smoothing parameter of the th reference factor segment, and represents the smoothing weight of the th reference factor segment.
9. The abnormal data discrimination method based on time series data analysis according to claim 1, characterized in that Said calculating the abnormal difference value based on the predicted value, including: taking the absolute value of the difference between the predicted value of the neighborhood difference factor and the neighborhood difference factor as the abnormal difference value.
10. An abnormal data discrimination device based on time series data analysis, characterized in that, Including: A time series data acquisition module, configured to: acquire a phosphate concentration time series and a temperature time series whose acquisition times of the last data are both the current moment, and the acquisition times of the phosphate concentration in the phosphate concentration time series and the acquisition times of the temperature in the temperature time series correspond one by one; A reference factor segment division module, configured to: calculate several neighborhood difference factors according to the differences between adjacent phosphate concentrations in the phosphate concentration time series and adjacent temperatures in the temperature time series, arrange all the neighborhood difference factors into a neighborhood difference factor time series, calculate several initial segmentation points according to the change trends of the neighborhood difference factors before and after the neighborhood difference factors in the neighborhood difference factor time series, and divide the neighborhood difference factor time series into several reference factor segments according to the initial segmentation points; An adaptive smoothing parameter calculation module, configured to: calculate the difference fluctuation degree of each reference factor segment according to the change difference between different neighborhood difference factors in the reference factor segment, calculate the initial smoothing parameter of each reference factor segment according to the proportion of the difference fluctuation degree between the reference factor segment and the overall reference factor segment, calculate the smoothing contribution degree of each reference factor segment according to the difference of the difference fluctuation degree between the reference factor segment and the overall reference factor segment and the length of the reference factor segment, calculate the smoothing weight of each reference factor segment according to the proportion of the smoothing contribution degree between the reference factor segment and the overall reference factor segment, and calculate the adaptive smoothing parameter of the neighborhood difference factor time series according to the initial smoothing parameter and the smoothing weight; An abnormal data discrimination module, configured to: calculate the predicted value of the neighborhood difference factor according to the adaptive smoothing parameter, calculate the abnormal difference value based on the predicted value, and if the abnormal difference value is greater than a preset fourth threshold, the phosphate concentration and temperature at the current moment are abnormal data.
Citation Information
Patent Citations
Abnormity detection method and device, equipment and computer readable storage medium
CN112101554A
Temperature sensor data abnormity processing method for moxibustion therapeutic instrument
CN118121487A
VAE and association difference-based multivariate time series data anomaly detection method
CN119783010A
Water conservancy project frequency converter state detection method and system
CN120103036A
Lithium battery data acquisition anomaly identification method and system, storage medium and device
WO2024212403A1