Data collection method and system based on multi-algorithm interaction
Through the data collection method of multi-algorithm interaction, the random forest algorithm and the long short-term memory network are used to dynamically adjust the collection and transmission frequency, which solves the problems of redundancy or omission of data collection and insufficient recognition ability of a single algorithm in the traditional method, and improves the efficiency of data collection. The accuracy and robustness improve the intelligence and automation level of the system.
Patent Information
- Application Number
- CN202410755483.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-12
AI Technical Summary
Traditional data collection methods lack an adaptive adjustment mechanism, resulting in redundancy or omissions in data collection, and a single algorithm cannot effectively identify complex data anomalies, reducing the accuracy and robustness of data analysis, and increasing labor costs and response times.
Adopt a data collection method based on multi-algorithm interaction, use random forest algorithm and long short-term memory network to conduct abnormal analysis and comprehensive analysis of sensor node data, dynamically adjust the collection and transmission frequency, and improve the accuracy of data collection through multi-level feedback and adjustment mechanisms performance and robustness.
It enhances the system's sensitivity and adaptability to environmental changes, improves the accuracy and reliability of anomaly detection, reduces the need for human intervention, and improves the system's intelligence and automation levels.
Smart Images

Figure CN118368187B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data collection and analysis, and in particular to a data collection method and system based on multi-algorithm interaction. Background Art
[0002] Traditional data collection methods and systems are usually based on fixed collection and transmission frequencies and lack adaptive adjustment mechanisms. Regardless of whether environmental conditions or specific parameters change, sensor nodes are preset to collect and transmit data at a fixed frequency. This static configuration often leads to redundancy or omission of collected data. For example, in a stable state, frequent data collection may lead to unnecessary resource consumption, while in sudden or abnormal conditions, sparse collection frequencies cannot obtain key data in a timely manner, resulting in anomalies that cannot be discovered and processed in a timely manner. At the same time, due to the lack of dynamic adjustment based on data conditions, these systems cannot adjust the data collection and transmission frequency based on real-time analysis feedback.
[0003] In addition, traditional methods mainly rely on simple threshold judgments or basic statistical analysis, and have limited ability to identify complex data anomalies, and are prone to miss potential abnormal patterns or falsely report anomalies. More importantly, traditional systems usually use a single algorithm and cannot combine the advantages of different algorithms, resulting in low accuracy and robustness of data analysis. For example, relying only on basic statistical analysis or simple rules, it is impossible to dig deep into the intrinsic characteristics and trends of the data. In addition, the lack of coordination between different algorithm models and the limitations of a single algorithm make the system less adaptable when facing complex and changing environments, including dealing with various data characteristics such as nonlinearity, long-term and short-term dependencies, and traditional methods seem unable to cope. When abnormal conditions occur, traditional systems often need to rely on manual responses, which not only increases labor costs, but may also lead to untimely responses, thereby reducing the automation and intelligence level of the system. Summary of the invention
[0004] The purpose of the present invention is to provide a data collection method and system based on multi-algorithm interaction to solve the problems raised in the above background technology.
[0005] To achieve the above object, one of the objects of the present invention is to provide a data collection method based on multi-algorithm interaction, comprising the following method steps:
[0006] S1. Collect data using multiple sensors as sensor node data; wherein the sensor collection process includes data collection frequency and data transmission frequency;
[0007] S2. Perform abnormal analysis on the sensor node data using a random forest algorithm model to generate current analysis results; wherein:
[0008] If the current analysis result is abnormal, feedback is given to S1 according to the abnormal result, and the data collection frequency is adjusted by adjusting the sensor node data corresponding to the abnormal result, and S2 is performed again. If the current analysis result is abnormal, the abnormal result is sent to the management personnel;
[0009] If the current analysis result is normal, S3 will be executed;
[0010] S3. Analyze the sensor node data using a time series analysis algorithm to obtain a time series result, and perform a comprehensive analysis on the time series result according to a long short-term memory network algorithm; wherein:
[0011] If the comprehensive analysis result is abnormal, feedback is given to S1 according to the abnormality of the comprehensive analysis result, and the data transmission frequency is adjusted for the corresponding sensor node data in the comprehensive analysis result, and the weight of the sensor node data is increased;
[0012] If the comprehensive analysis result is normal, the data collection and abnormality analysis are completed.
[0013] As a further improvement of the technical solution, the data collection frequency is initialized and set, and the sensor nodes collect data periodically; the data transmission frequency is initialized and set, and the sensor node data is transmitted wirelessly.
[0014] As a further improvement of this technical solution, the random forest algorithm model training steps are as follows:
[0015] Sample selection: From the training data set The random selection was done by bootstrapping samples, generate multiple sub-sample sets;
[0016] Feature selection: For each decision tree node, randomly select from all features features, among which , from which the best features are selected for splitting, where is the number of all features;
[0017] For each sub-sample set, a decision tree is constructed. The specific steps are as follows:
[0018] Split nodes: Use the Gini coefficient as the splitting condition, and select Find the best split feature among the features, and the Gini coefficient formula is: ,in Indicates The frequency of class samples in the training data set, Represents the total number of categories in the training dataset;
[0019] Recursive construction: Split the data set according to the best features, and recursively perform the above splitting on the segmented sub-datasets until the stopping condition is met, including but not limited to reaching the maximum depth of the tree;
[0020] Model fusion: All trained decision trees are combined in an integrated manner. , each decision tree classifies it independently and outputs the category ;
[0021] Use majority voting method (the majority classification result is the final classification result) to determine the final prediction category of the input data , the formula is: ,in is the total number of decision trees, Represents majority vote.
[0022] As a further improvement of the technical solution, the steps of performing anomaly analysis based on sensor node data by the random forest algorithm model are as follows:
[0023] The current sensor node data Input into the trained random forest model;
[0024] Random forest model output corresponding classification results ;in:
[0025] like When , it means that the current analysis result is abnormal, and the corresponding abnormal data point is marked and fed back to S1. According to the abnormal data point, the corresponding sensor node is selected, and the data collection frequency of the corresponding sensor node in S1 is adjusted. By reducing the collection interval and increasing the collection frequency, the abnormal analysis of S2 is performed again. If the current analysis result is still abnormal at this time, the abnormal result is sent to the management personnel;
[0026] like , it indicates that the current analysis result is normal and S3 will be executed.
[0027] As a further improvement of the technical solution, the sensor node data is analyzed using a time series analysis algorithm to obtain a time series result, which specifically includes:
[0028] Extracting seasonal components from time series , Trend Components , and residual ;in:
[0029] Seasonal ingredients The calculation of is as follows:
[0030] Smoothing the data by moving window smoothing;
[0031] In each cycle, a local polynomial fit was performed for each time point;
[0032] The sliding window is moved left by one time step and local smoothing is performed again until the entire time series is traversed;
[0033] Trending ingredients The calculation of is as follows:
[0034] Subtract the seasonal component from the original time series data To obtain deseasonalized data;
[0035] Deseasonalized data are smoothed by moving average to obtain the trend component;
[0036] Construct a sliding window that is larger than the seasonal window;
[0037] Perform local polynomial fitting on time series data to obtain smoothed trend components;
[0038] Residual The calculation of is as follows:
[0039] Subtract the extracted trend component from the original time series and seasonal ingredients ;
[0040] Finally, the time series results The calculation is: .
[0041] As a further improvement of the present technical solution, the architecture of the long short-term memory network algorithm model includes an input gate, a forget gate, candidate memory unit information, memory unit state update, an output gate and a hidden state output. The retention and update of the current input information and past memory are controlled by the input gate and the forget gate, a new memory state is generated in combination with the candidate memory unit, and a hidden state of comprehensive short-term and long-term information is generated through the output gate for prediction; the long short-term memory network algorithm model is trained by setting an objective function and adjusting the parameters of the model through the back propagation algorithm.
[0042] As a further improvement of the technical solution, the steps of predicting the comprehensive analysis results by the long short-term memory network algorithm model are as follows:
[0043] After the LSTM algorithm model is trained, for a given input sequence, the LSTM algorithm model outputs the predicted value and hidden state of the current time step;
[0044] The current prediction error is determined by comparing the model's predicted value with the actual value, and whether the current prediction error is abnormal is determined, where:
[0045] If the comprehensive analysis result is abnormal, the sensor node corresponding to the current time column data is fed back to S1 as the result of the comprehensive analysis. Based on the comprehensive analysis result, the sensor node is identified and the data transmission frequency of the sensor node is adjusted. The data transmission frequency is increased by reducing the data transmission interval; and the data set in S2 is increased. The weight of the corresponding sensor node data is increased by a fixed step size method;
[0046] If the comprehensive analysis results are normal, data collection and analysis are completed.
[0047] As a further improvement of the present technical solution, the comparison and determination process calculates the mean and standard deviation of historical prediction errors and sets a threshold range based on the standard deviation. If the current prediction error exceeds the threshold range, it is considered abnormal; otherwise, it is normal.
[0048] The second object of the present invention is to provide a system for a data collection method based on multi-algorithm interaction, including a data collection module, a data analysis module and a comprehensive analysis module, wherein:
[0049] The data collection module uses multiple sensors to collect data as sensor node data; wherein the sensor collection process includes data collection frequency and data transmission frequency;
[0050] The data analysis module uses a random forest algorithm model to perform abnormal analysis on the sensor node data to generate a current analysis result; wherein:
[0051] If the current analysis result is abnormal, the data collection module is fed back according to the abnormal result, and the data collection frequency is adjusted by the sensor node data corresponding to the abnormal result, and the data analysis module is performed again. If the current analysis result is abnormal, the abnormal result is sent to the management personnel;
[0052] If the current analysis result is normal, the comprehensive analysis module will be executed;
[0053] The comprehensive analysis module uses a time series analysis algorithm to analyze the sensor node data to obtain a time series result, and performs a comprehensive analysis on the time series result according to a long short-term memory network algorithm; wherein:
[0054] If the comprehensive analysis result is abnormal, feedback is given to the data collection module according to the abnormality of the comprehensive analysis result, and the data transmission frequency is adjusted for the corresponding sensor node data in the comprehensive analysis result, and the weight of the sensor node data is increased;
[0055] If the comprehensive analysis result is normal, the data collection and abnormality analysis are completed.
[0056] Compared with the prior art, the present invention has the following beneficial effects:
[0057] 1. The data collection method based on multi-algorithm interaction and the interaction between S2 and S1 in the system reflect the adaptive ability of the system. When the random forest algorithm model detects anomalies in the sensor node data in S2, it not only marks and feedbacks the abnormal data, but also actively adjusts the data collection frequency of the corresponding sensor node in S1; this adjustment ensures that when potential anomalies are found, the relevant data is monitored more carefully, thereby enhancing the system's sensitivity to changes. When an anomaly is detected, by increasing the collection frequency and the weight of the sensor node data, the system can provide richer and higher-quality data in the next round of analysis, making the anomaly detection process more accurate and reliable. This automated response mechanism not only improves the effectiveness of data collection, but also reduces the need for human intervention and improves the intelligence level of the entire system.
[0058] 2. The data collection method based on multi-algorithm interaction and the interaction between S3 and S1 in the system further enhance the accuracy and responsiveness of the entire system. After processing the sensor node data using the time series analysis algorithm, the long short-term memory network conducts a comprehensive analysis of the time series results to determine the trends and anomalies of the data; when the comprehensive analysis results indicate that a sensor node may be abnormal, the system will feedback the results to S1 and adjust the data transmission frequency of the node; at the same time, the weight of the data will be increased to increase its importance in the random forest model analysis. Through this supporting dynamic adjustment and weight increase, the system not only captures more detailed data, but also provides more detailed and useful input to the random forest model, thereby improving the accuracy and reliability of anomaly detection. This multi-level feedback and adjustment mechanism enables the system to efficiently respond to environmental changes and dynamic changes in data status.
[0059] 3. The data collection method based on multi-algorithm interaction and its system integration of different algorithm models have significant beneficial effects in the process of this method; first, the random forest algorithm model is used for preliminary anomaly detection, and its integrated learning characteristics improve the accuracy and robustness of classification; secondly, the time series analysis algorithm extracts the seasonality, trend and residual components of the data, making the data preprocessing more accurate, which is conducive to the subsequent long-term and short-term memory network analysis; when processing sequence data, the long-term and short-term memory network ensures the effective fusion of short-term and long-term information through the input gate, forget gate and output gate, so that the model performs well in capturing the long-term and short-term dependencies in the time series; this comprehensive method takes advantage of the advantages of each algorithm model, and through multi-level feedback and adjustment mechanisms, it complements each other to improve the overall performance of data collection and anomaly detection. The collaborative work between different algorithm models forms an efficient, intelligent, dynamically adaptive data collection and analysis system, which significantly improves the system's adaptability and ability to handle complex problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 It is a schematic diagram of the overall module of the present invention;
[0061] Figure 2 It is a schematic diagram of the overall method flow of the present invention.
[0062] In the figure: 100, data collection module; 200, data analysis module; 300, comprehensive analysis module. DETAILED DESCRIPTION
[0063] The following will be combined with the accompanying drawings in the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0064] See also Figure 1-2 One of the purposes of this embodiment is to provide a data collection method and system based on multi-algorithm interaction, including the following method steps:
[0065] S1. Deploy multiple sensors in the target environment. The sensors include but are not limited to temperature sensors, humidity sensors, and pressure sensors, etc., for collecting different environmental parameters. Each sensor node sets an initial data collection frequency and data transmission frequency, and transmits the collected data as sensor node data, including:
[0066] The sensor nodes collect data periodically and read the data according to the initial collection frequency, for example, once every minute;
[0067] The sensor node data is transmitted wirelessly according to the initial data transmission frequency, for example, once per minute;
[0068] S2. Performing abnormal analysis on the sensor node data using a random forest algorithm model, specifically including:
[0069] According to the sensor node data transmitted in S1, a multi-dimensional data set is formed. Assume that the data set is , whose structure is ,in Indicates The data of sensor nodes, and , each data point has Features
[0070] In order to train the random forest algorithm model, it is necessary to collect the training data of the random forest algorithm model. The training data has the same data features as the sensor node data, as well as the corresponding abnormal results, and the corresponding abnormal results are used as labels. The representation of the training data is ,in is a binary classification label (0 means normal, 1 means abnormal);
[0071] The random forest algorithm is an ensemble learning method based on decision trees. Its core idea is to improve the accuracy of classification by integrating the results of multiple decision trees. The specific steps are as follows:
[0072] Sample selection: From the training data set The random selection was done by bootstrapping samples, generate multiple sub-sample sets;
[0073] Feature selection: For each decision tree node, randomly select from all features features, among which , from which the best features are selected for splitting, where is the number of all features;
[0074] For each sub-sample set, a decision tree is constructed. The specific steps are as follows:
[0075] Split nodes: Use the Gini coefficient as the splitting condition, and select Find the best split feature among the features, and the Gini coefficient formula is: ,in Indicates The frequency of class samples in the training data set, Represents the total number of categories in the training dataset;
[0076] Recursive construction: Split the dataset according to the best features, and recursively perform the above splitting on the segmented sub-datasets until the stopping condition is met (such as high node purity or the maximum depth of the tree is reached);
[0077] Model fusion: All trained decision trees are combined in an integrated manner. , each decision tree classifies it independently and outputs the category ;
[0078] Use majority voting method (the majority classification result is the final classification result) to determine the final prediction category of the input data , the formula is: ,in is the total number of decision trees, Represents majority vote.
[0079] The steps of the random forest algorithm model for anomaly analysis based on sensor node data are as follows:
[0080] The current sensor node data Input into the trained random forest model;
[0081] Random forest model output corresponding classification results (0 means normal, 1 means abnormal); where:
[0082] like , it indicates that the current analysis result is abnormal, and the corresponding abnormal data point is marked and fed back to S1. The corresponding sensor node is selected according to the abnormal data point, and the data collection frequency of the corresponding sensor node in S1 is adjusted. By reducing the collection interval, the collection frequency is increased, so as to monitor the status of the sensor more carefully. For example, if the data is collected once a minute, it is adjusted to collect once every 30 seconds. After adjusting the data collection frequency in S1, perform abnormal analysis of S2 again. If the current analysis result is still abnormal, the abnormal result is sent to the management personnel.
[0083] like , it indicates that the current analysis result is normal and S3 will be executed.
[0084] S3, using a time series analysis algorithm to analyze the sensor node data to obtain a time series result, specifically including:
[0085] Extracting seasonal components from time series , Trend Components , and residual ;
[0086] Seasonal ingredients The calculation of is as follows:
[0087] Smoothing the data by moving window smoothing;
[0088] Within each period (e.g., one month of data), a local polynomial fit is performed for each time point;
[0089] The sliding window is shifted left by one time step, and then local smoothing is performed again until the entire time series is traversed;
[0090] Trending ingredients The calculation of is as follows:
[0091] Subtract the seasonal component from the original time series data To obtain deseasonalized data;
[0092] Deseasonalized data are smoothed by moving average to obtain the trend component;
[0093] Build a larger sliding window (generally larger than the seasonal window);
[0094] Perform local polynomial fitting on time series data to obtain smoothed trend components;
[0095] Residual The calculation of is as follows:
[0096] Subtract the extracted trend component from the original time series and seasonal ingredients ;
[0097] Finally, the time series results The calculation is: .
[0098] A comprehensive analysis of the time series results based on the long short-term memory network algorithm revealed the following:
[0099] Input time series: The time series results Split the data into multiple segments, each segment contains a fixed number of time steps, for example, using the data from the previous few days to predict today's data, so that each group of segments forms an input sequence;
[0100] Standardized data: Standardize the original time series data to make its mean 0 and variance 1 to improve the convergence speed and prediction accuracy of the model;
[0101] The architecture of the long short-term memory network algorithm model:
[0102] Input gate: The function of the input gate is to determine which parts of the current input information need to be brought into the current state. In simple terms, the input gate controls how much the new input information will affect the current memory state;
[0103] Forget gate: The function of the forget gate is to decide which parts of the past memory information need to be discarded. This step is very important, as it helps the model clean up irrelevant or outdated information, making the information in the memory unit more accurate and relevant;
[0104] Candidate memory unit information: This step generates new candidate memory information, which is calculated by combining the current input and the state of the previous time step, and is prepared as candidate material for updating the current memory unit;
[0105] Memory unit state update: In this part, the model combines the forgotten part of the forget gate and the newly added part of the input gate to update the current memory state. Through this update, the model can retain important historical information and add new useful information;
[0106] Output gate: The output gate determines how much information is output from the current memory unit as the hidden state of the current time step. This hidden state will be passed on as important information of the current time step or used to predict the output;
[0107] Hidden state output: Finally, the model generates the hidden state of the current time step by combining the output of the output gate and the state of the current memory unit. This hidden state not only contains relevant short-term information, but also carries the influence of long-term memory, which is a comprehensive reflection of the current input and previous state.
[0108] The input gate and forget gate are used to control the retention and update of current input information and past memory, and a new memory state is generated by combining candidate memory units. Finally, a hidden state that integrates short-term and long-term information is generated through the output gate for transmission or prediction.
[0109] The training process of the long short-term memory network algorithm model:
[0110] Define the goal: Set an objective function to measure the accuracy of the model's predictions by calculating the difference between the predicted value and the actual value;
[0111] Optimize the model: Use the back propagation algorithm to adjust the model parameters so that the prediction results are closest to the actual values. This step requires continuous adjustment and optimization of the model to minimize the error.
[0112] The prediction process of the long short-term memory network algorithm model, that is, the result of comprehensive analysis:
[0113] After the LSTM algorithm model is trained, for a given input sequence, the LSTM algorithm model will output the predicted value and hidden state of the current time step;
[0114] Determine anomalies: Determine the current prediction error by comparing the model's predicted value with the actual value, and determine whether the current prediction error is abnormal. The comparison process is as follows: Calculate the mean and standard deviation of the historical prediction errors, and set a threshold range based on the standard deviation. For example, assuming that the mean of the historical errors is 0 and the standard deviation is σ, then we can set 3σ as the threshold, which means that if the current prediction error exceeds 3 times the standard deviation of the mean, it can be considered abnormal; otherwise, it is normal; Among them:
[0115] If the comprehensive analysis result is abnormal, the sensor node corresponding to the current time column data is fed back to S1 as the result of the comprehensive analysis. Based on the comprehensive analysis result, the sensor node is identified and the data transmission frequency of the sensor node is adjusted. The data transmission frequency is increased by reducing the data transmission interval. For example, the data transmission frequency of the sensor is once every 10 minutes. Since the comprehensive analysis result is the temperature sensor data, the data transmission frequency of the temperature sensor is adjusted to once every 2 minutes. This can capture more detailed data and contribute to more accurate abnormal analysis; and increase the data set in S2 The weight of the corresponding sensor node data in is increased by a fixed step method. For example, the fixed step is 0.1, and the original weight is increased from 1.0 to 1.1. In this way, the random forest model will pay more attention to the data changes of the temperature sensor when analyzing anomalies. In this way, the data in S2 is analyzed for anomalies, so as to ensure that the comprehensive analysis result of S3 is not caused by the data anomaly.
[0116] If the comprehensive analysis results are normal, data collection and analysis are completed.
[0117] The second purpose of this embodiment is to provide a system for a data collection method based on multi-algorithm interaction, including a data collection module 100, a data analysis module 200 and a comprehensive analysis module 300.
[0118] The data collection module 100 uses multiple sensors to collect data as sensor node data; wherein the sensor collection process includes data collection frequency and data transmission frequency;
[0119] The data analysis module 200 uses a random forest algorithm model to perform an abnormal analysis on the sensor node data to generate a current analysis result; wherein:
[0120] If the current analysis result is abnormal, the data collection module 100 is fed back according to the abnormal result, and the data collection frequency is adjusted by adjusting the sensor node data corresponding to the abnormal result, and the data analysis module 200 is performed again. If the current analysis result is abnormal, the abnormal result is sent to the management personnel;
[0121] If the current analysis result is normal, the comprehensive analysis module 300 will be executed;
[0122] The comprehensive analysis module 300 uses a time series analysis algorithm to analyze the sensor node data to obtain a time series result, and performs a comprehensive analysis on the time series result according to a long short-term memory network algorithm; wherein:
[0123] If the comprehensive analysis result is abnormal, feedback is given to the data collection module 100 according to the abnormality of the comprehensive analysis result, and the data transmission frequency is adjusted for the sensor node data corresponding to the comprehensive analysis result, and the weight of the sensor node data is increased;
[0124] If the comprehensive analysis result is normal, the data collection and abnormality analysis are completed.
[0125] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A data collection method based on multi-algorithm interaction, characterized in that: The method comprises the following steps: S1. Collect data using multiple sensors as sensor node data; wherein the sensor collection process includes data collection frequency and data transmission frequency; S2. Perform abnormal analysis on the sensor node data using a random forest algorithm model to generate current analysis results; wherein: If the current analysis result is abnormal, feedback is given to S1 according to the abnormal result, and the data collection frequency is adjusted by adjusting the sensor node data corresponding to the abnormal result, and S2 is performed again. If the current analysis result is abnormal, the abnormal result is sent to the management personnel; If the current analysis result is normal, S3 will be executed; S3. Analyze the sensor node data using a time series analysis algorithm to obtain a time series result, and perform a comprehensive analysis on the time series result according to a long short-term memory network algorithm; wherein: If the comprehensive analysis result is abnormal, feedback is given to S1 according to the abnormality of the comprehensive analysis result, and the data transmission frequency is adjusted for the corresponding sensor node data in the comprehensive analysis result, and the weight of the sensor node data is increased; If the comprehensive analysis result is normal, the data collection and abnormality analysis are completed; The random forest algorithm model training steps are as follows: Sample selection: From the training data set The random selection was done by bootstrapping samples, generate multiple sub-sample sets; Feature selection: For each decision tree node, randomly select from all features features, among which , from which the best features are selected for splitting, where is the number of all features; For each sub-sample set, a decision tree is constructed. The specific steps are as follows: Split nodes: Use the Gini coefficient as the splitting condition, and select Find the best split feature among the features, and the Gini coefficient formula is: ,in Indicates The frequency of class samples in the training dataset, Represents the total number of categories in the training dataset; Recursive construction: Split the data set according to the best features, and recursively perform the above splitting on the segmented sub-datasets until the stopping condition is met, including but not limited to reaching the maximum depth of the tree; Model fusion: All trained decision trees are combined in an integrated manner. , each decision tree classifies it independently and outputs the category ; Use majority voting to determine the final prediction class for the input data , the formula is: ,in is the total number of decision trees, represents majority vote; The steps of performing anomaly analysis based on sensor node data by the random forest algorithm model are as follows: The current sensor node data Input into the trained random forest model; Random forest model output corresponding classification results ;in: like When , it means that the current analysis result is abnormal, and the corresponding abnormal data point is marked and fed back to S1. According to the abnormal data point, the corresponding sensor node is selected, and the data collection frequency of the corresponding sensor node in S1 is adjusted. By reducing the collection interval and increasing the collection frequency, the abnormal analysis of S2 is performed again. If the current analysis result is still abnormal at this time, the abnormal result is sent to the management personnel; like When , it means that the current analysis result is normal and S3 will be executed; The time series analysis algorithm is used to analyze the sensor node data to obtain the time series results, which specifically includes: Extracting seasonal components from time series , Trend Components , and residual ;in: Seasonal ingredients The calculation of is as follows: Smoothing the data by moving window smoothing; In each cycle, a local polynomial fit was performed for each time point; The sliding window is moved left by one time step and local smoothing is performed again until the entire time series is traversed; Trending ingredients The calculation of is as follows: Subtract the seasonal component from the original time series data To obtain deseasonalized data; Deseasonalized data are smoothed by moving average to obtain the trend component; Construct a sliding window that is larger than the seasonal window; Perform local polynomial fitting on time series data to obtain smoothed trend components; Residual The calculation of is as follows: Subtract the extracted trend component from the original time series and seasonal ingredients ; Finally, the time series results The calculation is: .
2. The data collection method based on multi-algorithm interaction according to claim 1 is characterized in that: The data collection frequency is initialized and set, and the data is periodically collected through the sensor nodes; the data transmission frequency is initialized and set, and the sensor node data is transmitted wirelessly.
3. The data collection method based on multi-algorithm interaction according to claim 1 is characterized in that: The architecture of the long short-term memory network algorithm model includes an input gate, a forget gate, candidate memory unit information, memory unit state update, an output gate and a hidden state output. The input gate and the forget gate are used to control the retention and update of the current input information and the past memory, and a new memory state is generated in combination with the candidate memory unit. The output gate is used to generate a hidden state of comprehensive short-term and long-term information for prediction. The long short-term memory network algorithm model is trained by setting an objective function and adjusting the parameters of the model through the back propagation algorithm.
4. The data collection method based on multi-algorithm interaction according to claim 3 is characterized in that: The steps of predicting the comprehensive analysis results by the long short-term memory network algorithm model are as follows: After the LSTM algorithm model is trained, for a given input sequence, the LSTM algorithm model outputs the predicted value and hidden state of the current time step; The current prediction error is determined by comparing the model's predicted value with the actual value, and whether the current prediction error is abnormal is determined, where: If the comprehensive analysis result is abnormal, the sensor node corresponding to the current time column data is fed back to S1 as the result of the comprehensive analysis. Based on the comprehensive analysis result, the sensor node is identified and the data transmission frequency of the sensor node is adjusted. The data transmission frequency is increased by reducing the data transmission interval; and the data set in S2 is increased. The weight of the corresponding sensor node data is increased by a fixed step size method; If the comprehensive analysis results are normal, data collection and analysis are completed.
5. The data collection method based on multi-algorithm interaction according to claim 4 is characterized in that: The comparison and determination process calculates the mean and standard deviation of historical prediction errors and sets a threshold range based on the standard deviation. If the current prediction error exceeds the threshold range, it is considered abnormal; otherwise, it is normal.
6. A system using the data collection method based on multi-algorithm interaction according to any one of claims 1 to 5, characterized in that: It comprises a data collection module (100), a data analysis module (200) and a comprehensive analysis module (300), wherein: The data collection module (100) uses a plurality of sensors to collect data as sensor node data; wherein the sensor collection process includes a data collection frequency and a data transmission frequency; The data analysis module (200) uses a random forest algorithm model to perform an abnormality analysis on the sensor node data to generate a current analysis result; wherein: If the current analysis result is abnormal, the data collection module (100) is fed back according to the abnormal result, the data collection frequency is adjusted by adjusting the sensor node data corresponding to the abnormal result, and the data analysis module (200) is performed again. If the current analysis result is abnormal, the abnormal result is sent to the management personnel; If the current analysis result is normal, the comprehensive analysis module (300) will be executed; The comprehensive analysis module (300) uses a time series analysis algorithm to analyze the sensor node data to obtain a time series result, and performs a comprehensive analysis on the time series result according to a long short-term memory network algorithm; wherein: If the comprehensive analysis result is abnormal, feedback is given to the data collection module (100) according to the abnormality of the comprehensive analysis result, and the data transmission frequency is adjusted for the sensor node data corresponding to the comprehensive analysis result, and the weight of the sensor node data is increased; If the comprehensive analysis result is normal, the data collection and abnormality analysis are completed.
