Abnormal refueling behavior recognition method for CNG refueling substation based on unsupervised machine learning

Unsupervised machine learning technology is used to identify and analyze abnormal refueling behavior of CNG refueling substations, solving the problems of low refueling efficiency and high operating costs, and achieving improved refueling efficiency and cost control.

CN111259984BActive Publication Date: 2024-09-17TIANJIN AGRICULTURE COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010098914.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-18
Publication Date
2024-09-17
Estimated Expiration
2040-02-18

AI Technical Summary

Technical Problem

The refueling efficiency of CNG refueling substations is low, resulting in high operating costs and poor user experience. There is also a lack of effective abnormal refueling behavior identification and analysis methods, which affects refueling efficiency and cost control.

Method used

Using a method based on unsupervised machine learning, through data preprocessing, feature variable selection and construction, abnormal gas refilling behavior identification and cause analysis, combined with information entropy, scatter plot matrix, iterative boxplot, kernel density estimation, support vector machine, ellipse Techniques such as envelope fitting, isolation forest, and robust covariance identify and reduce abnormal aeration behavior.

Benefits of technology

It improves the refueling efficiency of CNG refueling substations, reduces operating costs, reduces the waiting time for refueling vehicles, and improves user experience and efficiency of refueling guns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111259984B
    Figure CN111259984B
Patent Text Reader

Abstract

The present invention relates to the technical field of big data analysis, and belongs to compressed natural gas filling analysis technology, and in particular to a method for identifying abnormal filling behavior of a CNG filling substation based on unsupervised machine learning, comprising the following steps: step 1: data preprocessing, importing the original CNG filling substation filling log into an analysis system; step 2: selecting and constructing characteristic variables describing the filling behavior; step 3: visualizing the relationship between the characteristic variables of the filling behavior; step 4: identifying abnormal filling behavior; step 5: mining the causes of the abnormal filling behavior; and step 6: a plan to reduce the abnormal filling behavior.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of big data analysis, and belongs to compressed natural gas filling analysis technology, and in particular to a method for identifying abnormal filling behavior of a CNG filling substation based on unsupervised machine learning. Background Art

[0002] Compressed natural gas (CNG) is formed by compressing natural gas (20-25MPa) and storing it in high-pressure steel cylinders. CNG is recommended by government departments and preferred by users due to its environmental advantages and price advantages over gasoline and diesel. Take natural gas vehicles as an example. Compared with traditional fuel vehicles, their emissions are more environmentally friendly; and for new energy vehicles, they are cheaper than hydrogen fuel vehicles, have more mature technology, and are safer to use. Compared with electric vehicles, their fuel supply is more convenient, so they have broader development prospects.

[0003] At present, CNG filling substations are the main model for building stations in China. The gas source is provided by the mother station near the city through a transfer vehicle, and then filled into the corresponding natural gas vehicles by the filling substation. However, due to the current restrictions on gas filling efficiency, it takes longer to fill the fuel than traditional fuel vehicles. The sub-gas station serves fewer vehicles per unit time and has high operating costs, which leads to a small number of sub-gas stations. During peak hours, natural gas vehicles need to wait in line for 2-3 hours to refuel, which reduces the user experience of natural gas vehicle users and increases the time cost of natural gas vehicle users, forming a vicious circle and hindering the increase in the number of natural gas vehicles.

[0004] Therefore, how to improve the refueling efficiency of CNG refueling substations and reduce the operating costs of refueling substations is one of the urgent issues to be solved in expanding China's natural gas vehicle industry. Based on the data mining method, the applicant has applied for a patent application with application number "2017102455457" in 2017, but no relevant literature has been published on the time difference of abnormal behavior in refueling behavior, the analysis of the causes of abnormal behavior, and the scheme to reduce abnormal behavior. The goal of abnormal behavior detection is to find refueling behaviors that are different from most other refueling behaviors. In the scatter diagram of the data, the abnormal data is far away from other data, so the abnormal behavior is often called outlier behavior. The abnormal refueling behavior of CNG refueling substations not only reduces the refueling efficiency of CNG refueling substations, but also affects the analysis of normal refueling behavior of refueling substations. Therefore, it is necessary to mine abnormal refueling behaviors, identify which refueling behaviors belong to abnormal refueling behaviors, and find out the causes of these abnormal refueling behaviors. By reducing or eliminating abnormal refueling behavior, the refueling efficiency of CNG refueling substations can be improved, thereby helping to save energy and reduce consumption of CNG refueling substations. To this end, the applicant proposed this patent application for "Abnormal refueling behavior identification method for CNG refueling substations based on unsupervised machine learning" based on the above design requirements and purposes. Summary of the invention

[0005] In view of the shortcomings in the prior art, the purpose of the present invention is to provide a method for identifying abnormal gas filling behavior of CNG gas filling stations based on unsupervised machine learning. The method is used for identifying and analyzing the causes of abnormal gas filling behaviors of CNG gas filling stations, and providing a solution to reduce abnormal gas filling behaviors, thereby reducing the probability of abnormal gas filling behaviors, achieving the purpose of improving the gas filling efficiency of CNG gas filling stations and reducing operating costs.

[0006] The technical solution adopted by the present invention is:

[0007] The method for identifying abnormal refueling behavior of a CNG refueling substation based on unsupervised machine learning is characterized by comprising the following steps:

[0008] Step 1: Data preprocessing, importing the original CNG filling substation filling log into the analysis system;

[0009] Step 2: Selection and construction of characteristic variables describing gas filling behavior;

[0010] Step 3: Visualization of the relationship between the characteristic variables of gas filling behavior;

[0011] Step 4: Identification of abnormal gas filling behavior;

[0012] Step 5: Exploring the causes of abnormal gas filling behavior;

[0013] Step 6: Plans to reduce abnormal gassing behavior.

[0014] Furthermore, the step 2 comprises:

[0015] 2.1 Based on the definition of information entropy, calculate the information entropy of each characteristic variable;

[0016] 2.2 Select characteristic variables based on the value of information entropy and combined with correlation analysis between characteristic variables and physical process analysis;

[0017] 2.3 Based on actual needs, construct new characteristic variables to describe gas filling behavior;

[0018] 2.4 Classification of feature variables.

[0019] Furthermore, the step 3 comprises:

[0020] 3.1 Scatter plot matrix of feature variables:

[0021] Based on the selected and constructed gas filling behavior characteristic variables, the relationship of these variables is visualized through a scatter plot matrix;

[0022] 3.2 Characteristic variable evaluation:

[0023] The final characteristic variables are selected based on the scatter plot matrix of the characteristic variables, the physical process of gas filling behavior, and the purpose of improving gas filling efficiency.

[0024] Further, the step 4 comprises:

[0025] 4.1 Identification of abnormal gas filling behavior based on a single variable:

[0026] Based on the single variables including gas filling volume, pressure before gas filling, pressure after gas filling and gas filling time interval, the iterative boxplot method and kernel density estimation method are used to identify whether the gas filling behavior expressed by the single variable is abnormal behavior;

[0027] 4.2 Identification of abnormal gas filling behavior based on multivariate;

[0028] 4.2.1 Identification of abnormal gas filling behavior based on dual variables;

[0029] The abnormal behavior mining method based on multiple attributes mainly relies on support vector machine (SVM), fitting an elliptic envelope, isolation forest and local outlier factor. By comparing the results of these four unsupervised machine learning and the results based on single variable identification, as well as the analysis of comprehensive physical processes, the better identification method among the four methods is obtained.

[0030] 4.2.2 Identification of abnormal gas filling behavior based on three variables;

[0031] The robust covariance unsupervised abnormal behavior method is used to identify abnormal gas filling behavior described by three variables.

[0032] Furthermore, the abnormal behavior refers to the gas filling behavior that reduces the gas filling efficiency.

[0033] The advantages and positive effects of the present invention are:

[0034] 1. In the present invention, the acquired raw data information is introduced and loaded into the database as the basis for data mining and identification of abnormal gas filling behavior. Variables based on attributes including gas filling volume v, pressure pi at the beginning of gas filling, pressure pf at the end of gas filling, and constructed pressure change value dp are introduced. Based on the purpose of improving gas filling efficiency, the abnormal gas filling behavior defined in the present invention is the gas filling behavior with less gas filling volume. Abnormal behavior is identified for the gas filling behavior described by a single variable, the gas filling behavior described by a two-variable, and the gas filling behavior described by a three-variable with the help of unsupervised machine learning methods such as boxplot and robust covariance.

[0035] 2. In the present invention, the abnormal gas filling behavior results identified based on different variables and using different methods are compared, the overlap of these identification results is analyzed, and the causes of the abnormal gas filling behavior are analyzed.

[0036] 3. In the present invention, based on the abnormal gas filling behavior identification results and the cause analysis results of the abnormal behavior, a solution to reduce abnormal gas filling behavior is proposed, thereby achieving the purpose of achieving the efficiency of gas filling gun use and reducing the waiting time of gas filling vehicles. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 is a flow chart of the present invention;

[0038] Figure 2 Scatter plot of the relationship between the serial number and storage number of a CNG filling station in Tianjin from May to July 2014;

[0039] Figure 3 Scatter matrix diagram of CNG refueling substation refueling behavior based on v, pi, pf and dtcng;

[0040] Figure 4 Scatter matrix diagram of CNG refueling substation refueling behavior based on time interval variables such as v, dp and dtcng;

[0041] Figure 5 Scatter matrix diagram of CNG refueling substation refueling behavior based on variables such as v, dp, dtcng, pi, and pf;

[0042] Figure 6CNG filling substation refueling behavior based on v boxplot and bar chart and probability density function estimation curve chart;

[0043] Figure 7 CNG filling substation refueling behavior based on pi boxplot and bar chart and probability density function estimation curve;

[0044] Figure 8 CNG filling substation refueling behavior based on pf boxplot and bar chart and probability density function estimation curve;

[0045] Fig. 9 CNG filling substation refueling behavior based on dtcng boxplot and bar chart and probability density function estimation curve;

[0046] Fig.10 The abnormal values ​​of CNG refueling behavior and refueling time length dtcng in the substation are caused by recording errors;

[0047] Fig.11 Abnormal behavior analysis diagram of the refueling behavior time interval of the entire CNG refueling substation;

[0048] Fig.12 The gas filling behavior described by the dual variables v and dp is set to the ratio of abnormal behavior to the ratio of the recognition result based on the v single variable. The recognition result diagram of four unsupervised abnormal behavior machine learning methods;

[0049] Fig.13 The gas filling behavior described by the dual variables v and dp is set to the ratio of abnormal behavior to the ratio of the pf single variable recognition result based on the four unsupervised abnormal behavior machine learning methods.

[0050] Fig.14 The histogram of the abnormal behavior score distribution of the local outlier factor method for the identification of the dual variable description of the gas filling behavior under two abnormal ratio settings;

[0051] Fig.15 The histogram of abnormal behavior score distribution of the Isolation Forest method for the identification of the two variables describing the gas filling behavior under two abnormal ratio settings;

[0052] Fig.16 The histogram of abnormal behavior score distribution of the support vector machine (SVM) method for the identification of the dual variable description of the gas filling behavior under two abnormal ratio settings;

[0053] Fig.17The robust covariance (also known as the fitting anelliptic envelope) method is used to identify the aeration behavior of the two variables under two abnormal proportion settings.

[0054] Fig.18 The aeration behavior described by the three variables v, dp, and dtcng is set to be a robust covariance unsupervised abnormal behavior machine learning method recognition result diagram based on the ratio of the abnormal behavior based on the v single variable recognition result;

[0055] Fig.19 The aeration behavior described by the three variables v, dp, and dtcng is set to be a robust covariance unsupervised abnormal behavior machine learning method recognition result diagram based on the pf single variable recognition result ratio;

[0056] Fig. 20 The robust covariance method is used to identify the three variables describing the gas filling behavior. The distribution bar graph of abnormal behavior scores under two abnormal ratio settings. DETAILED DESCRIPTION

[0057] The present invention is further described below in conjunction with examples. The following examples are illustrative rather than restrictive, and the protection scope of the present invention cannot be limited by the following examples.

[0058] The invention discloses a method for identifying abnormal refueling behavior of a CNG refueling substation based on unsupervised machine learning, and the invention is innovative in that it comprises the following steps:

[0059] Step 1: Data preprocessing, importing the original CNG filling substation filling log (as shown in Table 1, part of the data recorded in the filling log of a CNG filling substation in Tianjin) into the analysis system;

[0060] Table 1 Gas filling log record of a CNG filling substation in Tianjin (partial)

[0061]

[0062] Each row in Table 1 represents a gas filling behavior, and each column represents the value of each characteristic variable in the gas filling behavior.

[0063] Column 1 is the time when the transaction event records the start of the gas filling behavior, which is the time coordinate identified as the time when the gas filling behavior occurs;

[0064] Column 2 is the gun number where the gas filling behavior occurs, that is, which gas filling gun is filling gas, which can be considered as the spatial coordinates where the gas filling behavior occurs;

[0065] Columns 3 and 4 record the cumulative number of gas fillings for each gas filling gun (see the information entropy section for the specific meaning);

[0066] Columns 5 to 7 are the gas volume (v), amount and unit price, which are the key information in the gas filling behavior, and the relationship between the three is amount = gas volume × unit price

[0067] It can be seen that the consumption amount and the gas filling amount are in a one-to-one correspondence;

[0068] Columns 8 to 16 mainly contain some environmental or external characteristics of the refueling behavior, mainly the recipient of the refueling behavior, that is, the information of the refueling vehicle read from the card;

[0069] Columns 17 to 21 mainly represent the variables related to the gas filling behavior, including the team, employee card number, payment, cashier, sign, etc.;

[0070] Columns 22 and 23 are the starting pressure (pi) and ending pressure (pf) of the added gas volume (v);

[0071] Column 24 is the gas adding time (addgaslong, Δt), which represents the physical characteristics of a gas adding behavior.

[0072] Among them, the two types of features in columns 22, 23 and 24 are mainly used to analyze the causes of abnormal gas filling behavior.

[0073] By writing a program in Python, the refueling log records of a CNG refueling substation in Tianjin shown in Table 1 are loaded into the mongoDB database system, laying the foundation for further analysis; as a typical non-relational open source database, the mongoDB database can not only take into account historical data in different record formats, but also be used for free to reduce costs. This embodiment collects the refueling data of a CNG refueling substation in Tianjin as shown in Table 1. The substation has 6 refueling guns. The refueling record collection period is from May 1 to July 30, 2014, with a total of 125,021 refueling records.

[0074] Step 2: Selection and construction of characteristic variables describing gas filling behavior;

[0075] Each gas filling behavior in this embodiment involves 24 characteristic variables. Characteristic variables that are easy to visualize should be selected or constructed from the above 24 characteristic variables. In this process, repeated features (i.e., strongly correlated characteristic variables) should be eliminated, which can be done through a bivariate graph matrix or a scatter plot matrix of data set attribute pairs. However, due to the large number of variables, making a 24×24 matrix graph seems too crowded, so the number of variables should first be reduced through other methods.

[0076] 2.1 Based on the definition of information entropy, calculate the information entropy of each characteristic variable;

[0077] By observing the original records, it is found that the values ​​of some characteristic variables do not change with time and space. Therefore, by calculating the Shannon entropy of each characteristic variable, those characteristic variables with small entropy values ​​are eliminated. If a discrete variable may take n values, the probability of taking the i-th value is p i , then the Shannon entropy of the discrete variable is defined as

[0078] S=-∑p i ×log(p i ),

[0079] After the Python implementation of this definition, Table 2 lists the first 16 variables in descending order of Shannon entropy values ​​among the characteristic variables of the CNG refueling substation 24 in this embodiment. The values ​​in the first row of Table 2 are the values ​​of Shannon entropy of all refueling records of the CNG refueling substation in Tianjin, and the values ​​in the second row are the values ​​of Shannon entropy of the refueling records of the CNG refueling substation with the refueling gun number 1. From the comparison of the two rows of data, it can be seen that, except for the gun number, the Shannon entropy ranking of other variables remains basically unchanged.

[0080]

[0081] 2.2 Select characteristic variables based on the value of information entropy and combined with correlation analysis between characteristic variables and physical process analysis;

[0082] For variables with Shannon entropy lower than 1, since their values ​​are almost unchanged, these variables are discarded. For variables with Shannon entropy values ​​greater than 1, the card balance is the remaining amount in the user's card number after the gas filling behavior is settled. The relationship between this value and the gas filling behavior is expressed as the remaining value of the amount in the card minus the amount of this gas filling, and is related to this gas filling behavior. In addition, the serial number and storage number are both the cumulative number of gas filling behaviors recorded for each gun number. Every time the serial number reaches 59999, it will restart from 0, and the maximum value of the storage number is 59999. Therefore, the entropy value of the serial number is larger than the entropy value of the storage number. The visualization result of the relationship between the two is as follows: Figure 2 As shown in the figure, these two variables do not involve the temporal and spatial information of the gas filling behavior, nor do they involve the specific characteristic values ​​of the gas filling behavior. These two variables are discarded because they have no direct connection with the identification of abnormal gas filling behavior.

[0083] From the entropy value point of view, the entropy value of the user card number and the license plate number is the same. And through the verification of the original data, the two are also highly consistent. But there are also special card numbers, such as team cards, which do not have corresponding license plate numbers. This is because there are times when CNG car drivers forget their CNG refueling cards. At this time, they use the team card of the team when refueling the car to refuel. The consumption fee is deducted normally through the team card, and the driver pays the corresponding consumption amount in cash or other means. At the same time, the user card number and license plate number are a code for the refueling object, which has little to do with the mining of refueling behavior characteristics based on energy saving and consumption reduction. The entropy values ​​of the variables amount and volume are similar, and during the data period collected for the project research, the unit price of CNG remained unchanged, that is, 4.2 yuan / Nm 3 Since the purpose of this study is to identify abnormal gas filling behavior, the volume v is used as a variable. The amount will change with the price and is a derivative variable of the volume.

[0084] The transaction time and gun number record the time and place of each gas filling behavior, which is equivalent to the time and space coordinates of the event. Therefore, the transaction time and gun number are two basic variables of the gas filling behavior in the present invention. The employee card number and team can be used as variables for the assessment of gas filling workers. The basic physical quantities used to describe the gas filling behavior are the gas filling amount, i.e., volume (v), and the pressure in the gas storage container of the vehicle to be filled (p i ), before and after gasification (p f ), the time taken for the refueling behavior, that is, the refueling duration. Therefore, the variables mainly used in this project from the original records are as follows:

[0085] (1) Transaction time, which indicates the time when the gas filling behavior occurs, represented by t;

[0086] (2) Gun number, which indicates the specific gun number or location where the gas filling behavior occurs (often referred to as space during the research process of this project, because the transaction time and gun number record the time and space coordinates of the gas filling behavior), represented by r;

[0087] (3) Volume, which indicates the volume of CNG in this refueling operation, expressed in Nm 3 The unit is v;

[0088] (4) Starting pressure, which indicates the pressure in the CNG container of the vehicle before the refueling occurs, expressed as p i , pi or p inital express;

[0089] (5) End pressure, which indicates the pressure in the CNG container of the vehicle after the refueling is completed, expressed as p f , pf or p final express;

[0090] (6) Gas filling time, which indicates the time taken for gas filling, expressed as dt cng express.

[0091] 2.3 Based on actual needs, construct new characteristic variables to describe gas filling behavior;

[0092] In order to identify abnormal gas filling behavior, this embodiment also introduces the following variables:

[0093] (1) Pressure change value, which describes the change in pressure value before and after the gas addition behavior occurs, is expressed as Δp and is defined as

[0094] Δp=p f -p i

[0095] (2) The time interval of the gas filling behavior is the difference between the times of the adjacent gas filling actions of the same gun number. The time interval of the i-th gas filling behavior is Δt i g or dt i g It means that it is defined as

[0096] Δt i g =t i+1 g -t i g

[0097] where t i g With t i+1 g It indicates the time when the i-th and i+1-th gas filling actions occur under the gun number g (the time when gas filling starts).

[0098] (3) The length of the preparation time for the gas filling behavior indicates how much time is not the time for the gas filling behavior. We understand this as the length of the preparation time for the gas filling behavior, expressed as Δt prep or dt pre It means that its definition is

[0099] Δt prep =Δt i g -dt cng

[0100] (4) The time interval between adjacent gas filling behaviors in the entire gas filling station is the difference in time between adjacent gas filling behaviors in the same gas filling station (not necessarily behaviors occurring under the same gas filling gun). The time interval between the i-th gas filling behaviors is Δt i or dt i It means that it is defined as

[0101] Δti =t i+1 -t i

[0102] where t i With t i+1 Indicates the time when the i-th and i+1-th gas filling behaviors of the gas filling substation occur (the time when gas filling starts). The above time variables are all time attribute variables related to the gas filling behaviors under the same gun number, but for improving the gas filling efficiency of the entire gas filling substation, the time interval between adjacent gas filling behaviors of the entire gas filling substation is obviously more important than the time interval between adjacent gas filling behaviors under a single gas filling gun, so it is necessary to introduce this variable.

[0103] 2.4 Classification of feature variables;

[0104] Based on the information entropy value and simple analysis of the variables describing the gas filling behavior, the variables describing the gas filling behavior can be divided into the following three categories:

[0105] The first category is physical quantities that characterize the physical process of gas filling, such as directly measured gas filling volume (v), pressure values ​​before and after gas filling (pi, pf) and gas filling time length (dt cng ), and the constructed variable pressure change value (Δp). These variables are the main variables to be investigated when identifying abnormal gas filling behavior;

[0106] The second category is the variables that have an indirect impact on gas filling behavior, such as card balance, length of preparation time for gas filling, etc.

[0107] The third category is the background environment variables of gas filling behavior, such as the time of gas filling behavior, gas gun number, gas filling team, user card number, license plate number, etc.

[0108] When identifying abnormal behavior during gas filling, the first type of variables is mainly examined, while the remaining variables can be used to explain the causes of abnormal behavior.

[0109] Step 3: Visualization of the relationship between the characteristic variables of gas filling behavior;

[0110] Transaction time (t) and gun number are variables that record the time and place of gas filling behavior. These two variables can be considered as independent variables. Therefore, it is necessary to study the relationship between other variables in describing gas filling behavior, so as to select the main characteristic quantity describing gas filling behavior and lay the foundation for the identification of abnormal gas filling behavior. The research method is to use a scatter plot matrix to show the relationship between them.

[0111] 3.1 Scatter plot matrix of feature variables:

[0112] Based on the selected and constructed gas filling behavior characteristic variables, the relationship between these variables is visualized through a scatter plot matrix. The visualization results are shown in Figure 3 shown.

[0113] It is worth mentioning that in order to highlight the visualization effect, we set the refueling time longer than 300 seconds to 300. This setting is based on common sense, because the common sense of current refueling technology tells us that normal refueling behavior cannot last more than 5 minutes.

[0114] from Figure 3 It can be seen that the starting pressure and the ending pressure are related to the volume and the filling time, but the volume and the filling time are more related to the pressure change before and after. At the same time, the filling time interval dt and the preparation time dt of the filling behavior are introduced prep For visualization purposes, dt and dt prep Values ​​greater than 600 are set to 600, and dt prep The behavior less than 0 seconds is set to 0. The results visualized by the scatter plot matrix are as follows Figure 4 As shown. Figure 4 It can be seen that the refueling time interval dt and the preparation time dt of the refueling behavior prep With volume v, pressure change Δp and filling time dt prep Moreover, because the transaction time t is recorded with an accuracy of only minutes, dt and dt prep All are discretized.

[0115] 3.2 Evaluation of characteristic variables;

[0116] Therefore, from the visualization results, the main variables describing the relationship between the variables of the gas filling behavior are v, Δp, dt cng and p f , p i The relationship between these variables is visualized through a scatter plot matrix. Figure 5 As shown. Figure 5 It can be seen that the first three are positively correlated as a whole, which is in line with common sense. However, it is also found that some points are outliers, that is, there are abnormal gas filling behaviors. These abnormal gas filling behaviors will be mined through relevant methods to find the reasons for these points.

[0117] In v, Δp and dt cng where Δp is a constructed variable, which is obtained by directly measuring the variable p f , p i Therefore, the abnormal gas filling behavior described based on Δp may be directly measured variable p f The abnormality may also be p i , or both are caused by abnormalities, so we will use p interchangeably in the following research. f , p iCombining the scatter plot matrix of characteristic variables, the physical process of gas filling behavior and the purpose of improving gas filling efficiency, the present invention selects the final characteristic variables as v, Δp, dt when identifying abnormal gas filling behavior. cng and p f , p i , while the remaining variables are mainly used to explain the causes of abnormal behavior.

[0118] Step 4: Identification of abnormal gas filling behavior;

[0119] Abnormal behaviors are either caused by hardware defects or improper management. These abnormal behaviors reduce the efficiency of refueling and increase the operating costs of CNG refueling substations. Therefore, it is necessary to identify abnormal refueling behaviors through machine learning methods. Abnormal behaviors can be divided into local / situational abnormal behaviors and global abnormal behaviors.

[0120] Global abnormal behavior

[0121] Global abnormal behavior generally requires all attributes of the behavior to judge, while local or contextual abnormal behavior depends on contextual attributes. Contextual attributes include spatial attributes, time, network locations, and sophisticated structured attributes. In addition, behavioral attributes define the characteristics of the research object and are therefore used to evaluate whether a research object is abnormal in the context to which it belongs. For example, when determining whether the temperature of a certain place is abnormal, attributes that describe the location, such as spatial (i.e., longitude and latitude) or location (such as points in a graph or network) attributes, are contextual attributes. At the same time, time attributes also belong to the contextual attributes of the outlier determination problem. For another example, in customer-relationship management, whether a consumer is abnormal depends on the behavior of the consumer and other consumers with similar consumer profile attributes. All attributes that define the consumer profile constitute the contextual attributes in the contextual anomaly, such as age, income, and place of residence.

[0122] As for the refueling behavior of CNG refueling substations, our intuition tells us that normal refueling behavior should be a large refueling volume v, a low starting pressure pi, or a large ending pressure pf. This is because normal behavior means that the pressure in the cylinder is low, the remaining CNG is small, and refueling is needed. After refueling is completed, the pressure should be high. Therefore, the abnormal refueling behavior we refer to is mainly the abnormal situational refueling behavior.

[0123] In addition, under normal circumstances, the time interval dt between adjacent gas filling activities at the gas filling substation is station It should not be large (it can be 0, because a gas filling substation has multiple gas filling guns that can fill gas at the same time). The duration of each gas filling action is dt cng It should not be too long, nor too short.

[0124] In order to quantify what kind of value is too large / too much, or too small / too little, a method is needed to give the corresponding critical value to assist in the judgment. This will be achieved through an outlier test based on a single variable. At the same time, multiple variables can be used to describe the behavior from various angles, so the quantity describing the behavior will have multiple attributes. The relationship between the attributes reflects the law of the behavior. The deviation of a few data points indicates that there is an abnormality in its behavior. Therefore, the outlier test under multiple variables can be used to find abnormal behavior.

[0125] 4.1 Identification of abnormal gas filling behavior based on a single variable:

[0126] Based on the single variables including gas filling volume, pressure before gas filling, pressure after gas filling and pressure change before and after gas filling, the iterative boxplot method and kernel density estimation method are used to identify whether the gas filling behavior expressed by the single variable is abnormal behavior;

[0127] Suppose the refueling behavior is described by a single attribute as {x i}, i = 1, ..., n. When identifying scenario outliers based on univariate attributes, we mainly rely on statistical methods, including parametric methods and non-parametric methods. This study mainly uses parametric methods, specifically the boxplot method, which is an empirical rule.

[0128] x i Arrange in ascending order, and you can get the 1 / 4 quantile Q of the ordered sequence in turn. 1, The median Q2 or M, and the 3 / 4 quantile Q3, and the inter-quartile range (IQR) is defined as

[0129] IQR=Q3-Q1

[0130] The standard method of box-whisker plot defines the upper and lower critical values ​​of outliers as

[0131] F U =Q3+k U ×IQR,F L =Q1-k L ×IQR

[0132] In the standard box-whisker diagram, k U =k L =1.5. If x iIf the normal distribution is satisfied, the selection of 1.5 makes the measured values ​​belonging to the normal distribution have only a 0.7% probability of being identified as outliers, which is similar to the proportion of data outside 3σ in the standard normal distribution of 0.3% of the total data. One of the advantages of the standard box-and-whisker plot is that compared with the 3σ method, the parameter F of this method of finding outliers is U , F L The calculation of is not greatly affected by outliers.

[0133] In the variable selection part, it is mentioned that the description of the gas filling behavior is the gas filling volume v, the starting pressure pi and the ending pressure pf. At the same time, the purpose of the present invention is to improve the efficiency of the CNG gas filling substation, so the abnormal gas filling behavior includes behaviors that are less necessary to occur, such as small gas filling volume v, large starting pressure pi or small ending pressure pf. In order to identify whether a behavior belongs to these abnormal behaviors, the critical value of the abnormal value quantified by the corresponding physical quantity is required. In the study of the present invention based on the identification of abnormal behaviors based on single variable attributes, the critical value of the abnormal value is mainly obtained by means of the standard box and whisker plot method. However, the project iteratively uses the standard box and whisker plot method for a certain attribute until the critical value of the abnormal value of the attribute no longer changes, and the abnormal value critical value obtained is used as the final judgment standard. The rationality of the critical values ​​of the abnormal values ​​of these attributes is explained by analyzing the causes of these abnormal behaviors.

[0134] 4.1.1 Identification of abnormal gas filling behavior based on gas filling volume (v);

[0135] The i-th refueling behavior of the refueling substation is determined by its refueling volume v i Description. By v i The time series graph and histogram (such as Figure 6 As shown in Figure 2, it is found that the probability density function has a local maximum in the smaller volume. According to the standard box-whisker plot method, based on the gas volume v i The abnormal behavior threshold is

[0136] F U =Q3+k U ×IQR,F L =Q1-k L ×IQR

[0137] For a small amount of data, most literature only uses the standard box-and-whisker plot method or its derivative method once for the research data. However, for the more than 120,000 data involved in this example, Figure 6 Medium F U 1 , F L 1The results of using the standard method once were not satisfactory. According to the idea of ​​iterative elimination of outliers provided by CCAggarwal, the project iterated the use of the standard box-whisker plot method until there were no more outliers defined by this method in the data after the outliers were proposed. Figure 6 Medium F 1 , F i The superscripts represent the results of using only one time and using an iterative method. In addition, Figure 6 The bin width in the histogram directly utilizes the bandwidth in the kernel density estimation.

[0138] 4.1.2 Based on the starting gas pressure (p i )’s abnormal gas filling behavior identification;

[0139] Using a similar method, assume that the j-th refueling behavior of the refueling substation starts from its starting pressure p i j Description. By p i j The time series graph and histogram (such as Figure 7 It is found that the probability density function has a local maximum in the part with higher pressure at the beginning. Therefore, there is a suspicion of abnormal behavior. The standard box-whisker plot method is used for multiple iterations to obtain the p-based i Identify abnormal gas filling behavior.

[0140] 4.1.3 Based on the end of filling pressure (p f )’s abnormal gas filling behavior identification;

[0141] Using a similar method, let the i-th refueling behavior of the refueling substation be its ending pressure p f i Description. By p f i The time series graph and histogram (such as Figure 8 It is found that there is a lot of gas addition behavior in the part with lower end pressure. Therefore, there is a suspicion of abnormal behavior. The standard box-whisker plot method is used for multiple iterations to obtain the p-based f Identify abnormal gas filling behavior.

[0142] 4.1.4 Based on the length of refueling time (dt cng )’s abnormal gas filling behavior identification;

[0143] Using a similar method, let the refueling time length of the i-th refueling behavior of the refueling substation be dt cng Description. Through its time series graph and histogram (such as Fig. 9As shown in Figure 2, it is found that there is a local peak in the part with a shorter gas filling time. Therefore, there is a suspicion of abnormal behavior. The standard box-whisker plot method is used for multiple iterations to obtain abnormal gas filling behavior based on time length identification. For data visualization, for gas filling time greater than 2 times the upper limit threshold of abnormal value (F U i ) is truncated to 2 times the threshold (2F U i ). Using the Python language function sum(np.array(dtcng)>2F U i ), the statistical results show that there are 139 gas filling times longer than 2F U i . Use strftime('%H:%M') to extract the hours and minutes of these abnormal gas filling behaviors and make a graph. Fig.10 .Using the truncated coordinate technology, all the abnormally long refueling time lengths are visualized. From the figure, it can be seen that this is caused by the instability of the equipment recording the refueling time length during overnight calculation. After checking the original records, it was further confirmed that the recording equipment was unstable. The two abnormal behaviors occurred at 20:39 and 21:30, and their values ​​are the same as 2 16 The difference is not big, which should be caused by data overflow. Therefore, the recording accuracy and stability of the time length of the gas filling equipment are poor, and the reliability of the gas filling time in abnormal identification is reduced. Therefore, it is necessary to further investigate the abnormal identification of adjacent gas filling time intervals of the gas filling substation.

[0144] 4.1.5 Identification of abnormal refueling behavior based on the refueling time interval (Δt) of the entire refueling substation

[0145] Since the purpose of the present invention is to identify abnormal gas filling behavior and improve gas filling efficiency, the improvement of efficiency includes that the gas filling behavior time interval (Δt) of the entire gas filling substation does not have an excessively large time interval. Therefore, it is necessary to identify abnormal gas filling behavior based on this variable.

[0146] Fig.11 The horizontal axis represents the time interval Δt between adjacent gas-filling behaviors, and the vertical axis represents the ratio of the number of gas-filling behaviors ΔN (Δt) with a time interval of Δt to the total number of gas-filling behaviors N (the time interval of N behaviors is N-1, strictly speaking, N-1 should be used here, but because N is much greater than 1, for the convenience of description and expression, the present invention still uses N). The column width of the bar graph is 1 minute. From the partial enlarged image, it can be seen that Fig.11 There are two peaks in the distribution, and the horizontal coordinate corresponding to the minimum value between the two distributions is 19 minutes, that is, this value can be used as the minimum time for replacing the on-board gas cylinder group or the time interval value of the fault.

[0147] 4.2 Identification of abnormal gas filling behavior based on multivariate;

[0148] The abnormal behavior mining method based on multiple attributes mainly relies on Support Vector Machine (SVM), Fitting an elliptic envelope (also known as Robust Co-variance), Isolation Forest and Local Outlier Factor. By comparing the results of these four unsupervised machine learning methods with the results based on single variable identification, as well as the analysis of comprehensive physical processes, the better identification method among the four methods is obtained.

[0149] 4.2.1 Identification of abnormal gas filling behavior based on dual variables;

[0150] For CNG refueling behavior, the two most important quantities in this physical process are the volume v of CNG added to the car and the change dp of the pressure in the gas cylinder in the car before and after refueling. Therefore, the present invention first uses the four algorithms provided by sklearn to identify abnormal refueling behavior for the refueling behavior described by the two attribute variables. The abnormal behavior in the algorithm provided by sklearn is defined by a learned decision function, and the learned decision function needs to be determined by the proportion of given abnormal behavior. In this example, since the proportions of abnormal behaviors identified by the single variable boxplot method based on v and pi are similar, and the proportion identified based on pf is larger, we set the abnormal behavior proportions to 3.379% (the proportion of abnormal behaviors identified by the boxplot method based on the v variable, and the proportion of abnormal behaviors identified by the boxplot method based on the pi variable is 3.173%. The two are close, and the abnormal behaviors identified by the two have a overlap of up to 91.305%. Therefore, the larger of the two proportions is the possible ratio of abnormal behavior.) and 11.056% (the proportion of abnormal behaviors identified by the boxplot method based on the pf variable). The recognition results are as follows Fig.12 and Fig.13 As shown. Fig.12 and Fig.13 It can be seen that the results of the local anomaly factor method are relatively poor and there is no clear boundary. The abnormal behavior distributions identified by the isolation forest and support vector machine methods are similar, while the abnormal behavior given by the robust covariance method is more in line with people's expectations: the normal gas addition volume v should be linearly related to the pressure change dp.

[0151] in addition, Figure 14-17 The distribution of gas filling behavior abnormality scores of four methods under two abnormal behavior ratios are given respectively. Fig.14 and 15 The local anomaly factor and the score distribution of the isolation forest do not change with the abnormal behavior ratio. Different abnormal behavior ratios can be directly adjusted by adjusting different abnormal behavior score thresholds to achieve the corresponding abnormal behavior identification. Fig.16 and 17 The support vector machine and robust covariance method represented by , in form, the different proportions of abnormal behavior lead to a simple translation of the distribution. However, in actual comparison, it is found that the specific distribution form will change with a certain degree of abnormal behavior ratio. In other words, according to Table 3, the latter two methods keep the critical value unchanged, and the different proportions of abnormal values ​​are achieved by moving the distribution.

[0152] Table 3 Critical values ​​of abnormal behavior scores identified by four methods in the gas filling behavior described by the v-dp bivariate

[0153] Local abnormal factors isolated forest Support Vector Machine Robust Covariance The anomaly ratio is the same as the univariate v identification -1.129 -0.0123 -0.0002 0.0000 The anomaly proportion is the same as the univariate pf identification -1.066 0.0272 -0.0000 0.0000

[0154] 4.2.2 Identification of abnormal gas filling behavior based on three variables;

[0155] For the gas filling behavior described by two variables, the result of robust covariance identification using the unsupervised abnormal behavior method is relatively good. Therefore, the present invention uses the robust covariance method to identify the abnormal gas filling behavior described by three variables;

[0156] Because the purpose of identifying abnormal behavior in the present invention is to improve the efficiency of gas filling. Therefore, from the perspective of physical process and time, the three variables describing gas filling behavior can be selected as v, dp, and dtcng. Robust covariance is used to identify abnormal behavior for these three variables, and the error ratio is set to 3.379% and 11.056% respectively. The recognition results are shown in Fig.18 and 19 ,and Fig. 20 Histogram of the abnormal behavior scores for the robust covariance method at these two abnormal behavior ratios.

[0157] Step 5: Exploring the causes of abnormal gas filling behavior;

[0158] The abnormal behavior identified by the present invention refers to the gasification behavior that reduces the gasification efficiency. Therefore, the abnormal gasification behavior identified based on the single variable v is the most important. For this reason, the gasification behavior with a smaller v is considered to be an abnormal gasification behavior in the present invention. The critical value for identifying a smaller v is determined by the boxplot method. In order to explore the causes of these gasification behaviors, the present invention uses the sum statement in the numpy module of the Python language to calculate the number of overlaps between the abnormal behaviors identified by v and the abnormal behaviors identified based on pi, pf, etc., as shown in Table 4.

[0159] Table 4 Reproducibility of abnormal behaviors identified based on different variables and methods

[0160] <![CDATA[v<v c ]]> <![CDATA[pi>pi c ]]> <![CDATA[pf<pf c ]]> <![CDATA[dp<dp c ]]> all <![CDATA[v<v c ]]> 4227 3623 1980 4136 1362 <![CDATA[pi>pi c ]]> 3623 3968 1371 3882 1362 <![CDATA[pf<pf c ]]> 1980 1371 13822 2195 1362 <![CDATA[dp<dp c ]]> 4136 3882 2195 4719 1362 all 1362 1361 1362 1362 1362

[0161] The robust covariance method is used to score abnormal behaviors based on v and dp bivariate identification. The number of overlaps between abnormal behaviors identified by v and pf univariate identification ratios and abnormal behaviors identified by v are 685 and 3633 respectively.

[0162] While for the ratio of abnormal behaviors identified by single variables v and pf, the number of repetitions of abnormal behaviors identified by three variables v, dp, and dtcng and abnormal behaviors identified by single variable based on v is 1324 and 3651 respectively.

[0163] Further analysis found that of the 4227 abnormal gas filling behaviors identified by the boxplot based on the v single variable, 4074 were caused by repeated gas filling, and 153 gas filling behaviors were to be explained. Among these 153 non-repeated gas filling behaviors, 120 behaviors occurred when the time interval between gas filling behaviors in the entire gas filling substation was greater than 19 minutes, which can be considered to be caused by the replacement of tank trucks in the gas filling substation. The 33 non-repeated abnormal gas filling behaviors were caused by the gas filling substation setting to stop gas filling when the card balance was less than 3.95.

[0164] Step 6: Plans to reduce abnormal gassing behavior.

[0165] In view of the analysis results of step 5, the present invention proposes a solution to reduce abnormal gas filling behavior, that is, first of all, to reduce repeated gas filling behavior, which requires improving the accuracy of the pressure sensor to prevent the gas filling gun from repeatedly filling due to inaccurate sensor data. The second is to increase the intelligence and scientificity of tank truck scheduling at the gas filling substation. Finally, the setting of stopping gas filling when the card balance is lower than 3.95 is changed. The card purchase deposit can be used to allow the card balance to continue to be filled when it is lower than 3.95. At the same time, the method of checking the card balance after filling is changed to first checking the card balance before filling when inserting the card.

[0166] The present invention identifies abnormal refueling behaviors of CNG refueling substations by means of boxplot method and robust covariance method, and compares and analyzes the identification results, and proposes a data mining method for abnormal behavior identification and analysis based on unsupervised learning for these refueling behaviors. Abnormal refueling behaviors are identified by entering refueling data into a database, selecting and constructing feature variables, using boxplot method based on single variables, and unsupervised machine learning methods such as robust covariance based on multivariate, and comparing and analyzing the identification results of different abnormal refueling behaviors and the identification results based on different feature variables.

[0167] The present invention is described above by way of example. It should be noted that, without departing from the core of the present invention, any simple deformation, modification or other equivalent replacement that can be made by those skilled in the art without inventive effort falls within the protection scope of the present invention.

Claims

1. A method for identifying abnormal refueling behavior of a CNG refueling substation based on unsupervised machine learning, characterized in that: The steps include: Step 1: Data preprocessing, importing the original CNG filling substation filling log into the analysis system; Step 2: Selecting and constructing characteristic variables describing the gas filling behavior; Step 2 includes: 2.1 Based on the definition of information entropy, calculate the information entropy of each feature variable; 2.2 Select characteristic variables based on the value of information entropy and combined with correlation analysis between characteristic variables and physical process analysis; 2.3 Based on actual needs, construct new characteristic variables to describe gas filling behavior; 2.4 Classification of characteristic variables; Step 3: Visualization of the relationship between the characteristic variables of the gas filling behavior; Step 3 includes: 3.1 Scatter plot matrix of feature variables: Based on the selected and constructed gas filling behavior characteristic variables, the relationship of these variables is visualized through a scatter plot matrix; 3.2 Characteristic variable evaluation: The final characteristic variables are selected based on the scatter plot matrix of the characteristic variables, the physical process of gas filling behavior, and the purpose of improving gas filling efficiency; Step 4: Identification of abnormal gas filling behavior; Step 4 includes: 4.1 Identification of abnormal gas filling behavior based on a single variable: Based on the single variables including gas filling volume, pressure before gas filling, pressure after gas filling and gas filling time interval, the iterative boxplot method and kernel density estimation method are used to identify whether the gas filling behavior expressed by the single variable is abnormal behavior; 4.2 Identification of abnormal gas filling behavior based on multivariate; 4.2.1 Identification of abnormal gas filling behavior based on dual variables; The abnormal behavior mining method based on multiple attributes mainly relies on support vector machine (SVM), fitting an elliptic envelope, isolation forest and local outlier factor. By comparing the results of these four unsupervised machine learning and the results based on single variable identification, as well as the analysis of comprehensive physical processes, the better identification method among the four methods is obtained. 4.2.2 Identification of abnormal gas filling behavior based on three variables; The robust covariance unsupervised abnormal behavior method is used to identify abnormal gas filling behaviors described by three variables; Step 5: Exploring the causes of abnormal gas filling behavior; Step 6: Plans to reduce abnormal gassing behavior.

2. The method for identifying abnormal refueling behavior of a CNG refueling substation based on unsupervised machine learning according to claim 1 is characterized in that: The abnormal gas filling behavior refers to a gas filling behavior that reduces the gas filling efficiency.