Abnormality detection and prediction method and system for SOC module of environmental sanitation equipment
By combining the mixed abnormality detection method of VARIMA and GBDT models, the abnormality detection problem of SOC module data collection of sanitation equipment is solved, the stable operation of the equipment and resource optimization are achieved, and the continuity and intelligence level of sanitation services are improved.
Patent Information
- Application Number
- CN202510501645.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-08-01
AI Technical Summary
Data acquisition of SOC modules in sanitation equipment faces the difficulties of abnormal detection caused by harsh external environment conditions and internal hardware aging or software failures. Traditional methods are difficult to adapt to the complex operating mode changes of the equipment, resulting in unstable equipment operation and waste of resources.
A hybrid anomaly detection method combined with VARIMA model and GBDT model is adopted to build an adaptive anomaly detection and early warning mechanism through time window feature engineering, multivariate time series analysis and continuous learning, and combine real-time monitoring and multi-level early warning systems to ensure the stable operation of the equipment.
Accurate abnormal detection and prediction of SOC modules of sanitation equipment is realized, the stability and reliability of the equipment are improved, the risk of equipment downtime and energy consumption is reduced, resource allocation is optimized, and equipment upgrades and intelligent management is supported.
Smart Images

Figure CN120408444A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of intelligent environmental sanitation, and specifically relates to a method and system for abnormal detection and prediction of the SOC module of environmental sanitation equipment. Background Art
[0002] With the increasing widespread application of intelligent devices in the field of environmental sanitation, such as intelligent trash cans, garbage collection vehicles, etc., these devices are usually equipped with solar cells or other types of rechargeable batteries for power supply. To ensure the continuous and stable operation of these devices, it is crucial to accurately monitor and manage the battery's state of charge. However, in practical applications, due to the particularity and complexity of the operation of environmental sanitation equipment, the data acquisition of the SOC module faces a series of challenges.
[0003] Environmental sanitation equipment is often deployed in outdoor environments, which means they must withstand the influence of various harsh weather conditions, such as high temperature, low temperature, humidity, dryness, and strong winds. Due to the above-mentioned external factors, combined with reasons such as internal hardware aging or software failures, abnormal situations are prone to occur in the data acquisition process of the SOC module. For example, sensor readings may have instantaneous fluctuations due to sudden temperature changes; or there may be long-term measurement deviations due to component damage on the circuit board. If such abnormal data is not processed, it will seriously affect the assessment of the battery's health status and ultimately affect the normal operation of the equipment.
[0004] In addition, the working mode of environmental sanitation equipment is not static, but shows a certain periodicity and randomness with factors such as seasons and holidays. Taking garbage collection as an example, summer may be the peak period of garbage generation, while winter is relatively low; and during certain specific festivals, the amount of garbage will suddenly increase. This non-linear trend change poses a huge challenge to traditional anomaly detection methods based on fixed rules because they are difficult to adapt to rapidly changing workload patterns. Given the importance of environmental sanitation services and their impact on the quality of urban life, any equipment downtime caused by technical problems will bring inconvenience and even losses. Therefore, developing an efficient and reliable anomaly detection and prediction mechanism not only helps improve the working efficiency and service level of individual devices, but also can optimize the allocation of environmental sanitation resources in the entire city and reduce unnecessary energy consumption.
[0005] In summary, in the field of environmental sanitation, in view of the many challenges faced by the data acquisition of the SOC module, it is necessary to develop a method and system for abnormal detection and prediction of the SOC module of environmental sanitation equipment. Summary of the Invention
[0006] The purpose of the present invention is to provide a method and system for abnormal detection and prediction of the SOC module of environmental sanitation equipment, which can achieve more accurate abnormal detection and prediction to ensure the stability and reliability of the system.
[0007] In a first aspect, the method for detecting and predicting anomalies in the SOC module of sanitation equipment according to the present invention includes the following steps:
[0008] Data collection and processing step: Collect historical data from the SOC module of sanitation equipment, where the historical data includes voltage, current, and temperature parameters; clean the original data, remove significantly incorrect data points, and reasonably fill in missing values; perform time window feature engineering processing on the cleaned data, specifically including: defining a time window with a preset length, summarizing the data within each time window into a new feature vector, extracting statistical features from each time window, and introducing seasonal factors;
[0009] VARIMA model construction step: Use the preprocessed data and the constructed time window feature vectors to train a VARIMA model to simulate the changing trend of SOC module data over time; select the optimal (p, d, q) parameter combination according to the AIC / BIC criterion, where p is the autoregressive term, q is the moving average term, and d is the difference order, ensuring that the model is neither overfitted nor underfitted;
[0010] GBDT model construction step: Use the residual between the prediction result of the VARIMA model and the actual observation value as a new target variable, and use the GBDT model to mine the non-linear relationship in the residual; during the GBDT training process, adopt a cross-validation strategy to optimize the hyperparameters to ensure that the GBDT model has good generalization ability;
[0011] Anomaly detection and warning mechanism step: Combine the prediction results of the VARIMA model and the GBDT model, set a threshold, and trigger an alarm when the prediction error exceeds the set threshold, indicating that an abnormal situation may exist; combine with a real-time monitoring interface to allow operators to view abnormal alarm information in a timely manner and take corresponding measures;
[0012] Continuous learning and adaptive adjustment step: Regularly update the parameters of the VARIMA model and the GBDT model to adapt to new operating environments and condition changes; at the same time, automatically adjust the anomaly detection threshold according to new data to ensure its sensitivity and accuracy.
[0013] Optionally, the data cleaning step includes setting a reasonable range, determining a reasonable interval for each parameter according to the battery technical specifications, and filtering data points outside the reasonable interval.
[0014] Optionally, the missing value processing step uses the linear interpolation method, that is, based on the time series characteristics, the missing values are filled using the linear relationship between the two adjacent known data points.
[0015] Optionally, the statistical features include single-parameter statistical features, parameter correlation features, and dynamic change features; among them,
[0016] Single-parameter statistical features include mean, variance, and maximum and minimum difference. The mean represents the average value of all observations in each time window; the variance represents the degree of dispersion between observations in each time window; and the maximum and minimum difference represents the gap between the highest and lowest values in each time window.
[0017] The correlation characteristics between the parameters include Pearson correlation coefficient and mutual information;
[0018] The dynamic change characteristics include sliding average.
[0019] Optionally, the seasonal factor characteristics are defined according to the periodicity of the sanitation equipment usage pattern.
[0020] Optionally, in the VARIMA model construction step, the ADF test method is used to determine whether the time series is stationary, and the optimal (p, d, q) parameter combination is selected based on the ACF graph and the PACF graph.
[0021] Optionally, in the GBDT model construction step, mean square error is used as a loss function to evaluate the GBDT model performance and guide the gradient descent process, and a cross-validation strategy is used to optimize hyperparameters.
[0022] Optionally, in the anomaly detection and early warning mechanism step, a standard score, absolute error or relative error is selected as an indicator to measure the size of the prediction error, and a corresponding threshold is set to trigger an alarm.
[0023] Optionally, in the continuous learning and adaptive adjustment step, a sliding window technique is used to periodically recalculate the mean and standard deviation of historical residuals to maintain the timeliness of the threshold, and to adjust the model structure or parameters in a targeted manner according to the error analysis results.
[0024] In the second aspect, the present invention provides a sanitation equipment SOC module abnormality detection and prediction system, comprising a memory and a controller, wherein the memory stores a computer-readable program, and when the computer-readable program is called by the controller, it can execute the steps of the sanitation equipment SOC module abnormality detection and prediction method as described in the present invention.
[0025] Beneficial effects of the present invention:
[0026] (1) Accurately capture nonlinear trends over long time spans and improve anomaly detection capabilities:
[0027] By combining the autoregressive integrated moving average model (VARIMA model) with the gradient boosting decision tree model (GBDT model) and innovatively introducing "time window feature engineering", the present invention effectively solves the problem of insufficient capture of non-linear trends by traditional anomaly detection methods over a long time span. The VARIMA model is good at dealing with the long-term dependence and seasonal characteristics of time series data, while the GBDT algorithm enhances the modeling ability for complex non-linear relationships through ensemble learning. The combination of the two enables the system to accurately identify abnormal fluctuations in the SOC module data, such as instantaneous reading deviations and long-term measurement errors caused by external environments (high temperature, low temperature, humidity, etc.) or internal hardware aging and software failures, significantly improving the accuracy and reliability of anomaly detection.
[0028] (2) Adaptive complex working mode to solve the limitations of traditional methods:
[0029] Through the dynamic modeling of the time series trend by VARIMA and the flexible learning of non-linear relationships by GBDT in the present invention, it can adapt to the data characteristics under different working scenarios, quickly capture non-linear changes such as the peak garbage period in summer or the sudden increase in garbage volume during holidays, effectively avoiding the problems of missed detection or false detection caused by rigid rules of traditional methods, and ensuring the stable operation of the equipment under complex working conditions.
[0030] (3) Enhance system robustness and reduce the risk of downtime:
[0031] The anomaly detection and prediction mechanism of the present invention can monitor the SOC module data in real time, early warn of potential faults such as abnormal sensor readings and damaged circuit board components, so as to take maintenance measures in time to avoid equipment downtime caused by technical problems. This ability significantly improves the system robustness of sanitation equipment, reduces service interruptions caused by equipment failures, and ensures the continuity and stability of urban sanitation services.
[0032] (4) Optimize resource allocation and reduce energy consumption:
[0033] Through the accurate prediction of the SOC module data, the present invention can plan the power demand and charging plan of the equipment in advance, avoiding equipment shutdown caused by insufficient power or energy waste caused by overcharging. This function helps to optimize the allocation of sanitation resources, reduce unnecessary energy consumption, and conforms to the concept of green environmental protection and sustainable development.
[0034] (5) Provide data support to facilitate system upgrade:
[0035] The "time window feature engineering" of the present invention not only improves the accuracy of anomaly detection but also provides rich data support for future system upgrades. By deeply mining and analyzing historical data, the present invention can reveal the internal laws and trends of data changes in the SOC module, providing a scientific basis for the design, manufacturing, and maintenance of sanitation equipment. At the same time, this data also supports the development of a more intelligent and efficient sanitation management system, promoting the digital transformation and intelligent upgrade of the sanitation field.
[0036] In summary, through innovative hybrid models and feature engineering methods, the present invention effectively solves the problem of anomaly detection in the data collection of the SOC module of sanitation equipment, significantly improves the stability and reliability of the system, and provides strong support for the efficient operation and sustainable development of urban sanitation services. Brief Description of the Drawings
[0037] Figure 1 is a flowchart of the method for anomaly detection and prediction of the SOC module of sanitation equipment in the embodiments of the present application;
[0038] Figure 2 is a flowchart of the data collection and processing steps in the embodiments of the present application;
[0039] Figure 3 is a schematic block diagram of the system for anomaly detection and prediction of the SOC module of sanitation equipment in the embodiments of the present application. Detailed Embodiments
[0040] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the protection scope of the present invention.
[0041] As Figure 1 shown, in the embodiments of the present application, a method for anomaly detection and prediction of the SOC module of sanitation equipment includes the following steps:
[0042] I. Data collection and processing:
[0043] 1. Collect historical data from the SOC module, including but not limited to parameters such as voltage, current, and temperature.
[0044] 2. Clean the original data, remove obvious error data points (such as values beyond the physical range), and reasonably fill in missing values.
[0045] 3. Perform time window feature engineering on the data: Define a time window with a preset length (e.g., 30 minutes), and summarize the data within each time window into a new feature vector; Extract statistical features from each time window, such as mean, variance, difference between maximum and minimum values, etc., as the basis for subsequent analysis; Introduce seasonal factors, considering the possible periodicity of the usage pattern of sanitation equipment (such as peak hours in the morning and evening), to enhance the sensitivity of the model to periodic changes.
[0046] II. VARIMA Model Construction:
[0047] 1. Use the preprocessed data and the constructed time window features to train a VARIMA model to simulate the changing trend of SOC module data over time. Select the optimal (p, d, q) parameter combination according to the AIC / BIC criterion to ensure that the VARIMA model is neither overfitting nor underfitting. Here, p is the autoregressive term, q is the moving average term, and d is the order of differencing.
[0048] 2. III. GBDT Model Construction:
[0049] Take the residual between the prediction result of the VARIMA model and the actual observation value as the new target variable, and use the GBDT model to further explore the non-linear relationship in the residual. During the training process of the GBDT model, adopt a cross-validation strategy to optimize the hyperparameters to ensure that the GBDT model has good generalization ability.
[0050] IV. Anomaly Detection and Warning Mechanism:
[0051] Combine the prediction results of the VARIMA model and the GBDT model, set a threshold, and trigger an alarm when the prediction error exceeds the set threshold, indicating that there may be an abnormal situation. Combine with a real-time monitoring interface to allow operators to view abnormal alarm information in a timely manner and take corresponding measures.
[0052] V. Continuous Learning and Adaptive Adjustment:
[0053] Over time, update the model parameters regularly so that the system can continuously adapt to new operating environments and condition changes.
[0054] A number of intelligent garbage collection stations have been deployed in the city. By adopting the abnormal detection and prediction method of the sanitation equipment SOC module in the embodiments of the present application, they are all equipped with a solar power supply system with an SOC module. From early morning to late at night every day, these stations will automatically decide when to turn on facilities such as lighting lamps and fans according to the built-in algorithm. However, due to being located at the edge of the urban area, some stations are often affected by thunderstorm weather, resulting in unstable power supply. At this time, this method can continuously monitor the output of the SOC module, identify potential risks in advance, issue warnings before the problem worsens, help the maintenance team respond quickly, and ensure that the sanitation service is not affected. This method focuses on solving the problem of detecting non-linear trend changes over a long time span. By introducing time window feature engineering, the abnormal detection is made more accurate and effective, while maintaining a relatively simple architecture design, which is easy to implement and maintain.
[0055] The following is a detailed description of each step of this method:
[0056] I. Data collection and processing:
[0057] The data collection is the historical data from the SOC module, including but not limited to parameters such as voltage, current, and temperature. After receiving the historical data, data preprocessing is required to ensure further time window feature engineering processing and analysis.
[0058] As Figure 2 shown, the data preprocessing in the embodiments of the present application mainly includes data cleaning and missing value processing. The specific implementation scheme is as follows:
[0059] 2.1. Data cleaning
[0060] Purpose: Remove obviously incorrect data points (such as values outside the physical range).
[0061] Implementation method: Set a reasonable range, determine the reasonable interval of each parameter (voltage, current, temperature, etc.) according to the battery technical specifications; filter out unreasonable data, and any data falling outside the set range will be marked as invalid and removed from the dataset.
[0062] 2.2. Missing value processing
[0063] Purpose: Fill or process the missing values in the data to ensure the integrity of the dataset.
[0064] Implementation method: Adopt the linear interpolation method, that is, based on the time series characteristics, use the linear relationship between the two known data points before and after to fill the missing values. If there are two time points t1 and t3, the observed value corresponding to t1 is y1, the observed value corresponding to t3 is y3, and the value at t2 is missing, then the predicted value of t2 can be calculated by the following formula
[0065]
[0066] By performing the above data cleaning and missing value processing on the collected data, the data quality and reliability are improved, laying a solid foundation for subsequent time series analysis and machine learning.
[0067] Performing time window feature engineering on the data is a key technology in the embodiments of this application. The aim is to capture the dynamic characteristics of the SOC module data by constructing meaningful time window features. These features can help the model better understand the non-linear trend changes over a long time span, thereby improving the accuracy of anomaly detection. The following will be described in combination with specific implementation schemes, formulas and actual examples.
[0068] 3.1. Define the time window
[0069] Select a time window with a preset length to effectively summarize and analyze the data. In this application, a reasonable time window length is determined according to the working mode of the sanitation equipment and the data acquisition frequency. For example: for the case where data is collected every half hour, 30 minutes can be selected as a time window; for each time window, all data points within this time period are summarized into a new feature vector. For example: assume that the intelligent garbage collection station records the voltage value of the SOC module every half hour. If a 30-minute time window is defined, this means that each time window contains one voltage reading.
[0070] 3.2. Extract statistical features
[0071] The purpose is to extract statistical features from each defined time window that are helpful for describing the data distribution and change trend. The features extracted in the embodiments of this application include the following aspects:
[0072] ⑴ Single-parameter statistical features
[0073] Mean: Calculate the average value of all observations within each time window.
[0074] Variance: Measure the degree of dispersion between observations within each time window.
[0075] Range: Represent the gap between the highest value and the lowest value within each time window.
[0076] ⑵ Inter-parameter correlation features
[0077] Pearson correlation coefficient: Measure the Pearson correlation coefficient of voltage V and current I within the same time window to understand whether the two change synchronously, and thus gain a more comprehensive understanding of the operating state of the SOC module.
[0078]
[0079] Among them, r VI is the Pearson correlation coefficient, which represents the linear correlation strength between voltage V and current I.
[0080] V i represents the value of voltage V at the i-th observation point.
[0081] I i represents the value of current I at the i-th observation point.
[0082] represents the sample mean of voltage V.
[0083] represents the sample mean of current I.
[0084] n represents the number of observation points, that is, the number of samples in the dataset.
[0085] Mutual information: Evaluate the amount of information shared between two non-linearly related variables, voltage V and temperature T, to understand the impact of temperature on battery performance and thus more comprehensively understand the operating state of the SOC module.
[0086]
[0087] Among them, I(V; T) is the mutual information, representing the amount of information shared between voltage V and temperature T.
[0088] p(v,a) is the joint probability distribution function, representing the probability of observing V = v and T = a simultaneously.
[0089] p(v) is the marginal probability distribution function, representing the probability of observing V = v alone.
[0090] p(a) is the marginal probability distribution function, representing the probability of observing T = a alone.
[0091] log: Natural logarithm or logarithm to the base 2.
[0092] Considering the Pearson correlation coefficient r of voltage V and current I within the same time window VI , it can reflect whether they change synchronously; while the mutual information I(V; T) between voltage V and temperature T can help understand the impact of temperature on battery performance.
[0093] ⑶ Dynamic change characteristics
[0094] Moving average: Smooth short-term fluctuations and highlight long-term trends.
[0095]
[0096] Among them, MA(x, w) represents the moving average value, where x is the time series and w is the width of the moving window, that is, the number of data points participating in the average calculation. x i represents the i-th observed value in the time series. t represents the current time point. represents the sum of all observed values from t - w + 1 to t time periods.
[0097] For the data recorded every half hour within a day, the first-order difference of voltage ΔV can be calculated for each hour to monitor the instantaneous change of battery power; at the same time, the moving average MA(V, 24) of all voltage readings on the same day can also be calculated to observe the power consumption trend throughout the day.
[0098] ⑷. Seasonal factor characteristics
[0099] Considering the possible periodicity in the usage pattern of sanitation equipment (such as peak hours in the morning and evening), the sensitivity of the model to periodic changes is enhanced. Specifically, by analyzing historical data, the activity patterns with obvious periodicity can be identified, and the corresponding seasonal factors can be defined accordingly. For example, different time periods in a day can be created as seasonal variables, or based on the differences between weekdays / weekends within a week. Generally, the garbage collection stations may be busier in the morning and evening, so the battery consumption is also greater. Therefore, a binary seasonal factor S is introduced, where S = 1 represents the peak period (such as 7:00 - 9:00, 17:~00 - 19:00), and S = 0 represents the non-peak period. For voltage data, if all four time points are in the non-peak period, the S value is 0; if a certain time point falls in the peak period, the S value is 1.
[0100] ⑸. Construction of comprehensive feature vector
[0101] Integrating all the above features into a comprehensive feature vector, the feature vector for a certain time window can be obtained as:
[0102] [Mean V ,Var V ,Range V ,Mean I ,Var I ,Range I ,Mean T ,Var T ,Range T ,r VI ,I(V; T), MA(V, w), S]; where: Mean V represents the mean value of voltage V, Var V represents the variance of voltage V, Range V represents the difference between the maximum and minimum values of voltage V, Mean Irepresents the mean value of current I, Var I represents the variance of current I, Range I represents the difference between the maximum and minimum values of current I, Mean T represents the mean value of temperature T, Var T represents the variance of temperature T, Range T represents the difference between the maximum and minimum values of temperature T. The feature vectors contain the statistical features of voltage, current, and temperature respectively, the correlations between parameters, dynamic change features, and seasonal factors. These feature vectors will subsequently be used as inputs for the VARIMA model (Vector Autoregressive Integrated Moving Average Model) and the GBDT model for anomaly detection and prediction analysis. In this way, the working state of the SOC module can be more comprehensively understood, anomalies can be detected and processed in a timely manner, thereby improving the stability and reliability of the system.
[0103] II. Construction of VARIMA Model:
[0104] The VARIMA model is a method widely used in time series prediction, especially suitable for dealing with data with trends and seasons. In the embodiments of this application, the VARIMA model will be used to capture the time dependence of the SOC module data and perform anomaly detection and prediction in combination with the feature vectors extracted in the previous steps. The construction of the VARIMA model is as follows:
[0105] 1. Determine the differencing order d
[0106] The purpose is to make the time series reach a stationary state, that is, the mean and variance do not change with time. Specifically, first-order differencing calculations, second-order differencing calculations, etc. are performed in sequence according to the key parameters (such as voltage mean, current mean, etc.) in the feature vectors of each time window until all sequences become stationary, thereby obtaining the differencing order. In this application, the ADF test method (a statistical method used in time series analysis to test the existence of unit roots in time series) can be used to judge whether it is stationary. It can be set that if the P value (used to measure the probability that the test statistic falls in the extreme region under the condition that the null hypothesis holds) is less than a certain significance level (such as 0.05), then the sequence is considered stationary; otherwise, differencing processing is required.
[0107] 2. Select the autoregressive term p and the moving average term q
[0108] The aim is to select appropriate values of p and q to best fit the time series data while avoiding overfitting or underfitting. The specific method is based on the ACF (Autocorrelation Function) plot and PACF (Partial Autocorrelation Function) plot. The ACF plot shows the autocorrelation coefficient at lag k, while the PACF plot removes the influence of other lags and directly reflects the autocorrelation at lag k. According to the shapes of the ACF plot and PACF plot, the values of p and q can be initially estimated. If the ACF decays slowly and the PACF truncates rapidly at some lags, it may be an AR model (i.e., Autoregressive model); if the PACF decays slowly and the ACF truncates rapidly at some lags, it may be an MA model (Moving Average model); if both show rapid truncation, it may be an ARMA model (Autoregressive Moving Average model).
[0109] The following is a simple and specific illustration: Assume that the first-order difference voltage mean sequence from the previous step is used, and the ACF plot and PACF plot of this first-order difference voltage mean sequence are drawn, and it is found that: The ACF plot truncates rapidly at lag 2 and then is almost close to zero; the PACF plot also truncates rapidly at lag 1, which indicates that p = 2 and q = 1 are a relatively optimal choice.
[0110] 3. Construct a VARIMA model
[0111] To process multiple features simultaneously, the multivariate time series analysis method VARIMA is adopted. It extends the traditional univariate ARIMA model to accommodate multiple mutually correlated time series. The VARIMA model can simultaneously consider the influences between different features and can capture the dynamic interaction between them. Its specific formula is as follows:
[0112]
[0113] Where:
[0114] Y t = [y 1,t , y 2,t , …, y k,t T , where y k,t represents the value of the k-th feature at time t;
[0115] ΔY t : Represents the time series value after differencing according to the determined differencing order d;
[0116] ΔY t-i : Represents the multivariate time series value after differencing at time point t - i. Here, "differencing" is an operation to make the original sequence reach a stationary state. For a non-stationary time series, it is usually necessary to perform differencing to eliminate trends and seasonal components to make it a stationary sequence.
[0117] Example explanation: Suppose there is a multivariate time series Y composed of the mean voltage, mean current, etc. t . Perform a first-order difference operation on each element to obtain ΔY t , that is: ΔY t = Y t - Y t-1 , for a specific feature, such as the mean voltage Mean V , its difference form is: ΔMean v,t = Mean v,t - Mean v,t-1 , in the VARIMA model, ΔY t-i refers to the difference value at time point t - i.
[0118] c: is the constant term vector;
[0119] Φ i : is the autoregressive matrix;
[0120] Θ j : is the moving average matrix;
[0121] ∈ t : represents the error or residual at time point t;
[0122] ∈ t-j : represents the error or residual term at time point t - j. This is the difference between the model prediction value and the actual observed value, reflecting the part of the information that the model fails to capture.
[0123] p: is the autoregressive term;
[0124] q: is the moving average term.
[0125] 4. Model fitting and verification
[0126] By dividing the historical data into a training set and a test set, use the training set to estimate the parameters of the VARIMA model, and use the test set to evaluate the performance of the VARIMA model. Suppose there is one month of historical data, where the first three weeks are used for training and the last week is used for testing. Fit the VARIMA model through the training set, and then verify its prediction accuracy with the data in the test set.
[0127] 5. Predict future values
[0128] Use the trained VARIMA model to predict future time points, and the data change situation of the SOC module within the next few time windows can be predicted.
[0129] In this way, the VARIMA model can be used to accurately predict the key parameters of the SOC module, and combined with other eigenvector information to improve the ability of anomaly detection, thereby enhancing the operation stability and reliability of intelligent devices in the environmental sanitation field.
[0130] III. Construction of GBDT Model
[0131] GBDT (Gradient Boosting Decision Tree) is a powerful machine learning algorithm suitable for processing time series data with complex non-linear relationships. In the embodiments of this application, the GBDT model will be used to further mine the non-linear patterns in the VARIMA prediction errors and perform anomaly detection and prediction in combination with the eigenvectors output in the previous step. The construction of the GBDT model is as follows:
[0132] 1. Prepare training data
[0133] Take the residual between the VARIMA model prediction result and the actual observation value as the new target variable, and at the same time add the comprehensive eigenvector obtained from the data collection and processing steps as the input feature.
[0134] 2. Construct the GBDT model
[0135] Evaluate the performance of the GBDT model and guide the gradient descent process by gradually adding decision trees to minimize the loss function L (in the embodiments of this application, the mean squared error (MSE) is used as the loss function). By iteratively adding new decision trees, gradually reduce the gap between the predicted value and the true value, and finally make the prediction of the GBDT model more accurate. The formula for the mean squared error (MSE) in the embodiments of this application is:
[0136]
[0137] Where:
[0138] MSE is the mean squared error, representing the average square of the difference between the predicted value and the true value;
[0139] y i is the true value (actual value) of the i-th observation point;
[0140] F(x i ) is the predicted value of the i-th observation point in the time series.
[0141] The GBDT model gradually optimizes the loss function through the method of gradient descent. Specifically, in each iteration, it calculates the residual (i.e., the negative gradient) between the current model predicted value and the true value, and then trains a new decision tree to fit these residuals. This process can be expressed by the following formula:
[0142] F m (x) = F m-1(x) + ηh m (x) (7)
[0143] Where:
[0144] F m (x) is the cumulative prediction value at the m-th step;
[0145] F m-1 (x) is the cumulative prediction value at the (m - 1)-th step;
[0146] h m (x) is the newly added decision tree at the m-th step, used to fit the residuals;
[0147] η is the learning rate, which determines the update amplitude of each step and can be determined by linear search. In this application, it can be set to 0.1.
[0148] In addition, in the embodiments of this application, the performance of the GBDT model is also improved by adjusting hyperparameters to avoid overfitting or underfitting. The specific hyperparameters involved are as follows:
[0149] Number of decision trees: It determines the complexity and fitting ability of the GBDT model. More trees can capture more complex patterns, but may also lead to overfitting. Therefore, choosing the appropriate number of trees is the key to balancing model complexity and computational cost.
[0150]
[0151] F M (x) is the comprehensive prediction result of the entire GBDT model after M iterations, which reflects the best prediction model obtained by gradually optimizing the loss function
[0152] Where M represents the number of decision trees, that is, the number of iterations, and in the embodiments of this application, it can be set to 100.
[0153] Maximum depth: Its maximum depth limits the maximum number of layers of a single decision tree, thus controlling the complexity of the model. Deeper trees can capture more subtle data features, but are also prone to overfitting. Appropriately setting the maximum depth helps improve the generalization ability of the model.
[0154] h m (x) = DecisionTree(x; d) (9)
[0155] DecisionTree(·) represents a decision tree;
[0156] Where d is the maximum depth, and in the embodiments of this application, it can be set to 3, that is, the maximum number of layers of the tree is 3.
[0157] Minimum Samples Split: The minimum samples split specifies the minimum number of samples that a node must contain to continue splitting. A larger value of s can prevent the model from over-focusing on a few outliers and reduce the risk of overfitting. However, setting it too large will prevent the model from fully learning the patterns in the data. In the embodiments of the present application, it can be set to 2.
[0158] The above hyperparameters can be tuned using techniques such as Grid Search, Random Search, or Bayesian Optimization. In addition, common existing methods are not elaborated here.
[0159] 3. Model Training and Validation
[0160] Use the training set to estimate the parameters of the GBDT model, and use the test set to evaluate the performance of the GBDT model. Apply cross-validation to ensure that the GBDT model has good generalization ability. By dividing the training data into a training set and a test set, use the training set to estimate the parameters of the GBDT model and use the test set to evaluate the performance of the GBDT model. Suppose there is one month of training data, where the first three weeks are used for training and the last week is used for testing. Fit the GBDT model using the training set, and then verify its prediction accuracy using the data in the test set.
[0161] 4. Predicting Future Values
[0162] Use the trained GBDT model to predict future time points and combine its prediction results with those of the VARIMA model to obtain the final predicted values.
[0163] IV. Anomaly Detection and Warning Mechanism
[0164] The anomaly detection and warning mechanism is a key link to ensure the stable operation of intelligent devices in the environmental sanitation field. In the embodiments of the present application, by combining the prediction results of the VARIMA model and the GBDT model, identify abnormal situations by setting reasonable thresholds and using statistical test methods, and issue warning signals in a timely manner. The specific solution is as follows:
[0165] 1. In the embodiments of the present application, the following indicators are selected to measure the size of the prediction error:
[0166] Standard Score (Z): Standardize the prediction error into a standard normal distribution with a mean of 0 and a standard deviation of 1: where μ ∈ and σ ∈ are the mean and standard deviation of the historical residuals, respectively.
[0167] Absolute Error (AE): Directly calculate the difference between the predicted value and the true value. Where: AE t represents the absolute error at time t, where y t is the true value at time t, is the predicted value at time t.
[0168] Relative Error (RE): Proportional error relative to the true value. Where RE t represents the relative error at time t.
[0169] 2. Determine one or more thresholds based on historical data, and trigger an alarm when the detection index exceeds these thresholds: For the standard score, set data points with an absolute value greater than 3 as outliers; for the absolute error or relative error, set specific thresholds according to business requirements. For example, set the AE threshold for the voltage mean to 0.1V and the RE threshold for the voltage mean to 5%. To ensure the timeliness of the threshold, the sliding window technique can be used to recalculate μ ∈ and σ ∈ , for example, update the parameters every hour to ensure that the threshold can reflect the latest working conditions.
[0170] 3. Multi-level early warning system mechanism
[0171] The purpose is to set different levels of alarms according to the severity of the anomaly to help operators respond quickly.
[0172] Level 1 alarm: Issue a warning when the detection index slightly exceeds the threshold, indicating that there may be a problem but no immediate action is required.
[0173] Level 2 alarm: When a certain detection index significantly exceeds the threshold or multiple indices exceed the threshold, issue an emergency alarm, requiring immediate inspection and handling of potential faults.
[0174] In this way, the anomaly detection and early warning mechanism can be used to effectively monitor the working status of the SOC module, promptly discover and handle abnormal situations, thereby improving the operation stability and reliability of intelligent devices in the environmental sanitation field. This method not only considers the time dependence of individual features but also captures the mutual relationship between different features, making the system more robust and accurate.
[0175] V. Continuous Learning and Adaptive Adjustment
[0176] Continuous learning and adaptive adjustment are key steps to ensure the long-term effectiveness and robustness of the model. In the embodiments of this application, the system will be able to continuously adapt to new operating environments and condition changes by regularly updating model parameters, adaptive threshold adjustment, and feedback loops. The following are the specific implementation plans:
[0177] 1. Retrain the model regularly
[0178] As new data accumulates, retrain the model regularly to capture the latest trends and patterns. Specifically, at regular intervals (such as monthly or quarterly), use the accumulated new data to retrain the VARIMA model and the GBDT model. At the same time, maintain a fixed-size data window, removing the oldest data and adding the latest data each time an update is made to reflect the most recent working conditions.
[0179] 2. Adaptive threshold adjustment
[0180] Automatically adjust the threshold for anomaly detection based on new data to ensure its sensitivity and accuracy. Specifically, use the above-mentioned sliding window statistical method, that is, regularly recalculate the mean μ ∈ and standard deviation σ ∈ of the historical residuals to maintain the timeliness of indicators such as Z-Score. In addition, methods based on Bayesian inference can be used to dynamically adjust the threshold to adapt to different workload patterns.
[0181] 3. Feedback loop
[0182] Establish a closed-loop process from warning to correction and then to improving the model to continuously enhance the performance of the system. Specifically, whenever an alarm is triggered, record the corresponding feature vector and actual result for subsequent analysis; based on the results of error analysis, adjust the model structure or parameters targeted to improve the accuracy of future predictions. Whenever an alarm is triggered, the corresponding feature vector and actual result will be recorded for subsequent analysis. For example, if it is found that the mean voltage deviates significantly from the predicted value during a certain time, it may be caused by external factors (such as extreme weather). These situations can be marked and the impact of such events can be particularly concerned in future model optimization.
[0183] In this way, the continuous learning and adaptive adjustment mechanism can be used to effectively monitor and maintain the operating status of intelligent devices in the environmental sanitation field, timely detect and handle abnormal situations, thereby improving the stability and reliability of the system. This method not only considers the time dependence of individual features but also captures the mutual relationships between different features, making the system more robust and accurate.
[0184] This method combines the autoregressive integrated moving average model (VARIMA) with the gradient boosting decision tree (GBDT) algorithm to achieve more accurate anomaly detection and prediction, thus ensuring the stability and reliability of the environmental sanitation equipment system. Specifically:
[0185] 1. Use time window feature engineering during initial data processing: Select a time window of appropriate length to effectively aggregate and analyze data. In the embodiment of this application, a reasonable time window length is determined based on the operating mode of the sanitation equipment and the data acquisition frequency. For each time window, all data points within the time period are aggregated into a new comprehensive feature vector for subsequent model training and prediction. In addition, when constructing the comprehensive feature vector, full use is made of the statistical characteristics of single parameters, the correlation characteristics between parameters, the dynamic change characteristics, and the seasonal factor characteristics, which can accurately reverse the operating conditions of the sanitation equipment system.
[0186] 2. Application of the multivariate time series analysis method VARIMA: Usually, all relevant features (i.e., the constructed comprehensive feature vector) are integrated into a comprehensive model for training. This can provide a more comprehensive understanding of the working status of the sanitation equipment SOC module, timely detect and handle abnormal situations, and thus improve the stability and reliability of the system. This method not only considers the time dependence of individual features, but also captures the relationship between different features, making the model more robust and accurate.
[0187] 3. Application of Gradient Boosting Decision Trees (GBDT): The GBDT model captures nonlinear patterns that the VARIMA model fails to account for and combines all eigenvector information to improve anomaly detection capabilities, thereby enhancing the operational stability and reliability of smart sanitation equipment. This approach not only considers the temporal dependencies of individual features but also captures the interrelationships between different features, making the model more robust and accurate.
[0188] 4. A multi-level warning method is used in the anomaly detection and early warning mechanism: Level 1 alarm: When the detection indicator slightly exceeds the threshold, a warning is issued, indicating that there may be a problem but no immediate action is required; Level 2 alarm: When a certain indicator is significantly exceeded the threshold or multiple indicators exceed the threshold, an emergency alarm is issued, requiring immediate inspection and handling of potential faults.
[0189] 5. Continuous Learning and Adaptive Adjustment Strategy: As new data accumulates, the model is regularly retrained to capture the latest trends and patterns. A fixed-size data window is maintained during data collection, with each update removing the oldest data and adding the latest data to reflect recent operating conditions. A closed-loop process is established from early warning to correction to model improvement to continuously improve system performance. Specifically, whenever an alarm is triggered, the corresponding feature vector and actual results are recorded for subsequent analysis. Based on the results of error analysis, the model structure or parameters are adjusted to improve the accuracy of future predictions. Whenever an alarm is triggered, the corresponding feature vector and actual results are recorded for subsequent analysis.
[0190] like Figure 3As shown in the figure, in the embodiment of the present application, an abnormal detection and prediction system for the SOC module of a sanitation device includes a memory and a controller. A computer-readable program is stored in the memory, and when the computer-readable program is called by the controller, it can execute the steps of the abnormal detection and prediction method for the SOC module of the sanitation device as described in the embodiment of the present application.
[0191] This method combines the hybrid anomaly detection method of the autoregressive integrated moving average model (VARIMA) and the gradient boosting decision tree (GBDT) algorithm, which is specifically used for the anomaly detection and prediction of SOC module data acquisition in sanitation devices, realizing more accurate anomaly detection and prediction, thereby ensuring the stability and reliability of the system. It can solve the following problems: The data acquisition process of the SOC module is prone to anomalies due to external environmental factors, internal hardware aging, software failures, etc.; The working mode of sanitation devices shows a certain periodicity and randomness with factors such as seasons and holidays. This non-linear trend change poses a huge challenge to traditional fixed-rule-based anomaly detection methods because it is difficult for them to adapt to rapidly changing workload patterns.
[0192] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention shall be equivalent replacement methods and are all included in the protection scope of the present invention.
Claims
1. A method for abnormal detection and prediction of the SOC module of a sanitation equipment, characterized in that, It includes the following steps: Data collection and processing step: Collect historical data from the SOC module of sanitation equipment, where the historical data includes voltage, current, and temperature parameters; Clean the original data, remove obviously incorrect data points, and reasonably fill in missing values; Perform time window feature engineering on the cleaned data, specifically including: defining a time window with a preset length, summarizing the data within each time window into a new feature vector, extracting statistical features from each time window, and introducing seasonal factors; VARIMA model construction step: Use the preprocessed data and the constructed time window feature vectors to train a VARIMA model to simulate the changing trend of SOC module data over time; Select the optimal (p, d, q) parameter combination according to the AIC / BIC criterion, where p is the autoregressive term, q is the moving average term, and d is the differencing order; GBDT model construction step: Use the residual between the prediction result of the VARIMA model and the actual observation value as a new target variable, and use the GBDT model to mine the non-linear relationship in the residual; During the GBDT training process, adopt a cross-validation strategy to optimize hyperparameters; Abnormal detection and warning mechanism step: Combine the prediction results of the VARIMA model and the GBDT model, set a threshold, and trigger an alarm when the prediction error exceeds the set threshold, indicating that there may be an abnormal situation; Continuous learning and adaptive adjustment step: Regularly update the parameters of the VARIMA model and the GBDT model. At the same time, automatically adjust the threshold of abnormal detection according to new data.
2. The abnormal detection and prediction method for the sanitation equipment SOC module according to claim 1, characterized in that The data cleaning step includes setting a reasonable range, determining the reasonable interval for each parameter according to the battery technical specifications, and filtering data points outside the reasonable interval.
3. The abnormal detection and prediction method for the sanitation equipment SOC module according to claim 1, characterized in that The missing value processing step adopts the linear interpolation method, that is, based on the characteristics of the time series, use the linear relationship between two adjacent known data points to fill in the missing values.
4. The abnormal detection and prediction method for the sanitation equipment SOC module according to claim 1, characterized in that The statistical features include single-parameter statistical features, inter-parameter correlation features, and dynamic change features; among them, The single-parameter statistical features include mean, variance, and maximum-minimum difference. Among them, the mean represents the average value of all observations within each time window; the variance represents the degree of dispersion between observations within each time window; the maximum-minimum difference represents the gap between the highest value and the lowest value within each time window; The inter-parameter correlation features include Pearson correlation coefficient and mutual information; The dynamic change features include moving average.
5. The abnormal detection and prediction method for the sanitation equipment SOC module according to claim 1, characterized in that The seasonal factor feature is defined according to the periodicity of the sanitation equipment usage pattern.
6. The abnormal detection and prediction method for the sanitation equipment SOC module according to claim 1, characterized in that In the VARIMA model construction step, use the ADF test method to judge whether the time series is stationary, and select the optimal (p, d, q) parameter combination according to the ACF graph and PACF graph.
7. The method for abnormal detection and prediction of the sanitation equipment SOC module according to claim 1, wherein In the GBDT model construction step, use the mean squared error as the loss function to evaluate the performance of the GBDT model and guide the gradient descent process, and use the cross-validation strategy to optimize hyperparameters.
8. The abnormal detection and prediction method for the sanitation equipment SOC module according to claim 1, characterized in that In the steps of the anomaly detection and early warning mechanism, the standard score, absolute error or relative error is selected as the index to measure the magnitude of the prediction error, and the corresponding threshold is set to trigger an alarm.
9. The abnormal detection and prediction method for the sanitation equipment SOC module according to claim 1, characterized in that In the steps of continuous learning and adaptive adjustment, the sliding window technique is used to periodically recalculate the mean and standard deviation of the historical residuals to maintain the timeliness of the threshold, and the model structure or parameters are adjusted according to the error analysis results.
10. A sanitation equipment SOC module anomaly detection and prediction system, including a memory and a controller, wherein a computer-readable program is stored in the memory, and when the computer-readable program is called by the controller, it can execute the steps of the sanitation equipment SOC module anomaly detection and prediction method as described in any one of claims 1 to 9.
Citation Information
Cited By
Method, device and equipment for identifying abnormal pollution discharge based on multi-source data and medium
CN121256304A