Anomaly Detection Method and System for Subway Air Conditioning Compressors Based on Isolation Forest
Through an abnormality detection method based on isolated forests, the exhaust temperature data of the air conditioner compressor is used to solve the problem of difficult to predict the failure of the air conditioner compressor in the prior art, early abnormality detection and prediction are achieved, and the safety and reliability of rail vehicles are improved.
Patent Information
- Application Number
- CN202310244874.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-14
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2043-03-14
AI Technical Summary
The prior art is difficult to predict potential failures of air conditioning compressors, which affects the safety and reliability of rail vehicles' operation and is also high in operation and maintenance costs.
An abnormality detection method based on isolated forest is adopted, by obtaining the exhaust temperature data of the air conditioner compressor in the subway train, calculating statistical characteristics, constructing an isolated forest abnormality detection model, obtaining the average path length of the sample, and detecting it according to the abnormal threshold.
Early prediction and detection of abnormalities of air conditioning compressors is realized, reducing the occurrence of train main line operation failures, reducing operation and maintenance costs, and improving detection efficiency and interpretability.
Smart Images

Figure CN116181635B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of abnormal detection of rail vehicles, and particularly to an abnormal detection method and system for a subway air-conditioning compressor based on an isolation forest. Background Art
[0002] As an underground means of transportation, the quality of the air directly affects the comfort level of the subway. The role of the air-conditioning system is to make the air temperature, humidity, etc. in the subway meet the comfort requirements of passengers, and at the same time provide a suitable working environment for the staff. Due to the actual situation that the subway is generally located underground, sunlight is rarely seen all year round, the relative space is small, and the density of people inside the station is large, the role of the ventilation and air-conditioning system is particularly important. First, due to human activities and equipment heat dissipation inside the station, it is necessary to ensure that the carbon dioxide concentration does not exceed the standard, and the temperature, humidity, etc. should reach relative stability; second, for the section of the interval tunnel, due to vehicle operation heat generation and on-vehicle air conditioner heat dissipation, etc., it is also necessary to consider the impact of the increased interval temperature on the surrounding environment; third, the subway is a crowded place, and in the event of sudden accidents such as fires, the impact is relatively large, which also puts forward disaster prevention requirements for the station air-conditioning system. Thus, it can be seen that the station air-conditioning system is an important part of the subway systems.
[0003] In vapor compression refrigeration equipment, the compressor is one of the four main components (compressor, condenser, evaporator, expansion valve). The compressor continuously inhales and discharges gas, and compresses the refrigerant from a low-pressure state to a high-pressure state, creating the conditions for the refrigerant liquid to vaporize and refrigerate in the evaporator and liquefy at normal temperature in the condenser. Therefore, it is the "heart" of the entire air-conditioning device.
[0004] Currently, the detection of abnormal conditions of the air-conditioning compressor is mostly based on some traditional inspection methods, troubleshooting through daily inspections, or maintenance after a failure occurs based on real-time data. This "failure repair" method is often relatively lagging and cannot predict potential failures. How to improve the safety and reliability of rail vehicle operation, reduce the operation and maintenance costs, and achieve the transformation from planned maintenance to condition-based maintenance has become an urgent problem to be solved currently. Summary of the Invention
[0005] In view of the above technical problem that the potential failures of the air conditioner cannot be predicted, the present invention proposes an abnormal detection method and system for a subway air-conditioning compressor based on an isolation forest.
[0006] In a first aspect, an embodiment of the present application provides an abnormal detection method for a subway air-conditioning compressor based on an isolation forest, including:
[0007] A data acquisition step: acquiring the exhaust temperature data of the air-conditioning compressor in a subway train and grouping the data;
[0008] Feature calculation step: Perform statistical feature calculation on each group of exhaust gas temperature data to obtain a sample matrix;
[0009] Path length obtaining step: Construct an isolation forest anomaly detection model, input the sample matrix into the isolation forest anomaly detection model, and obtain the average path length of each sample in the sample matrix;
[0010] Anomaly detection step: Obtain the score of the sample according to the average path length of each sample, and detect whether the score of each sample is abnormal according to the anomaly threshold to obtain the anomaly detection result.
[0011] The above anomaly detection method, wherein the sample matrix includes: the mean, standard deviation, minimum value, first quartile, second quartile, maximum value, proportion of samples outside 1.5 times the IQR above and below, mean of the largest 5% sample data, and mean of the smallest 5% samples of the compressor exhaust gas temperature data.
[0012] The above anomaly detection method, wherein the anomaly detection step includes:
[0013] Normalization step: Normalize the average path length of the sample to obtain the score of the sample;
[0014] Anomaly threshold calculation step: Calculate the anomaly threshold by calculating the first quartile, third quartile, and interquartile range of the scores of all samples;
[0015] Anomaly judgment step: If the score of the sample is less than the anomaly threshold, the sample is abnormal.
[0016] The above anomaly detection method, wherein the normalization step includes:
[0017] First normalization step: Normalize the average path length of the sample according to the average path length of the trees in the isolation forest anomaly detection model to obtain the score of the sample matrix;
[0018] Second normalization step: Normalize the score of the sample matrix according to the minimum value and maximum value in the score of the sample matrix to obtain the score of the sample.
[0019] The above anomaly detection method, wherein the path length obtaining step includes:
[0020] Model construction step: Set the maximum height of the trees in the isolation forest anomaly detection model according to the number of groups of the exhaust gas temperature data of the air conditioner compressor, and use the sample matrix as the input data;
[0021] Sample splitting step: Select a feature in the sample matrix, select a splitting point between the maximum value and the minimum value of the feature, and split the sample matrix according to the splitting point to obtain a left child node sample and a right child node sample, and increase the depth of the tree by 1;
[0022] Loop step: Use the left child node sample and the right child node sample as input data respectively to repeat the sample splitting step until the depth of the tree ≥ the maximum height of the tree, or the number of left child node samples and the number of right child node samples < 1.
[0023] The above abnormal detection method, wherein, the data acquisition step includes:
[0024] Data screening step: Screen out the dataset of the normal line operation of the subway train with the train speed greater than 0 and the platform number data equal to the vehicle depot number, and screen out the exhaust temperature data of the air-conditioning compressor;
[0025] Data grouping step: Group the exhaust temperature data according to the numbers of the compressors.
[0026] In a second aspect, an embodiment of the present application provides an abnormal detection system for a subway air-conditioning compressor based on an isolation forest, which is used to implement the abnormal detection method described in the first aspect above, and includes:
[0027] Data acquisition unit: Acquire the exhaust temperature data of the air-conditioning compressor in the subway train and group it;
[0028] Feature calculation unit: Calculate the statistical features of each group of exhaust temperature data to obtain a sample matrix;
[0029] Path length acquisition unit: Construct an isolation forest abnormal detection model, input the sample matrix into the isolation forest abnormal detection model, and obtain the average path length of each sample in the sample matrix;
[0030] Abnormal detection unit: Obtain the score of the sample according to the average path length of each sample, and detect whether the score of each sample is abnormal according to the abnormal threshold to obtain the abnormal detection result.
[0031] The above abnormal detection system, wherein, the abnormal detection unit includes:
[0032] Normalization module: Normalize the average path length of the sample to obtain the score of the sample;
[0033] Abnormal threshold calculation module: Calculate the abnormal threshold by calculating the first quartile, the third quartile, and the interquartile range of the scores of all samples;
[0034] Anomaly judgment module: If the score of a sample is less than the anomaly threshold, then the sample is anomalous.
[0035] The above anomaly detection system, wherein, the path length obtaining unit includes:
[0036] Model construction module: Set the maximum height of the trees in the isolation forest anomaly detection model according to the number of groups of the exhaust temperature data of the air-conditioning compressor, and use the sample matrix as the input data;
[0037] Sample segmentation module: Select a feature in the sample matrix, select a segmentation point between the maximum value and the minimum value of the feature, and segment the sample matrix according to the segmentation point to obtain a left child node sample and a right child node sample, and increase the depth of the tree by 1;
[0038] Loop module: Repeat the sample segmentation step with the left child node sample and the right child node sample as the input data respectively until the depth of the tree ≥ the maximum height of the tree, or the number of left child node samples and the number of right child node samples < 1.
[0039] The above anomaly detection system, wherein, the data acquisition unit includes:
[0040] Data screening module: Screen out the dataset of the normal operation of the subway train on the main line with the train speed greater than 0 and the platform number data equal to the depot number, and screen out the exhaust temperature data of the air-conditioning compressor;
[0041] Data grouping module: Group the exhaust temperature data according to the numbers of the compressors.
[0042] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0043] 1. The present invention adopts a data-driven method to detect the anomalies of the air-conditioning compressor, anticipates the occurrence of faults in advance, and issues a prompt to remind the ground monitoring personnel to pay key attention, reducing the occurrence of faults in the normal operation of the train. Compared with the prior art, the present invention directly extracts features from the collected parameters such as the compressor temperature, and can realize anomaly detection without human participation; the anomalies of the exhaust temperature are obvious in the statistical value matrix, which is conducive to the algorithm to distinguish and has good interpretability;
[0044] 2. Adopt the tree-based isolation forest anomaly detection algorithm. In the process of tree generation, the selection of features and thresholds is random, reducing the calculation time-consuming, and having the advantage of fast operation speed; it can detect anomalies before traditional manual detection, has predictability, and can judge anomalies without human participation. At the same time, the algorithm has a fast operation speed. The algorithm takes about 10s for the data of one vehicle in 16 days, reducing the human time cost compared with manual anomaly detection and improving the efficiency of anomaly detection;
[0045] 3. During the calculation of the isolation forest anomaly score, the present invention ingeniously transforms the value range of the anomaly score of the data from (0, 1) to (-0.5, 0.5), and then normalizes the score to (0, 100). Combining with the threshold threshold setting in the actual dataset, according to the comparison between the anomaly value score and the threshold, it is determined whether the detection sample is abnormal. Combining business knowledge makes the result judgment more in line with the convention, easier to understand and explain, and increases the interpretability and judgment. Description of the Drawings
[0046] Figure 1 It is a schematic diagram of the steps of the anomaly detection method for the subway air-conditioning compressor based on the isolation forest provided by the present invention;
[0047] Figure 2 Based on what the present invention provides Figure 1 It is a schematic diagram of the process of step S1;
[0048] Figure 3 Based on what the present invention provides Figure 1 It is a schematic diagram of the process of step S3;
[0049] Figure 4 Based on what the present invention provides Figure 1 It is a schematic diagram of the process of step S4;
[0050] Figure 5 Based on what the present invention provides Figure 4 It is a schematic diagram of the process of step S41;
[0051] Figure 6 It is a schematic diagram of the process of an embodiment of the anomaly detection method for the subway air-conditioning compressor based on the isolation forest provided by the present invention;
[0052] Figure 7 It is the calculation result of each statistical value of the exhaust temperature of the train unit system provided by the present invention;
[0053] Figure 8 It is the score of the exhaust temperature of the train unit system provided by the present invention;
[0054] Figure 9 It is the result of score normalization of the exhaust temperature of the train unit system provided by the present invention;
[0055] Figure 10 It is the anomaly unit identification diagram provided by the present invention;
[0056] Figure 11 It is the detection result diagram of a certain train provided by the present invention;
[0057] Figure 12Structural schematic diagram of the abnormal detection system for subway air-conditioning compressors based on isolation forest provided by the present invention. Detailed implementation manners
[0058] In order to make the objectives, technical solutions and advantages of the present application clearer, the following describes and explains the present application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments provided in the present application without creative efforts belong to the scope of protection of the present application.
[0059] Obviously, the accompanying drawings in the following description are only some examples or embodiments of the present application. For those of ordinary skill in the art, without creative efforts, the present application can also be applied to other similar scenarios based on these drawings. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for those of ordinary skill in the art related to the content disclosed in the present application, some design, manufacturing or production changes based on the technical content disclosed in the present application are only conventional technical means and should not be understood as the content disclosed in the present application being insufficient.
[0060] Referring to "embodiments" in the present application means that the specific features, structures or characteristics described in connection with the embodiments can be included in at least one embodiment of the present application. The phrase appears in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those of ordinary skill in the art explicitly and implicitly understand that the embodiments described in the present application can be combined with other embodiments without conflict.
[0061] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the ordinary meanings understood by those with ordinary skills in the technical field to which this application belongs. The words such as "a", "an", "one", "the" and the like involved in this application do not indicate a limitation in quantity and can represent singular or plural. The terms "include", "comprise", "have" and any variations thereof involved in this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may further include steps or units not listed, or may further include other steps or units inherent to these processes, methods, products or devices. The words such as "connect", "be connected", "couple" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "plurality" involved in this application means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, "A and / or B" can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. The terms "first", "second", "third" and the like involved in this application are only used to distinguish similar objects and do not represent a specific order for the objects.
[0062] The present invention will be described in detail below with reference to the embodiments shown in the drawings. However, it should be noted that these embodiments are not limitations on the present invention, and any equivalent transformation or substitution in terms of function, method, or structure made by those of ordinary skill in the art according to these embodiments shall fall within the protection scope of the present invention.
[0063] Before elaborating on the various embodiments of the present invention in detail, an overview of the core inventive concept of the present invention is given and will be elaborated in detail through the following several embodiments.
[0064] How to improve the safety and reliability of the operation of rail vehicles, reduce the operation and maintenance costs, and realize the transformation from planned maintenance to condition-based maintenance has become an urgent problem to be solved currently. To address this problem, the present invention adopts a data-driven method to detect the anomalies of air-conditioning compressors, predict the occurrence of faults in advance, and issue prompts to remind the ground monitoring personnel to pay key attention, so as to reduce the occurrence of faults during the main line operation of the train.
[0065] Embodiment 1:
[0066] As Figure 1 shown, this embodiment discloses a specific implementation manner of an anomaly detection method for subway air-conditioning compressors based on isolation forest (hereinafter referred to as "the method"), which can quickly detect the anomalies of subway air-conditioning compressors according to the collected data.
[0067] Specifically, the method disclosed in this embodiment mainly includes the following steps:
[0068] Step S1: Obtain the exhaust temperature data of the air-conditioning compressor in the subway train and group it;
[0069] Among them, as Figure 2 shown, the specific steps of Step S1 include:
[0070] Step S11: Screen out the dataset of the normal operation of the subway train on the main line where the train speed is greater than 0 and the platform number data is equal to the vehicle depot number, and screen out the exhaust temperature data of the air-conditioning compressor;
[0071] Step S12: Group the exhaust temperature data according to the numbers of the compressors.
[0072] Among them, the main parameters of the compressor are the suction temperature, the exhaust temperature, and the high-pressure pressure. Through the observation of the related faults of the air-conditioning compressor, it is found that the abnormalities and faults of the compressor will be more obvious in the exhaust temperature parameter. More specifically, some statistical quantities can be calculated for the air-conditioning exhaust temperature parameter, which can reflect the data distribution of the air-conditioning abnormality. At the same time, based on the assumption that the compressors with faults on the train are in the minority and most are in the normal operation state, this application can find out the abnormal compressors of each vehicle through the anomaly detection algorithm.
[0073] Specifically, first, data screening is performed. According to the conditions that the train speed > 0 and the platform number data = the vehicle depot number, the dataset of the normal operation of the subway train on the main line is screened out, and the exhaust temperature dataset P of the compressor is screened out from it; then data grouping is performed. Taking the numbers of the compressors as the grouping conditions, the dataset is divided into P 1 , P 2 , P 3 ....P n .
[0074] Step S2: Calculate the statistical features of each group of exhaust temperature data to obtain a sample matrix;
[0075] Specifically, calculate the statistical features of each group of exhaust temperature data Pi to obtain 9-dimensional features Q, Q ∈ R 9, These features are respectively the mean, standard deviation (std), minimum (min), first quartile (25%), second quartile (50%), maximum (max), the proportion of samples outside 1.5 times the IQR above and below (outlier%), the mean of the largest 5% of the sample data (top5% mean), and the mean of the smallest 5% of the samples (bottom5% mean). These statistical values describe the characteristics of the parameter distribution from the perspectives of the degree of data dispersion, the overall range, and the proportion of outliers. Then for n groups of data, by calculating the features, the sample matrix X ∈ R is finally obtained n×9 .
[0076] Step S3: Construct an isolation forest anomaly detection model, input the sample matrix into the isolation forest anomaly detection model, and obtain the average path length of each sample in the sample matrix;
[0077] Among them, as Figure 3 shown, the specific steps of step S3 include:
[0078] Step S31: Set the maximum height of the tree in the isolation forest anomaly detection model according to the number of groups of the exhaust temperature data of the air-conditioning compressor, and use the sample matrix as the input data;
[0079] Step S32: Select a feature in the sample matrix, select a splitting point between the maximum value and the minimum value of the feature, and split the sample matrix according to the splitting point to obtain a left child node sample and a right child node sample, and increase the depth of the tree by 1;
[0080] Step S33: Repeat step S32 with the left child node sample and the right child node sample as the input data respectively until the depth of the tree ≥ the maximum height of the tree, or the number of left child node samples and the number of right child node samples < 1.
[0081] Specifically, in the model construction, the above sample matrix X is used as the input of the isolation forest algorithm. Since the operating conditions of all units during the normal operation of the subway are basically the same, if an abnormality occurs in a certain unit, its statistical characteristics must be different from those of other samples and are easily separated, which is in line with the application background of the isolation forest algorithm. Set the number of trees in the isolation forest algorithm to T, and the input data to X. The construction process of the isolation forest algorithm is as follows:
[0082] 1. Set the maximum height of the tree l = log 2 n, where n is the number of groups of data;
[0083] 2. Construct each subtree t (1 ≤ t ≤ T): At this time, the depth e of the tree is 0,
[0084] 1) Let Q be the feature set of the input data X;
[0085] 2) Randomly select a feature q ∈ Q;
[0086] 3) Randomly select a splitting point p between the maximum and minimum values of the feature q;
[0087] 4) Split the data X to obtain the left child node X l (q < p) and the right child node X r (q ≥ p);
[0088] 5) The depth e of the tree = e + 1;
[0089] 6) Treat the left child node sample X l and the right child node sample X r respectively as the input data X and repeat steps 5) - 6) until e ≥ l or the number of samples in X l and X r is less than 1.
[0090] Step S4: Obtain the scores of the samples according to the average path length of each sample, and detect whether the scores of each sample are abnormal according to the anomaly threshold to obtain the anomaly detection result.
[0091] Among them, as Figure 4 shown, step S4 specifically includes:
[0092] Step S41: Normalize the average path length of the samples to obtain the scores of the samples;
[0093] Specifically, as Figure 5 shown, step S41 includes:
[0094] Step S411: Normalize the average path length of the samples according to the average path length of the trees of the isolation forest anomaly detection model to obtain the scores of the sample matrix;
[0095] Step S412: Normalize the scores of the sample matrix according to the minimum and maximum values in the scores of the sample matrix to obtain the scores of the samples.
[0096] Step S42: Calculate the anomaly threshold by calculating the first quartile, the third quartile, and the interquartile range in the scores of all samples;
[0097] Step S43: If the score of the sample is less than the anomaly threshold, then the sample is abnormal.
[0098] Specifically, calculate the average path length E(h(x)) of each sample x in X. That is, calculate h(x) by counting the number of edges experienced by sample x from the root node to the node containing sample x in each tree. After calculating the path lengths of T trees, the average path length E(h(x)) can be obtained, and the score for this sample can be calculated according to the following formula:
[0099]
[0100] where is the average path length of the tree, which is used to normalize the path length of sample x. Then s ∈ (-0.5, 0.5].
[0101] According to this formula, the lower the score, the shorter the path, and the more abnormal the corresponding sample. According to the algorithm output, the algorithm score S for the sample matrix X ∈ R n .
[0102] Then, normalize the score S to the range of 0 to 100 according to the following formula to obtain S′, and set a threshold in combination with the actual data to achieve anomaly detection.
[0103]
[0104] By calculating the Q1 (first quartile), Q3 (third quartile), and IQR (interquartile range) of the normalized path length, calculate the anomaly threshold threshold, as shown in the following formula: threshold = Q1 - 3 * IQR. If the score is less than this anomaly threshold, it is an abnormal sample.
[0105] Compared with the prior art, the present invention directly extracts features from the collected parameters such as the compressor temperature, etc., and can achieve anomaly detection without human participation; the anomaly of the exhaust temperature is obvious in the statistical value matrix, which is conducive to the algorithm to distinguish and has good interpretability; the isolation forest, a tree-based anomaly detection algorithm, is adopted. During the tree generation process, the selection of features and thresholds is random, reducing the calculation time-consuming and having the advantage of fast operation speed;
[0106] Next, with reference to Figure 6 , the anomaly detection method for the subway air-conditioning compressor based on the isolation forest proposed by the present invention will be further described in detail with specific embodiments.
[0107] 1. Screen the data of a certain day of the subway as the original data;
[0108] 2. Screen the data of the main line operation on that day;
[0109] 3. Calculate the statistical values for the exhaust gas temperatures in the main line data: the mean, standard deviation (std), minimum (min), first quartile (25%), second quartile (50%), maximum (max), the proportion of samples outside 1.5 times the IQR above and below (outlier%), the mean of the largest 5% of the sample data (top5% mean), and the mean of the smallest 5% of the sample data (bottom5% mean). The calculation results are as Figure 7 shown:
[0110] 4. Take each statistical value of the exhaust gas temperature of each system as input data and input it into the Isolation Forest algorithm to calculate the score of the exhaust gas temperature of each system, as Figure 8 .
[0111] 5. Normalize and scale it to [0, 100], as Figure 9 shown; calculate the Q1 (first quartile), Q3 (third quartile), and IQR (interquartile range) of the path length after normalization, and calculate the threshold threshold = Q1 - 3 * IQR. In this example, the threshold is calculated to be 6.895133.
[0112] 6. As Figure 10 shown, the compressor score in the box in the figure is less than the threshold, which is an abnormal unit.
[0113] As Figure 11 shown, Figure 11 is the detection result diagram of a certain train. It can be clearly observed that the algorithm had a continuous alarm for the exhaust gas temperature of the unit 2 of system 1 of car TC1 from June 2, 2021 to July 6, 2021. By referring to the maintenance records, it can be found that there was a high - pressure fault in the compressor 2 of unit 1 of car TC1 from July 5 to July 7, 2021. The algorithm detected the abnormality of the air - conditioning unit nearly 1 month in advance before the maintenance record.
[0114] From this, it can be shown that this method has the following advantages:
[0115] 1. The Isolation Forest anomaly detection algorithm adopted in the present invention can detect anomalies before traditional manual detection, has predictability, and can judge anomalies without manual participation.
[0116] 2. At the same time, the algorithm has a fast operation speed. The algorithm takes about 10s to process the data of one car for 16 days, reducing the human and time costs compared with manual anomaly detection and improving the efficiency of anomaly detection.
[0117] Example 2:
[0118] Combined with the abnormal detection method of the subway air-conditioning compressor based on the isolation forest disclosed in Embodiment 1, this embodiment discloses a specific implementation example of an abnormal detection system (hereinafter referred to as "the system") of the subway air-conditioning compressor based on the isolation forest.
[0119] Referring to Figure 12 as shown, the system includes:
[0120] Data acquisition unit 1: Acquire the exhaust temperature data of the air-conditioning compressor in the subway train and group it;
[0121] Among them, the data acquisition unit 1 includes:
[0122] Data screening module 11: Screen out the data set of the normal operation of the main line of the subway train with the train speed greater than 0 and the platform number data equal to the depot number, and screen out the exhaust temperature data of the air-conditioning compressor;
[0123] Data grouping module 12: Group the exhaust temperature data according to the numbers of each compressor.
[0124] Feature calculation unit 2: Calculate the statistical features of each group of exhaust temperature data to obtain a sample matrix;
[0125] Among them, the sample matrix includes: the mean, standard deviation, minimum value, first quartile, second quartile, maximum value, the proportion of samples outside 1.5 times IQR above and below, the mean of the largest 5% sample data, and the mean of the smallest 5% samples of the exhaust temperature data of the compressor.
[0126] Path length acquisition unit 3: Construct an isolation forest anomaly detection model, input the sample matrix into the isolation forest anomaly detection model, and obtain the average path length of each sample in the sample matrix;
[0127] Among them, the path length acquisition unit 3 includes:
[0128] Model construction module 31: Set the maximum height of the tree in the isolation forest anomaly detection model according to the number of groups of the exhaust temperature data of the air-conditioning compressor, and use the sample matrix as the input data;
[0129] Sample segmentation module 32: Select a feature in the sample matrix, select a segmentation point between the maximum value and the minimum value of the feature, and segment the sample matrix according to the segmentation point to obtain a left child node sample and a right child node sample, and the depth of the tree is increased by 1;
[0130] Loop module 33: Use the left child node sample and the right child node sample as input data respectively, and repeat the sample segmentation step until the depth of the tree ≥ the maximum height of the tree, or the number of left child node samples and the number of right child node samples < 1.
[0131] Anomaly detection unit 4: Obtain the score of each sample according to the average path length of each sample, and detect whether the score of each sample is abnormal according to the anomaly threshold to obtain the anomaly detection result.
[0132] Among them, the anomaly detection unit 4 includes:
[0133] Normalization module 41: Normalize the average path length of the sample to obtain the score of the sample;
[0134] Specifically, the normalization module 41 includes:
[0135] First normalization module 411: Normalize the average path length of the sample according to the average path length of the trees of the isolated forest anomaly detection model to obtain the score of the sample matrix;
[0136] Second normalization module 412: Normalize the score of the sample matrix according to the minimum value and the maximum value in the score of the sample matrix to obtain the score of the sample.
[0137] Anomaly threshold calculation module 42: Calculate the anomaly threshold by calculating the first quartile, the third quartile, and the interquartile range in the scores of all samples;
[0138] Anomaly judgment module 43: If the score of the sample is less than the anomaly threshold, the sample is abnormal.
[0139] For the technical solutions of the same parts in an anomaly detection system of a subway air-conditioning compressor based on an isolated forest disclosed in this embodiment and an anomaly detection method of a subway air-conditioning compressor based on an isolated forest disclosed in Embodiment 1, please refer to Embodiment 1 and will not be elaborated here.
[0140] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0141] The above embodiments only represent several implementation manners of the present application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several deformations and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.
Claims
1. An abnormal detection method for a subway air-conditioning compressor based on isolation forest, characterized in that, it includes: Data acquisition step: Acquire the exhaust temperature data of the air-conditioning compressor in the subway train and group it; The data acquisition step further includes: Data screening step: Screen out the data set of the normal operation of the subway train on the main line where the train speed is greater than 0 and the platform number data is equal to the depot number, and screen out the exhaust temperature data of the air-conditioning compressor; Data grouping step: Group the exhaust temperature data according to the number of each compressor; Feature calculation steps: Statistical feature calculation is performed on each group of exhaust gas temperature data to obtain a sample matrix; Statistical feature calculation is performed on each group of exhaust gas temperature data to obtain a 9-dimensional feature Q, Q ∈ R 9 , For n groups of data, the sample matrix X ∈ R is finally obtained by calculating the features n×9 , The sample matrix includes: the mean, standard deviation, minimum value, first quartile, second quartile, maximum value, the proportion of samples outside 1.5 times the IQR above and below, the mean of the largest 5% of the sample data, and the mean of the smallest 5% of the samples; Path length obtaining step: Construct an isolation forest abnormal detection model, input the sample matrix into the isolation forest abnormal detection model, and obtain the average path length of each sample in the sample matrix; Abnormal detection step: Obtain the score of the sample according to the average path length of each sample, and detect whether the score of each sample is abnormal according to the abnormal threshold, and obtain the abnormal detection result.
2. The abnormal detection method according to claim 1, characterized in that, the abnormal detection step includes: Normalization step: Normalize the average path length of the sample to obtain the score of the sample; Abnormal threshold calculation step: Calculate the abnormal threshold by calculating the first quartile, the third quartile, and the interquartile range in the scores of all samples; Abnormal judgment step: If the score of the sample is less than the abnormal threshold, the sample is abnormal.
3. The abnormal detection method according to claim 2, characterized in that, the normalization step includes: First normalization step: Normalize the average path length of the sample according to the average path length of the tree of the isolation forest abnormal detection model to obtain the score of the sample matrix; Second normalization step: Normalize the score of the sample matrix according to the minimum value and the maximum value in the score of the sample matrix to obtain the score of the sample.
4. The abnormal detection method according to claim 1, characterized in that, the path length obtaining step includes: Model construction step: Set the maximum height of the tree in the isolation forest abnormal detection model according to the number of groups of the exhaust temperature data of the air-conditioning compressor, and use the sample matrix as the input data; Sample segmentation step: Select a feature in the sample matrix, select a segmentation point between the maximum value and the minimum value of the feature, and segment the sample matrix according to the segmentation point to obtain the left child node sample and the right child node sample, and the depth of the tree is increased by 1; Loop step: Repeat the sample segmentation step with the left child node sample and the right child node sample as the input data respectively until the depth of the tree ≥ the maximum height of the tree, or the number of left child node samples and the number of right child node samples < 1.
5. An abnormal detection system for a subway air-conditioning compressor based on isolation forest, used to implement the abnormal detection method described in any one of claims 1-4 above, characterized in that, it includes: Data acquisition unit: Acquire the exhaust temperature data of the air-conditioning compressor in the subway train and group it; The data acquisition unit further includes: a data screening module: screening out a data set of the normal operation of a subway train on the main line where the train speed is greater than 0 and the platform number data is equal to the depot number, and screening out the exhaust temperature data of the air-conditioning compressor; a data grouping module: grouping the exhaust temperature data according to the numbers of the compressors; Feature calculation unit: perform statistical feature calculations on each set of exhaust gas temperature data to obtain a sample matrix; perform statistical feature calculations on each set of exhaust gas temperature data to obtain a 9-dimensional feature Q, Q ∈ R 9 , for n sets of data, finally obtain a sample matrix X ∈ R by calculating features n×9 , the sample matrix includes: the mean, standard deviation, minimum value, first quartile, second quartile, maximum value, proportion of samples outside 1.5 times the IQR above and below, mean of the largest 5% of the sample data, and mean of the smallest 5% of the samples; Path length obtaining unit: constructing an isolation forest anomaly detection model, inputting the sample matrix into the isolation forest anomaly detection model, and obtaining the average path length of each sample in the sample matrix; Anomaly detection unit: obtaining the score of each sample according to the average path length of each sample, and detecting whether the score of each sample is abnormal according to the anomaly threshold to obtain the anomaly detection result.
6. The anomaly detection system according to claim 5, wherein, the anomaly detection unit includes: Normalization module: normalizing the average path length of the sample to obtain the score of the sample; Anomaly threshold calculation module: calculating the anomaly threshold by calculating the first quartile, the third quartile, and the interquartile range among the scores of all samples; Anomaly judgment module: if the score of the sample is less than the anomaly threshold, the sample is abnormal.
7. The anomaly detection system according to claim 5, wherein, the path length obtaining unit includes: Model construction module: setting the maximum height of the tree in the isolation forest anomaly detection model according to the number of groups of the exhaust temperature data of the air-conditioning compressor, and using the sample matrix as the input data; Sample segmentation module: selecting a feature in the sample matrix, selecting a segmentation point between the maximum value and the minimum value of the feature, and segmenting the sample matrix according to the segmentation point to obtain a left child node sample and a right child node sample, and increasing the depth of the tree by 1; Loop module: repeating the sample segmentation step with the left child node sample and the right child node sample as the input data respectively until the depth of the tree ≥ the maximum height of the tree, or the number of left child node samples and the number of right child node samples < 1.
Citation Information
Patent Citations
Detection method and device for reliability of compressor
CN106089672A
Method, system and equipment for detecting abnormity of mine ventilator and storage medium
CN113915153A