Power utilization behavior analysis method

文档序号:1614256 发布日期:2020-01-10 浏览:7次 中文

阅读说明:本技术 一种用电行为分析方法 (Power utilization behavior analysis method ) 是由 张忠东 唐国亮 谢辉 石少青 陈超 吴石松 于 2019-09-02 设计创作,主要内容包括:本申请涉及一种用电行为分析方法,获取用电地址数据,将用电地址数据输入至已训练的地址预处理模型,得到用电地址的分词和实体信息,根据已训练的地址归一模型,对用电地址的分词和实体信息进行结构化处理和相似度计算,得出标准结构化地址,然后,对标准结构化地址进行特征优选和聚类分析,得出优选特征集和用电地址分类结果,基于优选特征集和用电地址分类结果,采用关联分析算法进行挖掘分析,得出用电行为分析结果。上述过程,对用电地址进行归一处理,能够有效解决源数据质量要求较高的问题,降低特征选取的难度,结合优选特征集和用电地址分类结果进行关联分析,能够有效甄别出不同区域的用电群体,提供更全面的用电行为分析结果。(The application relates to a power consumption behavior analysis method, which comprises the steps of obtaining power consumption address data, inputting the power consumption address data into a trained address preprocessing model to obtain word segmentation and entity information of a power consumption address, conducting structural processing and similarity calculation on the word segmentation and the entity information of the power consumption address according to a trained address normalization model to obtain a standard structural address, then conducting feature optimization and cluster analysis on the standard structural address to obtain an optimal feature set and a power consumption address classification result, and conducting mining analysis by adopting an association analysis algorithm based on the optimal feature set and the power consumption address classification result to obtain a power consumption behavior analysis result. According to the process, the power utilization addresses are normalized, the problem of high source data quality requirements can be effectively solved, the difficulty of feature selection is reduced, association analysis is carried out by combining the optimal feature set and the power utilization address classification result, power utilization groups in different areas can be effectively screened out, and a more comprehensive power utilization behavior analysis result is provided.)

1. A method for analyzing power usage behavior, the method comprising:

acquiring power utilization address data;

inputting the electricity utilization address data into a trained address preprocessing model to obtain word segmentation and entity information of the electricity utilization address, wherein the trained address preprocessing model is constructed based on historical electricity utilization address data and a word segmentation and named entity recognition model;

performing structural processing and similarity calculation on the word segmentation and entity information of the power utilization address according to a trained address normalization model to obtain a standard structural address, wherein the trained address normalization model is constructed based on the historical power utilization address data;

performing feature optimization and cluster analysis on the standard structured address to obtain an optimized feature set and a power utilization address classification result;

and mining and analyzing by adopting an association analysis algorithm based on the preferred feature set and the power utilization address classification result to obtain a power utilization behavior analysis result.

2. The power consumption behavior analysis method according to claim 1, wherein the performing feature optimization and cluster analysis on the standard structured address to obtain an optimized feature set and a power consumption address classification result comprises:

constructing an address feature database according to the standard structured address;

calculating the weight of each address feature in the address feature database according to preset index factors;

screening out an optimal feature set according to the weight;

and based on the preferred feature set, performing clustering analysis by adopting a clustering algorithm to obtain a power utilization address classification result.

3. The power usage behavior analysis method according to claim 1, wherein before inputting the power usage address data to the trained address preprocessing model, further comprising:

acquiring historical electricity utilization address data;

constructing a training set according to the historical electricity utilization address data;

performing parameter optimization on the segmentation and named entity recognition model based on a BERT pre-training model, and constructing an initial address preprocessing model;

and training the initial address preprocessing model by adopting a Keras deep learning framework based on the training set to obtain the trained address preprocessing model.

4. The method according to claim 3, wherein the constructing a training set according to the electricity consumption address data comprises:

performing processable feature extraction and classification on the electricity utilization address data to obtain an original sample;

combining the address data with less samples in the original samples according to a preset address level to construct a sample library;

and performing word segmentation and entity naming recognition and labeling on the data in the sample library by adopting a sequence labeling method, and constructing a training set.

5. The method of claim 3, wherein the training the initial address pre-processing model using a Keras deep learning framework based on the training set comprises:

inputting the training set into the initial address preprocessing model;

calculating the score of each data in the training set through the forward propagation of the initial address preprocessing model;

inputting the score into an error function, and calculating the error between the score and a score expected value;

performing back propagation by using the initial address preprocessing model to determine a gradient vector;

updating the initial address preprocessing model according to the gradient vector;

and inputting the updated initial address preprocessing model into the training set again, returning to the forward propagation through the initial address preprocessing model, and calculating the score of each data in the training set until the error between the score and the score expected value is minimum, and finishing the training.

6. The method for analyzing power consumption behavior according to claim 1, wherein before performing structuring processing and similarity calculation on the participles and the entity information of the power consumption address according to the trained address normalization model to obtain a standard structured address, the method further comprises:

collecting historical power utilization address data;

carrying out natural language processing on the electricity utilization address data to obtain hierarchical address information;

processing the hierarchical address information according to a preset hierarchical address structuring processing rule;

and calculating the similarity between the processed hierarchical address information and a preset reference address, marking the address with the highest similarity weight as a normalized address, and constructing an address normalization model.

7. An electricity consumption behavior analysis apparatus, characterized in that the apparatus comprises:

the data acquisition module is used for acquiring power utilization address data;

the first data processing module is used for inputting the electricity utilization address data into a trained address preprocessing model to obtain word segmentation and entity information of the electricity utilization address, and the trained address preprocessing model is constructed on the basis of historical electricity utilization address data;

the second data processing module is used for carrying out structural processing and similarity calculation on the word segmentation and entity information of the power utilization address according to a trained address normalization model to obtain a standard structural address, and the trained address normalization model is constructed on the basis of historical power utilization address data;

the data clustering module is used for carrying out feature optimization and clustering analysis on the standard structured address to obtain an optimized feature set and a power utilization address classification result;

and the data mining analysis module is used for mining and analyzing by adopting an association analysis algorithm based on the preferred feature set and the power utilization address classification result to obtain a power utilization behavior analysis result.

8. The electrical behavior analysis apparatus according to claim 7, further comprising:

the first model building module is used for obtaining historical power utilization address data, building a training set according to the historical power utilization address data, carrying out parameter optimization on a word segmentation and entity naming recognition model based on a BERT pre-training model, building an initial address preprocessing model, and training the initial address preprocessing model by adopting a Keras deep learning framework based on the training set to obtain the trained address preprocessing model.

9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.

Technical Field

The present application relates to the field of power grid technologies, and in particular, to a power consumption behavior analysis method, device, computer device, and storage medium.

Background

With the deep exploration and reformation of the electric power system in China, the electric power marketization process is continuously accelerated, and in the electric power marketing business, corresponding scheduling and service strategies need to be formulated aiming at different customer groups, and the management of the electricity utilization demand side is guided through the analysis of electricity utilization behaviors.

At present, the existing power consumption behavior analysis method is generally used for analyzing the power consumption data of users based on big data or a clustering method, the analysis method has high requirements on the quality of source data, the difficulty in selecting characteristics is high, the characteristics cannot be selected in a targeted manner for analysis, and the power consumption behavior analysis result is incomplete.

Disclosure of Invention

In view of the above, it is necessary to provide a more comprehensive power consumption behavior analysis method, device, computer device, and storage medium for solving the problem that the existing power consumption behavior analysis method is not comprehensive.

A method for analyzing power consumption behaviors, comprising the following steps:

acquiring power utilization address data;

inputting the electricity utilization address data into a trained address preprocessing model to obtain word segmentation and entity information of the electricity utilization address, wherein the trained address preprocessing model is constructed on the basis of historical electricity utilization address data, word segmentation and a named entity recognition model;

performing structural processing and similarity calculation on the word segmentation and entity information of the electricity utilization address according to a trained address normalization model to obtain a standard structural address, wherein the trained address normalization model is constructed on the basis of historical electricity utilization address data;

performing feature optimization and cluster analysis on the standard structured address to obtain an optimized feature set and a power utilization address classification result;

and mining and analyzing by adopting a correlation analysis algorithm based on the optimal feature set and the power utilization address classification result to obtain a power utilization behavior analysis result.

In one embodiment, the performing feature optimization and cluster analysis on the standard structured address to obtain an optimized feature set and a classification result of the electricity utilization address comprises:

constructing an address feature database according to the standard structured address;

calculating the weight of each address characteristic in the address characteristic database according to preset index factors;

screening out a preferred feature set according to the weight;

and based on the preferred feature set, performing clustering analysis by adopting a clustering algorithm to obtain a power utilization address classification result.

In one embodiment, before inputting the power utilization address data into the trained address preprocessing model, the method further includes:

acquiring historical electricity utilization address data;

constructing a training set according to historical power utilization address data;

performing parameter optimization on the segmentation and named entity recognition model based on a BERT (Bidirectional Encoder Representation from Transformers) pre-training model to construct an initial address preprocessing model;

and training an initial address preprocessing model by adopting a Keras deep learning framework based on the training set to obtain a trained address preprocessing model.

In one embodiment, constructing the training set from the electricity usage address data comprises:

performing processable feature extraction and classification on the electricity utilization address data to obtain an original sample;

combining the address data with less samples in the original samples according to a preset address level to construct a sample library;

and performing word segmentation and entity naming recognition and labeling on the data in the sample library by adopting a sequence labeling method to construct a training set.

In one embodiment, training the initial address preprocessing model using the Keras deep learning framework based on the training set comprises:

inputting the training set into an initial address preprocessing model;

calculating the score of each data in the training set through the forward propagation of the initial address preprocessing model;

inputting the score into an error function, and calculating the error between the score and the expected value of the score;

performing back propagation by using an initial address preprocessing model to determine a gradient vector;

updating an initial address preprocessing model according to the gradient vector;

and inputting the training set into the updated initial address preprocessing model again, returning to the step of calculating the score of each data in the training set through the forward propagation of the initial address preprocessing model until the error between the score and the score expected value is minimum, and finishing the training.

In one embodiment, before performing the structuring process and similarity calculation on the participles and the entity information of the electricity utilization address according to the trained address normalization model to obtain the standard structured address, the method further includes:

collecting historical power utilization address data;

natural language processing is carried out on the historical electricity utilization address data to obtain hierarchical address information;

processing the hierarchical address information according to a preset hierarchical address structured processing rule;

and calculating the similarity between the processed hierarchical address information and a preset reference address, marking the address with the highest similarity weight as a normalized address, and constructing an address normalization model.

An electricity consumption behavior analysis apparatus, comprising:

the data acquisition module is used for acquiring power utilization address data;

the first data processing module is used for inputting the electricity utilization address data into a trained address preprocessing model to obtain word segmentation and entity information of the electricity utilization address, and the trained address preprocessing model is constructed on the basis of historical electricity utilization address data;

the second data processing module is used for carrying out structural processing and similarity calculation on the participles and the entity information of the electricity utilization address according to the trained address normalization model to obtain a standard structural address, and the trained address normalization model is constructed on the basis of historical electricity utilization address data;

the data clustering module is used for carrying out feature optimization and clustering analysis on the standard structured address to obtain an optimized feature set and a power utilization address classification result;

and the data mining analysis module is used for mining and analyzing by adopting an association analysis algorithm based on the preferred feature set and the power utilization address classification result to obtain a power utilization behavior analysis result.

In one embodiment, the apparatus further comprises:

the first model building module is used for obtaining historical power utilization address data, building a training set according to the historical power utilization address data, carrying out parameter optimization on a word segmentation and entity naming recognition model based on a BERT pre-training model, building an initial address preprocessing model, and training the initial address preprocessing model by adopting a Keras deep learning framework based on the training set to obtain the trained address preprocessing model.

A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:

acquiring power utilization address data;

inputting the electricity utilization address data into a trained address preprocessing model to obtain word segmentation and entity information of the electricity utilization address, wherein the trained address preprocessing model is constructed on the basis of historical electricity utilization address data, word segmentation and a named entity recognition model;

performing structural processing and similarity calculation on the word segmentation and entity information of the electricity utilization address according to a trained address normalization model to obtain a standard structural address, wherein the trained address normalization model is constructed on the basis of historical electricity utilization address data;

performing feature optimization and cluster analysis on the standard structured address to obtain an optimized feature set and a power utilization address classification result;

and mining and analyzing by adopting a correlation analysis algorithm based on the optimal feature set and the power utilization address classification result to obtain a power utilization behavior analysis result.

A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:

acquiring power utilization address data;

inputting the electricity utilization address data into a trained address preprocessing model to obtain word segmentation and entity information of the electricity utilization address, wherein the trained address preprocessing model is constructed on the basis of historical electricity utilization address data, word segmentation and a named entity recognition model;

performing structural processing and similarity calculation on the word segmentation and entity information of the electricity utilization address according to a trained address normalization model to obtain a standard structural address, wherein the trained address normalization model is constructed on the basis of historical electricity utilization address data;

performing feature optimization and cluster analysis on the standard structured address to obtain an optimized feature set and a power utilization address classification result;

and mining and analyzing by adopting a correlation analysis algorithm based on the optimal feature set and the power utilization address classification result to obtain a power utilization behavior analysis result.

The power utilization behavior analysis method, the device, the computer equipment and the storage medium acquire power utilization address data, input the power utilization address data into a trained address preprocessing model to obtain word segmentation and entity information of the power utilization address, perform structural processing and similarity calculation on the word segmentation and the entity information of the power utilization address according to a trained address normalization model to obtain a standard structured address, perform feature optimization and cluster analysis on the standard structured address to obtain an optimal feature set and a power utilization address classification result, and perform mining analysis by adopting an association analysis algorithm based on the optimal feature set and the power utilization address classification result to obtain a power utilization behavior analysis result. According to the process, the power utilization addresses are normalized, the problem that source data quality requirements are high can be effectively solved, the difficulty of feature selection is reduced, association analysis is carried out by combining the optimal feature set and the power utilization address classification results, power utilization groups in different areas can be effectively screened out, and more comprehensive power utilization behavior analysis results are provided.

Drawings

FIG. 1 is a diagram illustrating an exemplary embodiment of an application environment of a power usage behavior analysis method;

FIG. 2 is a schematic flow chart of a power usage behavior analysis method according to an embodiment;

FIG. 3 is a detailed flow chart of the electricity usage behavior analysis in another embodiment;

FIG. 4 is a schematic flow chart of the steps of constructing a training set in another embodiment;

FIG. 5 is a block diagram showing the structure of a power consumption behavior analyzing apparatus according to an embodiment;

FIG. 6 is a block diagram showing the structure of an apparatus for analyzing an electrical behavior according to another embodiment;

FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

The power utilization behavior analysis method provided by the application can be applied to the application environment shown in fig. 1. The user checks the user electricity consumption behavior analysis result at the terminal, the electricity consumption behavior analysis instruction is sent to the server 104 through the terminal 102, the server 104 responds to the instruction to obtain the electricity consumption address data, the electricity consumption address data is input to the trained address preprocessing model to obtain the word segmentation and the entity information of the electricity consumption address, the trained address preprocessing model is constructed based on the historical electricity consumption address data and the word segmentation and named entity recognition model, the word segmentation and the entity information of the electricity consumption address are subjected to structural processing and similarity calculation according to the trained address normalization model to obtain a standard structural address, the trained address normalization model is constructed based on the historical electricity consumption address data, the standard structural address is subjected to feature optimization and cluster analysis to obtain an optimized feature set and an electricity consumption address classification result, and based on the optimized feature set and the electricity consumption address classification result, and mining and analyzing by adopting a correlation analysis algorithm to obtain an electricity utilization behavior analysis result. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.

In one embodiment, as shown in fig. 2, a power consumption behavior analysis method is provided, which is described by taking the application of the method to the server in fig. 1 as an example, and includes the following steps:

and step S100, acquiring power utilization address data.

The power utilization address data refers to a power user address, in this embodiment, the power utilization address data may be a user address data file derived from early-stage collection, the file format may be multiple source files such as excel, word, db and the like, the power utilization address data mainly includes user information and specific address information of a power user, the user information includes user categories such as residents, enterprises or public facilities and the like, and the specific address information includes other address information such as province, city, district and county, town, village committee, street lane, house number, building, unit number and the like.

And S200, inputting the power utilization address data into a trained address preprocessing model to obtain word segmentation and entity information of the power utilization address, wherein the trained address preprocessing model is constructed on the basis of historical power utilization address data, word segmentation and a named entity recognition model.

The word segmentation means that the text is segmented into words, and the named entity recognition means that the words after the word segmentation are spliced again to find the mode of the named entity. In practical application, a common word segmentation and named entity recognition model is not suitable for processing power utilization address data, so that the effect of power utilization behavior analysis is achieved. The power utilization address data is acquired, and the power utilization address data can be input into a trained address preprocessing model after certain data processing such as data feature extraction, data enhancement and the like is carried out on the power utilization address data, so that word segmentation and entity information of the power utilization address are acquired.

And step S300, performing structural processing and similarity calculation on the word segmentation and entity information of the power utilization address according to the trained address normalization model to obtain a standard structural address, wherein the trained address normalization model is constructed based on historical power utilization address data.

The address normalization model is used for performing normalization processing on the electricity utilization address data and is constructed on the basis of historical electricity utilization address data. As described in the foregoing embodiment, after the word segmentation and the entity information of the power consumption address are obtained, in order to unify the data characteristic expression form of the power consumption address, the word segmentation and the entity information of the power consumption address may be input to a trained address normalization model, and the word segmentation and the entity information of the power consumption address are subjected to structuring processing and similarity calculation by the address normalization model, so as to obtain a standard structured address.

And S400, performing feature optimization and cluster analysis on the standard structured address to obtain an optimized feature set and a power utilization address classification result.

Feature optimization is a method for screening representative data features from high-dimensional feature data through a certain optimization criterion. Because the electricity utilization address data is a large-scale heterogeneous data set and the data processing process is complex, the subsequent clustering accuracy is low. Therefore, representative characteristics cannot be screened in a targeted manner, and more accurate reference data is provided for power consumption behavior analysis. In this embodiment, in order to reduce the redundancy of classification information among the power utilization address data features and implement the dimension reduction of high-dimensional features, feature optimization and cluster analysis may be performed on the standard structured address, and effective features may be selected to obtain an optimal feature set. Specifically, the candidate electricity utilization address features can be evaluated and calculated according to preset index information, an optimal feature set is screened out, then cluster analysis is performed according to the optimal feature set and the electricity utilization address classification results, the clustering accuracy is improved, the effectiveness of calculation complexity is reduced, and optimization of user electricity utilization behavior analysis is completed.

And S500, mining and analyzing by adopting an association analysis algorithm based on the optimized feature set and the power utilization address classification result to obtain a power utilization behavior analysis result.

As described in the foregoing embodiment, after the preferred feature set and the power consumption address classification result are obtained, in order to further obtain the user power consumption behavior, abnormal conditions, load capacity, association relationship and other value information, mining analysis may be performed according to an association analysis algorithm based on the preferred feature set and the power consumption address classification result to obtain a power consumption behavior analysis result. In this embodiment, the association analysis algorithm is an optimized Apriori algorithm, and specifically, the optimization processing includes generating a candidate set by scanning an analysis transaction to be processed based on the Apriori algorithm, generating a frequent item set according to a preset minimum support, then determining target feature data by item set screening through connection, and finally analyzing the target feature data, so as to narrow the range of the transaction set to be analyzed and reduce the time complexity of the algorithm. The algorithm also comprises the steps of dividing time sequence transactions by a specified time interval by utilizing the correlation analysis of the time sequence, and meanwhile, carrying out deduplication on the acquired frequent item set and carrying out process optimization on the support degree and the confidence degree. It is understood that in other embodiments, the association analysis algorithm may also be other algorithms such as the FP-Growth algorithm.

The power consumption behavior analysis method comprises the steps of obtaining power consumption address data, inputting the power consumption address data into a trained address preprocessing model to obtain word segmentation and entity information of a power consumption address, conducting structural processing and similarity calculation on the word segmentation and the entity information of the power consumption address according to a trained address normalization model to obtain a standard structural address, conducting feature optimization and cluster analysis on the standard structural address to obtain an optimized feature set and power consumption address classification result, conducting mining analysis by adopting an association analysis algorithm based on the optimized feature set and the power consumption address classification result, and obtaining a power consumption behavior analysis result. According to the process, the power utilization addresses are normalized, the problem that source data quality requirements are high can be effectively solved, the difficulty of feature selection is reduced, association analysis is carried out by combining the optimal feature set and the power utilization address classification results, power utilization groups in different areas can be effectively screened out, and more comprehensive power utilization behavior analysis results are provided.

As shown in fig. 3, in one embodiment, the performing feature optimization and cluster analysis on the standard structured address to obtain the optimized feature set and the classification result of the electricity consumption address includes: step S420, an address feature database is built according to the standard structured address, the weight of each address feature in the address feature database is calculated according to preset index factors, an optimal feature set is screened out according to the weight, clustering analysis is carried out by adopting a clustering algorithm based on the optimal feature set, and a power utilization address classification result is obtained.

In practical applications, after a standardized structure address is obtained, the standardized structure address contains a large amount of address characteristic data, and the address information contains multi-level address data, such as a city district, a street living committee district, and the like, and the user information contains enterprises, residents, public facilities, and the like, which can be used as category candidate characteristics, but not every characteristic has value, for example, a category of residents whose address information is a certain room of a certain building in a certain area of a certain city has an extremely low weight ratio in the whole data set to be analyzed, and is not enough for clustering, so that in order to improve the efficiency of cluster analysis, valuable representative characteristics need to be screened out. In this embodiment, an address feature database may be constructed according to a standard structured address, then, weights of address features are calculated according to preset index factors, an optimal feature set is screened out according to the weights, clustering is performed by using an optimized K-means algorithm based on the screened optimal feature set, and the weight calculation of a plurality of address features is integrated in a parallel manner, so that the classification refinement of users is realized. Specifically, a similarity measurement standard is defined through critic weighting, then a cluster center selection Index is defined based on a density peak value, initial cluster center point selection and clustering are carried out, meanwhile, a Semantic Index LSI (Latent Semantic Index) model is adopted to carry out dimensionality reduction on vector space model data, in the clustering process, a cosine similarity algorithm is adopted to carry out weighting to improve clustering accuracy, and finally, the distribution condition after data clustering is judged according to cluster average dissimilarity, so that the most appropriate K value is selected to obtain a clustering result. It is understood that in other embodiments, the clustering algorithm may also be other algorithms such as density-based clustering algorithms. In the embodiment, the clustering analysis is performed through the K-means algorithm with optimized characteristics, so that power users in different areas, different sections, different groups and different types can be effectively screened.

As shown in fig. 3, in one embodiment, before inputting the power utilization address data into the trained address preprocessing model, the method further includes: step S150, obtaining historical power utilization address data, constructing a training set according to the historical power utilization address data, carrying out parameter optimization on a word segmentation and named entity recognition model based on a BERT pre-training model, constructing an initial address preprocessing model, and training the initial address preprocessing model by adopting a Keras deep learning framework based on the training set to obtain a trained address preprocessing model.

The address preprocessing model is a model constructed based on historical electricity utilization address data, word segmentation and named entity recognition models, and in practical application, the construction process of the address preprocessing model can be as follows: the method comprises the steps of firstly obtaining historical power utilization address data from an address data file in a preset database, conducting data processing on the historical power utilization address data, extracting processable data features such as street lanes, buildings and the like according to preset specifications to build a training set, conducting parameter optimization on a segmentation and named entity recognition model based on a BERT pre-training model after the training set is built, adjusting parameters of the segmentation and named entity recognition model such as Batchsize, learning rate, epochs and dropout, building an initial address preprocessing model suitable for processing address information, then training the initial address preprocessing model based on the training set by adopting a Keras deep learning framework, and obtaining the trained address preprocessing model. In this embodiment, the training of the address preprocessing model can be completed quickly and effectively by adopting the Keras deep learning framework.

As shown in fig. 4, in one embodiment, constructing the training set according to the electricity utilization address data includes: step S152, performing processable feature extraction and classification on the electricity utilization address data to obtain an original sample; step S154, address data with less samples in the original samples are combined according to the preset address level to construct a sample library; and step S156, performing word segmentation and entity naming recognition labeling on the data in the sample library by adopting a sequence labeling method, and constructing a training set.

Specifically, the training set may be constructed by performing processable feature extraction and classification on the electricity consumption address data, for example, extracting data including features of province, city, street lane, buildings and the like according to a preset standard to obtain an original sample, combining address data with a small number of samples in the original sample according to a preset address level, for example, performing data enhancement according to a preset 10-level address model (province, city, district, county, country, village, street lane, house number, building, unit number and others), constructing a combination of various key features of city + street lane + unit number, city + county + street lane + building and the like, and then constructing a sample library, and then, using a sequence labeling method such as BMES (B-begin, M-middle, E-end, S-single) labeling and biees (B-begin, I-interior, O-exterior, e-end, S-single) labeling method, performing word segmentation and entity naming recognition labeling on data in a sample library, and constructing a training set. In the embodiment, the address data with fewer samples in the original sample are combined according to the preset 10-level address model, so that data enhancement is realized, the data samples are further enriched, and the accuracy and the expansibility of the address preprocessing model can be improved by labeling the samples.

In one embodiment, training the initial address preprocessing model using the Keras deep learning framework based on the training set comprises:

1) inputting the training set into an initial address preprocessing model;

2) calculating the score of each data in the training set through the forward propagation of the initial address preprocessing model;

3) inputting the score into an error function, and calculating the error between the score and the expected value of the score;

4) performing back propagation by using an initial address preprocessing model to determine a gradient vector;

5) updating an initial address preprocessing model according to the gradient vector;

6) and inputting the training set into the updated initial address preprocessing model again, returning to the step of calculating the score of each data in the training set through the forward propagation of the initial address preprocessing model until the error between the score and the score expected value is minimum, and finishing the training.

In practical application, training an initial address preprocessing model by using a Keras deep learning framework to obtain the address preprocessing model, which may include inputting a labeled training set into the initial address preprocessing model, setting parameters of the initial address preprocessing model such as Batchsize, learning rate, epochs, and dropouts, and the like, allowing data to forward propagate through an input neural network (i.e., each neuron weights and accumulates input values first, inputs the weighted and accumulated values into an activation function, and takes the result of the activation function as the output value of the neuron), obtaining scores of each data in the training set, inputting the scores into an error function, i.e., a target function, calculating the error between the output score and the expected value of the scores, judging the recognition degree of the model by the error, performing backward propagation by using the initial address preprocessing model, determining gradient vectors, and adjusting the weight of each network layer of the initial address preprocessing model according to the gradient vectors, and updating the initial address preprocessing model, inputting the updated initial address preprocessing model into the training set again, returning to the step of calculating the score of each data in the training set through the forward propagation of the initial address preprocessing model until the error between the score and the score expected value is minimum or the value of the parameter batchsize is minimum, and finishing the training to obtain the trained address preprocessing model. In this embodiment, the gradient vector is used to update the model, and the gradient vector is gradually reduced as the loss value approaches its minimum value, so that the gradient vector is more accurate.

As shown in fig. 3, in one embodiment, before performing the structural processing and similarity calculation on the participle and entity information of the electricity consumption address according to the trained address normalization model to obtain the standard structural address, the method further includes: step S250, collecting historical electricity utilization address data, carrying out natural language processing on the historical electricity utilization address data to obtain hierarchical address information, processing the hierarchical address information according to a preset hierarchical address structuralization processing rule, calculating the similarity between the processed hierarchical address information and a preset reference address, marking the address with the highest similarity weight as a normalized address, and constructing an address normalization model.

Because the power utilization addresses are diversified, the addresses need to be normalized, and in the embodiment, the address normalization model is constructed by adopting natural language processing, rules and statistics. Specifically, the model construction may be collecting historical electricity consumption address data, performing natural language processing on the historical electricity consumption address data to obtain hierarchical address information, then establishing a hierarchical address structured processing rule according to a preset 10-level address structured model, processing the hierarchical address information according to the rule, performing similarity calculation on the hierarchical address processed according to the rule and a preset reference address by using a statistical method, marking an address with the highest similarity weight as a normalized address, and constructing an address normalization model. And according to the constructed address normalization model, the normalization processing of the power utilization address data can be completed.

It should be understood that although the various steps in the flow charts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.

In one embodiment, as shown in fig. 5, there is provided an electricity usage behavior analysis apparatus including: a data acquisition module 510, a first data processing module 520, a second data processing module 530, a data clustering module 540, and a data mining analysis module 550, wherein:

and a data obtaining module 510, configured to obtain the power utilization address data.

The first data processing module 520 is configured to input the power utilization address data into a trained address preprocessing model to obtain word segmentation and entity information of the power utilization address, where the trained address preprocessing model is constructed based on historical power utilization address data.

And the second data processing module 530 is configured to perform structural processing and similarity calculation on the word segmentation and the entity information of the power utilization address according to the trained address normalization model to obtain a standard structural address, where the trained address normalization model is constructed based on historical power utilization address data.

And the data clustering module 540 is used for performing feature optimization and cluster analysis on the standard structured address to obtain an optimized feature set and a power utilization address classification result.

And the data mining analysis module 550 is configured to perform mining analysis by using an association analysis algorithm based on the preferred feature set and the power utilization address classification result to obtain a power utilization behavior analysis result.

As shown in fig. 6, in one embodiment, the power consumption behavior analysis apparatus further includes a first model building module 560, configured to obtain historical power consumption address data, build a training set according to the historical power consumption address data, perform parameter optimization on the segmentation and entity naming recognition models based on a BERT pre-training model, build an initial address preprocessing model, and train the initial address preprocessing model based on the training set by using a Keras deep learning framework to obtain a trained address preprocessing model.

In one embodiment, the first model building module 560 is further configured to input the training set into the initial address preprocessing model, calculate a score of each data in the training set through forward propagation of the initial address preprocessing model, input the score into an error function, calculate an error between the score and a score expected value, perform backward propagation by using the initial address preprocessing model, determine a gradient vector, update the initial address preprocessing model according to the gradient vector, input the training set into the updated initial address preprocessing model again, return to the forward propagation through the initial address preprocessing model, calculate a score of each data in the training set until the error between the score and the score expected value is minimum, and end the training.

In one embodiment, the data clustering module 540 is further configured to construct an address feature database according to the standard structured address, calculate a weight of each address feature in the address feature database according to a preset index factor, screen out an optimal feature set according to the weight, and perform clustering analysis by using a clustering algorithm based on the optimal feature set to obtain a classification result of the power consumption address.

As shown in fig. 6, in one embodiment, the power consumption behavior analysis apparatus further includes a training set construction module 570, configured to perform processable feature extraction and classification on the power consumption address data to obtain original samples, combine the address data with a smaller number of samples in the original samples according to a preset address level to construct a sample library, and perform word segmentation and entity naming identification labeling on the data in the sample library by using a sequence labeling method to construct a training set.

In one embodiment, the electricity consumption behavior analysis apparatus further includes a second model building module 580, configured to collect historical electricity consumption address data, perform natural language processing on the historical electricity consumption address data to obtain hierarchical address information, process the hierarchical address information according to a preset hierarchical address structuring processing rule, calculate similarity between the processed hierarchical address information and a preset reference address, mark an address with the highest similarity weight as a normalized address, and build an address normalization model.

For specific limitations of the power consumption behavior analysis device, reference may be made to the above limitations of the power consumption behavior analysis method, which are not described herein again. Each module in the above-described electricity consumption behavior analysis apparatus may be wholly or partially implemented by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.

In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data such as power utilization address data, address normalization model data and address preprocessing model data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a power usage behavior analysis method.

Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.

In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program: acquiring power utilization address data, inputting the power utilization address data into a trained address preprocessing model to obtain word segmentation and entity information of the power utilization address, constructing the trained address preprocessing model based on historical power utilization address data and a word segmentation and named entity recognition model, performing structural processing and similarity calculation on the word segmentation and entity information of the power utilization address according to a trained address normalization model to obtain a standard structured address, constructing the trained address normalization model based on the historical power utilization address data, performing feature optimization and cluster analysis on the standard structured address to obtain an optimal feature set and power utilization address classification result, and mining and analyzing by adopting an association analysis algorithm based on the optimal feature set and the power utilization address classification result to obtain a power utilization behavior analysis result.

In one embodiment, the processor, when executing the computer program, further performs the steps of: and constructing an address feature database according to the standard structured address, calculating the weight of each address feature in the address feature database according to preset index factors, screening out an optimal feature set according to the weight, and performing cluster analysis by adopting a clustering algorithm based on the optimal feature set to obtain a power utilization address classification result.

In one embodiment, the processor, when executing the computer program, further performs the steps of: obtaining historical power utilization address data, constructing a training set according to the historical power utilization address data, carrying out parameter optimization on a segmentation and named entity recognition model based on a BERT pre-training model, constructing an initial address preprocessing model, and training the initial address preprocessing model by adopting a Keras deep learning framework based on the training set to obtain a trained address preprocessing model.

In one embodiment, the processor, when executing the computer program, further performs the steps of: the method comprises the steps of performing processable feature extraction and classification on electricity utilization address data to obtain original samples, combining the address data with fewer samples in the original samples according to preset address levels to construct a sample library, performing word segmentation and entity naming identification labeling on the data in the sample library by adopting a sequence labeling method, and constructing a training set.

In one embodiment, the processor, when executing the computer program, further performs the steps of: inputting the training set into an initial address preprocessing model, calculating the score of each data in the training set through the forward propagation of the initial address preprocessing model, inputting the score into an error function, calculating the error between the score and the score expected value, performing backward propagation by using the initial address preprocessing model, determining a gradient vector, updating the initial address preprocessing model according to the gradient vector, inputting the training set into the updated initial address preprocessing model again, returning to the step of calculating the score of each data in the training set through the forward propagation of the initial address preprocessing model until the error between the score and the score expected value reaches the minimum, and finishing the training.

In one embodiment, the processor, when executing the computer program, further performs the steps of: the method comprises the steps of collecting historical electricity utilization address data, carrying out natural language processing on the historical electricity utilization address data to obtain hierarchical address information, processing the hierarchical address information according to a preset hierarchical address structuralization processing rule, calculating the similarity between the processed hierarchical address information and a preset reference address, marking an address with the highest similarity weight as a normalized address, and constructing an address normalization model.

In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor performs the steps of: acquiring power utilization address data, inputting the power utilization address data into a trained address preprocessing model to obtain word segmentation and entity information of the power utilization address, constructing the trained address preprocessing model based on historical power utilization address data and a word segmentation and named entity recognition model, performing structural processing and similarity calculation on the word segmentation and entity information of the power utilization address according to a trained address normalization model to obtain a standard structured address, constructing the trained address normalization model based on the historical power utilization address data, performing feature optimization and cluster analysis on the standard structured address to obtain an optimal feature set and power utilization address classification result, and mining and analyzing by adopting an association analysis algorithm based on the optimal feature set and the power utilization address classification result to obtain a power utilization behavior analysis result.

In one embodiment, the computer program when executed by the processor further performs the steps of: and constructing an address feature database according to the standard structured address, calculating the weight of each address feature in the address feature database according to preset index factors, screening out an optimal feature set according to the weight, and performing cluster analysis by adopting a clustering algorithm based on the optimal feature set to obtain a power utilization address classification result.

In one embodiment, the computer program when executed by the processor further performs the steps of: obtaining historical power utilization address data, constructing a training set according to the historical power utilization address data, carrying out parameter optimization on a segmentation and named entity recognition model based on a BERT pre-training model, constructing an initial address preprocessing model, and training the initial address preprocessing model by adopting a Keras deep learning framework based on the training set to obtain a trained address preprocessing model.

In one embodiment, the computer program when executed by the processor further performs the steps of: the method comprises the steps of performing processable feature extraction and classification on electricity utilization address data to obtain original samples, combining the address data with fewer samples in the original samples according to preset address levels to construct a sample library, performing word segmentation and entity naming identification labeling on the data in the sample library by adopting a sequence labeling method, and constructing a training set.

In one embodiment, the computer program when executed by the processor further performs the steps of: inputting the training set into an initial address preprocessing model, calculating the score of each data in the training set through the forward propagation of the initial address preprocessing model, inputting the score into an error function, calculating the error between the score and the score expected value, performing backward propagation by using the initial address preprocessing model, determining a gradient vector, updating the initial address preprocessing model according to the gradient vector, inputting the training set into the updated initial address preprocessing model again, returning to the step of calculating the score of each data in the training set through the forward propagation of the initial address preprocessing model until the error between the score and the score expected value reaches the minimum, and finishing the training.

In one embodiment, the computer program when executed by the processor further performs the steps of: the method comprises the steps of collecting historical electricity utilization address data, carrying out natural language processing on the historical electricity utilization address data to obtain hierarchical address information, processing the hierarchical address information according to a preset hierarchical address structuralization processing rule, calculating the similarity between the processed hierarchical address information and a preset reference address, marking an address with the highest similarity weight as a normalized address, and constructing an address normalization model.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.

The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种人物关系识别模型训练方法、装置、设备及介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!