A data security transmission method and system for a digital energy air compressor station
By performing differential processing and isolated tree quality evaluation on the pressure data of digital energy air compressor stations, high-quality isolated trees are selected to build isolated forests, solving the problem of inability to effectively capture data changes and computational redundancy in the existing technology, and achieving more accurate abnormal data identification and improvement in computing efficiency.
Patent Information
- Application Number
- CN202411737304.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-11-29
AI Technical Summary
When filtering abnormal data, the prior art directly builds multiple isolated trees for pressure data, and cannot capture changes in pressure data. The tree is repeatedly constructed due to invalid data, increasing computational redundancy, resulting in low accuracy of abnormal data.
By performing differential processing of the pressure data, the differential feature sequence is obtained, and multiple isolated trees corresponding to the differential feature sequence are constructed. The target isolated trees are filtered based on the mass coefficient of the isolated tree, and an isolated forest is constructed to identify abnormal feature data and normal feature data.
It improves the ability to capture the changing trend of pressure data, reduces calculation redundancy, enhances the accuracy of abnormal data, and can more accurately identify abnormal feature data and normal feature data in pressure data.
Smart Images

Figure CN119226986B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data anomaly monitoring based on isolation forests, and in particular to a data security transmission method and system for a digital energy air compressor station. Background Art
[0002] With the rapid development of digital technology, digital energy air compressor stations are playing an increasingly important role in modern industrial production. By integrating advanced sensors, control algorithms and communication technologies, digital energy air compressor stations can realize intelligent monitoring, optimized management and efficient operation of air compressor stations. During the operation of digital energy air compressor stations, the pressure data of the gas tank is one of its core parameters. The stability and accuracy of the gas tank pressure are directly related to the working efficiency and production safety of the air compressor station. Therefore, before the pressure data is transmitted, it is usually necessary to classify the pressure data, filter out the normal data and abnormal data, and then encrypt the normal data and abnormal data before transmitting them.
[0003] When screening abnormal data, the existing technology usually uses the isolation forest algorithm to process the pressure data and construct multiple isolated trees to obtain abnormal data. However, in the actual industrial production environment, the operating status of the air compressor station may be affected by various factors, such as load changes, ambient temperature, equipment aging, etc., which will cause the pressure data of the gas tank to fluctuate and have the characteristics of non-time stationarity. The basic idea of the isolation forest algorithm is to randomly capture data points to construct isolated trees and then use the distribution characteristics of data points to identify outliers. Therefore, if multiple isolated trees are directly constructed for the pressure data, not only will the changes in the pressure data fail to be captured, but also the calculation redundancy will be increased because many invalid data are used to build trees multiple times, resulting in low accuracy of the acquired abnormal data. Summary of the invention
[0004] In order to solve the technical problem that directly constructing multiple isolated trees for pressure data not only fails to capture the changes in pressure data, but also increases calculation redundancy because many invalid data are built into trees multiple times, resulting in low accuracy of acquired abnormal data, the purpose of the present invention is to provide a data security transmission method and system for a digital energy air compressor station, and the technical solutions adopted are as follows:
[0005] Obtain the pressure data of the gas storage tank in the digital energy air compression station within a preset period of time;
[0006] The pressure data is divided to obtain a plurality of pressure data segments; the differences of the data values in all the pressure data segments are calculated and stability is determined based on the difference sequence to obtain a difference characteristic sequence corresponding to the pressure data;
[0007] Constructing multiple isolated trees corresponding to the differential feature sequence, and determining the quality coefficient of the isolated tree based on the similarity of the data values used between the isolated trees, the distribution fluctuation of the data values in the isolated trees, and the abnormality of the data values;
[0008] The target isolated tree is selected based on the quality coefficient; an isolation forest corresponding to the differential feature sequence is constructed according to all the target isolated trees; and abnormal feature data and normal feature data are determined in the pressure data based on the isolation forest.
[0009] Furthermore, the method for obtaining the pressure data segment includes:
[0010] Acquire a frequency spectrum corresponding to the pressure data based on Fourier transform;
[0011] In the frequency spectrum, the frequency corresponding to the maximum value is used as the target frequency, and the data period of the pressure data is obtained according to the target frequency;
[0012] Starting from the starting position of the pressure data, the pressure data is periodically divided based on the data period to obtain all pressure data segments corresponding to the pressure data.
[0013] Furthermore, the method for obtaining the differential feature sequence includes:
[0014] Iteratively calculate the difference sequence for all pressure data segments, wherein the order of the difference sequence increases by one in each iteration process;
[0015] In each iteration process, the differential sequence of each pressure data segment at the current iteration number is obtained, and a wide-range stationary judgment is performed on each differential sequence. If there is a differential sequence that does not meet the wide-range stationary condition, the next iteration process is performed until the differential sequences of all pressure data segments in the current iteration process meet the wide-range stationary condition, and the differential sequence of the pressure data at the current iteration number is used as the differential feature sequence.
[0016] Furthermore, the step of constructing a plurality of isolated trees corresponding to the differential feature sequence and determining the quality coefficient of the isolated tree based on the similarity of the data values used between the isolated trees, the distribution fluctuation of the data values in the isolated trees, and the abnormality of the data values includes:
[0017] A preset number of iterations is set, and in each iteration process, a preset first number of data values in the differential feature sequence are randomly captured to construct an isolated tree. Starting from the second iteration, the isolated trees of all iteration processes before the current iteration process are used as reference trees, and the isolated tree under the current iteration number is used as the tree to be tested;
[0018] In each iteration process starting from the second iteration, based on the similarity of the data values used between the tree to be tested and all corresponding reference trees, the similar eigenvalue corresponding to the tree to be tested is determined; based on the distribution fluctuation and abnormality of the data values in the tree to be tested in the reference trees, the fluctuation eigenvalue corresponding to the tree to be tested is determined;
[0019] The quality coefficient of the tree to be tested is determined based on the similarity eigenvalue and the fluctuation eigenvalue of the tree to be tested, wherein the similarity eigenvalue is negatively correlated with the quality coefficient, and the fluctuation eigenvalue is positively correlated with the quality coefficient.
[0020] Furthermore, the method for obtaining similar feature values includes:
[0021] Arranging the data values in the tree to be tested according to the order in the differential feature sequence to obtain a feature vector corresponding to the tree to be tested;
[0022] Arranging the data values in each reference tree corresponding to the tree to be tested according to the order in the differential feature sequence to obtain a feature vector corresponding to each reference tree;
[0023] The similarity between the feature vector corresponding to the tree to be tested and the feature vector corresponding to each reference tree is comprehensively considered to obtain the similar feature value corresponding to the tree to be tested.
[0024] Furthermore, the method for obtaining the fluctuation characteristic value includes:
[0025] Obtain the path length corresponding to each data value in the tree to be tested and the corresponding reference tree;
[0026] For any data value in the tree to be tested, based on the fluctuation of the path length of the data value in all corresponding reference trees, determine the fluctuation factor corresponding to the data value, average the fluctuation factors of all data values in the tree to be tested, and obtain the volatility parameter corresponding to the tree to be tested;
[0027] Based on the numerical characteristics of the path length of the data value in all corresponding reference trees, the clustering factor corresponding to the data value is determined, and the clustering factors of all data values in the tree to be tested are averaged to obtain the stability parameter corresponding to the tree to be tested;
[0028] The fluctuation characteristic value of the tree to be tested is determined according to the stability parameter and the fluctuation parameter corresponding to the tree to be tested, wherein the stability parameter and the fluctuation characteristic value change in opposite directions, and the fluctuation parameter and the fluctuation characteristic value change in the same direction.
[0029] Furthermore, the method for obtaining the target isolated tree includes:
[0030] The isolated tree whose quality coefficient is greater than the preset quality threshold is taken as the target isolated tree.
[0031] Further, determining abnormal feature data and normal feature data in the pressure data based on the isolation forest includes:
[0032] Obtaining an anomaly score for each data value in the isolation forest, and taking a data value whose anomaly score is greater than a preset anomaly threshold in the differential feature sequence as an abnormal data value;
[0033] In the pressure data corresponding to the differential feature sequence, the data value corresponding to the abnormal data value is used as the abnormal feature data, and the other data values except the abnormal feature data are used as the normal feature data.
[0034] After obtaining the abnormal feature data and the normal feature data, the method further includes:
[0035] Encrypt and transmit normal feature data based on a symmetric encryption algorithm;
[0036] The abnormal feature data is encrypted based on a homomorphic encryption algorithm to obtain encrypted data, and a ciphertext operation is performed on the encrypted data to obtain an operation result, and the encrypted data and the operation result are transmitted.
[0037] The present invention also proposes a data security transmission system for a digital energy air compressor station, the system comprising:
[0038] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of any one of the methods can be implemented when the processor executes the computer program.
[0039] The present invention has the following beneficial effects:
[0040] First, the pressure data of the gas storage tank in the digital energy air compressor station within the preset time period is obtained. Since the pressure data will be disturbed by various external factors, causing its time stability to change, in order to better capture the changing trend of the pressure data and help discover potential abnormal situations, the pressure data can be divided, and then the differential sequence analysis and stability judgment of each pressure data segment are performed to obtain the differential feature sequence; the differential feature sequence can better reflect the changing trend of the pressure data and further enhance the stability of the data. Since the monitoring of abnormal points by the isolation forest algorithm depends on the number of isolated trees to a certain extent, too many isolated trees will cause invalid or low-value data points to be captured multiple times for constructing isolated trees, thereby increasing computational redundancy, and too few isolated trees will cause the final abnormal data to be acquired inaccurately; therefore, in the present invention, the quality of each isolated tree constructed is evaluated: based on the similarity of the data values used between the isolated trees, the distribution fluctuation of the data values in the isolated trees, and the abnormal situation, the quality coefficient of the isolated tree is quantified. Thus, in the subsequent process, the target isolated tree with higher quality and higher analysis value is screened out based on the quality coefficient. Finally, an isolation forest is constructed based on all target isolated trees and abnormal data is analyzed, which can more accurately identify abnormal feature data and normal feature data in pressure data. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A method flow chart of a data security transmission method for a digital energy air compressor station provided by an embodiment of the present invention;
[0043] Figure 2 A method flow chart of a method for obtaining a quality coefficient provided by an embodiment of the present invention;
[0044] Figure 3 A system block diagram of a data security transmission system for a digital energy air compressor station provided by an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of the system structure of a data security transmission system for a digital energy air compressor station provided by an embodiment of the present invention;
[0046] Figure 5 A schematic diagram of a computer-readable storage medium provided for one embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the data security transmission method and system of a digital energy air compressor station proposed by the present invention, its specific implementation method, structure, characteristics and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0048] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0049] The following is a detailed description of a method and system for secure data transmission of a digital energy air compressor station provided by the present invention in conjunction with the accompanying drawings.
[0050] See also Figure 1 , which shows a method flow chart of a method for secure data transmission of a digital energy air compressor station provided by an embodiment of the present invention, the method comprising the following steps:
[0051] Step S1: Obtain the pressure data of the gas storage tank in the digital energy air compression station within a preset time period.
[0052] An air compressor station is generally an air compressor station that uses air compressors, gas tanks, dryers and filters to work together to generate an environmentally friendly power source. The digital energy air compressor station combines the traditional air compressor station with digital technology and monitors the operating status of the air compressor station through data, thereby realizing intelligent monitoring of the air compressor station. During the operation of the digital energy air compressor station, the pressure data of the gas tank is one of the core parameters. The stability and accuracy of the gas tank pressure is directly related to the working efficiency and production safety of the digital energy air compressor station. Therefore, pressure data is crucial for monitoring the operating status of the air compressor station, predicting potential failures, and optimizing operating strategies.
[0053] Obtain the pressure data of the gas storage tank in the digital energy air compression station within the preset time period. After data collection, since there may be problems with the data quality, the pressure data needs to be preprocessed to initially obtain relatively accurate pressure data.
[0054] It should be noted that the preset time period can be set to 60 minutes and the sampling interval can be set to 1s. The specific duration and sampling interval are not limited and can be adjusted according to the implementation scenario. The pressure data collection device can adopt a variety of methods, such as sensors, data acquisition systems, etc. The specific method is not limited and can be adjusted according to the implementation scenario. The data preprocessing method can roughly include detecting and processing missing values: identifying and filling missing values or deleting data points containing missing values, and correcting them using the mean method; smoothing and filtering: the corrected data is smoothed and filtered based on retaining trends and periodicity. The method used in the present invention is average filtering.
[0055] At this point, the pressure data of the gas storage tank in the digital energy air compression station within the preset time period can be obtained.
[0056] Step S2: Divide the pressure data to obtain multiple pressure data segments; calculate the differences of the data values in all the pressure data segments and make stability judgment based on the difference sequence to obtain the difference feature sequence corresponding to the pressure data.
[0057] During the operation of the air compressor station equipment, data exchange and data transmission are required between devices. The normal pressure data of the equipment is generally directly encrypted and transmitted to the terminal for storage. The abnormal pressure data has research value: analyzing the cause of the fault based on the abnormal pressure data to optimize the operation strategy, etc., so it is necessary to stay on the device side to perform the data calculation required for the abnormal analysis. At this time, the security of the data calculated on the device side cannot be guaranteed and is easily illegally hijacked, resulting in the loss of energy data assets. Therefore, different encryption measures can be taken for abnormal data and normal data. Before taking different encryption measures, it is necessary to accurately screen out the abnormal data.
[0058] The basic idea of the isolation forest algorithm is to use the sparsity of data distribution to detect outliers. In the data space, normal data are usually densely clustered together, while abnormal data are distributed in relatively sparse areas. When using the isolation forest algorithm to detect anomalies in the pressure data of the air compressor station, the operating status of the equipment in the air compressor station will be affected by a variety of external factors during actual operation, such as load changes, ambient temperature, equipment aging, etc. These factors will cause the pressure data to change over time, making the pressure data no longer meet the characteristics of a stationary time series, but have more complex features, such as periodicity or other forms of irregularity. For example, the existing periodic data (1, 2, 3, 2, 1, 2, 3, 2, 1) is normal periodic data, but when performing isolation forest detection based on data size, 3 has an obvious anomaly score; these features will lead to uneven distribution of data points in the feature space, which in turn affects the effect of random partitioning and tree construction in the isolation forest algorithm, making the detection of outliers inaccurate, so it is necessary to eliminate or reduce the impact of non-temporal stationarity of pressure data.
[0059] Differential processing can make the data more stable by performing differential operations on time series data, thereby eliminating or reducing the impact of non-temporal stationarity of pressure data. However, during the operation of air compressor station equipment, due to load changes, ambient temperature, equipment aging, etc., these factors may cause the pressure data to be periodic, and it is difficult to analyze the stability between different periods of periodic data. Therefore, in an embodiment of the present invention, the pressure data can be first periodically divided to obtain multiple pressure data segments, and then the differential sequence in each pressure data segment is calculated and stability analysis is performed to obtain the differential feature sequence corresponding to the pressure data. The differential feature sequence can highlight the change pattern of the pressure data and help understand the operating status of the equipment, effectively eliminating the impact of non-temporal stationarity of the pressure data, so that in the subsequent process, the accuracy of the isolation forest algorithm detection can be effectively improved by further analyzing the differential feature sequence.
[0060] In signal processing and data analysis, frequency domain information can reveal the distribution and variation characteristics of data in the frequency domain. Therefore, the period of pressure data can be obtained through frequency domain information, and the pressure data can be analyzed periodically, that is, the period is obtained through frequency domain information to obtain the pressure data segment.
[0061] Preferably, in one embodiment of the present invention, the method for obtaining the pressure data segment includes:
[0062] Fourier transform is a data tool that converts data between time domain and frequency domain. Based on Fourier transform, the spectrum diagram corresponding to the pressure data can be obtained. In the spectrum diagram, the horizontal axis is frequency and the vertical axis is energy.
[0063] In the spectrum diagram, the frequency corresponding to the maximum value usually represents the main periodic component in the data, because the periodic component will produce an obvious peak in the spectrum, and its height is proportional to the intensity of the periodic component. Therefore, the frequency corresponding to the maximum value is used as the target frequency, and the data period of the pressure data is obtained according to the target frequency. The data period can be obtained through simple mathematical operations. The relationship between period and frequency is: ;in, Represents the cycle, Indicates frequency.
[0064] Then, starting from the starting position of the pressure data, the pressure data is periodically divided based on the data period, that is, the pressure data is segmented according to its period length, so as to obtain all pressure data segments corresponding to the pressure data.
[0065] It should be noted that Fourier transform is a technical means well known to those skilled in the art and will not be elaborated here; if there is no periodic component in the pressure data of the air compression station, periodic division of the pressure data using frequency domain information does not affect the subsequent acquisition of differential feature sequences.
[0066] The main purpose of difference is to eliminate fluctuations in the data and make the data stable, which helps to analyze the changing trend of the data more intuitively. For non-stationary time series, difference is an effective method to extract deterministic information. Therefore, all pressure data segments are subjected to difference analysis, and the stability is judged based on the difference sequence, so as to obtain the difference feature sequence corresponding to the pressure data.
[0067] Preferably, in one embodiment of the present invention, the method for obtaining the differential feature sequence includes:
[0068] By performing differential processing on the pressure data, the data features in the pressure data can be extracted. Therefore, by gradually increasing the differential order and judging the stationarity of the differential sequence, the differential order that best reflects the data features of the pressure data is found to obtain the differential feature sequence.
[0069] Iteratively calculate the difference sequence for all pressure data segments, wherein the order of the difference sequence increases by one in each iteration process;
[0070] In each iteration process, the differential sequence of each pressure data segment under the current iteration number is obtained, and a wide-range stationary judgment is performed on each differential sequence. If there is a differential sequence that does not meet the wide-range stationary condition, the next iteration process is performed until the differential sequences of all pressure data segments in the current iteration process meet the wide-range stationary condition. The differential sequence of the pressure data under the current iteration number is used as the differential feature sequence.
[0071] It should be noted that, when performing differential sequence iteration, there may be a pressure data segment that becomes an all-0 sequence after a certain differential. If this happens, the differential sequence of the pressure data at the last iteration is used as the differential feature sequence.
[0072] The process is illustrated by an example: in the first iteration process, the order of the difference sequence is 1, that is, the first-order difference sequence corresponding to each periodic data segment is obtained, and a wide stationary judgment is performed on each first-order difference sequence. If all first-order difference sequences meet the wide stationary condition, the first-order difference sequence of the pressure data is calculated as the differential characteristic sequence.
[0073] If there is a first-order difference sequence that does not meet the wide stationary condition among the first-order difference sequences corresponding to all pressure data segments, the second iteration process is entered. At this time, the order of the difference sequence is 2. The second-order difference sequence corresponding to each periodic data segment is obtained, and each second-order difference sequence is judged to be wide stationary. If all second-order difference sequences meet the wide stationary condition, the second-order difference sequence of the pressure data is calculated as the differential feature sequence.
[0074] If there is a second-order difference sequence that does not meet the wide stationary condition in the second-order difference sequence corresponding to all pressure data segments, then continue to enter the third iteration process, enter the calculation and judgment of the third-order difference sequence, and so on, until the order of the difference sequence corresponding to a certain iteration process is reached, and all periodic data segments meet the wide stationary condition under the current order difference sequence, and then stop, and obtain the difference sequence corresponding to the pressure data under the current order difference sequence as the difference feature sequence.
[0075] It should be noted that the three conditions for wide stability are: (1) the mean does not change with time and is a constant; (2) the mean square value is finite; (3) the autocorrelation function is only related to the time interval; the judgment process of wide stability is a well-known technology and will not be elaborated here.
[0076] At this point, the differential feature sequence corresponding to the air compression station pressure data can be obtained. The differential feature sequence is the wide and stable data corresponding to the air compression station pressure data, which can provide more accurate data support for the subsequent abnormal analysis process.
[0077] Step S3: construct multiple isolated trees corresponding to the differential feature sequence, and determine the quality coefficient of the isolated tree based on the similarity of the data values used between the isolated trees, the distribution fluctuation of the data values in the isolated trees, and the abnormality of the data values.
[0078] The Isolation Forest algorithm randomly extracts a sample subset from the data set, which is smaller than the size of the original data set, to limit the size of the tree and reduce the computational complexity. Then, for each randomly selected sample subset, an isolation tree is constructed based on a recursive process: a feature is randomly selected each time and a split value is randomly selected between the maximum and minimum values of the feature. The data is divided into the left subtree or the right subtree according to this split value until the preset termination condition is reached (such as the tree reaches a limited height, the number of samples in the node reaches a certain number, or the selected feature values of all samples are the same value). After constructing multiple isolation trees, these isolation trees are used to construct an isolation forest, that is, the calculation results of all isolated tree species are combined to perform abnormal analysis on the data values.
[0079] The performance of the isolation forest algorithm depends to a certain extent on the number of isolated trees. Too many isolated trees will cause many invalid and low-value data to be used multiple times, thereby increasing computational redundancy; while too few isolated trees will lead to inaccurate detection. Therefore, in an embodiment of the present invention, before abnormality detection, the quality coefficient of each isolated tree is quantified by further analyzing the constructed isolated trees, thereby effectively improving the efficiency and accuracy of the subsequent detection process. The method for obtaining the quality coefficient is mainly based on two aspects. One is the similarity between isolated trees. The reason is that if the data points used by two isolated trees are highly similar, it means that more data are not involved in the establishment of the isolated forest. Without considering whether the data is abnormal or not, the quality is considered to be worse; on the other hand, the abnormality and distribution fluctuation of the data values in the isolated tree are analyzed. When the fluctuation of the isolated tree is more obvious and the more abnormal data there are, the higher the quality of the isolated tree is, that is, the higher the analysis value is.
[0080] Preferably, in one embodiment of the present invention, the method for obtaining the quality coefficient includes:
[0081] See also Figure 2 , which shows a flow chart of a method for obtaining a quality coefficient in one embodiment of the present invention, the method comprising the following steps:
[0082] Step S201: In each iteration process, a tree to be tested and a reference tree corresponding to the tree to be tested are determined.
[0083] The number of iterations is preset, and in each iteration process, a preset first number of data values in the differential feature sequence are randomly captured to construct an isolated tree. Starting from the second iteration, the isolated trees of all iteration processes before the current iteration process are used as reference trees, and the isolated trees under the current iteration number are used as the trees to be tested. For example, when the current iteration number is the second, the second isolated tree is used as the tree to be tested, and the isolated tree under the first iteration is the corresponding reference tree; when the current iteration number is the third, the third isolated tree is used as the tree to be tested, and the isolated tree under the first iteration and the isolated tree under the second iteration are used as the corresponding reference trees... and so on.
[0084] It should be noted that the number of iterations is set to 100, and the preset first quantity is rounded up to half of the total number of all data values in the differential feature sequence; the tree depth of each isolated tree is set to 50; the specific values of the aforementioned numerical values can be adjusted according to the implementation scenario and are not limited here.
[0085] Step S202: Determine the similarity characteristic value corresponding to the tree to be tested according to the similarity of the data values used between the tree to be tested and the corresponding reference tree.
[0086] Since the number of data values used to build an isolated tree is the same in each iteration, the isolation forest should essentially strive to allow more different data values to participate in the construction process of each isolated tree, so as to be able to more comprehensively judge the abnormality of data values. The higher the similarity of the data values used between the two isolated trees, the more it means that the data value ranges involved in the two isolated trees are the same, then the reference value of the isolated tree will be reduced and the quality will be worse.
[0087] Therefore, in each iteration starting from the second iteration, the data values in the tree to be tested are arranged in the order in the differential feature sequence to obtain the feature vector corresponding to the tree to be tested. The data values in each reference tree corresponding to the tree to be tested are arranged in the order in the differential feature sequence to obtain the feature vector corresponding to each reference tree.
[0088] The similarity between the feature vector corresponding to the tree to be tested and the feature vector corresponding to each reference tree is synthesized to obtain the similar feature value corresponding to the tree to be tested. In this embodiment of the present invention, the similarity can be characterized by the cosine similarity between the feature vectors. The formula model of the similar feature value includes:
[0089]
[0090] in, Indicates Similar eigenvalues corresponding to the trees to be tested; Indicates The number of reference trees corresponding to the trees under test; Indicates The feature vector of the tree to be tested; Indicates The tree to be tested corresponds to the The feature vector of a reference tree; Represents the cosine formula.
[0091] In the formula model of similar eigenvalues, the cosine similarity between the eigenvectors of the tree to be tested and each corresponding reference tree is calculated to obtain The value range of cosine similarity is [-1,1], and the closer it is to 1, the higher the similarity between the two feature vectors. Conversely, the closer it is to -1, the lower the similarity between the two feature vectors. The cosine similarity between the test tree and each reference tree is adjusted to the value range, using the formula , map the cosine similarity to [0, 1], and the closer to 1, the higher the similarity, and the closer to 0, the lower the similarity. Finally, the adjusted cosine similarities between the tree to be tested and all corresponding reference trees are comprehensively averaged to obtain the similarity eigenvalue corresponding to the tree to be tested. The larger the similarity eigenvalue, the higher the similarity between the tree to be tested and the isolated tree in the previous iteration process. In this case, the reference value of the tree to be tested in the current iteration process will be lower, that is, the lower the quality.
[0092] S203: Determine the fluctuation characteristic value corresponding to the tree to be tested according to the distribution fluctuation and abnormality of the data values in the tree to be tested in the reference tree.
[0093] In step S202, similar characteristic values corresponding to the isolated trees are obtained by analyzing the similarities of the data values used between the isolated trees. In this step, on the other hand, the quality of the test tree is evaluated by analyzing the abnormalities and distribution fluctuations of the data values in the reference tree.
[0094] In an isolated tree, the path length of a data value is usually closely related to the degree of abnormality of the data value. Therefore, starting from the second iteration, for each tree to be tested in each iteration, the path length corresponding to each data value in the tree to be tested and the corresponding reference tree is obtained.
[0095] For any data value in the tree to be tested, the fluctuation factor corresponding to the data value is determined based on the fluctuation of the path length of the data value in all corresponding reference trees, and the fluctuation factors of all data values in the tree to be tested are averaged to obtain the volatility parameter corresponding to the tree to be tested. In this embodiment of the present invention, the fluctuation factor is characterized by the variance of the path length of the data value in all corresponding reference trees. In other embodiments, the standard deviation can also be used for characterization.
[0096] Based on the numerical characteristics of the path length of the data value in all corresponding reference trees, the clustering factor corresponding to the data value is determined, and the clustering factor can be represented by the mean of the path length of the data value in all references; the clustering factors of all data values in the tree to be tested are averaged to obtain the stability parameter corresponding to the tree to be tested; in other embodiments of the present invention, the clustering factor can also be represented by the median or mode of the length of the data value in all reference paths.
[0097] According to the stability parameter and volatility parameter corresponding to the tree to be tested, the fluctuation characteristic value of the tree to be tested is determined, the stability parameter and the fluctuation characteristic value change in opposite directions, and the volatility parameter and the fluctuation characteristic value change in the same direction. The formula model of the fluctuation characteristic value can be specifically, for example:
[0098]
[0099] in, Indicates The fluctuation eigenvalue corresponding to the tree to be tested; Indicates The total number of data values in the trees to be tested; Indicates The first The fluctuation factor corresponding to each data value; Indicates The first The clustering factor corresponding to each data value; Indicates the preset first parameter.
[0100] In the formula model of the fluctuation characteristic value, when the variance of the path length of a data value in the tree to be tested in all its corresponding reference trees is larger, that is, the fluctuation factor is larger, it means that the abnormality of the data value in different isolated trees is unstable, then the data value should be retained and needs to be verified multiple times. On the contrary, if the variance of the path length of a data value in its corresponding reference tree is smaller, that is, the fluctuation factor is smaller, it means that the abnormality of the data value in different isolated trees tends to be stable, then the retention degree of the data value is low and the reference value is low. The fluctuation factors corresponding to all data values in the tree to be tested are averaged to obtain the volatility parameters of the tree to be tested. At this time, when the volatility parameter is larger, it means that the data value in the tree to be tested needs to be verified multiple times, and the tree to be tested should be retained as a reference for subsequent abnormal analysis, so the quality will be higher. When the average of the path lengths of a data value in the tree to be tested in all its corresponding reference trees, that is, the smaller the clustering factor, it means that the data value is more likely to be isolated in the isolated tree, then the possibility that the data value is abnormal data is higher, so the data needs to be verified and analyzed multiple times, and the retention degree will be higher; anyway, when the clustering factor is larger, it means that the data value is not easy to be isolated in the isolated tree, and is closer to normal data, so multiple verifications are not needed, and the retention degree will be lower, so the clustering factors corresponding to all data values in the tree to be tested are averaged to obtain the stability parameter , the smaller the stability parameter is, the more the data values in the tree to be tested need to be verified multiple times, and should be retained to confirm its abnormality. Then the stability parameter is used as the denominator and the volatility parameter is used as the numerator to obtain the fluctuation characteristic value corresponding to the tree to be tested. The larger the fluctuation characteristic value is, the higher the reference value of the tree to be tested in the current iteration process will be, that is, the higher the quality will be.
[0101] It should be noted that the first parameter is preset The function of is to prevent the denominator from being 0. Here, the value can be 0.001. The specific value can be adjusted according to the implementation scenario and is not limited here.
[0102] Step S204: The similar eigenvalues and the fluctuating eigenvalues corresponding to each tree to be tested are integrated to determine the quality coefficient of the tree to be tested.
[0103] The similar eigenvalues and fluctuation eigenvalues corresponding to the tree to be tested are integrated to construct the following formula to obtain the quality coefficient of the tree to be tested, and the value range of the quality coefficient is the normalized value. The formula model of the quality coefficient includes:
[0104]
[0105] in, Indicates The quality coefficient corresponding to the tree to be tested; Indicates Similar eigenvalues corresponding to the trees to be tested; Indicates The fluctuation eigenvalue corresponding to the tree to be tested; Indicates the preset second parameter; Represents the normalization function.
[0106] In the formula model of the quality coefficient, based on the above analysis, the larger the similarity eigenvalue, the higher the similarity between the tree to be tested and the isolated tree in the previous iteration process, so the reference value of the tree to be tested in the current iteration process will be lower, that is, the lower the quality; the larger the fluctuation eigenvalue, the higher the reference value of the tree to be tested in the current iteration process, that is, the higher the quality. Therefore, the similarity eigenvalue is used as the denominator and the fluctuation eigenvalue is used as the numerator to construct the above formula to obtain the quality coefficient of the tree to be tested.
[0107] It should be noted that, starting from the second iteration, the calculation of the quality coefficient of the tree to be tested in each iteration process requires the isolated tree in the first iteration process to be used as the reference tree. Therefore, the isolated tree in the first iteration process cannot be calculated by the above method. In order to enable it to participate in the subsequent screening process of the target isolated tree, the quality coefficient of the isolated tree in the first iteration process can be set to the average of the quality coefficients of the isolated trees in the remaining other iteration processes; or the quality coefficient of the isolated tree in the first iteration process can be set to 1; the second parameter is preset The function of is to prevent the denominator from being 0. Here, the value can be 0.001. The specific value can be adjusted according to the implementation scenario and is not limited here.
[0108] In other embodiments of the present invention, multiple isolated trees corresponding to the differential feature sequence can also be constructed by the following method, and the quality coefficient of the isolated tree can be determined based on the similarity of the data values used between different isolated trees, the distribution fluctuation of the data values in the isolated tree, and the abnormality of the data values.
[0109] In the differential feature sequence, a preset first number of data values are randomly sampled each time to construct an isolated tree, and the random sampling is performed 100 times in total. At this time, the differential feature sequence corresponds to 100 isolated trees in total.
[0110] Any isolated tree can be used as the tree to be tested, and then all the remaining isolated trees can be used as reference trees. Then, the similarity of the data values used between each isolated tree and its corresponding reference tree is analyzed to obtain the similar eigenvalues of each isolated tree, and the formula model of the similar eigenvalues is consistent with the formula model in step S202.
[0111] Similarly, the fluctuation characteristic value is obtained for each isolated tree, and the formula model is consistent with the formula model in step S203. Finally, the quality coefficient corresponding to each isolated tree is obtained based on the formula model in step S204.
[0112] It should be noted that the preset first quantity value is half of the total number of all data values in the differential feature sequence rounded up, and the specific value can be adjusted according to the implementation scenario and is not limited here.
[0113] Step S4: Filter the target isolation tree based on the quality coefficient; construct an isolation forest corresponding to the differential feature sequence according to all the target isolation trees; and determine abnormal feature data and normal feature data in the pressure data based on the isolation forest.
[0114] Based on the above process, the quality coefficients of all isolated trees in the process of building an isolation forest can be obtained. Based on the quality coefficients, a part of isolated trees with better performance can be screened out as target isolated trees for building an isolation forest, thereby reducing the amount of calculation while ensuring the accuracy of subsequent abnormal analysis results. After obtaining the isolation forest, the corresponding abnormal feature data and normal feature data can be determined in the original data corresponding to the differential feature sequence, that is, the pressure data, according to the abnormal conditions of all data values in the isolation forest.
[0115] Preferably, in one embodiment of the present invention, the method for obtaining the target isolated tree includes:
[0116] Since the larger the quality coefficient, the more isolated trees should be retained for building an isolation forest, isolated trees with quality coefficients greater than a preset quality threshold are taken as target isolated trees, where the quality threshold is set to 0.8.
[0117] In other embodiments of the present invention, the quality coefficients of all isolated trees may be arranged in descending order to obtain a sorted sequence, and then the isolated trees corresponding to the first preset second number of quality coefficients in the sorted sequence may be used as target isolated trees, where the second number is set to one third of the total number of isolated trees rounded up, and the specific value may be adjusted according to the implementation scenario and is not limited here.
[0118] After obtaining all the target isolated trees, an isolation forest can be constructed based on all the target isolated trees. Since the isolation forest at this time is established on the basis of the differential feature sequence, it is also necessary to distinguish the pressure data and obtain the abnormal conditions of all data values in the differential feature sequence based on the abnormal conditions of the data values obtained by the isolation forest.
[0119] Preferably, in one embodiment of the present invention, determining abnormal feature data and normal feature data in pressure data based on isolation forest includes:
[0120] The anomaly score of each data value in the isolation forest is calculated, and in the differential feature sequence, the data value with an anomaly score greater than the preset anomaly threshold is regarded as an abnormal data value.
[0121] In the pressure data corresponding to the differential feature sequence, the data values corresponding to the abnormal data values are taken as abnormal feature data, and the other data values except the abnormal feature data are taken as normal feature data.
[0122] After obtaining the normal feature data and the abnormal feature data, since the normal feature data can usually be directly encrypted and transmitted, the normal feature data is encrypted and transmitted based on a symmetric encryption algorithm; and for the abnormal feature data, since it needs to stay on the device side and analyze the cause of the abnormality, the abnormal feature data can be encrypted based on a homomorphic encryption algorithm to obtain encrypted data, and then the encrypted data is ciphertext operated to obtain the operation result, and finally the encrypted data and the operation result are transmitted.
[0123] It should be noted that calculating the anomaly score of each data value based on the isolation forest is a technical means well known to those skilled in the art and will not be described in detail here; the anomaly threshold is set to 0.7, and the specific value can be adjusted according to the implementation scenario and is not limited here; after obtaining the abnormal data value, the differential feature sequence can be inversely differentiated to obtain the abnormal feature value corresponding to each abnormal data value in the pressure data, and the specific process will not be described in detail here; symmetric encryption algorithm and homomorphic encryption algorithm are both well-known technologies and will not be described in detail here.
[0124] In summary, firstly, the pressure data of the air compressor station within the preset time period is obtained. Since the pressure data of the air compressor station will be disturbed by various external factors, causing its time stability to change, in order to better capture the changing trend of the pressure data and help to discover potential abnormal situations, the period is obtained according to the frequency domain information in the pressure data and the pressure data is periodically divided, and then the differential sequence analysis and stability judgment of each pressure data segment are performed to obtain the differential feature sequence; the differential feature sequence can better reflect the changing trend of the pressure data and further enhance the stability of the data. Since the monitoring of abnormal points by the isolation forest algorithm depends on the number of isolated trees to a certain extent, too many isolated trees will cause invalid or low-value data points to be captured multiple times for constructing isolated trees, thereby increasing computational redundancy, and too few isolated trees will cause the final abnormal data to be acquired inaccurately; therefore, in an embodiment of the present invention, the quality of each isolated tree constructed is evaluated: based on the similarity of the data values used between the isolated trees, the distribution fluctuation of the data values in the isolated trees and the abnormal situation, the quality coefficient of the isolated tree is quantified. Thus, in the subsequent process, the target isolated tree with higher quality and higher analysis value is screened out based on the quality coefficient. Finally, an isolation forest is constructed based on all target isolated trees and abnormal data is analyzed, which can more accurately identify abnormal feature data and normal feature data in pressure data.
[0125] It should be noted that, in order to facilitate calculation, all indicator data involved in the calculation in the embodiment of the present invention are preprocessed to eliminate the dimension effect. The specific means of eliminating the dimension effect are technical means well known to those skilled in the art and are not limited here.
[0126] This embodiment also provides a data security transmission system for a digital energy air compressor station. Figure 3 , which shows a system structure block diagram, including: a data acquisition module 301, a differential feature acquisition module 302, a quality evaluation acquisition module 303, and an abnormality analysis module 304.
[0127] It should be noted that the system provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the data security transmission system of a digital energy air compressor station and the data security transmission method embodiment of a digital energy air compressor station provided in the above embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0128] See also Figure 4 , which shows a system structure diagram of a data security transmission system for a digital energy air compressor station provided by an embodiment of the present invention, including a processor 400, a memory 401, a bus 402 and a communication interface 403, wherein the processor 400, the communication interface 403 and the memory 401 are connected via the bus 402; wherein the memory 401 may include a high-speed random access memory, the bus 402 may be an ISA bus, a PCI bus or an EISA bus, etc., and the processor 400 may be an integrated circuit chip with signal processing capabilities; the memory 401 stores at least one instruction, at least one program, a code set or an instruction set, and when the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor, a step in a data security transmission method for a digital energy air compressor station is implemented.
[0129] The present invention also provides a computer-readable storage medium corresponding to the method provided in the above-mentioned embodiment. Figure 5 , the storage medium shown is a CD, on which a computer program (ie, a program product) is stored. When the computer program is run by a processor, it will execute the method provided by any of the aforementioned embodiments.
[0130] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), read-only memory (ROM), and other optical and magnetic storage media, which are not listed here one by one.
[0131] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0132] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A data security transmission method for a digital energy air compressor station, characterized in that: The method comprises: Obtain the pressure data of the gas storage tank in the digital energy air compression station within a preset period of time; The pressure data is divided to obtain a plurality of pressure data segments; the differences of the data values in all the pressure data segments are calculated and stability is determined based on the difference sequence to obtain a difference characteristic sequence corresponding to the pressure data; A preset number of iterations is set, and in each iteration process, a preset first number of data values in the differential feature sequence are randomly captured to construct an isolated tree. Starting from the second iteration, the isolated trees of all iteration processes before the current iteration process are used as reference trees, and the isolated tree under the current iteration number is used as the tree to be tested; In each iteration process starting from the second iteration, the data values used between the tree to be tested and all corresponding reference trees are arranged in the order in the differential feature sequence to obtain the similarity of the feature vectors corresponding to the tree to be tested, and the similar feature value corresponding to the tree to be tested is determined; based on the distribution fluctuation and abnormality of the path length corresponding to the data value in the tree to be tested in the reference tree, the fluctuation feature value corresponding to the tree to be tested is determined; Determine the quality coefficient of the tree to be tested based on the similarity eigenvalue and the fluctuation eigenvalue of the tree to be tested, wherein the similarity eigenvalue is negatively correlated with the quality coefficient, and the fluctuation eigenvalue is positively correlated with the quality coefficient; Screening target isolated trees based on the quality coefficient; constructing an isolation forest corresponding to the differential feature sequence according to all target isolated trees; and determining abnormal feature data and normal feature data in the pressure data based on the isolation forest; Encrypt and transmit normal feature data based on a symmetric encryption algorithm; The abnormal feature data is encrypted based on a homomorphic encryption algorithm to obtain encrypted data, and a ciphertext operation is performed on the encrypted data to obtain an operation result, and the encrypted data and the operation result are transmitted.
2. According to claim 1, a data security transmission method for a digital energy air compressor station is characterized in that: The method for obtaining the pressure data segment includes: Acquire a frequency spectrum corresponding to the pressure data based on Fourier transform; In the frequency spectrum, the frequency corresponding to the maximum value is used as the target frequency, and the data period of the pressure data is obtained according to the target frequency; Starting from the starting position of the pressure data, the pressure data is periodically divided based on the data period to obtain all pressure data segments corresponding to the pressure data.
3. According to claim 1, a data security transmission method for a digital energy air compressor station is characterized in that: The method for obtaining the differential feature sequence includes: Iteratively calculate the difference sequence for all pressure data segments, wherein the order of the difference sequence increases by one in each iteration process; In each iteration process, the differential sequence of each pressure data segment at the current iteration number is obtained, and a wide-range stationary judgment is performed on each differential sequence. If there is a differential sequence that does not meet the wide-range stationary condition, the next iteration process is performed until the differential sequences of all pressure data segments in the current iteration process meet the wide-range stationary condition, and the differential sequence of the pressure data at the current iteration number is used as the differential feature sequence.
4. According to claim 1, a data security transmission method for a digital energy air compressor station is characterized in that: The method for obtaining the similar feature value comprises: Arranging the data values in the tree to be tested according to the order in the differential feature sequence to obtain a feature vector corresponding to the tree to be tested; Arranging the data values in each reference tree corresponding to the tree to be tested according to the order in the differential feature sequence to obtain a feature vector corresponding to each reference tree; The similarity between the feature vector corresponding to the tree to be tested and the feature vector corresponding to each reference tree is comprehensively considered to obtain the similar feature value corresponding to the tree to be tested.
5. According to claim 1, a data security transmission method for a digital energy air compressor station is characterized in that: The method for obtaining the fluctuation characteristic value comprises: Obtain the path length corresponding to each data value in the tree to be tested and the corresponding reference tree; For any data value in the tree to be tested, based on the fluctuation of the path length of the data value in all corresponding reference trees, determine the fluctuation factor corresponding to the data value, average the fluctuation factors of all data values in the tree to be tested, and obtain the volatility parameter corresponding to the tree to be tested; Based on the numerical characteristics of the path length of the data value in all corresponding reference trees, the clustering factor corresponding to the data value is determined, and the clustering factors of all data values in the tree to be tested are averaged to obtain the stability parameter corresponding to the tree to be tested; The fluctuation characteristic value of the tree to be tested is determined according to the stability parameter and the fluctuation parameter corresponding to the tree to be tested, wherein the stability parameter and the fluctuation characteristic value change in opposite directions, and the fluctuation parameter and the fluctuation characteristic value change in the same direction.
6. According to claim 1, a data security transmission method for a digital energy air compressor station is characterized in that: The method for obtaining the target isolated tree includes: The isolated tree whose quality coefficient is greater than the preset quality threshold is taken as the target isolated tree.
7. According to claim 1, a data security transmission method for a digital energy air compressor station is characterized in that: The determining of abnormal feature data and normal feature data in the pressure data based on the isolation forest includes: Obtaining an anomaly score for each data value in the isolation forest, and taking a data value whose anomaly score is greater than a preset anomaly threshold in the differential feature sequence as an abnormal data value; In the pressure data corresponding to the differential feature sequence, the data value corresponding to the abnormal data value is used as the abnormal feature data, and the other data values except the abnormal feature data are used as the normal feature data.
8. A data security transmission system for a digital energy air compressor station, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Anomalous data detecting method, device, computer equipment, and storage medium
CA3170154A1
MFR waveform unit extraction method based on step-by-step variable threshold isolated forest
CN114839607A