Gas consumption behavior analysis method and device

Through the density clustering method, the user gas data is clustered, which solves the problem of poor effectiveness of the traditional K-means algorithm under complex data distribution, and achieves more accurate and applicable user group clustering.

CN119693043APending Publication Date: 2025-03-25WUHAN SHUCHUN INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411707475.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The traditional K-means clustering algorithm is difficult to apply to irregular and non-circular regional features of user data, resulting in poor results when distributed in complex data and difficult to capture subtle differences in specific application scenarios.

Method used

The density clustering method is adopted, and the user is density clustered using multiple historical gas data and preset user tag information, and the clustering effect is optimized through parameters such as density radius and density threshold, and the clustering effect is evaluated through coverage and accuracy.

Benefits of technology

It realizes rapid and reliable analysis of user gas behavior and clusters of user groups, improves the accuracy and practicality of classification, and can better adapt to complex data distribution and specific application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693043A_ABST
    Figure CN119693043A_ABST
Patent Text Reader

Abstract

The invention discloses a gas consumption behavior analysis method and device, and relates to the technical field of gas consumption behavior analys.The method comprises the steps that multiple pieces of historical gas consumption data are obtained, and each piece of historical gas consumption data corresponds to one piece of user identity information and one gas consumption date; performing data preprocessing on the plurality of historical gas consumption data, and adding preset user label information to the corresponding user identity information; based on a preset density clustering search parameter, performing density clustering on the plurality of preprocessed historical gas consumption data to obtain a plurality of user groups; and based on the user tag information existing in each user group, adding the user tag information to the user identity information lacking the user tag information in the user group. According to the method and the device, the users are subjected to density clustering processing on the basis of the plurality of historical gas consumption data in combination with the preset user label information, so that the gas consumption behaviors of the users are quickly and reliably analyzed, and the user groups are clustered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of gas usage behavior analysis, and specifically to a gas usage behavior analysis method and device. Background Art

[0002] In traditional gas management, users' gas consumption is collected through IC card gas meters. This method is difficult to provide users with detailed daily gas consumption information, making it difficult for companies to formulate refined gas management strategies and accurately predict gas demand at different stages.

[0003] With the development of technology, it is now possible to provide enterprises with high-frequency and refined daily gas consumption data. The current research on natural gas customer classification management usually uses the K-means clustering algorithm. In order to improve the accuracy and practicality of classification, researchers continue to optimize and improve the K-means algorithm and explore how to achieve better classification results under the background of data complexity and user behavior diversity.

[0004] However, it was found during use that the distribution of user data showed irregular and non-circular regional characteristics, making the traditional K-means clustering algorithm difficult to apply and less effective when faced with complex data distribution. Before inputting data into the algorithm, it is usually necessary to perform feature extraction and dimensionality reduction on the original data to improve the performance and efficiency of the model. In addition, traditional methods mostly provide an overall evaluation of the clustering results, but may not capture the subtle differences in specific application scenarios.

[0005] Therefore, in order to meet actual needs, a new gas consumption behavior analysis technology is provided. Summary of the invention

[0006] In view of the defects existing in the prior art, the purpose of the present application is to provide a gas usage behavior analysis method and device, which performs density clustering processing on users based on multiple historical gas usage data and combined with preset user tag information, so as to quickly and reliably analyze users' gas usage behavior and cluster user groups.

[0007] In order to achieve the above objectives, the technical solution adopted by this application is:

[0008] In a first aspect, the present application provides a method for analyzing gas usage behavior, the method comprising the following steps:

[0009] Acquire multiple historical gas usage data, each of which corresponds to a user identity information and a gas usage date;

[0010] Performing data preprocessing on the plurality of historical gas usage data, and adding preset user tag information to the corresponding user identity information;

[0011] Based on preset density clustering search parameters, density clustering is performed on the preprocessed plurality of historical gas usage data to obtain a plurality of user groups;

[0012] Based on the user tag information existing in each of the user groups, the user tag information is added to the user identity information in the user group that lacks the user tag information.

[0013] On the basis of the above technical solution, data preprocessing is performed on the plurality of historical gas usage data, and preset user tag information is added to the corresponding user identity information, including the following steps:

[0014] Based on the plurality of historical gas usage data, construct a gas usage feature vector;

[0015] Adding preset user tag information to the corresponding user identity information;

[0016] Normalizing the historical gas usage data in the gas usage feature vector to obtain a normalized gas usage feature vector;

[0017] The normalized gas usage feature vector is subjected to dimensionality reduction processing and visualization processing to obtain visualized gas usage feature data.

[0018] On the basis of the above technical solution, based on the preset density clustering search parameters, the pre-processed multiple historical gas usage data are density clustered to obtain multiple user groups, including the following steps:

[0019] Based on preset density clustering search parameters, the visualized gas usage characteristic data is density clustered to obtain multiple user groups.

[0020] Based on the above technical solution, the density clustering search parameters include a density radius and a density threshold.

[0021] On the basis of the above technical solution, the method further includes a density clustering effect evaluation process, and the density clustering effect evaluation process includes the following steps:

[0022] Based on the user tag information of the user group obtained by density clustering through the density clustering search parameters, combined with the actual user tag ratio tag information of each user identity information, the corresponding coverage rate and accuracy rate are calculated; wherein,

[0023] The coverage rate is used to indicate the proportion of user identity information with preset user tag information that is correctly classified;

[0024] The accuracy rate is used to indicate the proportion of correctly classified user identity information among all the user groups.

[0025] Based on the above technical solution, the gas usage characteristic vector is C i =[x i1 ,x i2 ,...,x ij ];in,

[0026] x ij Represents the gas consumption of the i-th user on the j-th day.

[0027] On the basis of the above technical solution, the method is configured with a normalization formula, which is:

[0028] X ij =(x ij ―min(R j )) / (max(R j )―min(R j ));in,

[0029] X ij represents the gas consumption of the i-th user on the j-th day after normalization;

[0030] R j represents the gas usage vector of all users on day j, R j =[x 1j ,x 2j ,…,x ij ].

[0031] On the basis of the above technical solution, the method is configured with a coverage calculation formula, which is:

[0032] Coverage = TP / (TP+FN); where,

[0033] TP is the number of users with both true category and predicted category;

[0034] FN is the number of users whose true category exists but whose predicted category does not exist.

[0035] On the basis of the above technical solution, the method is configured with an accuracy calculation formula, which is:

[0036] Accuracy = (TP+TN) / (TP+FP+FN+TN); where,

[0037] TP is the number of users with both true category and predicted category;

[0038] FN is the number of users with true categories but no predicted categories;

[0039] FP is the number of users for whom the true category does not exist and the predicted category exists;

[0040] TN is the number of users who do not have the true category and the predicted category.

[0041] In a second aspect, the present application provides a gas usage behavior analysis device, the device comprising:

[0042] A data acquisition module, which is used to acquire a plurality of historical gas usage data, each of which corresponds to a user identity information and a gas usage date;

[0043] A data preprocessing module, which is used to perform data preprocessing on the plurality of historical gas usage data and add preset user tag information to the corresponding user identity information;

[0044] A user clustering module, which is used to perform density clustering on the pre-processed historical gas usage data based on preset density clustering search parameters to obtain multiple user groups;

[0045] The tag adding module is used to add the user tag information to the user identity information lacking the user tag information in the user group based on the user tag information existing in each of the user groups.

[0046] On the basis of the above technical solution, the data preprocessing module is further used to construct a gas usage feature vector based on the plurality of historical gas usage data;

[0047] The data preprocessing module is also used to add preset user tag information to the corresponding user identity information;

[0048] The data preprocessing module is also used to normalize the historical gas usage data in the gas usage feature vector to obtain a normalized gas usage feature vector;

[0049] The data preprocessing module is also used to perform dimensionality reduction and visualization processing on the normalized gas usage feature vector to obtain visualized gas usage feature data.

[0050] On the basis of the above technical solution, the user clustering module is further used to perform density clustering on the visualized gas usage characteristic data based on preset density clustering search parameters to obtain multiple user groups.

[0051] Based on the above technical solution, the density clustering search parameters include a density radius and a density threshold.

[0052] On the basis of the above technical solution, the device also includes a density clustering effect evaluation module, which is used to calculate the corresponding coverage and accuracy based on the user label information of the user group obtained by density clustering through the density clustering search parameters, combined with the actual user label ratio label information of each user identity information; wherein,

[0053] The coverage rate is used to indicate the proportion of user identity information with preset user tag information that is correctly classified;

[0054] The accuracy rate is used to indicate the proportion of correctly classified user identity information among all the user groups.

[0055] Based on the above technical solution, the gas usage characteristic vector is C i =[x i1 ,x i2 ,...,x ij ];in,

[0056] x ij Represents the gas consumption of the i-th user on the j-th day.

[0057] On the basis of the above technical solution, the method is configured with a normalization formula, which is:

[0058] X ij =(x ij ―min(R j )) / (max(R j )―min(R j ));in,

[0059] X ij represents the gas consumption of the i-th user on the j-th day after normalization;

[0060] R j represents the gas usage vector of all users on day j, R j =[x 1j ,x 2j ,…,x ij ].

[0061] On the basis of the above technical solution, the method is configured with a coverage calculation formula, which is:

[0062] Coverage = TP / (TP+FN); where,

[0063] TP is the number of users with both true category and predicted category;

[0064] FN is the number of users whose true category exists but whose predicted category does not exist.

[0065] On the basis of the above technical solution, the method is configured with an accuracy calculation formula, which is:

[0066] Accuracy = (TP+TN) / (TP+FP+FN+TN); where,

[0067] TP is the number of users with both true category and predicted category;

[0068] FN is the number of users with true categories but no predicted categories;

[0069] FP is the number of users for whom the true category does not exist and the predicted category exists;

[0070] TN is the number of users who do not have the true category and the predicted category.

[0071] Compared with the prior art, the advantages of this application are:

[0072] This application performs density clustering on users based on multiple historical gas usage data combined with preset user tag information, so as to quickly and reliably analyze users' gas usage behaviors and cluster user groups. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Terminology explanation:

[0074] PCA: Principal Component Analysis, principal component analysis method;

[0075] DBSCAN: Density-Based Spatial Clustering of Applications with Noise), density-based clustering algorithm;

[0076] UMAP: Uniform Manifold Approximation and Projection, unified manifold approximation and projection.

[0077] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0078] Figure 1 This is a flow chart of the steps of the gas usage behavior analysis method of an embodiment of the present application;

[0079] Figure 2This is a technical principle flow chart of the gas usage behavior analysis method of an embodiment of the present application;

[0080] Figure 3 A schematic diagram of the UMAP dimensionality reduction effect in the gas usage behavior analysis method of an embodiment of the present application;

[0081] Figure 4 A schematic diagram of the PCA dimensionality reduction effect in the gas usage behavior analysis method of an embodiment of the present application;

[0082] Figure 5 This is a structural block diagram of a gas usage behavior analysis device according to an embodiment of the present application. DETAILED DESCRIPTION

[0083] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0084] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.

[0085] The embodiments of the present application provide a method and device for analyzing gas usage behavior, which performs density clustering processing on users based on multiple historical gas usage data in combination with preset user tag information, thereby quickly and reliably analyzing the gas usage behavior of users and clustering user groups.

[0086] In order to achieve the above technical effects, the overall idea of ​​this application is as follows:

[0087] A method for analyzing gas usage behavior, the method comprising the following steps:

[0088] S1. Acquire multiple historical gas usage data, each of which corresponds to a user identity information and a gas usage date;

[0089] S2. Preprocess multiple historical gas usage data and add preset user tag information to corresponding user identity information;

[0090] S3. Based on preset density clustering search parameters, density clustering is performed on the pre-processed multiple historical gas consumption data to obtain multiple user groups;

[0091] S4. Based on the user tag information existing in each user group, add user tag information to the user identity information that lacks user tag information in the user group.

[0092] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.

[0093] First, see Figures 1 to 4 As shown, the embodiment of the present application provides a method for analyzing gas usage behavior, the method comprising the following steps:

[0094] S1. Acquire multiple historical gas usage data, each of which corresponds to a user identity information and a gas usage date;

[0095] S2. Preprocess multiple historical gas usage data and add preset user tag information to corresponding user identity information;

[0096] S3. Based on preset density clustering search parameters, density clustering is performed on the pre-processed multiple historical gas consumption data to obtain multiple user groups;

[0097] S4. Based on the user tag information existing in each user group, add user tag information to the user identity information that lacks user tag information in the user group.

[0098] It should be noted that the existing technical solutions for processing user behavior data only stay at the basic data preprocessing stage, such as data cleaning, outlier processing and missing value filling. However, this processing method does not deeply explore the characteristics of the data. High-dimensional features, especially unprocessed high-dimensional features, often contain a large amount of redundant data, which not only reduces the training efficiency of the model, but may also cause the model to overfit. More importantly, these preprocessing steps do not fully consider the characteristics of the data itself, but directly send the preprocessed data to the K-means algorithm for clustering analysis. The choice of this method is not based on the consideration of data characteristics, but adopts a general clustering method, which may lead to limited optimization space of the algorithm effect and may not select the most appropriate algorithm. Therefore, before selecting an algorithm, it is necessary to understand more about the specific characteristics of the data to ensure the effectiveness and accuracy of the clustering results.

[0099] After analysis, it was found that the distribution of user data showed irregular and non-circular regional characteristics, which made the traditional K-means algorithm difficult to apply. The K-means algorithm assumes that the distribution of data points is circular clusters and classifies by minimizing the sum of squares within the cluster, which is less effective when faced with complex data distribution.

[0100] Before inputting data into the algorithm, it is usually necessary to perform feature extraction and dimensionality reduction on the raw data to improve the performance and efficiency of the model. Common dimensionality reduction techniques include principal component analysis (PCA) and t-distributed random neighbor embedding (t-SNE). PCA is a linear dimensionality reduction method that can reduce feature dimensions by extracting the main components in the data, but it requires feature extraction of the data in advance and has limited data processing capabilities for nonlinear structures. t-SNE is particularly suitable for dimensionality reduction of small-scale data sets. It performs well in maintaining the local structure of the data, but it is not applicable to large-scale gas user groups.

[0101] Clustering algorithms are often classified as unsupervised learning algorithms because they do not rely on the labels of the data during execution. However, this unsupervised nature also brings a major challenge to the DBSCAN algorithm, which is the difficulty in determining its key parameters: the density radius (Eps) and the density threshold (MinPts). In order to optimize these parameters, it is usually necessary to initialize them using the k-distance graph method before calling the DBSCAN model for actual clustering. In addition, due to the unsupervised nature of the DBSCAN algorithm and the lack of data labels, it is difficult to conduct a personalized evaluation of the clustering results. Therefore, when evaluating the clustering effect, some general evaluation indicators such as the silhouette coefficient and the Davies-Bouldin index are usually relied on, which can provide an overall evaluation of the clustering results, but may not capture the subtle differences in specific application scenarios.

[0102] The embodiment of the present application performs density clustering processing on users based on multiple historical gas usage data combined with preset user tag information, thereby quickly and reliably analyzing the gas usage behavior of users and clustering user groups.

[0103] Further, data preprocessing is performed on the plurality of historical gas usage data, and preset user tag information is added to the corresponding user identity information, including the following steps:

[0104] Based on the plurality of historical gas usage data, construct a gas usage feature vector;

[0105] Adding preset user tag information to the corresponding user identity information;

[0106] Normalizing the historical gas usage data in the gas usage feature vector to obtain a normalized gas usage feature vector;

[0107] The normalized gas usage feature vector is subjected to dimensionality reduction processing and visualization processing to obtain visualized gas usage feature data.

[0108] Further, based on the preset density clustering search parameters, density clustering is performed on the pre-processed plurality of historical gas usage data to obtain a plurality of user groups, including the following steps:

[0109] Based on preset density clustering search parameters, the visualized gas usage characteristic data is density clustered to obtain multiple user groups.

[0110] Furthermore, the density clustering search parameters include a density radius and a density threshold.

[0111] Furthermore, the method also includes a density clustering effect evaluation process, and the density clustering effect evaluation process includes the following steps:

[0112] Based on the user tag information of the user group obtained by density clustering through the density clustering search parameters, combined with the actual user tag ratio tag information of each user identity information, the corresponding coverage rate and accuracy rate are calculated; wherein,

[0113] The coverage rate is used to indicate the proportion of user identity information with preset user tag information that is correctly classified;

[0114] The accuracy rate is used to indicate the proportion of correctly classified user identity information among all the user groups.

[0115] Furthermore, the gas usage characteristic vector is C i =[x i1 ,x i2 ,...,x ij ];in,

[0116] x ij Represents the gas consumption of the i-th user on the j-th day.

[0117] The historical gas usage data respectively correspond to a user identity information and a gas usage date, the gas usage date is the jth day or a specific date, the user identity information is the ith user or the specific identity information, and the historical gas usage data is the gas usage amount.

[0118] Furthermore, the method is configured with a normalization formula, which is:

[0119] X ij =(x ij ―min(R j )) / (max(R j )―min(R j ));in,

[0120] X ij represents the gas consumption of the i-th user on the j-th day after normalization;

[0121] R j represents the gas usage vector of all users on day j, R j =[x 1j ,x 2j ,…,x mj ].

[0122] Furthermore, the method is configured with a coverage calculation formula, which is:

[0123] Coverage = TP / (TP+FN); where,

[0124] TP is the number of users with both true category and predicted category;

[0125] FN is the number of users whose true category exists but whose predicted category does not exist.

[0126] Furthermore, the method is configured with an accuracy calculation formula, which is:

[0127] Accuracy = (TP+TN) / (TP+FP+FN+TN); where,

[0128] TP is the number of users with both true category and predicted category;

[0129] FN is the number of users with true categories but no predicted categories;

[0130] FP is the number of users for whom the true category does not exist and the predicted category exists;

[0131] TN is the number of users who do not have the true category and the predicted category.

[0132] Based on the technical solution of the embodiment of the present application, during the specific implementation, the situation is as follows:

[0133] The first step is to obtain the original data:

[0134] The database stores each user’s daily gas consumption, which provides basic information for user grouping.

[0135] The second step is data preprocessing:

[0136] (1) Feature vector representation: Each user’s gas usage feature is represented as a vector in the following format:

[0137] C i =[x i1 ,x i2 ,...,x ij ]

[0138] where x ijRepresents the gas consumption of the i-th user on the j-th day.

[0139] (2) Labeled data:

[0140] Based on the user labels provided by the business department, these users are marked. These labels will be used for subsequent model evaluation and verification.

[0141] (3) Data normalization:

[0142] In order to eliminate the difference in dimensions, the daily gas consumption data is normalized to the interval [0,1] based on the maximum and minimum gas consumption of all users every day. The normalization formula is as follows:

[0143] X ij =(x ij ―min(R j )) / (max(R j )―min(R j ));in,

[0144] X ij represents the gas consumption of the i-th user on the j-th day after normalization;

[0145] R j represents the gas usage vector of all users on day j, expressed as follows,

[0146] R j =[x 1j ,x 2j ,…,x ij ].

[0147] (4) UMAP Dimensionality Reduction:

[0148] The UMAP algorithm is used to map high-dimensional data to a low-dimensional space (3D in this case) to preserve the relative distance between data. At the same time, the reduced-dimensional data is visualized to facilitate observation of the distribution and characteristics of the data. Due to the irregularity of data distribution, the DBSCAN model is selected for subsequent clustering analysis.

[0149] The third step is parameter initialization:

[0150] Use the k-distance method to initialize the density radius (Eps) and density threshold MinPts. The k-distance method can effectively identify and mine outliers in the data, but our goal is to group users, and we need to divide user groups into more granular groups. In order to achieve our goal, we need to further optimize the model parameters.

[0151] The fourth step is DBSCAN density clustering:

[0152] (1) Grid search parameters:

[0153] In order to improve the clustering effect, the parameters of DBSCAN will be optimized based on the initialization parameters in step 3 and combined with the grid search method. By traversing all parameters in the interval, all possible values ​​of all parameters are rehearsed and combined.

[0154] (2) Effect evaluation:

[0155] In order to comprehensively evaluate the clustering effect of the DBSCAN model under different parameter settings, we defined two key indicators - coverage and accuracy, which will help us measure the performance of each set of parameters. Refer to the confusion matrix, as shown in Table 1 below:

[0156]

[0157] Table 1

[0158] Define two evaluation metrics:

[0159] Coverage: This metric measures the proportion of users who are correctly classified among the labeled user categories. It is specifically defined as:

[0160] Coverage ratio = TP / (TP+FN).

[0161] Accuracy: This metric evaluates the percentage of correctly classified users among all classified users. It is specifically defined as:

[0162] Accuracy = (TP+TN) / (TP+FP+FN+TN);

[0163] Here, “correct classification” means that it is actually correctly identified as that category.

[0164] When applying these indicators, the user data matrix is ​​input into the DBSCAN model and multiple passes are performed for each set of parameter configurations. By calculating the coverage and accuracy of each clustering result, the effect of different parameter settings can be evaluated. Finally, the parameter combination with the highest coverage and accuracy is selected as the optimal parameter setting for the DBSCAN model.

[0165] Step 5: User tag:

[0166] To further improve the labeling process of user grouping, the user groups output by the model are labeled in combination with some user labeling information provided by the business department. When an unlabeled user is classified into a labeled category, the user will be assigned the label of the labeled user in the category. This method ensures that the user groups output by the model are consistent with the actual labels of the business department, improving the accuracy and practicality of the labels.

[0167] In summary, the technical solution of the embodiment of the present application has the following technical key points:

[0168] First, in the user clustering solution, the dimensionality reduction method was changed from PCA to UMAP. At the same time, the data after dimensionality reduction was visualized to more intuitively observe the distribution and structural characteristics of the data, and according to the characteristics of the data after dimensionality reduction, a more suitable clustering model DBSCAN was selected.

[0169] Second, personalized evaluation indicators and parameter optimization: To further improve the clustering effect of the DBSCAN model, a small amount of labeled data provided by the business department was introduced, and based on these data labels, two personalized evaluation indicators were designed: coverage and accuracy. These two personalized evaluation indicators can be used to more deeply analyze the clustering effect of the model and help select the optimal parameters.

[0170] In summary, the technical solution of the embodiment of the present application has the following technical advantages:

[0171] Compared with PCA dimensionality reduction, UMAP can not only realize feature extraction and save the time-consuming and labor-intensive feature engineering process, but also retain the local structure and topological characteristics of the data when mapping high-dimensional data to low-dimensional space, which facilitates visualization and fully observes the characteristics of the data, thus facilitating the selection of a more appropriate model for clustering.

[0172] Generally speaking, DBSCAN is often used for anomaly detection, and k-means is often selected for clustering of users. The embodiment of the present application proposes for the first time a complete set of user clustering solutions with strong interpretability for the gas industry and for segmenting all users, so that business departments can make reasonable gas usage plans based on the gas usage patterns of different users.

[0173] It should be noted that the dimensionality reduction effects of UMAP and PCA are compared:

[0174] The data after dimension reduction by UMAP completely retains the topological characteristics of high-dimensional data and can clearly distinguish users of different categories;

[0175] The dimensionality reduction effect of PCA is also reduced to 3 dimensions. PCA cannot clearly distinguish between various types of user data.

[0176] Second, see Figure 5 As shown, an embodiment of the present application provides a gas usage behavior analysis device, the device comprising:

[0177] A data acquisition module, which is used to acquire a plurality of historical gas usage data, each of which corresponds to a user identity information and a gas usage date;

[0178] A data preprocessing module, which is used to perform data preprocessing on the plurality of historical gas usage data and add preset user tag information to the corresponding user identity information;

[0179] A user clustering module, which is used to perform density clustering on the pre-processed historical gas usage data based on preset density clustering search parameters to obtain multiple user groups;

[0180] The tag adding module is used to add the user tag information to the user identity information lacking the user tag information in the user group based on the user tag information existing in each of the user groups.

[0181] The embodiment of the present application performs density clustering processing on users based on multiple historical gas usage data combined with preset user tag information, thereby quickly and reliably analyzing the gas usage behavior of users and clustering user groups.

[0182] Furthermore, the data preprocessing module is further used to construct a gas usage feature vector based on the plurality of historical gas usage data;

[0183] The data preprocessing module is also used to add preset user tag information to the corresponding user identity information;

[0184] The data preprocessing module is also used to normalize the historical gas usage data in the gas usage feature vector to obtain a normalized gas usage feature vector;

[0185] The data preprocessing module is also used to perform dimensionality reduction and visualization processing on the normalized gas usage feature vector to obtain visualized gas usage feature data.

[0186] Furthermore, the user clustering module is also used to perform density clustering on the visualized gas usage characteristic data based on preset density clustering search parameters to obtain multiple user groups.

[0187] Furthermore, the density clustering search parameters include a density radius and a density threshold.

[0188] Furthermore, the device also includes a density clustering effect evaluation module, which is used to calculate the corresponding coverage and accuracy based on the user label information of the user group obtained by density clustering through the density clustering search parameters, combined with the actual user label ratio label information of each user identity information; wherein,

[0189] The coverage rate is used to indicate the proportion of user identity information with preset user tag information that is correctly classified;

[0190] The accuracy rate is used to indicate the proportion of correctly classified user identity information among all the user groups.

[0191] Furthermore, the gas usage characteristic vector is C i =[x i1 ,xi2 ,...,x ij ];in,

[0192] x ij Represents the gas consumption of the i-th user on the j-th day.

[0193] Furthermore, the method is configured with a normalization formula, which is:

[0194] X ij =(x ij ―min(R j )) / (max(R j )―min(R j ));in,

[0195] X ij represents the gas consumption of the i-th user on the j-th day after normalization;

[0196] R j represents the gas usage vector of all users on day j, R j =[x 1j ,x 2j ,…,x ij ].

[0197] On the basis of the above technical solution, the method is configured with a coverage calculation formula, which is:

[0198] Coverage = TP / (TP+FN); where,

[0199] TP is the number of users with both true category and predicted category;

[0200] FN is the number of users whose true category exists but whose predicted category does not exist.

[0201] Furthermore, the method is configured with an accuracy calculation formula, which is:

[0202] Accuracy = (TP+TN) / (TP+FP+FN+TN); where,

[0203] TP is the number of users with both true category and predicted category;

[0204] FN is the number of users with true categories but no predicted categories;

[0205] FP is the number of users for whom the true category does not exist and the predicted category exists;

[0206] TN is the number of users who do not have the true category and the predicted category.

[0207] It should be noted that the gas usage behavior analysis device mentioned in the embodiment of the present application is similar to the technical principles of the gas usage behavior analysis method mentioned in the first aspect in terms of technical issues, technical solutions and technical effects, and will not be elaborated here.

[0208] In the description of the present application, it should be noted that the terms "upper", "lower", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. Unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.

[0209] It should be noted that, in this application, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0210] The above is only the specific implementation mode of the present application, so that those skilled in the art can understand or implement the present application. It will be apparent to those skilled in the art that various modifications to these embodiments are possible, and the general principles defined in the embodiments of the present application can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown in the embodiments of the present application, but will conform to the widest scope consistent with the principles and novel features applied for by the embodiments of the present application.

Claims

1. A method for analyzing gas usage behavior, characterized in that: The method comprises the following steps: Acquire multiple historical gas usage data, each of which corresponds to a user identity information and a gas usage date; Performing data preprocessing on the plurality of historical gas usage data, and adding preset user tag information to the corresponding user identity information; Based on preset density clustering search parameters, density clustering is performed on the preprocessed plurality of historical gas usage data to obtain a plurality of user groups; Based on the user tag information existing in each of the user groups, the user tag information is added to the user identity information in the user group that lacks the user tag information.

2. The gas usage behavior analysis method according to claim 1, characterized in that: Performing data preprocessing on the plurality of historical gas usage data and adding preset user tag information to the corresponding user identity information includes the following steps: Based on the plurality of historical gas usage data, construct a gas usage feature vector; Adding preset user tag information to the corresponding user identity information; Normalizing the historical gas usage data in the gas usage feature vector to obtain a normalized gas usage feature vector; The normalized gas usage feature vector is subjected to dimensionality reduction processing and visualization processing to obtain visualized gas usage feature data.

3. The gas usage behavior analysis method according to claim 2, characterized in that: Based on the preset density clustering search parameters, density clustering is performed on the pre-processed historical gas usage data to obtain multiple user groups, including the following steps: Based on preset density clustering search parameters, the visualized gas usage characteristic data is density clustered to obtain multiple user groups.

4. The gas usage behavior analysis method according to claim 1, characterized in that: The density clustering search parameters include a density radius and a density threshold.

5. The gas usage behavior analysis method according to claim 1, characterized in that: The method further includes a density clustering effect evaluation process, and the density clustering effect evaluation process includes the following steps: Based on the user tag information of the user group obtained by density clustering through the density clustering search parameters, combined with the actual user tag ratio tag information of each user identity information, the corresponding coverage rate and accuracy rate are calculated; wherein, The coverage rate is used to indicate the proportion of user identity information with preset user tag information that is correctly classified; The accuracy rate is used to indicate the proportion of correctly classified user identity information among all the user groups.

6. The gas usage behavior analysis method according to claim 2, characterized in that: The gas consumption characteristic vector is C i =[x i1 , x i2 , ..., x ij ];in, x ij Represents the gas consumption of the i-th user on the j-th day.

7. The gas usage behavior analysis method according to claim 6, characterized in that: The method is configured with a normalization formula, which is: X ij =(x ij -min(R j )) / (max(R j )-min(R j ));in, X ij represents the gas consumption of the i-th user on the j-th day after normalization; R j represents the gas usage vector of all users on day j, R j =[x 1j , x 2j , ..., x mj ].

8. The gas usage behavior analysis method according to claim 5, characterized in that: The method is configured with a coverage calculation formula, which is: Coverage = TP / (TP+FN); where, TP is the number of users with both true category and predicted category; FN is the number of users whose true category exists but whose predicted category does not exist.

9. The gas usage behavior analysis method according to claim 5, characterized in that: The method is configured with an accuracy calculation formula, which is: Accuracy = (TP+TN) / (TP+FP+FN+TN); where, TP is the number of users with both true category and predicted category; FN is the number of users with true categories but no predicted categories; FP is the number of users for whom the true category does not exist and the predicted category exists; TN is the number of users who do not have the true category and the predicted category.

10. A gas usage behavior analysis device, characterized in that: The device comprises: A data acquisition module, which is used to acquire a plurality of historical gas usage data, each of which corresponds to a user identity information and a gas usage date; A data preprocessing module, which is used to perform data preprocessing on the plurality of historical gas usage data and add preset user tag information to the corresponding user identity information; A user clustering module, which is used to perform density clustering on the pre-processed historical gas usage data based on preset density clustering search parameters to obtain multiple user groups; The tag adding module is used to add the user tag information to the user identity information lacking the user tag information in the user group based on the user tag information existing in each of the user groups.

Citation Information

Cited By

  • User portrait generation method for electric bicycle charging platform

    CN121301897A