Customer relationship management method and system for electricity marketing

Through clustering algorithms and machine learning models, the problem of insufficient accuracy and personalized services in the traditional power marketing model is solved, and more efficient power marketing management and user satisfaction improvement is achieved.

CN118941298AInactive Publication Date: 2024-11-12STATE GRID XINJIANG ELECTRIC POWER CO KEZHOU POWERSUPPLY CO
View PDF 0 Cites 20 Cited by

Patent Information

Application Number
CN202411098322.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-11-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The traditional power marketing model lacks accurate grasp of the characteristics and needs of different user groups, resulting in low efficiency in allocation of marketing resources, unable to provide personalized value-added services, difficult to improve user satisfaction and loyalty, and difficult to effectively mine the value of power data in big data analysis.

Method used

The clustering algorithm is used to generate user portraits, combine the XGBoost model to predict electricity consumption trends, and the random forest algorithm performs multi-level power demand prediction. Through the self-encoded network feature fusion, information gain and Gini index screening features, differentiated power marketing management is achieved.

Benefits of technology

It has improved the targetedness of power marketing strategies, improved user satisfaction and loyalty, and achieved more accurate and personalized power demand forecasting and marketing management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118941298A_ABST
    Figure CN118941298A_ABST
Patent Text Reader

Abstract

The invention discloses a customer relationship management method and system for power marketing, and relates to the field of power marketing, and the method comprises the steps: obtaining multi-source heterogeneous data; extracting user power consumption behavior features and user payment habit features, performing feature fusion through an auto-encoding network to obtain user features, and screening the user features by using information gain and Gini indexes to obtain a user feature set; according to the user feature set, clustering the users by adopting a DBSCAN clustering algorithm, and performing tagging processing on a clustering result to obtain a tagged portrait data set; according to the power consumption data of the user, an XGBoost gradient boosting tree model is adopted to predict the power consumption trend in a period of time in the future; according to a prediction result, adopting a random forest algorithm to predict the power demand of each user group; and performing differential marketing according to the tag portraits of different user groups and the multi-level power consumption prediction results. Aiming at the lack of pertinence of power marketing in the prior art, the application improves the pertinence of the power marketing strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of power marketing, and in particular to a customer relationship management method and system for power marketing. Background Art

[0002] With the deepening of power system reform and the gradual liberalization of the power sales market, power companies are facing increasingly fierce market competition. In this increasingly competitive environment, how power companies can achieve precision marketing and improve customer satisfaction and loyalty has become a key issue that needs to be solved urgently.

[0003] Traditional power marketing models often adopt a "flooding" type of extensive marketing strategy, lacking a precise grasp of the characteristics and needs of different user groups, resulting in inefficient allocation of marketing resources and high marketing costs. At the same time, due to the inability to gain in-depth insights into user electricity consumption behavior and payment habits, power companies find it difficult to provide personalized value-added services and interactive experiences, and it is difficult to improve user satisfaction and loyalty.

[0004] The advent of the big data era has brought new opportunities and challenges to power marketing. Massive amounts of power data contain valuable information on user behavior patterns and demand characteristics. How to effectively mine and utilize these data has become the key to power companies achieving precision marketing. However, power data has the characteristics of large data volume, high dimensionality, and diverse types, which makes data analysis and processing very difficult. Traditional data analysis methods, such as manually designed features and simple statistical analysis, are difficult to fully mine the value of data and cannot meet the needs of precision marketing. Summary of the invention

[0005] In response to the problem of lack of targeting in power marketing in the prior art, the present application provides a customer relationship management method and system for power marketing, which clusters users through a clustering algorithm to form labeled user portraits, and then combines the XGBoost model to predict electricity consumption trends. Finally, the random forest algorithm is used to predict the multi-level electricity demand of different user groups, thereby improving the targeting of power marketing strategies.

[0006] The purpose of this application is achieved through the following technical solutions.

[0007] The present application provides a customer relationship management method for power marketing, comprising: obtaining multi-source heterogeneous data, the multi-source heterogeneous data including user power consumption data and payment data; extracting user power consumption behavior characteristics and user payment habit characteristics based on the multi-source heterogeneous data, obtaining user characteristics by feature fusion through an autoencoder network, and filtering the user characteristics by using information gain and Gini index to obtain a user feature set; clustering users based on the filtered user feature set using a DBSCAN clustering algorithm to obtain a user clustering cluster set, and labeling the clustering results to obtain a labeled portrait data set reflecting the characteristics of different user groups; predicting the power consumption trend for a period of time in the future based on the user power consumption data using an XGBoost gradient boosting tree model; predicting the power consumption trend based on the power consumption trend prediction result, using a random forest algorithm, taking different user groups obtained by clustering as units, predicting the power demand of each user group, and forming a multi-level power consumption prediction result, wherein the multi-level includes week, month and year; and performing differentiated power marketing management based on the label portraits of different user groups and the multi-level power consumption prediction results.

[0008] Among them, taking different user groups as units means that when predicting electricity demand, users are divided into different groups obtained by clustering, and predictions are made for each group separately. The user groups here are obtained based on the clustering results. Specifically, the DBSCAN clustering algorithm is used to cluster users, and a set of clusters reflecting different user characteristics is obtained. Each cluster represents a user group, and the users in the group are relatively similar in characteristics such as electricity consumption behavior and payment habits. The random forest algorithm takes these clustered user groups as units and predicts the electricity demand of each group separately. In other words, for each user group, a random forest model will be established separately, and the historical electricity consumption data of users in the group will be used for training and prediction. In this way, multi-level electricity consumption prediction results for different user groups can be obtained. The advantage of predicting based on groups is that the electricity consumption behavior and demand characteristics of users in the group are relatively similar, and the accuracy of the prediction can be improved. There may be differences in electricity demand between different groups, and separate predictions can better capture and reflect these differences. Based on the prediction results of different groups, more refined and targeted electricity marketing strategies can be formulated.

[0009] Among them, Information Gain: An indicator used for feature selection, used to measure the contribution of a feature to the classification or prediction results. By calculating the information gain of each user feature for the user clustering results, the features that contribute the most to the user clustering can be screened out, thereby obtaining a more discriminative user feature set. The higher the information gain, the stronger the ability of the feature to distinguish different user groups. Gini Index: An indicator used for feature selection, used to measure the uncertainty of a feature for the classification or prediction results. By calculating the Gini Index of each user feature, features with less uncertainty can be screened out, that is, features that are more discriminative for distinguishing different user groups. The smaller the Gini Index, the stronger the ability of the feature to distinguish different user groups. DBSCAN Clustering Algorithm (Density-Based Spatial Clustering of Applications with Noise): A density-based clustering algorithm that can aggregate data points into clusters and identify noise points or outliers. Using the DBSCAN algorithm to cluster users, users can be divided into different groups according to the similarity of user features and the number of clusters can be automatically determined. The DBSCAN algorithm can find clusters of any shape and is robust to noise points, making it suitable for cluster analysis of power user data. XGBoost gradient boosting tree model (e Xtreme Gradient Boosting): A machine learning model based on gradient boosting trees that iteratively builds multiple decision trees and combines their prediction results to improve the accuracy of predictions. Use the XGBoost model to predict the power consumption trend for a period of time in the future. The XGBoost model can effectively process large-scale data and capture the complex patterns of power consumption trends through automatic selection and combination of features, thereby providing accurate power consumption trend prediction results.

[0010] Furthermore, obtaining a user feature set includes: obtaining user electricity consumption data, which includes the user's electricity meter record data and electricity load data; calculating the user's daily electricity consumption, monthly electricity consumption and annual electricity consumption based on the pre-processed electricity meter record data; dividing the users into different electricity consumption levels such as high, medium and low according to their electricity consumption levels through cluster analysis; dividing a day into multiple time periods, such as peak time periods, normal time periods and valley time periods, based on the pre-processed electricity load data; calculating the proportion of the user's electricity consumption in different time periods to obtain the user's electricity consumption time distribution characteristics; discovering the user's electricity consumption behavior patterns and laws in different time periods through association rule mining; constructing the user's daily load curve, based on the pre-processed electricity load data, Weekly load curve and monthly load curve; extract features from load curve, calculate the peak value, valley value, average value, standard deviation and other statistical features of load curve; discover dynamic features such as periodicity, trend and mutation point of user load curve through time series pattern mining; fuse the extracted power consumption features, power consumption period distribution features and load curve features; select the most distinguishing and representative power consumption behavior features through feature selection algorithms such as information gain or chi-square test; generate the user's comprehensive power consumption behavior feature vector as a structured representation of the user's power consumption behavior; when extracting power consumption features, use K-means clustering algorithm to divide users according to power consumption level, and use Euclidean distance or Manhattan distance as the distance measurement of clustering. When extracting power consumption period distribution features, use Apriori association rule mining algorithm to discover the power consumption behavior patterns of users in different periods, and the support and confidence thresholds of association rules are set according to actual needs. When extracting load curve features, use time series pattern mining algorithms, such as time series frequent pattern mining or time series periodicity detection, to discover the dynamic features of load curves, and the frequency and periodicity thresholds of time series patterns are set according to actual needs. When integrating electricity consumption behavior features, feature selection algorithms such as information gain or chi-square test are used to evaluate the importance and discrimination of each electricity consumption behavior feature, and the Top-K most representative features are selected to form the user's comprehensive electricity consumption behavior feature vector.

[0011] Obtain user payment data, which includes user payment records and payment details; calculate the user's average monthly payment amount, annual payment amount and historical cumulative payment amount based on the pre-processed payment record data; divide users into different payment levels such as high, medium and low according to the payment amount level through cluster analysis; identify users with abnormally high or low payment amounts through anomaly detection as a marker of special payment behavior; based on the pre-processed payment record data, count the number of payments and payment amount distribution of users in different time periods (such as the first half of the month, the middle half of the month and the last half of the month); calculate the user's payment frequency and payment amount ratio in different time periods to obtain the user's payment time distribution characteristics; discover the user's behavioral patterns and habits at payment time through sequence pattern mining; based on the pre-processed payment details Data, count the number of times users use different payment methods (such as counter payment, online payment, automatic payment, etc.) and the amount distribution; calculate the user's preference for different payment methods to obtain the user's payment method preference characteristics; through association rule mining, discover the association patterns and rules of users in choosing payment methods; merge the extracted payment amount characteristics, payment time distribution characteristics and payment method characteristics; through feature weighting, consider the impact of different payment habit characteristics on user behavior and assign different weight coefficients; generate the user's comprehensive payment habit feature vector as a structured representation of the user's payment behavior; when extracting the payment amount characteristics, use the density-based DBSCAN clustering algorithm to divide users according to the payment amount level, and the clustering distance measurement uses the Mahalanobis distance or cosine similarity. When extracting the payment time distribution characteristics, use the PrefixSpan sequence pattern mining algorithm to discover the user's behavior rules at the payment time, and the support threshold of the sequence pattern is set according to actual needs. When extracting payment method features, the Apriori association rule mining algorithm is used to discover the association patterns of users' payment method choices, and the support and confidence thresholds of the association rules are set according to actual needs. When integrating payment habit features, a weighted fusion method is used to determine the weight coefficients of different payment habit features through expert experience or data analysis to generate the user's comprehensive payment habit feature vector.

[0012] The auto-encoding network is used to fuse the user's electricity consumption behavior characteristics and the user's payment habit characteristics to obtain user characteristics. The information gain and Gini index are used to filter the fused user characteristics to obtain a user feature set. Among them, the load curve (Load Curve) is a curve that describes the change of power load over a period of time (usually one day or one week). It reflects the user's electricity demand and electricity consumption pattern in different time periods.

[0013] Furthermore, the autoencoder network is an unsupervised learning neural network model, which is mainly used for data dimension reduction and feature extraction. In this scheme, the user's electricity consumption behavior characteristics and the user's payment habit characteristics are fused through the autoencoder network to obtain compressed and representative user characteristics, including: splicing the user's electricity consumption behavior characteristics and the user's payment habit characteristics by column to form an input matrix. Assuming that the user's electricity consumption behavior characteristics are p×m dimensions and the user's payment habit characteristics are p×n dimensions, the dimension of the spliced ​​input matrix is ​​p×(m+n), where p is the number of users. Design an autoencoder network structure containing a dimensionality reduction hidden layer, and the number of hidden layer nodes is less than the feature dimension of the input matrix to achieve feature compression. The autoencoder network usually consists of two parts: an encoder and a decoder. The encoder maps the input data to a low-dimensional feature space, and the decoder restores the low-dimensional features to the original data. The number of hidden layer nodes can be determined based on experience or cross-validation, and is usually set to a smaller value less than the input feature dimension, such as (m+n) / 2 or (m+n) / 4.

[0014] The concatenated input matrix is ​​used as a sample to train the autoencoder network in an unsupervised manner. The training goal is to minimize the reconstruction error, that is, to make the output of the decoder as similar as possible to the input matrix. Commonly used loss functions include mean square error (MSE) or cross entropy loss function. The parameters of the autoencoder network are optimized by backpropagation algorithm and optimizer (such as Adam) until the preset number of iterations or convergence conditions are reached. The encoder part of the trained autoencoder network is extracted separately for feature dimensionality reduction. The input matrix is ​​input into the trained encoder, and the output of the last hidden layer is obtained as the comprehensive feature matrix after dimensionality reduction. The dimension of the feature matrix after dimensionality reduction is p×k, where k is the number of hidden layer nodes, which is usually smaller than the original feature dimension (m+n).

[0015] The L1 regularization is performed on the comprehensive feature matrix after dimensionality reduction to introduce sparsity constraints. L1 regularization can be achieved by adding the L1 norm term to the loss function, which encourages the sparsity of features and makes the weights of some features tend to zero. The dimension of the feature matrix after sparseness is still p×k, but some elements may become zero, indicating that the corresponding features are eliminated in the fused representation. The sparse p×k dimensional comprehensive feature matrix is ​​output as the final user feature. This user feature matrix combines the characteristics of user electricity consumption behavior and user payment habits, and is reduced in dimension and sparse through an autoencoder network to extract the most critical feature information.

[0016] Furthermore, information gain and Gini index are both commonly used feature selection indicators. The importance and discriminative ability of features are evaluated by calculating the correlation or purity between each feature and the target variable (user category). In this scheme, by comprehensively considering information gain and Gini index, user features are sorted and screened to obtain the most representative and discriminative user feature set. Calculate mutual information: Take user category as random variable Y and each column of the user feature matrix as random variable X. Calculate the mutual information I(X; Y) between each feature X and user category Y. The mutual information represents the degree of correlation between feature X and user category Y. The calculation formula of mutual information is: I(X; Y) = H(Y)-H(Y|X), where H(Y) is the entropy of user category Y and H(Y|X) is the conditional entropy of user category Y under the condition of given feature X. An n-dimensional mutual information vector is obtained, where n is the number of user features and each element of the vector represents the mutual information value between the corresponding feature and the user category. Calculate the Gini index: Calculate the Gini index for each column of the user feature matrix. The Gini index represents the purity or ability to distinguish user categories. The calculation formula for the Gini index is: Among them, p i It represents the probability distribution of user categories when feature X takes the i-th value. We get an n-dimensional Gini index vector, where n is the number of user features and each element of the vector represents the Gini index value of the corresponding feature.

[0017] Feature sorting: Arrange the n-dimensional mutual information vector in ascending order according to the mutual information value to obtain the mutual information sorting index sequence. Arrange the n-dimensional Gini index vector in descending order according to the Gini index value to obtain the Gini index sorting index sequence. Perform arithmetic average on the mutual information sorting index sequence and the Gini index sorting index sequence to obtain the n-dimensional comprehensive sorting index sequence. Rearrange the m×n-dimensional user feature matrix according to the comprehensive sorting index sequence, and arrange the features from left to right according to the comprehensive sorting results to obtain the m×n-dimensional feature sorting matrix. Feature selection: According to the preset feature selection ratio p, select the original user features corresponding to the first p columns from the m×n feature sorting matrix. Initialize an all-zero n-dimensional feature screening marker vector to mark the selected features. Set the elements of the first p columns selected in the sorting matrix in the screening marker vector to 1, and the remaining elements to 0. Output the marked n-dimensional feature screening marker vector to indicate whether each feature is selected. Feature extraction: Use the marked n-dimensional feature screening marker vector to filter the m×n-dimensional original user feature matrix by column. The corresponding feature columns marked as 1 in the tag vector are extracted to obtain the m×p-dimensional filtered user feature subset matrix. The filtered user feature subset matrix is ​​used as the final user feature set for subsequent analysis and modeling.

[0018] Furthermore, the DBSCAN clustering algorithm is used to cluster users and generate labeled portraits. DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a density-based clustering algorithm that discovers clusters of any shape by identifying high-density areas near sample points and can automatically determine the number of clusters. In this scheme, user features are clustered by the DBSCAN algorithm to obtain clusters reflecting different user groups, and the clustering results are labeled to generate intuitive and easy-to-understand user portraits. Input sample set and parameter setting: The user feature set after m×p dimension screening is used as the input sample set of the DBSCAN clustering algorithm, where m is the number of users and p is the number of features after screening. The initial neighborhood radius ε0 and the minimum number of included points min Pts of the DBSCAN algorithm are preset. These two parameters determine the granularity of clustering and the determination of noise points.

[0019] Calculate the local density factor of the sample point: traverse the input sample set, for each sample point x i , calculate x i The Euclidean distance with other sample points is obtained as the sample point x i The distance set D(x i ). i ) are sorted in ascending order, and the kth nearest neighbor sample point and x are selected. i The distance of the sample point x i The local density factor d(x i ), where k is the preset density estimation parameter. By using the local density factor d(x i ), the neighborhood radius of each sample point can be adaptively adjusted so that the denser areas have smaller neighborhood radius and the less dense areas have larger neighborhood radius. Calculate the adaptive neighborhood radius of the sample point: For each sample point x i , according to its local density factor d(x i ) and the initial neighborhood radius ε0, calculate the sample point x i The adaptive neighborhood radius ε(x i )=ε×d(x i ). The calculation of the adaptive neighborhood radius takes into account the differences in local density of sample points, enabling the DBSCAN algorithm to adaptively adjust the granularity of clustering in areas of different density.

[0020] Apply the DBSCAN clustering algorithm: According to the adaptive neighborhood radius ε(x i) and the minimum number of included points min Pts, the DBSCAN clustering algorithm is used to cluster the input m×p dimensional user feature sample set. The DBSCAN algorithm distributes sample points to different clusters by expanding high-density areas, and marks noise points as outliers. A set of user clusters is obtained, and each cluster represents a user group with similar characteristics. Generate a cluster center feature matrix: For each user cluster, calculate the eigenvalues ​​of all user samples in the cluster on p feature dimensions, and calculate the mean of the eigenvalues ​​of each dimension. Generate a p-dimensional central feature vector of the corresponding cluster, which represents the average level of the cluster on each feature dimension. Output a cluster center feature matrix containing the p-dimensional central feature vectors of each cluster, which provides the location information of the cluster in the feature space.

[0021] Generate label feature descriptions for clusters: Perform semantic mapping on the p-dimensional central feature vector of each cluster in the cluster center feature matrix. Convert the numerical eigenvalues ​​in the feature vector into easy-to-understand semantic descriptions, such as mapping the power consumption characteristics to "high-power users" and "low-power users". Extract the user's power consumption behavior characteristics and the user's payment habit characteristics, and generate semantic label feature descriptions for the corresponding clusters. Output the label feature description set of each cluster, providing an intuitive explanation of the characteristics of different user groups. Preferably, a cluster center feature matrix is ​​obtained, which includes p-dimensional center feature vectors of multiple clusters; a semantic mapping rule base is constructed: based on domain expert knowledge and data analysis, a set of semantic mapping rules are predefined; the semantic mapping rules map different value ranges of the cluster center feature vector to corresponding semantic labels; the semantic labels include descriptions of user electricity consumption behavior characteristics and user payment habit characteristics; semantic mapping is performed on each cluster in the cluster center feature matrix: the p-dimensional center feature vector of the cluster is extracted; the feature value of each dimension of the center feature vector is matched with the rules in the semantic mapping rule base; based on the matching results, a semantic label feature description of the cluster is generated; the semantic label feature description of the cluster is fused: for each cluster, its semantic label feature description is fused to generate a complete label feature description; the fusion process considers the correlation and importance between different features, and uses a weighted combination method to generate the final label feature description; the label feature description set of each cluster is output, and the label feature description set reflects the user characteristics and behavior patterns of different clusters. When constructing the semantic mapping rule base, the semantic mapping rules are expressed in the form of IF-THEN, where the IF part is the value range condition of the cluster center feature vector, and the THEN part is the corresponding semantic label. When semantic mapping is performed on each cluster in the cluster center feature matrix, the eigenvalue of the center feature vector is matched with the rules in the semantic mapping rule base by fuzzy matching to obtain a semantic label that meets the conditions. When fusing the semantic label feature description of the cluster cluster, the TF-IDF weight or information gain weight is used to measure the importance of different features, and the semantic label feature description is weighted combined.

[0022] Generate a labeled portrait dataset: Traverse the user cluster set and associate the user samples in each cluster with the label feature description corresponding to the output cluster. Obtain a labeled portrait dataset with different user group characteristics, and each user sample is labeled with the label feature description of the cluster to which it belongs. The labeled portrait dataset provides an intuitive understanding and description of different user groups, which facilitates the subsequent marketing strategy formulation and personalized services.

[0023] Furthermore, in this solution, the user's electricity consumption time series data is modeled and predicted through the XGBoost model to obtain the predicted value of electricity consumption for each time unit in the future. The acquired user electricity consumption data is extracted according to the time series to form the user electricity consumption time series data set Dele = {d1, d2, ..., d T}, where d t Denotes the power consumption of the tth time unit, and T is the length of the power consumption time series. The dataset Dele is used as the training sample set of the XGBoost model, and each sample represents the power consumption of one time unit.

[0024] Perform data preprocessing on the electricity consumption time series dataset Dele to obtain the preprocessed dataset Dele'. The preprocessing steps may include missing value processing, outlier processing, data normalization, etc. to improve data quality and model training effect. Build an XGBoost gradient boosting tree model and set the model's hyperparameters. Hyperparameters include the number of trees n tree 、The maximum depth of the tree max depth , learning rate l r and the regularization parameter reg lambda The grid search cross-validation method is used to optimize the hyperparameters. By traversing different hyperparameter combinations, the hyperparameter settings with the best performance on the validation set are selected. Based on the preprocessed electricity consumption time series dataset Dele', a supervised learning training sample set {(X train ,y train )}. The power consumption of each time unit d t As the feature X of the training sample train , the power consumption after several time units d t+k As the label y of the training sample train By sliding the window, multiple training samples are generated on the time series, and each sample represents the power consumption characteristics within a time window and the corresponding future power consumption label.

[0025] Using the constructed training sample set (X train ,y train ) to train the XGBoost model. By minimizing the loss function of the model on the training samples, the model parameters are continuously iterated and updated to obtain the trained XGBoost electricity consumption trend prediction model Mele. The XGBoost model integrates multiple decision trees to continuously reduce the residual of the model and improve the accuracy of the prediction. The trained XGBoost model Mele is used to predict the electricity consumption trend in the future. The features of the electricity consumption time series data of several time units are constructed to form the test sample X test . The test sample X testInput the model Mele to obtain the predicted value y_pred of electricity consumption per time unit in the future.

[0026] Furthermore, in this scheme, the hyperparameters of the XGBoost model are set and the grid search cross-validation method is used to optimize the hyperparameters to find the optimal model configuration, including: according to the preprocessed electricity consumption time series dataset Dele', a random sampling method with replacement is used to generate multiple training sets Train set and validation set Val set Random sampling with replacement means that during the sampling process, each sample will be put back into the original data set after being drawn, so it may be drawn repeatedly. By generating multiple sets of training sets and validation sets, the impact of randomness of data partitioning on model performance can be reduced, and the stability of model evaluation can be improved.

[0027] Set the value range of the key hyperparameters of the XGBoost model to form a hyperparameter search space. The hyperparameters include: the number of trees n tree : Indicates the number of decision trees in the XGBoost model. Usually the value range can be [50, 100, 200, 300, 500], etc. The maximum depth of the tree max depth : represents the maximum depth of each decision tree. Usually the value range can be [3, 5, 7, 9], etc. Learning rate l r : represents the weight reduction coefficient of each decision tree, which controls the learning rate of the model. The value range is usually [0.01, 0.05, 0.1, 0.2], etc. Regularization parameter reg lambda : represents the weight of the L2 regularization term, which is used to control the complexity and overfitting of the model. The value range can usually be [0.1, 1, 5, 10], etc. By setting the value range of the hyperparameter, a hyperparameter search space can be constructed for subsequent grid search. The Bayesian optimization algorithm is used to search for the global optimal hyperparameter combination.

[0028] Furthermore, in this scheme, the Bayesian optimization algorithm is used to efficiently search the hyperparameter search space to find the global optimal hyperparameter combination. The Bayesian optimization algorithm is used to search the hyperparameter search space. A set of initial hyperparameters is randomly generated based on prior knowledge and added to the hyperparameter observation set HP obs Prior knowledge can come from experience, literature, or preliminary experimental results to guide the selection of initial hyperparameters.

[0029] Cross-validation evaluation: Based on the hyperparameter observation set HP obs Each set of hyperparameters hp in i , in the obtained multiple training sets Train set and validation set Val setK-fold cross validation is performed on each validation set. For each set of hyperparameters hp_i, the root mean square error RMSE of the model is calculated on each validation set. i . Will (hp i ,RMSE i ) as a set of observation data and added to the performance observation set Perf obs .Performance Observation Collection Perf obs The model performance corresponding to different hyperparameter combinations was recorded for subsequent Gaussian process modeling.

[0030] Constructing Gaussian process proxy model: Based on performance observation set Perf obs , construct a Gaussian process regression proxy model GP between the hyperparameter hp and the model performance RMSE model Gaussian process regression is a nonparametric Bayesian model that can predict the performance distribution of unknown hyperparameters based on observed data. model It can capture the complex relationship between hyperparameters and model performance and quantify the uncertainty of prediction. Specifically, from the performance observation set Perf obs Extract the hyperparameter hp and the corresponding model performance RMSE. Take the hyperparameter hp as the input feature and the RMSE as the target value to form the observation data pair (hp, RMSE). The observation data pair represents the actual performance of the model under different hyperparameter combinations. Define the Gaussian process prior: Select appropriate mean function m(hp) and covariance function k(hp, hp') to define the prior distribution of the Gaussian process. The mean function m(hp) represents the prior mean of the hyperparameter hp, which can usually be set to a constant or a zero function. The covariance function k(hp, hp') represents the correlation between different hyperparameters. Common choices include the squared exponential kernel function (SEkernel), Matérn kernel function, etc. The parameters of the covariance function (such as length scale, variance, etc.) can be determined by maximizing marginal likelihood estimation or Bayesian inference.

[0031] Construct a Gaussian process regression model: Given an observed data pair (hp, RMSE) and a Gaussian process prior, calculate the Gaussian process posterior distribution through Bayesian inference. The posterior distribution consists of the posterior mean function μ(hp) and the posterior covariance function cov(hp, hp'). The posterior mean function μ(hp) represents the expected value of the model performance at the hyperparameter hp. The posterior covariance function cov(hp, hp') represents the uncertainty of performance prediction between different hyperparameters. The posterior distribution can be calculated by a closed-form solution or numerical approximation methods (such as variational inference, MCMC, etc.). Make predictions and uncertainty estimates: For any unobserved hyperparameter hp new , using the Gaussian process regression model GP model Make predictions. Through the posterior mean function μ(hp new) Predict hp new The expected value of the model performance at . Through the posterior covariance function cov(hp new ,hp' new ) Estimated hp new Uncertainty estimation can help the acquisition function balance exploration and utilization and select more promising hyperparameters.

[0032] Update the Gaussian process regression model: When a new observation data pair (hp new ,RMSE new ), add it to the observed data set. Retrain the Gaussian process regression model GP model , update the posterior distribution. The updated model can take advantage of new observation information and improve the accuracy and reliability of the prediction.

[0033] Select the next set of hyperparameters: Using the constructed Gaussian process surrogate model GP model l, predict the expected performance μ and uncertainty σ of unobserved hyperparameters in the hyperparameter search space. The next set of hyperparameters to be evaluated hp is obtained by maximizing the acquisition function acq(mu, sigma) new The acquisition function uses the Expected Improvement (EI) criterion to balance μ and σ, taking into account the performance expectations and uncertainty of the hyperparameters. The EI criterion gives priority to hyperparameters with high performance expectations and high uncertainty to explore potential areas.

[0034] Update the observation set: the next set of hyperparameters hp will be selected new Add hyperparameter observation set HP obs In Train set and Val set Use hp next Perform cross validation and evaluate its performance RMSE next . Will (hp next ,RMSE next )Add performance observation set Perf obs , update the observation data. Iterative update: based on the updated performance observation set Perf obs , retrain the Gaussian process proxy model GP model , get the updated GP model Repeatedly iterate and update the hyperparameter observation set HP obs and performance observation collection Perf obs , continuously improving the Gaussian process proxy model GP modelThe iteration process continues until the predetermined iteration stop condition is met, such as reaching the maximum number of iterations or the performance improvement is not significant. Output the optimal hyperparameters: When the iteration stops, the final Gaussian process proxy model GP is used model Make predictions on the hyperparameter search space. Select GP model The hyperparameter combination with the best prediction performance is taken as the global optimal hyperparameter combination hp opt .

[0035] Furthermore, by constructing features and extracting labels for the electricity consumption time series dataset Dele', a training sample set {(X train ,y train )}, which is used for subsequent electricity consumption prediction model training.

[0036] Sliding window feature construction: Set the length of the sliding window to w, which means that the feature vector of each training sample contains the power consumption information of w time units. For each time unit t in the data set Dele', extract the corresponding power consumption d t And the power consumption in the first w-1 time units {d t-w+1 ,......,d t-1}. t-w+1 ,......,d t-1} are combined to form a feature vector x of length w t , as the feature representation of a training sample. By sliding the sliding window over the entire time series, multiple feature vectors x_t can be generated, each of which corresponds to a training sample.

[0037] Label value extraction: Set the prediction lead time k, which means predicting the electricity consumption in the kth time unit in the future. For each feature vector x t , the power consumption d of the kth time unit after its corresponding time unit t t+k As the label value y of the training sample t . The feature vector x t and label value y t Combined to form a supervised learning training sample (x t ,y t Generate a training sample set: Generate multiple supervised learning training samples (x) by sliding the sliding window over the entire time series. t ,y t ). All generated training samples are combined to form a training sample set {(X train ,y train )}, where X train Represents the feature vector set of all training samples, y train Indicates the corresponding tag value set.

[0038] Furthermore, the random forest algorithm is used to make multi-level predictions of the power demand of different user groups. In this scheme, the random forest algorithm is used to predict the power demand of each user group at the weekly, monthly and annual levels in the future. Construction of training sample set: The labeled portrait data set of different user groups obtained by clustering is converted into the training sample set D for power demand prediction by eigenvalue quantization mapping. rf Each training sample is represented by a p-dimensional label feature vector x corresponding to the cluster i and the actual electricity demand value y of the corresponding cluster i The composition represents the characteristics of different user groups and their corresponding actual electricity demands.

[0039] Time series feature construction: Based on the predicted value y of electricity consumption per time unit in the future pred , construct the time series features of each user group in the future at the three levels of week, month, and year. Add the time series features of each level to the training sample set D rf In the expanded training sample set D rf ', each sample contains the label characteristics of the user group and the time series characteristics of electricity consumption at different time scales. Random forest model training: sampling training sample set D rf 'Training random forest model, random forest consists of n tree Each decision tree is generated based on bootstrap sampling of samples and random selection of features. tree The output of the decision tree is used to obtain the final prediction result. By integrating multiple decision trees, random forest can effectively reduce the variance of a single decision tree and improve the stability and accuracy of the prediction.

[0040] Model hyperparameter optimization: Grid Search and K-fold Cross Validation methods are used to optimize the hyperparameters of the random forest model. Hyperparameters include the number of decision trees n_tree, the maximum depth of the decision tree max depth , and the maximum number of features considered when splitting a node max features Through grid search and cross-validation, different hyperparameter combinations are traversed and the hyperparameter settings with the best performance on the validation set are selected to improve the generalization ability and prediction performance of the model.

[0041] Multi-level power demand forecasting: The random forest model with optimized parameters is used to forecast the power demand of each user group at the weekly, monthly and annual levels in the future. For each level, the corresponding label feature vector x is extracted. iand the time series feature vector t w (week), t m (month), t y (year), and input them into the random forest model for prediction. The predicted value y of electricity demand at each level is obtained pred_w (week), y pred_m (month) and y pred_y (year), representing the expected electricity demand of different user groups at different time scales in the future.

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

[0043] By acquiring multi-source heterogeneous data and extracting the user's electricity consumption behavior characteristics and payment habit characteristics from the user's electricity consumption data and payment data, the autoencoder network is used for feature fusion, and then the information gain and Gini index are combined for feature screening, and finally a user feature set that fully and accurately reflects the user's characteristics is obtained. Compared with traditional manually designed features, this method can automatically learn the inherent associations in the data and mine more comprehensive and discriminative user feature representations.

[0044] The DBSCAN density clustering algorithm is used to cluster the filtered user feature set. By adaptively adjusting the neighborhood radius, cluster structures of any shape can be found, overcoming the a priori requirements of traditional clustering methods on the number and shape of clusters, making the clustering results more accurate and flexible. At the same time, by semantically labeling the clustering results, labeled user portraits are generated, which intuitively reflects the behavioral characteristics of different user groups and provides explainable user insights for differentiated marketing.

[0045] The XGBoost gradient boosting tree model is used to predict the user's electricity consumption trend in the future. The time series features and Bayesian optimization hyperparameter search are introduced to fully explore the trend and periodicity of time series data, improving the accuracy of trend prediction. At the same time, the XGBoost model enhances the robustness and generalization ability of prediction by integrating multiple decision trees, and can well cope with fluctuations and abnormalities in electricity consumption data.

[0046] Taking different user groups obtained by clustering as units, the random forest algorithm is used to predict the electricity demand of each user group at the weekly, monthly and annual levels. By integrating user label features and time series features, the random forest model can capture the electricity consumption patterns of different user groups at different time scales, achieving more fine-grained and personalized demand forecasting.

[0047] The present application also provides a customer relationship management system for power marketing, which is used to execute a customer relationship management method for power marketing of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The present application will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:

[0049] Figure 1 is an exemplary flow chart of a customer relationship management method for power marketing according to some embodiments of the present application;

[0050] Figure 2 is an exemplary flow chart of obtaining a user feature set according to some embodiments of the present application;

[0051] Figure 3 is an exemplary flow chart of obtaining a labeled portrait data set of different user group characteristics according to some embodiments of the present application;

[0052] Figure 4 is an exemplary flow chart of obtaining a predicted value of power consumption according to some embodiments of the present application;

[0053] Figure 5 This is an exemplary flowchart for obtaining electricity demand forecast values ​​at various levels according to some embodiments of the present application. DETAILED DESCRIPTION

[0054] The method and system provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0055] Figure 1 The present invention is an exemplary flow chart of a customer relationship management method for power marketing shown in some embodiments of the present application, comprising: obtaining multi-source heterogeneous data, the multi-source heterogeneous data including user power consumption data and payment data; extracting user power consumption behavior characteristics and user payment habit characteristics based on the multi-source heterogeneous data, obtaining user characteristics by feature fusion through an autoencoder network, and filtering user characteristics by using information gain and Gini index to obtain a user feature set; clustering users based on the filtered user feature set using a DBSCAN clustering algorithm to obtain a user clustering cluster set, and labeling the clustering results to obtain a labeled portrait data set reflecting the characteristics of different user groups; predicting power consumption trends in the future based on user power consumption data using an XGBoost gradient boosting tree model; predicting power consumption trends based on power consumption trend prediction results using a random forest algorithm, taking different user groups obtained by clustering as units, predicting power demand for each user group, and forming a multi-level power consumption prediction result, wherein the multi-level includes week, month and year; performing differentiated power marketing management based on the label portraits of different user groups and the multi-level power consumption prediction results.

[0056] Data collection and preprocessing: collect the following data from the business system of the power company: User electricity consumption data: including user number, electricity consumption address, electricity consumption category, meter number, meter reading date, beginning reading, end reading, electricity consumption, electricity fee, etc. The data granularity is daily or monthly, and the time span is 1-2 years. User payment data: including user number, payment serial number, payment amount, payment time, payment channel (such as online business hall, mobile APP, counter, etc.). The data granularity is each payment record, and the time span is 1-2 years. Data association: with the user number as the primary key, the cleaned user electricity consumption data is associated with the payment data to form a complete user information record. Timestamp alignment: based on the meter reading date and payment time, the electricity consumption and payment amount are aggregated to unify the time granularity (such as day and month) to facilitate subsequent time series analysis.

[0057] Figure 2 This is an exemplary flow chart for obtaining a user feature set according to some embodiments of the present application, user feature engineering, user electricity behavior feature extraction, electricity consumption characteristics: aggregate the daily electricity consumption sequence of each user, and calculate the monthly, quarterly, and annual total electricity consumption, average electricity consumption, maximum electricity consumption, and minimum electricity consumption and other statistical indicators as user electricity consumption characteristics. Electricity consumption time period distribution characteristics: divide the 24 hours of each day into 96 time periods, slice the daily electricity consumption sequence of each user, calculate the average electricity consumption of each time period, and obtain a 96-dimensional time period electricity consumption distribution feature vector to characterize the user's electricity consumption pattern in different time periods. Load curve characteristics: draw a load curve for each user's daily electricity consumption sequence, and extract the peak and valley characteristic parameters of the curve, such as peak-to-valley difference, peak-to-valley ratio, load rate, etc., as user load curve characteristics.

[0058] User payment habit feature extraction, payment amount feature: aggregate each user's historical payment records, calculate the monthly, quarterly, and annual total payment amount, average payment amount, maximum payment amount, and minimum payment amount and other statistical indicators as user payment amount features. Payment time distribution feature: divide each month into three time periods (early, mid-term, and late term), count each user's historical payment records, calculate the proportion of payment times in each time period to the total payment times, and obtain a 3-dimensional payment time distribution feature vector. Payment method feature: count each user's historical payment records, calculate the proportion of payment times in each payment channel (such as online business hall, mobile APP, counter, etc.) to the total payment times, and obtain an n-dimensional payment method feature vector (n is the number of payment channels).

[0059] User feature fusion and feature concatenation: Concatenate the extracted user electricity consumption behavior features (such as electricity consumption, time period distribution, load curve features) and the extracted user payment habit features (such as payment amount, time distribution, method features) column-wise to form an input matrix X of dimension m×(p + q), where m is the number of users, and p and q are the dimensions of the electricity consumption behavior features and payment habit features, respectively. Autoencoder network construction: Design an autoencoder network structure that includes an input layer, an encoding layer, and a decoding layer. The encoding layer contains k nodes (k < p + q) to achieve dimensionality reduction and compression; the decoding layer has the same number of nodes as the input layer to achieve data reconstruction. Network training: Use matrix X as the input and train the autoencoder network in an unsupervised逐层预训练和微调的方式 (逐层预训练和微调的方式 needs to be adjusted according to the correct English expression, for example, layer-by-layer pre-training and fine-tuning). By minimizing the reconstruction error (such as mean squared error), make the output of the decoding layer as similar as possible to the data in the input layer to complete feature compression and fusion. Comprehensive feature extraction: Input matrix X into the trained autoencoder network to obtain the k-dimensional reduced features in the encoding layer as the comprehensive feature matrix H. Feature sparsification: Perform L1 regularization on the comprehensive feature matrix H to obtain a sparse m×n-dimensional comprehensive feature matrix Z (n ≤ k), eliminate redundant features, improve feature interpretability, and output as the final user feature representation.

[0060] It should be noted that the Chinese phrase "逐层预训练和微调的方式" in the original text needs to be accurately translated according to the specific context and common English expressions in the field of neural networks. The above translation is for reference only and may need to be adjusted according to the correct English terms.User feature screening, mutual information calculation: Take the user category (such as user clustering results) as the random variable Y, take each column of the m×n-dimensional user feature matrix Z obtained in S23 as the random variable X, and calculate the mutual information of X and Y I(X;Y)=H(Y)-H(Y|X), where H(Y) is the entropy of Y, and H(Y|X) is the conditional entropy of Y given X. Traverse n features to obtain an n-dimensional mutual information vector I that reflects the degree of correlation between each feature and the user category. Gini index calculation: For each column feature of the matrix Z, calculate its Gini index Gini(X)=1-∑(pi^2), where pi is the probability that the user category is a certain category when the feature X takes the i-th value. Traverse n features to obtain an n-dimensional Gini index vector G that reflects the ability of each feature to distinguish user categories. Comprehensive sorting: Sort the mutual information vector I in ascending order according to the mutual information value to obtain an ascending index sequence idxI; sort the Gini index vector G in descending order according to the Gini index to obtain a descending index sequence idxG. Perform arithmetic averaging on the two index sequences to obtain a comprehensive sorting index sequence idxC = (idxI + idxG) / 2. Feature rearrangement: According to the comprehensive sorting index sequence idxC, rearrange the columns of the m×n dimensional user feature matrix Z, that is, Z[:, i] = Z[:, idxC[i]], to obtain an m×n dimensional feature sorting matrix Zs. Feature selection: Set the feature selection ratio p (such as 20%), and select the original user features corresponding to the first np columns from the feature sorting matrix Zs. Initialize the n-dimensional all-zero feature screening mark vector mask, set the elements in the mask corresponding to the first np columns of Zs to 1, and output the marked feature screening vector mask. Feature extraction: Use the feature screening vector mask to filter the original user feature matrix Z by column, extract the corresponding feature columns marked as 1 in the mask, and obtain the m×(n*p) dimensional screened user feature subset matrix Zf as the final user feature set.

[0061] Figure 3 This is an exemplary flow chart of obtaining a labeled portrait data set of different user group characteristics according to some embodiments of the present application, user clustering and grouping, clustering parameter setting, and using the m×p-dimensional filtered user feature subset matrix Zf as the input sample set of the clustering algorithm. Two key parameters of the DBSCAN clustering algorithm are preset: the initial neighborhood radius ε0 (such as ε0=0.5) and the minimum number of included points min Pts (such as min Pts=5), which are used to control the density and size of the clustering clusters. Distance calculation, traverse the m input user samples, and for each p-dimensional sample point xi (i=1, 2,..., m), calculate the Euclidean distance between xi and the other m-1 sample points. Get the m-1-dimensional distance set D(xi) of the sample point xi.

[0062] Density estimation: sort the m-1-dimensional distance set D(xi) of the sample point xi in ascending order to obtain the sorted distance set Ds(xi). Select the kth element in the sorted distance set Ds(xi), that is, the distance between the kth nearest neighbor sample point and xi, as the local density factor d(xi) of the sample point xi. d(xi)=Ds(xi)

[0063] [k], where k is the preset density estimation parameter, such as k = 10. According to the initial neighborhood radius ε0 and the local density factor d(xi), the adaptive neighborhood radius ε(xi) of the sample point xi is calculated. ε(xi) = ε0 × d(xi), where ε0 is the preset initial neighborhood radius, such as ε0 = 0.5. The distance set D(x1) of the sample point x1 is [0.2, 0.5, 0.8, 1.2, 1.5, 1.8, 2.0, 2.3, 2.5, 2.8, 3.0], the density estimation parameter k = 5, and the initial neighborhood radius ε0 = 0.5. Sorting D(x1) in ascending order, we get Ds(x1) = [0.2, 0.5, 0.8, 1.2, 1.5, 1.8, 2.0, 2.3, 2.5, 2.8, 3.0]. Select the k=5th element in Ds(x1) as the local density factor d(x1). d(x1)=Ds(x1)[5]=1.5; Calculate the adaptive neighborhood radius ε(x1) of the sample point x1. ε(x1)=ε0×d(x1)=0.5×1.5=0.75; Therefore, the local density factor d(x1) of the sample point x1 is

[0064] =1.5, adaptive neighborhood radius ε(x1)=0.75.

[0065] DBSCAN clustering. According to the adaptive neighborhood radius ε(xi) and the minimum number of points min Pts of m sample points, the DBSCAN clustering algorithm is used to cluster the input m×p-dimensional user feature sample set Zf. The specific steps are as follows: Randomly select an unvisited sample point xi as the current point and mark it as visited; Calculate the number of sample points N within the neighborhood with xi as the center and ε(xi) as the radius; If N < min Pts, mark xi as a noise point; Otherwise, create a new cluster C, add xi to C, and expand the cluster with xi as the center: a. Find all sample points within the neighborhood with xi as the center and ε(xi) as the radius; b. For each unvisited sample point xj within the neighborhood, mark it as visited and calculate the number of sample points N' within the neighborhood of xj; c. If N' ≥ min Pts, add all unclustered sample points within the neighborhood of xj to C; d. If xj has been added to C, continue with the sample points in the next neighborhood; Otherwise, add xj to C. Repeat until C no longer expands; Repeat until all sample points have been visited. Finally, obtain a set of n user clusters {C1, C2,..., Cn}, and each cluster Ci contains a group of similar user sample points.

[0066] Calculate the cluster centers. Initialize an n×p empty matrix Zc to store the cluster center feature vectors. Traverse the set of user clusters {C1, C2,..., Cn}: For each cluster Ci (i = 1, 2,..., n): Initialize a p-dimensional zero vector ci = (0, 0,..., 0) to accumulate the feature values of the samples within the cluster. Traverse the mi user samples within cluster Ci: For each user sample xij (j = 1, 2,..., mi), accumulate its p-dimensional feature vector (xij1, xij2,..., xijp) to ci. Calculate the mean vector of cluster Ci in p feature dimensions, that is, ci = ci / mi. Store the p-dimensional center feature vector ci of cluster Ci in the i-th row of the cluster center feature matrix Zc. Output the n×p-dimensional cluster center feature matrix Zc.

[0067] Extract label features and initialize an empty set L to store the label feature description of cluster clusters. Traverse each row of the cluster center feature matrix Zc, that is, the p-dimensional center feature vector ci of each cluster Ci: For each component cik (k = 1, 2, ..., p) of ci, map it to the corresponding semantic label lik according to the predefined feature to semantic label mapping rule. For the power consumption feature, it can be mapped to labels such as "high power consumption", "medium power consumption", and "power consumption" according to the numerical range of cik. For another example, for the payment time feature, it can be mapped to labels such as "pay on time" and "delayed payment" according to the numerical value of cik. Combine the semantic labels of cluster Ci in each feature dimension into a complete label feature description li, such as "high power consumption-evening peak power consumption-pay on time". Add the label feature description li to the set L. Output the label feature description set L = {l1, l2, ..., ln} of n cluster clusters.

[0068] Generate user portraits and initialize an empty set P to store the labeled user portraits of cluster clusters. Traverse the user cluster set {C1, C2, ..., Cn} and the corresponding label feature description set L: For each cluster cluster Ci and its corresponding label feature description li (i = 1, 2, ..., n): Initialize an empty set Pi to store the labeled user portraits of cluster cluster Ci. Traverse all user samples xij (j = 1, 2, ..., mi) in cluster cluster Ci: Combine user sample xij and label feature description li into a tuple (xij, li), representing the labeled features of user xij. Add the tuple (xij, li) to the set Pi. Add the labeled user portrait set Pi of cluster cluster Ci to P. Output the labeled user portrait dataset P = {P1, P2, ..., Pn} of n cluster clusters.

[0069] Figure 4It is an exemplary flow chart for obtaining the predicted value of power consumption according to some embodiments of the present application, power consumption trend prediction, construction of power consumption time series data set, grouping the original power consumption data according to user ID, and obtaining the power consumption record of each user. The power consumption records of each user are sorted according to the timestamp to obtain the power consumption sequence arranged in chronological order. The power consumption sequence of each user is aggregated according to a fixed time unit (such as hours, days, weeks, etc.) to obtain a power consumption time series indexed by the time unit. Aggregation by day obtains a daily power consumption sequence {d_1, d_2, ..., d_T} indexed by date, where d_t represents the power consumption on the tth day, and T is the total number of days. The power consumption time series data of each user is packaged into a data set D_ele as a training sample set for the XGBoost model. The power consumption time series data is preprocessed, and the preprocessed power consumption time series data set D_ele'={d_1', d_2', ..., d_T'}; for missing values ​​in the time series, interpolation methods can be used to fill them, such as linear interpolation, spline interpolation, etc. For outliers in time series, they can be smoothed by moving average, median filtering, etc. For non-stationary time series, they can be converted into stationary series by difference operation. The first-order difference is to subtract each element in the sequence from its previous element to obtain a difference sequence.

[0070] XGBoost model hyperparameter optimization, divide the dataset D_ele' into K folds, select 1 fold as the validation set Val_set each time, and the remaining K-1 folds as the training set Train_set, forming K groups (Train_set, Val_set). Initialize the hyperparameter observation set HP_obs to an empty set, and the performance observation set Perf_obs to an empty set. Randomly generate a set of initial hyperparameters hp_init based on prior knowledge and add them to HP_obs. Iterate the following steps until the iteration stop condition is met: For each set of hyperparameters hp_i in HP_obs, perform K-fold cross validation on K groups (Train_set, Val_set): Use hp_i as the hyperparameter of the XGBoost model and train the model on each Train_set. Evaluate the model performance on the corresponding Val_set, calculate the root mean square error RMSE, and obtain the average RMSE_i of hp_i on K folds. Add (hp_i, RMSE_i) as a set of observation data to Perf_obs. Based on the updated Perf_obs, train the Gaussian process regression proxy model GP_model to predict the relationship between hyperparameters and model performance. Using GP_model, predict the performance expectation mu and uncertainty sigma of unobserved points in the hyperparameter search space. Obtain the next set of hyperparameters to be evaluated hp_next by maximizing the acquisition function acq(mu, sigma) and add them to HP_obs. The acquisition function uses the expected improvement (EI) criterion to balance expected performance and uncertainty. Evaluate the performance RMSE_next of hp_next on K groups (Train_set, Val_set), and add (hp_next, RMSE_next) to Perf_obs. Output the global optimal hyperparameter combination hp_opt predicted by GP_model in the hyperparameter search space.

[0071] Use sliding windows to construct training samples, and initialize the feature set X_train and label set y_train as empty lists. Traverse the time series dataset D_ele', starting from the wth time unit, and slide the window until the kth time unit from the end: For each time unit t (w<=t<=Tk): Extract the power consumption at time t and the w-1 time units before it [d_{t-w+1}',...,d_t'] as the feature vector x_t. Extract the power consumption d_{t+k}' of the kth time unit after time t as the label value y_t. Append the feature vector x_t to X_train and the label value y_t to y_train. Convert the lists X_train and y_train to NumPy arrays and output them as the training sample set (X_train, y_train).

[0072] Use the training samples (X_train, y_train) to train the XGBoost model, and convert the training sample feature set X_train and label set y_train into the data format DMatrix required by XGBoost. Use the optimized hyperparameter hp_opt to initialize the XGBoost model. Set the objective function of XGBoost to the root mean square error (RMSE). Use the training samples (X_train, y_train) to fit the XGBoost model and perform model training. After the training is completed, return the trained XGBoost electricity consumption trend prediction model M_ele.

[0073] Use the trained XGBoost model to predict electricity consumption, construct sliding window features for the predicted electricity consumption time series fragment {d_{T+1}', d_{T+2}', ..., d_{T+m}'}, and obtain the test sample feature X_test. Convert the test sample feature X_test to the data format DMatrix required by XGBoost. Use the trained XGBoost model M_ele to predict the test sample and obtain the predicted value y_pred. Return the predicted value y_pred as the electricity consumption prediction result for the next k time units.

[0074] Figure 5This is an exemplary flow chart for obtaining the predicted values ​​of electricity demand at various levels according to some embodiments of the present application. For electricity demand prediction, users have been divided into different groups through cluster analysis, and each group has been labeled and portrayed to obtain a labeled portrait data set D_profile. This data set needs to be converted into a training sample set suitable for electricity demand prediction. First, for each sample in the labeled portrait data set D_profile, its corresponding p-dimensional label feature vector x_i is extracted. This feature vector contains various attributes and characteristics of the user group to which the sample belongs, such as electricity behavior characteristics, user attribute characteristics, etc. The purpose of extracting the label feature vector is to quantify the characteristic information of the user group and provide input for subsequent electricity demand prediction. Next, it is necessary to obtain the actual electricity demand value y_i of the cluster to which each sample belongs. This value represents the actual electricity consumption of the cluster in historical data. The average electricity demand value or total electricity demand value of the cluster can be calculated by counting the historical electricity consumption data of users in each cluster as the value of y_i. After obtaining the label feature vector x_i and the actual electricity demand value y_i, pair them to form a training sample (x_i, y_i). This training sample indicates that the actual electricity demand of the user group with feature x_i in the historical data is y_i. Add this paired training sample to the training sample set D_rf. Repeat the above steps, process each sample in the labeled portrait dataset D_profile in turn, convert them into corresponding training samples, and add them to D_rf. This process will traverse the entire D_profile dataset until all samples are converted and added to D_rf. Finally, the complete training sample set D_rf is obtained, in which each sample consists of two parts: the label feature vector x_i and the actual electricity demand value y_i. This training sample set contains the characteristic information of the user group and the corresponding actual electricity demand, providing the necessary data basis for the subsequent training of the electricity demand prediction model.

[0075] In the previous steps, the predicted value y_pred of the electricity consumption of each time unit in the future has been obtained. Now, based on these predicted values, we need to construct the time series features of each user group at the three levels of week, month and year in the future. First, aggregate the predicted value y_pred according to the time granularity of week, month and year. For each user group, calculate the predicted value of the total electricity consumption for each natural week, natural month and natural year in the future, and obtain three time series features: weekly time series feature t_w, monthly time series feature t_m and annual time series feature t_y. These time series features reflect the changing trend of electricity consumption of different user groups at different time scales in the future. Next, we need to add these time series features to the training sample set D_rf. For each sample in D_rf, find its corresponding user group, and then add the weekly time series feature t_w, monthly time series feature t_m and annual time series feature t_y of the group to the feature vector of the sample. In this way, the feature vector of each sample contains the original label feature and the newly added time series feature.

[0076] Repeat the above steps, process each sample in the training sample set D_rf in turn, and add the corresponding time series features to its feature vector. This process will traverse the entire D_rf data set until all samples have been processed. Finally, the training sample set D_rf' with added time series features is obtained. Compared with the original training sample set D_rf, the feature vector of each sample in D_rf' has added time series features at three levels: week, month, and year, providing richer information to predict electricity demand. Next, the training sample set D_rf' with added time series features is trained using a random forest model. First, n_tree self-service sampling sets are generated by random sampling from D_rf'. Each self-service sampling set is obtained by randomly selecting samples with replacement and has the same size as the original data set. For each self-service sampling set, a feature subset is randomly selected and a decision tree is constructed using the feature subset. The selection of feature subsets can be achieved by randomly selecting a certain proportion or number of features from all features. The decision tree construction process recursively selects the optimal partitioning features and thresholds to divide the samples into different sub-nodes until the stopping condition is met. Repeat the above steps to build a decision tree for each self-service sampling set, and finally obtain n_tree decision trees. These decision trees together constitute the random forest model RF_model. Each decision tree is generated based on different self-service sampling sets and feature subsets. By integrating the prediction results of multiple decision trees, the generalization ability and robustness of the model can be improved. In the prediction stage, for a new sample, it is input into each decision tree in the random forest model RF_model to obtain n_tree prediction results. Then, the final prediction result is obtained by averaging or voting these n_tree prediction results. This integration method can reduce the bias and variance of individual decision trees and improve the accuracy and stability of predictions.

[0077] When training a random forest model, you need to determine several key hyperparameters, including the number of decision trees n_tree, the maximum depth of the decision tree max_depth, and the maximum number of features considered when splitting a node max_features. The choice of these hyperparameters will affect the performance and generalization ability of the model. First, define the hyperparameter search space. For the number of decision trees n_tree, you can set a range, [50, 100, 200, 300], indicating the candidate value of the number of decision trees you want to try. For the maximum depth of the decision tree max_depth, you can set a range, [None, 10, 20, 30], where None means that the depth of the decision tree is not limited. For the maximum number of features considered when splitting a node max_features, you can set it to ['sqrt', 'log2', None], indicating that the square root, logarithm, or all features of the number of features are used.

[0078] Next, use grid search to generate a candidate set of hyperparameter combinations. Grid search will exhaust all possible hyperparameter combinations to generate a grid. If there are three hyperparameters and each hyperparameter has three candidate values, then grid search will generate 3x3x3=27 hyperparameter combinations. For each hyperparameter combination, use K-fold cross validation to evaluate the performance of the random forest model. K-fold cross validation divides the training data set into K subsets, uses K-1 subsets for training each time, and then tests on the remaining subset. This process is repeated K times, each time using a different subset as the test set, and finally obtains K test results. The average or median of these K test results can be calculated as the performance indicator of the hyperparameter combination.

[0079] K-fold cross validation is performed on each hyperparameter combination, and its performance indicators are recorded. Then, the hyperparameter combination with the best cross-validation performance is selected as the final optimization result hp_opt. This hyperparameter combination performs best in cross-validation and usually provides good generalization performance. With the optimized hyperparameter combination hp_opt, the final random forest model RF_model_opt can be trained. Next, the model is used to predict electricity demand at different time levels. For each user group, its label feature vector x_i is first extracted, which contains various attributes and characteristics of the user group.

[0080] In the weekly prediction, the label feature vector x_i is concatenated with the corresponding weekly time series feature vector t_w to form a complete feature vector. The weekly time series feature vector t_w contains the predicted electricity consumption value of the user group in each natural week in the future. After concatenating x_i and t_w, a complete feature vector that combines the characteristics of the user group and the weekly time series characteristics is obtained. Next, the concatenated feature vector is input into the optimized random forest model RF_model_opt for prediction. The model will use the trained decision tree set based on the input feature vector to give the predicted electricity demand value y_pred_w for each natural week in the future for the user group. Repeat the above steps to make predictions at the monthly and yearly levels respectively. At the monthly level, the label feature vector x_i is concatenated with the corresponding monthly time series feature vector t_m to form a complete feature vector, which is then input into RF_model_opt for prediction to obtain the predicted electricity demand value y_pred_m at the monthly level. At the annual level, the label feature vector x_i is concatenated with the corresponding annual time series feature vector t_y to form a complete feature vector, which is then input into RF_model_opt for prediction to obtain the annual electricity demand forecast value y_pred_y.

[0081] Through the above steps, the high-performance random forest model RF_model_opt was obtained by hyperparameter optimization, and the model was used to forecast electricity demand at the weekly, monthly and annual levels. This multi-level forecasting method can provide electricity demand forecast results at different time granularities to meet the planning and decision-making needs of power companies at different time scales. At the same time, by integrating user group characteristics and time series characteristics, it can more comprehensively capture the influencing factors of electricity demand and improve the accuracy and reliability of the forecast.

[0082] To make personalized marketing decisions, first of all, it is necessary to associate the labeled portrait features in the user clustering results with the multi-level power demand forecast results. The user clustering results provide rich labeled portrait features for each user group, including user attributes, power consumption behavior characteristics, etc. The multi-level power demand forecast results provide the power demand forecast values ​​of each user group at different time granularities (weekly, monthly, and annual levels) in the future. These two parts of information can be combined to form a comprehensive user group portrait. For each user group, its labeled portrait features are associated with the corresponding multi-level power demand forecast results to obtain a complete portrait containing user characteristics and future power demand trends. This comprehensive portrait not only describes the static characteristics of the user group, but also includes its dynamic power demand change trends. Based on this comprehensive portrait, personalized marketing strategies can be generated for different user groups. Analyze the characteristics and demand trends of each user group to identify their unique preferences and demand patterns. Then, based on these insights, customized marketing plans are designed, including personalized product recommendations, pricing strategies, promotional activities, etc.

Claims

1. A customer relationship management method for power marketing, comprising: Acquire multi-source heterogeneous data, which includes user electricity consumption data and payment data; Based on multi-source heterogeneous data, the user's electricity consumption behavior characteristics and user payment habit characteristics are extracted, and the user characteristics are obtained by feature fusion through the autoencoder network. The user characteristics are then screened using information gain and Gini index to obtain a user feature set. Based on the user feature set obtained through screening, the DBSCAN clustering algorithm is used to cluster users to obtain a user cluster set, and the clustering results are labeled to obtain a labeled portrait data set reflecting the characteristics of different user groups; Based on the user's electricity consumption data, the XGBoost gradient boosting tree model is used to predict the electricity consumption trend in the future; According to the power consumption trend forecast results, the random forest algorithm is used to predict the power demand of each user group based on the different user groups obtained by clustering, forming a multi-level power consumption forecast result, which includes weekly, monthly and annual levels; Differentiated power marketing management is carried out based on label portraits of different user groups and multi-level electricity consumption forecast results.

2. The customer relationship management method for power marketing according to claim 1, characterized in that: Get user feature set, including: From the user's electricity consumption data, the power consumption, power consumption time distribution and load curve are extracted through the time series mining model as the user's electricity consumption behavior characteristics; From the user payment data, the payment amount, payment time distribution and payment method are extracted through statistical analysis as the user payment habit characteristics; The auto-encoding network is used to fuse the user's electricity consumption behavior characteristics and the user's payment habit characteristics to obtain user characteristics; The information gain and Gini index are used to filter the fused user features to obtain a user feature set.

3. The customer relationship management method for power marketing according to claim 2, characterized in that: The auto-encoding network is used to fuse the user's electricity consumption behavior characteristics and the user's payment habit characteristics to obtain user characteristics, including: The user's electricity consumption behavior characteristics and the user's payment habit characteristics are concatenated column by column as the input matrix; Construct an autoencoder network structure with a dimension-reduced hidden layer, where the number of hidden layer nodes is smaller than the feature dimension of the input matrix to perform feature compression; Taking the input matrix as a sample, an unsupervised training autoencoder network is used to minimize the reconstruction error; Input the input matrix into the trained autoencoder network and obtain the output of the last hidden layer as the comprehensive feature matrix after dimensionality reduction; The L1 regularization process is performed on the dimensionality-reduced comprehensive feature matrix to obtain a sparse m×n dimensional comprehensive feature matrix as the m×n dimensional user feature output.

4. The customer relationship management method for power marketing according to claim 2, characterized in that: Information gain is used to filter user features to obtain a user feature set, including: The user category is taken as the random variable Y, and each column of the obtained user feature matrix is ​​taken as the random variable X. The mutual information of X and Y is calculated to obtain an n-dimensional mutual information vector reflecting the degree of correlation between n features and user category; I(X;Y) The Gini index is calculated for each column of the obtained user feature matrix to obtain an n-dimensional Gini index vector that reflects the ability of n features to distinguish user categories; Arrange the n-dimensional mutual information vectors in ascending order according to the mutual information value, and arrange the n-dimensional Gini index vectors in descending order according to the Gini index, to obtain a mutual information sorting index sequence and a Gini index sorting index sequence; Perform arithmetic averaging on the mutual information sorting index sequence and the Gini index sorting index sequence to obtain an n-dimensional comprehensive sorting index sequence, and rearrange the m×n-dimensional user feature matrix according to the comprehensive sorting index sequence to obtain an m×n-dimensional feature sorting matrix; According to the preset feature selection ratio p, select the original user features corresponding to the first p columns from the m×n feature sorting matrix, initialize an all-zero n-dimensional feature screening marker vector, set the elements of the first p columns selected in the sorting matrix in the screening marker vector to 1, and the remaining elements to 0, and output the marked n-dimensional feature screening marker vector; The labeled n-dimensional features are used to filter the label vector, and the m×n-dimensional original user feature matrix is ​​filtered by columns to extract the corresponding feature columns marked as 1 in the label vector, and the m×p-dimensional filtered user feature subset matrix is ​​obtained as the final user feature set.

5. The customer relationship management method for power marketing according to claim 4, characterized in that: Based on the user feature set, the DBSCAN clustering algorithm is used to cluster users and obtain labeled portraits reflecting different user groups, including: The user feature set after m×p dimension screening is used as the input sample set of the clustering algorithm, and the initial neighborhood radius ε0 and the minimum number of included points min Pts of the DBSCAN clustering algorithm are preset; Traverse the input sample set, for each sample point x i , calculate x i The Euclidean distance with other sample points is obtained as the sample point x i The distance set D(x i ); For D(x i ) are sorted in ascending order, and the kth nearest neighbor sample point and x are selected. i The distance of the sample point x i The local density factor d(x i ), where k is the preset density estimation parameter; calculate the sample point x i The adaptive neighborhood radius ε(x i )=ε×d(x i ); According to the area radius ε(x i ) and the minimum number of included points min Pts, the DBSCAN clustering algorithm is used to cluster the input m×p dimensional user feature sample set to obtain the user clustering cluster set; For each user cluster, calculate the eigenvalues ​​of all user samples in the cluster on p feature dimensions, calculate the mean of the eigenvalues ​​of each dimension, generate the p-dimensional central feature vector of the corresponding cluster, and output the cluster central feature matrix containing the p-dimensional central feature vectors of each cluster; Perform semantic mapping on the p-dimensional central feature vector of each cluster in the cluster central feature matrix, extract the user's electricity consumption behavior characteristics and the user's payment habit characteristics, generate the semantic label feature description of the corresponding cluster, and output the label feature description set of each cluster; Traverse the user clustering cluster set, associate the user samples in each cluster with the label feature description corresponding to the output cluster, and obtain a labeled portrait dataset of different user group characteristics.

6. The customer relationship management method for power marketing according to claim 5, characterized in that: Based on the user's electricity consumption data, the XGBoost gradient boosting tree model is used to predict the electricity consumption trend in the future, including: The acquired user electricity consumption data is extracted according to the time series to form the user electricity consumption time series data set Dele = {d1, d2, ..., d T }, where d t represents the electricity consumption of the t-th time unit, T is the length of the electricity consumption time series, and the dataset Dele is used as the training sample set of the XGBoost model; Perform data preprocessing on the electricity consumption time series data set Dele to obtain the preprocessed electricity consumption time series data set Dele'; Build an XGBoost gradient boosting tree model, set hyperparameters, and use grid search cross-validation method to optimize hyperparameters; hyperparameters include the number of trees n tree 、The maximum depth of the tree max depth , learning rate l r and the regularization parameter reg lambda ; According to the electricity consumption time series dataset Dele', the electricity consumption of each time unit d t As the feature X of the training sample train , the power consumption after several time units d t+k As the label y of the training sample train , construct supervised learning training sample set {(X train ,y train )}; Using training samples (X train ,y train ) Train the XGBoost model, minimize the loss function of the model on the training samples, and obtain the trained XGBoost electricity consumption trend prediction model Mele; Using the trained XGBoost model Mele, the features of the electricity consumption time series data of several time units are constructed to form the test sample X test , X test Input the model Mele to get the predicted value y of electricity consumption per unit time in the future pred .

7. The customer relationship management method for power marketing according to claim 6, characterized in that: Build an XGBoost gradient boosting tree model, set hyperparameters, and use grid search cross-validation method to optimize hyperparameters, including: According to the electricity consumption time series data set Dele', a random sampling method with replacement is used to generate multiple training sets Train set and validation set Val set ; Set the number of XGBoost model trees n respectively tree 、The maximum depth of the tree max depth , learning rate l r and the regularization parameter reg lambda The value range of constitutes the hyperparameter search space; The Bayesian optimization algorithm is used to search for the global optimal hyperparameter combination.

8. The customer relationship management method for power marketing according to claim 7, characterized in that: The Bayesian optimization algorithm is used to search for the global optimal hyperparameter combination, including: The Bayesian optimization algorithm is used to search the hyperparameter search space; the Bayesian optimization algorithm randomly generates a set of initial hyperparameters based on prior knowledge and adds them to the hyperparameter observation set HP obs ; According to the hyperparameter observation set HP obs Each set of hyperparameters hp in i In the obtained multiple training sets Train set and validation set Val set Perform K-fold cross validation on the i Root mean square error RMSE on each validation set i , will (hp i ,RMSE i ) as a set of observation data and added to the performance observation set Perf obs ; Based on the performance observation set Perf obs , construct a Gaussian process regression proxy model GP between the hyperparameter hp and the model performance RMSE model , used to predict the performance distribution of unobserved hyperparameters; Using the constructed Gaussian process proxy model GP model , predict the expected performance and uncertainty σ of the unobserved hyperparameters in the hyperparameter search space, and obtain the next set of hyperparameters hp to be evaluated by maximizing the acquisition function acq(μ,σ) next μ, where the acquisition function uses the expected improvement criterion to balance μ and σ; will hp next Add hyperparameter observation set HP obs , and in Train set and validation set Val set Cross validation was performed on the next Performance RMSE next , will (hp next ,RMSE next )Add performance observation set Perf obs ; Based on the updated performance observation set Perf obs , retrain the Gaussian process proxy model GP model , get the updated GP model ; Repeat the iteration until the iteration stop condition is met and output the GP at this time model The global optimal hyperparameter combination hp predicted in the hyperparameter search space opt .

9. The customer relationship management method for power marketing according to claim 8, characterized in that: According to the electricity consumption time series dataset Dele', a supervised learning training sample {(X train ,y train )},include: The sliding window method is used to construct the features of the training samples of the dataset Dele'. The window length is set to w, and the power consumption d corresponding to each time unit t in the dataset Dele' is calculated. t Compared with the electricity consumption in the previous w-1 time units {d t-w+1 ,......,d t-1 } are combined to form a feature vector x of length w t , as the feature representation of a training sample; Take the feature vector x t The power consumption d of the kth time unit after the corresponding time unit t t+k As the label value y of the training sample t , get a supervised learning training sample (x t ,y t ), where k is the forecast lead time, indicating the forecast of the electricity consumption in the kth time unit in the future; By sliding the sliding window over the entire time series, multiple supervised learning training samples (x t ,y t ), we get {(X train ,y train )}; Forecast the power demand of each user group and form multi-level power consumption forecast results, including: The obtained labeled portrait datasets of different user groups are converted into training sample sets D for power demand prediction through eigenvalue quantization mapping. rf ; Each sample is represented by the p-dimensional label feature vector x of the corresponding cluster i and the actual electricity demand value y of the corresponding cluster i composition; According to the predicted value y of power consumption per unit time in the future pred , construct the time series features of each user group in the future at the three levels of week, month and year, and add the time series features of each level to the training sample set D rf In the training sample set D rf '; Sampling training sample set D rf 'Training random forest model, random forest model consists of n tree Each decision tree is generated based on the bootstrap sampling of samples and the random selection of features. tree The output of each decision tree gets the final prediction result; Grid search and K-fold cross validation methods are used to optimize the hyperparameters of the random forest model, including the number of decision trees n. tree , the maximum depth of the decision tree max depth , and the maximum number of features for node splitting max features ; The random forest model with optimized parameters is used to extract the corresponding label feature vector x for each user group at the weekly, monthly, and yearly levels in the future. i and the time series feature vector t w ,t m ,t y , input the model for prediction, and obtain the predicted value y of electricity demand at each level pred_w ,y pred_m and pred_y .

10. A customer relationship management system for power marketing, characterized in that: include: At least one processing unit PE; used to execute instructions to implement the customer relationship management method for power marketing as described in any one of claims 1 to 9.

Citation Information

Cited By

  • Power consumption data processing method oriented to multiple user types

    CN119359344A

  • Power consumption data processing method for multiple user types

    CN119359344B

  • Characteristic screening-based energy consumption data prediction method and device, medium and terminal

    CN119416982A

  • Metering and checking method and system for grouped power consumers

    CN119624702A

  • An e-commerce marketing prediction method and system based on big data analysis

    CN119762122A