User industry category identification method and device, medium and equipment
By collecting and converting air conditioning load data, combining Gram angle and field technology and target classification model, the problem of low category identification accuracy in the air conditioning industry in the existing technology is solved, and accurate identification in complex environments is achieved.
Patent Information
- Application Number
- CN202410962444.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2025-03-11
AI Technical Summary
The existing air conditioning industry category identification method has low prediction/classification identification accuracy and low adaptability under the complex and changing industry environment and diverse building structure.
By collecting the initial air conditioning load data of the target user, the data is converted into the target image using the Gram angle and field conversion method, and the image is feature extraction and industry category recognition using the pre-trained target classification model.
It realizes accurate identification of target user industry categories, improves identification accuracy and adaptability, and can quickly and accurately determine industry categories in complex environments.
Smart Images

Figure CN119600321A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of data processing technology, and in particular to a method, device, medium and equipment for identifying user industry categories. Background Art
[0002] With the continuous development of intelligent and green building concepts, intelligent management of building air-conditioning systems has become increasingly important. Industry category identification / classification based on air-conditioning load is a key link in realizing intelligent energy-saving control. It can dynamically adjust the operation strategy of the air-conditioning system according to the results of industry category identification to achieve the purpose of energy saving and emission reduction. However, when facing complex and changing industry environments and diverse building structures, existing air-conditioning industry classification methods often have problems such as low prediction / classification recognition accuracy and poor adaptability.
[0003] Therefore, there is an urgent need for a user industry category identification method to solve the problem of inaccurate user industry category identification in the prior art. Summary of the invention
[0004] In view of this, the present invention provides a method, device, medium and equipment for identifying user industry categories, the main purpose of which is to solve the current problem of inaccurate identification of user industry categories.
[0005] To solve the above problems, the present application provides a method for identifying user industry categories, including:
[0006] Collecting some initial air conditioning load data of target users to obtain an initial air conditioning load vector;
[0007] Based on each initial air conditioning load data in the initial air conditioning load vector, a data conversion process is performed using the Gram angle and field conversion method to obtain a target image corresponding to the initial air conditioning load vector, so as to obtain a target image corresponding to the target user;
[0008] The target classification model obtained through pre-training is used to extract features of the target image to obtain a target feature image, and the industry category of the target user is identified based on the target feature image to obtain a target recognition result.
[0009] Optionally, the step of performing data conversion processing based on each initial air conditioning load data in the initial air conditioning load vector by using a Gram angle and field conversion method to obtain a target image corresponding to the initial air conditioning load vector, so as to obtain a target image corresponding to a target user, specifically includes:
[0010] Normalizing each of the initial air conditioning load data in the initial air conditioning load vector to obtain normalized target air conditioning load data corresponding to each of the initial air conditioning load data, so as to obtain a normalized target air conditioning load vector;
[0011] Determining the polar coordinates of each target air conditioning load data based on each target air conditioning load data and the collection time corresponding to each target air conditioning load data;
[0012] Based on the polar coordinates of each of the target air conditioning load data, the initial air conditioning load vector is converted into the target image.
[0013] Optionally, the converting the initial air conditioning load vector into the target image based on the polar coordinates of each target air conditioning load data specifically includes:
[0014] Based on the angle of the polar coordinates of each of the target air-conditioning load data, the cosine value of the Gram angular field sum between any two target air-conditioning load data is calculated to obtain a target Gram matrix, so as to obtain the target image.
[0015] Optionally, the target classification model includes a target feature extraction module, a target multi-head attention module and a target output module;
[0016] The method of extracting features from the target image using the pre-trained target classification model to obtain a target feature image, and identifying the industry category of the target user based on the target feature image to obtain a target recognition result specifically includes:
[0017] Extracting features from the target image based on the target feature extraction module to obtain a target feature image;
[0018] Performing attention calculation on the target feature image based on the target multi-head attention module to obtain an initial recognition result of the industry category;
[0019] The initial recognition result is classified and recognized based on the target output module to obtain the target industry category to obtain the target recognition result.
[0020] Optionally, the target feature extraction module includes an input layer, a convolution layer, a pooling layer, a first residual module, a second residual module, a third residual module, a fourth residual module, a fifth residual module, a sixth residual module, a seventh residual module, an eighth residual module, an average pooling layer and a fully connected layer connected in series in sequence;
[0021] Among them, each residual module includes a first branch and a second branch connected in parallel; the first branch includes two sub-convolutional layers connected in series; and the second branch includes a 1*1 convolutional layer.
[0022] Optionally, before collecting a number of initial air conditioning load data of the target user, the method further includes: pre-training to obtain the target classification model, specifically including:
[0023] Collecting a number of initial sample air conditioning load data of each sample user to obtain an initial sample air conditioning load vector corresponding to each sample user;
[0024] Based on each initial sample air conditioning load data in the same initial sample air conditioning load vector, a data conversion process is performed using a Gram angle and field conversion method to obtain a sample image corresponding to each of the initial air conditioning load vectors, so as to obtain a sample image corresponding to each of the sample users;
[0025] Based on the sample images of each of the sample users and the industry category labels of each of the sample users, the initial classification model is trained to obtain the target classification model.
[0026] Optionally, the performing model training on the initial classification model based on the sample images of each of the sample users and the industry category labels of each of the sample users to obtain the target classification model specifically includes:
[0027] Extract features from each of the sample images based on an initial feature extraction module in the initial classification model to obtain a sample feature image corresponding to each sample image;
[0028] Performing attention calculation on each of the sample feature images based on the initial multi-head attention module in the initial classification model, and obtaining the initial sample recognition result corresponding to each of the sample feature images;
[0029] Classify and identify each of the initial sample recognition results based on the initial output module in the initial classification model to obtain the industry category of the sample user, so as to obtain the initial target sample recognition result;
[0030] Based on the industry category labels corresponding to each sample user and the initial target sample recognition results, the model parameters in the initial classification model are adjusted to obtain the current classification model, and then feature extraction, attention calculation and classification recognition are re-performed on each sample image based on the current classification model to obtain the current target sample recognition result, until it is determined based on the current target sample recognition result that the predetermined training stop condition is met, and the current classification model is used as the target classification model.
[0031] In order to solve the above problems, the present application provides a user industry category identification device, comprising:
[0032] A collection module, used to collect some initial air conditioning load data of target users to obtain an initial air conditioning load vector;
[0033] A conversion module, used for performing data conversion processing based on each initial air conditioning load data in the initial air conditioning load vector by using a Gram angle and field conversion method to obtain a target image corresponding to the initial air conditioning load vector, so as to obtain a target image corresponding to a target user;
[0034] The recognition module is used to extract features of the target image using a pre-trained target classification model to obtain a target feature image, and to identify the industry category of the target user based on the target feature image to obtain a target recognition result.
[0035] In order to solve the above problems, the present application provides a storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned user industry category identification methods are implemented.
[0036] To solve the above problems, the present application provides an electronic device, comprising at least a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above-mentioned user industry category identification methods when executing the computer program on the memory.
[0037] The user industry category identification method, device, medium and equipment in the present application can accurately convert the initial air-conditioning load vector into a two-dimensional image by using the Gram angle and field to perform data conversion processing on the initial air-conditioning load vector. The two-dimensional image can then be input into a target classification model, and the target classification model is used to perform feature extraction and industry category classification / identification, so that the industry category of the target user can be accurately and quickly determined, thereby achieving accurate classification / identification of the target user's industry category based on air-conditioning load data.
[0038] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0040] Figure 1 This is a flow chart of a method for identifying a user industry category according to an embodiment of the present application;
[0041] Figure 2 This is a schematic diagram of the structure of the target feature extraction module in the embodiment of the present application;
[0042] Figure 3 This is a schematic diagram of the structure of the residual module in an embodiment of the present application;
[0043] Figure 4 This is a flow chart of a method for identifying a user industry category in another embodiment of the present application;
[0044] Figure 5 This is a training iteration curve diagram in another embodiment of the present application;
[0045] Figure 6 This is a schematic diagram of the prediction results of the training set in another embodiment of the present application;
[0046] Figure 7 This is the confusion matrix of the training set in another embodiment of the present application;
[0047] Figure 8 This is a schematic diagram of test set prediction results in another embodiment of the present application;
[0048] Fig. 9 This is a test set confusion matrix in another embodiment of the present application;
[0049] Fig.10 This is a structural block diagram of a user industry category identification device in another embodiment of the present application. DETAILED DESCRIPTION
[0050] Various aspects and features of the present application are described herein with reference to the accompanying drawings.
[0051] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.
[0052] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0053] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.
[0054] It should also be understood that although the present application has been described with reference to some specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the present application.
[0055] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
[0056] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.
[0057] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.
[0058] The present application embodiment provides a method for identifying the industry category of a user, which can be specifically applied to electronic devices such as terminals and servers. Figure 1 As shown, the method in this embodiment includes the following steps:
[0059] Step S101, collecting some initial air conditioning load data of the target user to obtain an initial air conditioning load vector;
[0060] In this step, the air conditioning load data may specifically be power parameters such as the power consumption of the air conditioner. When collecting the air conditioning load data, the power consumption of the air conditioner is collected within a predetermined time range and at a predetermined time interval to obtain a number of initial air conditioning load data, and then the initial air conditioning load data may be sorted according to the collection time of each initial air conditioning load data, so as to obtain an initial air conditioning load vector. The predetermined time range may be 24 hours, 48 hours, etc. The predetermined time interval may be 10 minutes, 15 minutes, 20 minutes, 30 minutes, etc., and may be set and adjusted according to actual needs.
[0061] Step S102, based on each initial air conditioning load data in the initial air conditioning load vector, a data conversion process is performed using a Gram angle and field conversion method to obtain a target image corresponding to the initial air conditioning load vector, so as to obtain a target image corresponding to the target user;
[0062] In this step, the corresponding polar coordinates of each initial air-conditioning load data can be calculated respectively, and then the initial air-conditioning load vector can be converted into a target image based on the polar coordinates corresponding to each initial load data, so as to facilitate the subsequent use of the target classification model to extract features of the target image and identify industry categories.
[0063] Step S103, using a pre-trained target classification model to extract features from the target image to obtain a target feature image, and based on the target feature image, identifying the industry category of the target user to obtain a target recognition result.
[0064] In this step, the industry categories may specifically include: business, hotel management, property, electricity, real estate, supermarkets, government buildings, hotels, public facilities and other industries, etc. The target classification model may specifically be a classification model based on the ResNet-18 neural network architecture. In this step, by utilizing the target classification model based on the ResNet-18 neural network architecture, the target image can be accurately extracted for features, and subsequently the industry category can be accurately identified based on the extracted target feature image.
[0065] The user industry category identification method in this embodiment can accurately convert the initial air-conditioning load vector into a two-dimensional image by using the Gram angle and field to perform data conversion processing on the initial air-conditioning load vector. The two-dimensional image can then be input into a target classification model, and the target classification model can be used to perform feature extraction and industry category classification / identification, so that the industry category of the target user can be accurately and quickly determined, thereby achieving accurate classification / identification of the target user's industry category based on air-conditioning load data.
[0066] On the basis of the above embodiments, another embodiment of the present application provides a method for identifying a user industry category. In this embodiment, based on each initial air conditioning load data in the initial air conditioning load vector, a data conversion process is performed using the Gram angle and field conversion method to obtain a target image corresponding to the initial air conditioning load vector, so as to obtain a target image corresponding to the target user, that is, when executing step S102, the specific process is as follows:
[0067] Step S1021, normalizing each of the initial air conditioning load data in the initial air conditioning load vector to obtain normalized target air conditioning load data corresponding to each of the initial air conditioning load data, so as to obtain a normalized target air conditioning load vector;
[0068] In this step, the minimum-maximum scaler can be used for normalization processing to scale the data range to a new air conditioning load vector within the interval [-1,1]. That is, the initial air conditioning load vector A i ={a i,1 ,a i,2 ,...,a i,j} each of the initial air conditioning load data a i,j , using the predetermined normalization formula, calculate and obtain Thus, the normalized target air conditioning load data is obtained. To obtain the normalized target air conditioning load vector Among them, the predetermined normalization formula is:
[0069]
[0070] Among them, A i represents the initial air conditioning load vector of the i-th user in the original building; is the new air conditioning load vector / target air conditioning load vector of the i-th user after normalization; a i,j is the jth eigenvalue in the initial air-conditioning load vector of the i-th user (the j-th initial air-conditioning load data); is the jth eigenvalue in the i-th air-conditioning load vector after normalization (j-th target air-conditioning load data).
[0071] Step S1022, determining the polar coordinates of each target air conditioning load data based on each target air conditioning load data and the collection time corresponding to each target air conditioning load data;
[0072] In this step, the normalized target air conditioning load vector can be encoded in polar coordinates, the scaled acceleration value can be encoded with angle cosine, the air conditioning load characteristic value / target air conditioning load data can be represented by polar coordinate angle cosine, and the value is between [0,π]; the timestamp is represented by radius. In other words, based on each target air conditioning load data And the collection time t corresponding to each target air conditioning load data i,j , using the predetermined polar coordinate calculation formula, calculate the polar coordinate angle ω i,j and the polar radius r i,j , in order to obtain the polar coordinates of the target air conditioning load data. The polar coordinate calculation formula is as follows:
[0073]
[0074]
[0075] Among them, ω i,j is the angle of the jth eigenvalue / target air conditioning load data in the i-th air conditioning load vector converted to polar coordinates; r i,j is the radius of the jth eigenvalue / target air conditioning load data in the i-th air conditioning load vector converted to polar coordinates; t i,j is the timestamp (collection time) corresponding to the jth eigenvalue / target air-conditioning load data in the ith air-conditioning load vector; T is the time normalization constant.
[0076] Step S1023, based on the polar coordinates of each of the target air conditioning load data, converting the initial air conditioning load vector into the target image;
[0077] In the specific implementation process of this step, the target air conditioning load vector The angle ω of the polar coordinates of each target air conditioning load data can be i,j , calculate the cosine value of the Gram angle field and the target air conditioning load vector between any two target air conditioning load data, and obtain The corresponding target Gram matrix G i , to obtain the target image. That is, after the rescaled time series is converted into a polar coordinate system, the time correlation within different time intervals can be identified by considering the trigonometric sum between each point and using the angle, and then further converted into GASF image data. Among them, the target Gram matrix G i for:
[0078]
[0079] In this embodiment, by using the Gram angle and field to convert the user's initial air-conditioning load vector, the target image corresponding to the initial air-conditioning load vector can be accurately and quickly converted, that is, the one-dimensional building air-conditioning load data is converted into a two-dimensional image, which lays the foundation for the subsequent use of the target classification model based on the target image to accurately identify the user's industry category.
[0080] Another embodiment of the present application provides a method for identifying a user industry category. In this embodiment, the target classification model includes a target feature extraction module, a target multi-head attention module, and a target output module. Figure 2 As shown, the target feature extraction module includes an input layer, a convolution layer, a pooling layer maxpool, a first residual module, a second residual module, a third residual module, a fourth residual module, a fifth residual module, a sixth residual module, a seventh residual module, an eighth residual module, an average pooling layer avgpool and a fully connected layer FC connected in series. Figure 3 As shown, each residual module includes a first branch and a second branch connected in parallel; the first branch includes two sub-convolutional layers connected in series; and the second branch includes a 1*1 convolutional layer.
[0081] In this embodiment, when the target classification model obtained by pre-training is used to extract features of the target image to obtain a target feature image, and the industry category of the target user is identified based on the target feature image to obtain a target identification result, that is, when executing step S103, the specific process is as follows:
[0082] Step S1031, extracting features from the target image based on the target feature extraction module to obtain a target feature image;
[0083] In this step, the target image is input into the target feature extraction module, and then the input layer, convolution layer, pooling layer, first residual module, second residual module, third residual module, fourth residual module, fifth residual module, sixth residual module, seventh residual module, eighth residual module, average pooling layer and full connection layer are used in sequence to extract features of the target image to obtain a target feature image. Specifically:
[0084] Input layer: used to receive 3-channel 224*224 RGB image data, that is, receive the target image, and then preprocess it to obtain the preprocessed first image.
[0085] Convolution layer: used to receive the first image output by the input layer, perform feature extraction on the first image, and obtain the first feature image. The convolution kernel size of the convolution layer is 7*7, the step size is 2, the padding is 3, the output channel is 64, and the output data / first feature image size is 64*112*112.
[0086] Pooling layer maxpool: used to receive the first feature image output by the convolution layer, extract features from the first feature image, and obtain the second feature image. Specifically, the data channel of the pooling layer remains unchanged and is also 64, halving the data size. The convolution kernel size is 3*3, the step size is 2, the padding is 1, and the output data / second feature image size is 64*56*56;
[0087] The first residual module is used to receive the second feature image output by the pooling layer, and extract features from the second feature image to obtain the third feature image. The first residual module includes a first branch and a second branch in parallel; the first branch includes a first sub-convolution layer and a second sub-convolution layer in series; the first sub-convolution layer and the second sub-convolution layer are the same, the convolution kernel is 3*3, the step size is 1, the padding is 1, the output channel is 64, and the output data size is 64*56*56. The second branch includes a 1*1 convolution layer, and the output channel of the convolution layer is 64.
[0088] The second residual module is used to receive the third feature image output by the first residual module, and perform feature extraction on the second feature image to obtain the fourth feature image. In this embodiment, the specific structure of the second residual module is the same as that of the first residual module, and also includes a first branch and a second branch connected in parallel; the first branch includes a third sub-convolution layer and a fourth sub-convolution layer connected in series; the third sub-convolution layer is the same as the fourth sub-convolution layer, and the convolution kernel is 3*3, the step size is 1, the padding is 1, the output channel is 64, and the output data size is 64*56*56. The second branch includes a 1*1 convolution layer, and the output channel of the convolution layer is 64.
[0089] The third residual module is used to receive the fourth feature image output by the second residual module, and perform feature extraction on the fourth feature image to obtain the fifth feature image. In this embodiment, the third residual module includes a first branch and a second branch connected in parallel; the first branch includes a fifth sub-convolution layer and a sixth sub-convolution layer connected in series; the fifth sub-convolution layer is the same as the sixth sub-convolution layer, the convolution kernel is 3*3, the step size is 1, the padding is 1, the output channel is 128, and the output data size is 128*28*28. The second branch includes a 1*1 convolution layer, and the output channel of the convolution layer is 128.
[0090] The fourth residual module is used to receive the fifth characteristic image output by the third residual module, and perform feature extraction on the fifth characteristic image to obtain the sixth characteristic image. In this embodiment, the specific structure of the fourth residual module is the same as that of the third residual module, and the fourth residual module also includes a first branch and a second branch in parallel; the first branch includes a seventh sub-convolution layer and an eighth sub-convolution layer in series; the seventh sub-convolution layer is the same as the eighth sub-convolution layer, and the convolution kernel is 3*3, the step size is 1, the padding is 1, the output channel is 128, and the output data size is 128*28*28. The second branch includes a 1*1 convolution layer, and the output channel of the convolution layer is 128.
[0091] The fifth residual module is used to receive the sixth feature image output by the fourth residual module, and perform feature extraction on the sixth feature image to obtain the seventh feature image. In this embodiment, the fifth residual module includes a first branch and a second branch in parallel; the first branch includes a ninth sub-convolution layer and a tenth sub-convolution layer in series; the ninth sub-convolution layer is the same as the tenth sub-convolution layer, and the convolution kernel is 3*3, the step size is 1, the padding is 1, the output channel is 256, and the output data size is 256*14*14. The second branch includes a 1*1 convolution layer, and the output channel of the convolution layer is 256.
[0092] The sixth residual module is used to receive the seventh feature image output by the fifth residual module, and perform feature extraction on the seventh feature image to obtain the eighth feature image. The specific structure of the sixth residual module in this embodiment is the same as that of the fifth residual module, and the fourth and sixth residual modules also include a first branch and a second branch in parallel; the first branch includes an eleventh sub-convolution layer and a twelfth sub-convolution layer in series; the eleventh sub-convolution layer is the same as the twelfth sub-convolution layer, and the convolution kernel is 3*3, the step size is 1, the padding is 1, the output channel is 256, and the output data size is 256*14*14. The second branch includes a 1*1 convolution layer, and the output channel of the convolution layer is 256.
[0093] The seventh residual module is used to receive the eighth feature image output by the sixth residual module, and perform feature extraction on the eighth feature image to obtain a ninth feature image. In this embodiment, the seventh residual module includes a first branch and a second branch in parallel; the first branch includes a thirteenth sub-convolution layer and a fourteenth sub-convolution layer in series; the thirteenth sub-convolution layer is the same as the fourteenth sub-convolution layer, the convolution kernel is 3*3, the step size is 1, the padding is 1, the output channel is 512, and the output data size is 512*7*7. The second branch includes a 1*1 convolution layer, and the output channel of the convolution layer is 512.
[0094] The eighth residual module is used to receive the ninth feature image output by the seventh residual module, and perform feature extraction on the ninth feature image to obtain the tenth feature image. In this embodiment, the eighth residual module has the same structure as the seventh residual module, that is, the seventh residual module includes a first branch and a second branch in parallel; the first branch includes a fifteenth sub-convolution layer and a sixteenth sub-convolution layer in series; the fifteenth sub-convolution layer is the same as the sixteenth sub-convolution layer, the convolution kernel is 3*3, the step size is 1, the padding is 1, the output channel is 512, and the output data size is 512*7*7. The second branch includes a 1*1 convolution layer, and the output channel of the convolution layer is 512.
[0095] Average pooling layer avgpool: used to receive the tenth feature image output by the eighth residual module, and perform global average pooling on the tenth feature map, convert the tenth feature map into a one-dimensional vector, obtain the eleventh feature map, and finally output the eleventh feature map as 512*1*1;
[0096] Fully connected layer FC: used to receive the eleventh feature map output by the average pooling layer and summarize it to output the target feature image with a size of 1000.
[0097] In this embodiment, by adopting the convolutional neural network architecture in this embodiment for feature extraction, the extracted target feature image can be made more accurate and reliable, laying the foundation for the subsequent accurate identification of user industry categories based on the target feature image.
[0098] Step S1032, performing attention calculation on the target feature image based on the target multi-head attention module to obtain an initial recognition result of the industry category;
[0099] In this step, the target feature image can be recognized based on each attention head in the target multi-head attention module to obtain a first recognition result corresponding to each attention head, and then the first recognition results can be merged / joined based on the attention weight of each attention head to obtain an initial recognition result.
[0100] In this step, the multi-head attention mechanism / multi-head attention module imitates human visual attention, focusing on key features in the input data and outputting representation information across different subspaces. The attention mechanism consists of query (Q), key (K), and value (V) vectors, which are mainly represented by the mapping of the query vector to a series of key-value pairs. For each head, the scaled dot product attention function is used to calculate the similarity between the query vector Q and the key vector K, thereby deriving the attention weight.
[0101] That is, we can use formula (5) and formula (6) to first calculate the query (Q) weight matrix W corresponding to the nth attention head: Q,n , the weight matrix W of the key (K) K,n The weight matrix W of the sum value (V) V,n . Then according to the weight matrix W of the nth attention head Q,n , W K,n and W V,n , calculate the attention weight I of the nth attention head n Finally, according to the attention weight I of each attention head n And the first recognition results of each attention head are combined to obtain the final initial recognition result using the recognition result merging formula / concatenation function; that is, after each head independently performs attention calculation and generates output, the output is merged through linear transformation to obtain the final output of the multi-head attention mechanism. Among them, the attention head weight calculation formula is:
[0102]
[0103] I n =Attention(QW Q,n ,KW K,n ,VW V,n )(6)
[0104] Among them, d k is a matrix consisting of the dimensions of each key; F softmax is the softmax function; W Q,n , W K,n , W V,n are the weight matrices of the query (Q), key (K), and value (V) of the nth head respectively; I n is the attention weight of the nth head.
[0105] The recognition result merging formula is:
[0106] MA(Q,K,V)=F concat (I1,I2,...,I n ) (7)
[0107] Among them, F concatis the characteristic concatenation function.
[0108] Step S1033, classify and identify the initial recognition result based on the target output module to obtain the target industry category to obtain the target recognition result.
[0109] In this step, by further classifying and identifying the initial recognition results based on the target output module, the target recognition results finally obtained can be made more accurate and reliable, and the accurate classification of user industry categories based on air-conditioning load data can be achieved.
[0110] In the specific implementation process of this embodiment, before collecting some initial air conditioning load data of the target user to obtain the initial air conditioning load vector, that is, before executing step S101, the target classification model can also be pre-trained. The training process of the target classification model in this embodiment is:
[0111] Step 1: Collect a number of initial sample air conditioning load data of each sample user to obtain an initial sample air conditioning load vector corresponding to each sample user;
[0112] Step 2: Based on each initial sample air-conditioning load data in the same initial sample air-conditioning load vector, a data conversion process is performed using a Gram angle and field conversion method to obtain a sample image corresponding to each of the initial air-conditioning load vectors, so as to obtain a sample image corresponding to each of the sample users;
[0113] Step three: Based on the sample images of each of the sample users and the industry category labels of each of the sample users, the initial classification model is trained to obtain the target classification model.
[0114] In the specific implementation process of this step, the feature extraction of each sample image can be performed based on the initial feature extraction module in the initial classification model to obtain a sample feature image corresponding to each sample image; the attention calculation can be performed on each sample feature image based on the initial multi-head attention module in the initial classification model to obtain an initial sample recognition result corresponding to each sample feature image; then, each initial sample recognition result is classified and recognized based on the initial output module in the initial classification model to obtain the industry category of the sample user to obtain the initial target sample recognition result; finally, based on the industry category label corresponding to each sample user and the initial target sample recognition result, the model parameters in the initial classification model are adjusted to obtain the current classification model, so as to re-perform feature extraction, attention calculation and classification recognition on each sample image based on the current classification model to obtain the current target sample recognition result, until it is determined based on the current target sample recognition result that the predetermined training stop condition is met, and the current classification model is used as the target classification model.
[0115] The following is an explanation of the user industry category identification method in this application in combination with specific application scenarios. Figure 4 As shown, the method in this embodiment includes the following steps:
[0116] Step 1: Obtain multi-day building air conditioning load data of each sample user in each industry category to obtain a building air conditioning load data set;
[0117] In this step, the building air conditioning load data set is specifically: a data set consisting of 5,000 user sample air conditioning load vectors with industry type labels in July and August, where each user corresponds to one or more sample air conditioning load vectors. Each sample air conditioning load vector contains 96 time series feature values (that is, each sample air conditioning load vector contains 96 sample air conditioning load data), and one feature value / sample air conditioning load data is collected every 15 minutes throughout the day. Each user is configured with a corresponding industry category label, and the industry categories include: business, hotel management, property, electricity, real estate, supermarkets, government buildings, hotels, public facilities and other industries.
[0118] Step 2: Use the Gram Angle Sum Field (GASF) to convert the one-dimensional sample air conditioning load vector of each user into a two-dimensional feature map / sample image to obtain a building air conditioning load image modal dataset, and retain the industry category label of each sample image;
[0119] In this step, the one-dimensional sample air conditioning load vector of each user is converted into a two-dimensional feature map / sample image by using the Gram Angle Sum Field (GASF), and the specific steps are as follows:
[0120] S01, for each user's initial air conditioning load vector A in the building air conditioning load data set i ={a i,1 ,a i,2 ,...,a i,m}, use the minimum-maximum scaler to normalize and scale the data range to a new air conditioning load vector in the interval [-1,1] Among them, A i is the i-th initial sample air conditioning load vector; is the new air conditioning load vector of the i-th target sample after normalization; a i,j is the jth eigenvalue in the i-th initial sample air conditioning load vector; is the jth eigenvalue in the i-th target sample air conditioning load vector after normalization.
[0121] S02, air conditioning load vector after encoding and normalization on polar coordinates The scaled acceleration value is encoded with the angle cosine, and the characteristic value of the air conditioning load of each target sample is Expressed as polar coordinate angle cosine, the target sample air conditioning load characteristic value is obtained The corresponding sample angle ω i,j and the sample radius r i,j , the value is between [0,π]; the timestamp is expressed in radius.
[0122]
[0123] Among them, t i,j is the timestamp / collection time corresponding to the jth target sample air-conditioning load characteristic value in the i-th target sample air-conditioning load vector; T is the time normalization constant.
[0124] S03, after the rescaled time series is converted into a polar coordinate system, it is further converted into GASF image data G by considering the trigonometric sum between each point and using the angle to identify the temporal correlation within different time intervals. i .
[0125]
[0126] Step 3: Divide the building air conditioning image modal dataset into a training set and a test set according to a preset ratio;
[0127] In this step, the building air conditioning load data set can be divided into a training set and a test set in a ratio of 80% / 20%.
[0128] Step 4: Based on the idea of transfer learning, each sample image in the training set is input into the initial classification model, and feature extraction, attention calculation and classification recognition are performed on each sample image based on the initial classification model to output the initial target sample recognition result corresponding to each sample image;
[0129] In this step, the initial classification model includes: an initial feature extraction module, an initial multi-head attention module and an initial output module. The initial feature extraction module includes an initial input layer, an initial convolution layer, an initial pooling layer, an initial first residual module, an initial second residual module, an initial third residual module, an initial fourth residual module, an initial fifth residual module, an initial sixth residual module, an initial seventh residual module, an initial eighth residual module, an initial average pooling layer and an initial fully connected layer connected in series in sequence. Among them, each residual module includes a first branch and a second branch connected in parallel respectively; the first branch includes two sub-convolution layers connected in series; the second branch includes a 1*1 convolution layer.
[0130] In this embodiment, the specific process of feature extraction, attention calculation and classification recognition of sample images based on the initial classification model is similar to the process of feature extraction, attention calculation and classification recognition of target images based on the target classification model in the above embodiment, and will not be repeated here.
[0131] Step 5. Based on the industry category label corresponding to each sample user and the initial target sample recognition result, the model parameters in the initial classification model are adjusted to obtain the current classification model, and the feature extraction, attention calculation and classification recognition are re-performed on each sample image in the training set based on the current classification model to obtain the current target sample recognition result. When it is determined that the predetermined training stop condition is met based on the current target sample recognition result, each sample image in the test set is input into the current classification model, and the feature extraction, attention calculation and classification recognition are re-performed on each sample image in the test set based on the current classification model to test the accuracy of the current classification model, thereby obtaining the target classification model.
[0132] In this step, the optimization algorithm uses the Adam gradient descent algorithm, the maximum number of training rounds is 200 rounds, the initial learning rate is 0.001, and the learning rate drops to 0.0001 after the number of rounds reaches 180. The training iteration curve is as follows: Figure 5 shown.
[0133] Specifically, the training set prediction results and the training set confusion matrix of this embodiment are as follows: Figure 6 , Figure 7 As shown, the classification prediction accuracy of the training set reached 98.7429%. The first category of industry (commercial) had the largest amount of user data, including 34 data that were misclassified into the seventh category (government building) industry.
[0134] Input the test set data to verify the model training results. The test set prediction results and the test set confusion matrix are as follows: Figure 8 , Fig. 9 As shown, the classification prediction accuracy of the test set reached 90.4%, among which the first category (commercial) industry and the seventh category (government building) industry had the largest data volume and good training effect, with accuracy rates reaching 94.1% and 97.6% respectively.
[0135] Step 6: Collect some initial air conditioning load data of the target user to obtain an initial air conditioning load vector;
[0136] Step 7: Based on each initial air conditioning load data in the initial air conditioning load vector, a Gram angle and field conversion method is used to perform data conversion processing to obtain a target image corresponding to the initial air conditioning load vector, so as to obtain a target image corresponding to the target user;
[0137] Step eight: extract features of the target image using a pre-trained target classification model to obtain a target feature image, and identify the industry category of the target user based on the target feature image to obtain a target recognition result.
[0138] In this embodiment, the Gram angle and field are used to convert the one-dimensional building air-conditioning load data into a two-dimensional feature map to achieve data dimensionality upgrade. The introduction of a multi-head attention mechanism / multi-head attention module can enhance the attention to key features of the data. Based on the idea of transfer learning, a pre-trained ResNet-18 neural network is used to realize the industry classification and identification of building air-conditioning loads. This can more effectively extract key features from complex and changeable building air-conditioning load data, thereby improving the accuracy of industry classification and identification, helping managers to accurately identify the nature of the building industry and dynamically adjust the operation strategy of the air-conditioning system.
[0139] Another embodiment of the present application provides a user industry category identification device, such as Fig.10 As shown, including:
[0140] The collection module 11 is used to collect some initial air conditioning load data of the target user to obtain an initial air conditioning load vector;
[0141] A conversion module 12 is used to perform data conversion processing based on each initial air conditioning load data in the initial air conditioning load vector by using a Gram angle and field conversion method to obtain a target image corresponding to the initial air conditioning load vector, so as to obtain a target image corresponding to a target user;
[0142] The recognition module 13 is used to extract features from the target image using a pre-trained target classification model to obtain a target feature image, and to identify the industry category of the target user based on the target feature image to obtain a target recognition result.
[0143] In the specific implementation process of this embodiment, the conversion module specifically includes a normalization unit, a determination unit and a conversion unit for;
[0144] The normalization unit is used to: perform normalization processing on each of the initial air conditioning load data in the initial air conditioning load vector to obtain normalized target air conditioning load data corresponding to each of the initial air conditioning load data, so as to obtain a normalized target air conditioning load vector;
[0145] The determining unit is used to: determine the polar coordinates of each target air conditioning load data based on each target air conditioning load data and the collection time corresponding to each target air conditioning load data;
[0146] The conversion unit is used to convert the initial air conditioning load vector into the target image based on the polar coordinates of each target air conditioning load data.
[0147] In the specific implementation process of this embodiment, the conversion unit is specifically used to: calculate the cosine value of the Gram angular field sum between any two target air conditioning load data based on the angle of the polar coordinates of each target air conditioning load data, obtain the target Gram matrix, and obtain the target image.
[0148] In the specific implementation process of this embodiment, the target classification model includes a target feature extraction module, a target multi-head attention module and a target output module; the recognition module is specifically used to: extract features of the target image based on the target feature extraction module to obtain a target feature image; perform attention calculation on the target feature image based on the target multi-head attention module to obtain an initial recognition result of the industry category; classify and identify the initial recognition result based on the target output module to obtain the target industry category, so as to obtain the target recognition result.
[0149] In the specific implementation process of this embodiment, the target feature extraction module includes an input layer, a convolution layer, a pooling layer, a first residual module, a second residual module, a third residual module, a fourth residual module, a fifth residual module, a sixth residual module, a seventh residual module, an eighth residual module, an average pooling layer and a fully connected layer connected in series in sequence;
[0150] Among them, each residual module includes a first branch and a second branch connected in parallel; the first branch includes two sub-convolutional layers connected in series; and the second branch includes a 1*1 convolutional layer.
[0151] In the specific implementation process of this embodiment, the user industry category identification device also includes a training module for pre-training to obtain the target classification model, and the training module is used to: collect a number of initial sample air-conditioning load data of each sample user to obtain an initial sample air-conditioning load vector corresponding to each sample user; based on each initial sample air-conditioning load data in the same initial sample air-conditioning load vector, use the Gram angle and field conversion method to perform data conversion processing to obtain a sample image corresponding to each initial air-conditioning load vector to obtain a sample image corresponding to each sample user; based on the sample image of each sample user and the industry category label of each sample user, perform model training on the initial classification model to obtain the target classification model.
[0152] In the specific implementation process of this embodiment, the training module is specifically used to: perform feature extraction on each of the sample images based on the initial feature extraction module in the initial classification model to obtain a sample feature image corresponding to each sample image; perform attention calculation on each of the sample feature images based on the initial multi-head attention module in the initial classification model to obtain an initial sample recognition result corresponding to each sample feature image; classify and identify each of the initial sample recognition results based on the initial output module in the initial classification model to obtain the industry category of the sample user to obtain an initial target sample recognition result; adjust the model parameters in the initial classification model based on the industry category label corresponding to each sample user and the initial target sample recognition result to obtain a current classification model, so as to re-perform feature extraction, attention calculation and classification recognition on each sample image based on the current classification model to obtain the current target sample recognition result, until it is determined based on the current target sample recognition result that a predetermined training stop condition is met, and the current classification model is used as the target classification model.
[0153] The user industry category identification device in this embodiment can accurately convert the initial air-conditioning load vector into a two-dimensional image by performing data conversion processing on the initial air-conditioning load vector using the Gram angle and field. The two-dimensional image can then be input into a target classification model, and the target classification model can be used to perform feature extraction and industry category classification / identification, thereby accurately and quickly determining the industry category of the target user, thereby achieving accurate classification / identification of the target user's industry category based on the air-conditioning load data.
[0154] Another embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the following method steps are implemented:
[0155] Step 1: Collect some initial air conditioning load data of the target user to obtain an initial air conditioning load vector;
[0156] Step 2: Based on each initial air conditioning load data in the initial air conditioning load vector, a Gram angle and field conversion method is used to perform data conversion processing to obtain a target image corresponding to the initial air conditioning load vector, so as to obtain a target image corresponding to the target user;
[0157] Step three: use the pre-trained target classification model to extract features from the target image to obtain a target feature image, and identify the industry category of the target user based on the target feature image to obtain a target recognition result.
[0158] The specific implementation process of the above method steps can refer to the embodiments of any of the above-mentioned user industry category identification methods, and this embodiment will not be repeated here.
[0159] The storage medium in the present application can accurately convert the initial air-conditioning load vector into a two-dimensional image by using the Gram angle and field to perform data conversion processing on the initial air-conditioning load vector. The two-dimensional image can then be input into a target classification model, and the target classification model can be used to perform feature extraction and industry category classification / identification, so that the industry category of the target user can be accurately and quickly determined, thereby achieving accurate classification / identification of the target user's industry category based on the air-conditioning load data.
[0160] Another embodiment of the present application provides an electronic device, comprising at least a memory and a processor, wherein the memory stores a computer program, and the processor implements the following method steps when executing the computer program in the memory:
[0161] Step 1: Collect some initial air conditioning load data of the target user to obtain an initial air conditioning load vector;
[0162] Step 2: Based on each initial air conditioning load data in the initial air conditioning load vector, a Gram angle and field conversion method is used to perform data conversion processing to obtain a target image corresponding to the initial air conditioning load vector, so as to obtain a target image corresponding to the target user;
[0163] Step three: use the pre-trained target classification model to extract features from the target image to obtain a target feature image, and identify the industry category of the target user based on the target feature image to obtain a target recognition result.
[0164] The specific implementation process of the above method steps can refer to the embodiments of any of the above-mentioned user industry category identification methods, and this embodiment will not be repeated here.
[0165] The electronic device in the present application can accurately convert the initial air-conditioning load vector into a two-dimensional image by performing data conversion processing on the initial air-conditioning load vector using the Gram angle and field. The two-dimensional image can then be input into a target classification model, and the target classification model can be used to perform feature extraction and industry category classification / identification, thereby accurately and quickly determining the industry category of the target user, thereby achieving accurate classification / identification of the target user's industry category based on the air-conditioning load data.
[0166] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.
Claims
1. A method for identifying user industry categories, characterized in that: include: Collecting some initial air conditioning load data of target users to obtain an initial air conditioning load vector; Based on each initial air conditioning load data in the initial air conditioning load vector, a data conversion process is performed using the Gram angle and field conversion method to obtain a target image corresponding to the initial air conditioning load vector, so as to obtain a target image corresponding to the target user; The target classification model obtained through pre-training is used to extract features of the target image to obtain a target feature image, and the industry category of the target user is identified based on the target feature image to obtain a target recognition result.
2. The method according to claim 1, characterized in that The method of performing data conversion processing based on each initial air conditioning load data in the initial air conditioning load vector by using the Gram angle and field conversion method to obtain a target image corresponding to the initial air conditioning load vector, so as to obtain a target image corresponding to the target user, specifically includes: Normalizing each of the initial air conditioning load data in the initial air conditioning load vector to obtain normalized target air conditioning load data corresponding to each of the initial air conditioning load data, so as to obtain a normalized target air conditioning load vector; Determining the polar coordinates of each target air conditioning load data based on each target air conditioning load data and the collection time corresponding to each target air conditioning load data; Based on the polar coordinates of each of the target air conditioning load data, the initial air conditioning load vector is converted into the target image.
3. The method according to claim 2, characterized in that The converting the initial air conditioning load vector into the target image based on the polar coordinates of each target air conditioning load data specifically includes: Based on the angle of the polar coordinates of each of the target air-conditioning load data, the cosine value of the Gram angular field sum between any two target air-conditioning load data is calculated to obtain a target Gram matrix, so as to obtain the target image.
4. The method according to claim 1, characterized in that The target classification model includes a target feature extraction module, a target multi-head attention module and a target output module; The method of extracting features from the target image using the pre-trained target classification model to obtain a target feature image, and identifying the industry category of the target user based on the target feature image to obtain a target recognition result specifically includes: Extracting features from the target image based on the target feature extraction module to obtain a target feature image; Performing attention calculation on the target feature image based on the target multi-head attention module to obtain an initial recognition result of the industry category; The initial recognition result is classified and recognized based on the target output module to obtain the target industry category to obtain the target recognition result.
5. The method according to claim 1, characterized in that The target feature extraction module includes an input layer, a convolution layer, a pooling layer, a first residual module, a second residual module, a third residual module, a fourth residual module, a fifth residual module, a sixth residual module, a seventh residual module, an eighth residual module, an average pooling layer and a fully connected layer connected in series in sequence; Among them, each residual module includes a first branch and a second branch connected in parallel; the first branch includes two sub-convolutional layers connected in series; and the second branch includes a 1*1 convolutional layer.
6. The method according to claim 1, characterized in that Before collecting a number of initial air conditioning load data of the target user, the method further includes: pre-training to obtain the target classification model, specifically including: Collecting a number of initial sample air conditioning load data of each sample user to obtain an initial sample air conditioning load vector corresponding to each sample user; Based on each initial sample air conditioning load data in the same initial sample air conditioning load vector, a data conversion process is performed using a Gram angle and field conversion method to obtain a sample image corresponding to each of the initial air conditioning load vectors, so as to obtain a sample image corresponding to each of the sample users; Based on the sample images of each of the sample users and the industry category labels of each of the sample users, the initial classification model is trained to obtain the target classification model.
7. The method according to claim 6, characterized in that The training of the initial classification model based on the sample images of the sample users and the industry category labels of the sample users to obtain the target classification model specifically includes: Extract features from each of the sample images based on an initial feature extraction module in the initial classification model to obtain a sample feature image corresponding to each sample image; Performing attention calculation on each of the sample feature images based on the initial multi-head attention module in the initial classification model, and obtaining the initial sample recognition result corresponding to each of the sample feature images; Classify and identify each of the initial sample recognition results based on the initial output module in the initial classification model to obtain the industry category of the sample user, so as to obtain the initial target sample recognition result; Based on the industry category labels corresponding to each sample user and the initial target sample recognition results, the model parameters in the initial classification model are adjusted to obtain the current classification model, and then feature extraction, attention calculation and classification recognition are re-performed on each sample image based on the current classification model to obtain the current target sample recognition result, until it is determined based on the current target sample recognition result that the predetermined training stop condition is met, and the current classification model is used as the target classification model.
8. A user industry category identification device, characterized in that: include: A collection module, used to collect some initial air conditioning load data of target users to obtain an initial air conditioning load vector; A conversion module, used for performing data conversion processing based on each initial air conditioning load data in the initial air conditioning load vector by using a Gram angle and field conversion method to obtain a target image corresponding to the initial air conditioning load vector, so as to obtain a target image corresponding to a target user; The recognition module is used to extract features of the target image using a pre-trained target classification model to obtain a target feature image, and to identify the industry category of the target user based on the target feature image to obtain a target recognition result.
9. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the user industry category identification method described in any one of claims 1 to 7 are implemented.
10. An electronic device, characterized in that: The method at least comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the user industry category identification method as described in any one of claims 1 to 7 when executing the computer program on the memory.