Data processing method, device, electronic device and storage medium
By extracting static and dynamic features and combining them with target classification models to detect users' electricity usage, the unresolved problems of illegal power supply and usage detection in existing technologies are solved, and fast, accurate and automated illegal power supply and usage detection is achieved, thereby improving detection efficiency and accuracy.
Patent Information
- Application Number
- CN202210297653.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-03-24
AI Technical Summary
In the existing technology, the detection method of illegal power supply and use has the problems of inaccurate inspection and low efficiency, and lacks timeliness and generalization.
By obtaining the static and dynamic electricity consumption data of the target user, the static features and dynamic features are extracted using the static feature extraction model and the dynamic feature extraction model, and then classified in combination with the target classification model to determine the user's electricity consumption.
It achieves fast, accurate and automated detection of illegal power supply and use, improving detection efficiency and accuracy.
Smart Images

Figure CN114707586B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a data processing method, device, electronic device, and storage medium. Background Art
[0002] In daily life, there are a large number of illegal electricity usage operations, such as privately transferring power supply lines, randomly pulling wires, high-priced and low-cost connections, and using electricity that does not meet specifications. These behaviors will pose a major safety hazard. Therefore, it is necessary to screen users who violate the regulations on electricity supply to reduce safety hazards.
[0003] Currently, manual inspections are usually carried out one by one to check suspected illegal electricity users. However, this inspection method has problems such as inaccuracy and low efficiency. Alternatively, the electricity consumption data of each user can be checked through manual experience and prior knowledge, but this method lacks timeliness and generalization.
[0004] In order to accurately and quickly identify users who violate the regulations on electricity supply and use, it is necessary to improve the detection method of illegal electricity use. Summary of the Invention
[0005] The present invention provides a data processing method, device, electronic equipment and storage medium to achieve the effect of quickly, accurately and automatically determining whether there is an abnormality in power supply and use.
[0006] In a first aspect, an embodiment of the present invention provides a data processing method, including:
[0007] Obtaining a target user's data set to be detected; wherein the data set to be detected includes static data and dynamic data, wherein the static data is basic information that does not change with time, and the dynamic data is electricity consumption-related data that changes with time;
[0008] Performing static feature extraction on the static data based on a static feature extraction model to obtain target static features output by the static feature extraction model;
[0009] Based on the dynamic data and the generation time corresponding to each dynamic data, determining dynamic sequence data corresponding to each dynamic data, and performing dynamic feature extraction on the dynamic sequence data based on a dynamic feature extraction model to obtain at least one set of dynamic features;
[0010] Based on the target classification model, the target static features and the at least one group of dynamic features are processed to obtain a target classification result; wherein the target classification result includes normal power consumption or abnormal power consumption.
[0011] In a second aspect, an embodiment of the present invention further provides a data processing device, including:
[0012] A module for acquiring a data set to be detected is used to obtain a data set to be detected of a target user; wherein the data set to be detected includes static data and dynamic data, wherein the static data is basic information that does not change with time, and the dynamic data is electricity consumption-related data that changes with time;
[0013] A static feature determination module, configured to extract static features from the static data based on a static feature extraction model to obtain target static features output by the static feature extraction model;
[0014] a dynamic feature determination module, configured to determine, based on the dynamic data and the generation time corresponding to each dynamic data, dynamic sequence data corresponding to the dynamic data, and extract dynamic features from the dynamic sequence data based on a dynamic feature extraction model to obtain at least one set of dynamic features;
[0015] The classification result determination module is used to process the target static features and the at least one group of dynamic features based on the target classification model to obtain a target classification result; wherein the target classification result includes normal power consumption or abnormal power consumption.
[0016] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising:
[0017] one or more processors;
[0018] a storage device for storing one or more programs,
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method as described in any one of the embodiments of the present invention.
[0020] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute the data processing method as described in any one of the embodiments of the present invention.
[0021] The technical solution of this embodiment obtains the target user's data set to be detected, and determines the static data and dynamic data corresponding to the target user, so as to determine the target static features from the static data, and determine at least one group of dynamic features from the dynamic data. Static feature extraction is performed on the static data based on the static feature extraction model to obtain the target static features output by the static feature extraction model, and the static data is reconstructed by the static feature extraction model. When the loss value corresponding to the loss function is minimized, the obtained static data can be used as the target static features. Based on the dynamic data and the generation time corresponding to each dynamic data, the dynamic sequence data corresponding to each dynamic data is determined, and dynamic feature extraction is performed on the dynamic sequence data based on the dynamic feature extraction model to obtain at least one group of dynamic features. Based on each generation time corresponding to the dynamic data, the graph data structure corresponding to each time is determined, and further the target graph data structure can be obtained. Then, matrixization is performed based on the target graph data structure to obtain a target matrix, so as to determine at least one group of dynamic features based on the target matrix. Based on the target classification model, the target static features and the at least one set of dynamic features are processed to obtain a target classification result. The target static features and the at least one set of dynamic features are then fused to obtain a fused feature. The fused feature is then input into the target classification model, and the fused feature is classified based on preset labels to determine the target classification result corresponding to the target user. This solves the problem of low detection efficiency and accuracy when manually determining whether a user has abnormal electricity usage, and achieves the effect of quickly, accurately, and automatically detecting whether a user has abnormal electricity supply and use. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings introduced here only illustrate some of the embodiments to be described by the present invention, and are not exhaustive. A person skilled in the art can derive other drawings based on these drawings without inventive effort.
[0023] Figure 1 A flowchart of a data processing method provided in the first embodiment of the present invention;
[0024] Figure 2 A schematic diagram of a graph data structure to be integrated provided in the first embodiment of the present invention;
[0025] Figure 3 A schematic diagram of a target graph data structure provided by the first embodiment of the present invention;
[0026] Figure 4 A flowchart of a data processing method provided in the second embodiment of the present invention;
[0027] Figure 5 A flowchart of a data processing method provided in Embodiment 3 of the present invention;
[0028] Figure 6 A schematic structural diagram of a data processing device provided in a fourth embodiment of the present invention;
[0029] Figure 7 This is a structural diagram of an electronic device provided in Example 5 of the present invention. DETAILED DESCRIPTION
[0030] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.
[0031] Example 1
[0032] Figure 1 This is a flow chart of a data processing method provided in the first embodiment of the present invention. This embodiment is applicable to the case of detecting whether there is any abnormality in the user's power supply and use. The method can be executed by a data processing device, which can be implemented in the form of software and / or hardware. The hardware can be an electronic device, such as a mobile terminal or a PC.
[0033] like Figure 1 As shown, the method includes:
[0034] S110: Obtain a target user's dataset to be tested.
[0035] In the entire power grid system, power can be supplied to various users, such as corporate users or household users. When determining whether the power supply lines currently used by each user are in compliance with power usage specifications, it is necessary to detect the power supply lines used by each user. The target user can be understood as the user who performs power supply line detection. The data set to be detected can be understood as a collection of data information corresponding to the target user. The data set to be detected includes static data and dynamic data. Taking corporate users as an example, static data can be understood as basic information corresponding to corporate users that does not change with time, such as the name information, scale information, and whether the distribution system is used by the corporate user; dynamic data can be understood as electricity-related data corresponding to corporate users that changes with time, such as current information, voltage information, and charge information.
[0036] Specifically, the power grid system stores data related to each user, such as static data. During a user's electricity usage, the grid system automatically acquires dynamic data associated with each user, i.e., their electricity usage information. To determine whether any user in the grid system is engaging in irregular electricity usage, such as unauthorized power line diversion, each user's power lines can be inspected.
[0037] Exemplarily, the target user that needs to be identified at present is determined, and a data set to be detected corresponding to the target user is obtained from the power grid system, wherein the data set to be detected includes basic information such as name information and scale information corresponding to the target user, and also includes dynamic data information corresponding to the target user, such as electricity consumption information within a period of time.
[0038] Optionally, obtaining the target user's data set to be detected includes: obtaining the data set to be detected corresponding to the target user, and obtaining at least one data to be detected in the data set to be detected; and determining the static data and dynamic data in the data to be detected based on the correspondence between each data to be detected and the data type in the target mapping table.
[0039] The data to be detected can be understood as static data and dynamic data in the data set to be detected. In order to determine whether the data type of each data to be detected is static data or dynamic data, a target mapping table can be pre-set. The target mapping table includes the data types of each data to be detected, including static data types and dynamic data types, and each data to be detected matches each data type. The data to be detected and the corresponding data types are stored in the target mapping table, and the data type of the data to be detected is determined to be static data or dynamic data according to the target mapping table.
[0040] Specifically, to determine the target user's corresponding dataset, the target user's corresponding dataset is first retrieved from the power grid system's database based on the target user's identification information. The dataset contains multiple pieces of data, including static and dynamic data. Based on the pre-stored correspondence between each piece of data and a data type in the target mapping table, the corresponding data type can be determined, as can whether each piece of data is static or dynamic. Furthermore, the dataset can be divided into static and dynamic data sets.
[0041] S120 , performing static feature extraction on the static data based on a static feature extraction model to obtain target static features output by the static feature extraction model.
[0042] The static feature extraction model can be understood as a model used to extract features from static data. Target static features can be obtained based on the static feature extraction model. For example, the static feature extraction model can be an autoencoder. When extracting features from each static data using the static feature extraction model, a static dataset can be constructed based on a small amount of static data. Therefore, the static data that can complete the reconstruction of the static dataset can be used as the target static features.
[0043] Specifically, the static data set includes multiple static data corresponding to the target user, representing the target user's basic information, or the target user can be identified based on the static data. Typically, a small amount of static data can be used to identify the corresponding target user. If the target user can be identified based on a small amount of static data, the extracted static data is used as the target static feature.
[0044] Optionally, the static feature extraction is performed on the static data based on the static feature extraction model to obtain the target static features output by the static feature extraction model, including: adjusting the model parameters of the static feature extraction model to be adjusted based on the target loss function to obtain the static feature extraction model; reconstructing the static data based on the static feature extraction model to obtain target static data, and determining the target static features corresponding to the target static data.
[0045] When extracting static features based on a static feature extraction model, it is necessary to determine a loss function corresponding to the static feature extraction model. The model parameters of the static feature extraction model are adjusted based on the loss function, and the loss function with the lowest loss value is used as the target loss function. The target static data is the static data output by the static feature extraction model. The target static features can be understood as the feature information corresponding to the target static data. Based on the target static feature information, the static dataset can be reconstructed.
[0046] In practical applications, taking the static feature extraction model as an autoencoder as an example, when determining the target static features, the static data set can be input into the autoencoder, and the static data set can be reconstructed unsupervisedly based on the autoencoder, and the static data set can be reconstructed through the neural network of the autoencoder. At the same time, the target loss function is used to train the autoencoder. By reducing the loss function value as the training target, the autoencoder is trained until the target static data output by the autoencoder is consistent with the input static data. The training of the autoencoder is completed, and the trained autoencoder is used as the static feature extraction model.
[0047] Specifically, after determining the target loss function corresponding to the static feature extraction model and completing the training of the static feature extraction model based on the target loss function, the static data set is input into the static feature extraction model to obtain target static data consistent with the input static data based on the static feature extraction model. When the target static data is obtained, the target static features corresponding to the target static data can be determined.
[0048] S130. Based on the dynamic data and the generation time corresponding to each dynamic data, determine the dynamic sequence data corresponding to the each dynamic data, and extract dynamic features from the dynamic sequence data based on a dynamic feature extraction model to obtain at least one set of dynamic features.
[0049] Among them, dynamic data is electricity consumption information related to the target user, such as current information, voltage information, charge information, and other electricity consumption information that can change over time. That is to say, dynamic data can change according to time, and the dynamic data corresponding to different moments are not exactly the same. The moment when each dynamic data is generated is used as the generation moment corresponding to each dynamic data. Dynamic sequence data can be understood as dynamic data in a time sequence based on each dynamic data and the corresponding generation moment. The dynamic feature extraction model can be understood as a model for extracting dynamic features from dynamic data, such as a self-attention pooling mechanism graph convolution model. Dynamic features can be understood as feature data used to characterize dynamic data corresponding to the target user.
[0050] Specifically, dynamic data can change over time. Based on each piece of dynamic data and its corresponding generation time, the dynamic data's change over a period of time can be determined, and dynamic sequence data can be obtained based on each piece of dynamic data and its generation time. To obtain dynamic features corresponding to the target user, the dynamic data sequence can be input into a dynamic feature extraction model, and feature extraction is performed on the dynamic data sequence based on the dynamic feature extraction model to obtain at least one set of dynamic features.
[0051] Optionally, based on the dynamic data and the generation moment corresponding to each dynamic data, the dynamic sequence data corresponding to the dynamic data is determined, and dynamic feature extraction is performed on the dynamic sequence data based on a dynamic feature extraction model to obtain at least one set of dynamic features, including: for the generation moment of the dynamic data, determining the current graph data structure to be integrated corresponding to the current generation moment; integrating the graph data structures to be integrated corresponding to each generation moment to obtain a target graph data structure; constructing a target matrix based on the target graph data structure, and determining the dynamic sequence data corresponding to the dynamic data based on the target matrix; processing the dynamic sequence data based on the dynamic feature extraction model to obtain at least one set of dynamic features.
[0052] The graph data structure to be integrated can be understood as a graph data structure generated based on at least one dynamic data associated with a certain generation moment, such as Figure 2 As shown in the figure, S1 represents a certain generation moment, and a1, b1, and c1 represent dynamic data of different dimensions corresponding to S1, such as voltage information, current information, and charge information. The current graph data structure to be integrated can be understood as the graph data structure to be integrated corresponding to the current moment, and the target graph data structure can be understood as the graph data structure obtained by connecting the graph data structures to be integrated, see Figure 3 , S1, S2, …, St represent the generation moments; a2, b2, and c2 represent the dynamic data of different dimensions corresponding to S2; at, bt, and ct represent the dynamic data of different dimensions corresponding to St. The target matrix can be understood as the matrix obtained by matrixing the target graph data structure.
[0053] Specifically, according to each generation moment, the corresponding graph data structure to be integrated is obtained based on the dynamic data associated with each generation moment, and the obtained multiple graph data structures to be integrated are integrated to obtain the target graph data structure. That is to say, after obtaining the graph data structure to be integrated corresponding to each generation moment, the target graph data structure can be obtained by integrating each graph data structure to be integrated according to the time series. The target graph data structure is then matrixed, such as by constructing a graph adjacency matrix, graph node information, and graph edge information to obtain the target graph data structure, and then the dynamic sequence data is determined based on the target graph data structure. The obtained dynamic sequence data is input into a dynamic feature extraction model, such as a graph convolution model with a self-attention pooling mechanism, and feature extraction of the dynamic data in the dynamic sequence data is performed based on the graph convolution in the model to obtain at least one dynamic feature.
[0054] S140. Based on a target classification model, process the target static features and the at least one group of dynamic features to obtain a target classification result; wherein the target classification result includes normal power usage or abnormal power usage.
[0055] Among them, the target classification model can be understood as a model for classifying the target user's electricity usage information, such as a deep neural network model. The target classification result can be understood as the classification result corresponding to the target user. For example, when the target classification result is abnormal electricity usage, it can be determined based on the target classification result that there is an abnormality in the electricity supply and use corresponding to the target user, such as the possibility of privately pulling wires or not using electricity in accordance with electricity usage regulations. Whether the result is normal electricity usage or abnormal electricity usage, it can be determined based on the target classification model whether the electricity usage information corresponding to the target user is normal electricity usage or abnormal electricity usage.
[0056] Specifically, the target static features and at least one set of dynamic features corresponding to the target user are input into a pre-trained target classification model. The static features and dynamic features corresponding to the target user are classified by the target classification model to determine whether the target user currently has abnormal electricity usage.
[0057] Optionally, based on the target classification model, the target static features and the at least one group of dynamic features are processed to obtain a target classification result, including: fusing the target static features and the at least one group of dynamic features to obtain a fused feature; inputting the fused feature into the target classification model, and determining the target classification result corresponding to the fused feature based on a preset label.
[0058] The fusion feature can be understood as the feature obtained by splicing the target static features and at least one set of dynamic features. It is understandable that before using the target classification model, the target classification model needs to be trained. During training, corresponding labels are usually set between each fusion feature and the corresponding classification result to determine the classification result corresponding to the fusion feature based on the preset label. In other words, the preset label can be used to characterize the correspondence between the fusion feature and the corresponding classification result.
[0059] Specifically, in order to ensure that the target classification model can obtain accurate classification results when classifying the target user's electricity usage information, the target classification model is first trained, and the target classification results corresponding to each fusion feature are determined based on the preset labels. If the target classification model can accurately classify each fusion feature, it can be determined that the target classification model training is complete. The fusion feature corresponding to the target user is then input into the trained target classification model, and the classification result corresponding to the fusion feature can be determined based on the preset label. If the target classification result is normal electricity usage, it can be determined that the current electricity supply and use of the target user is a normal power connection line; if the target classification result is abnormal electricity usage, it can be determined that the current electricity supply and use of the target user is abnormal, such as private wiring, high-price low-connection, and violation of electricity usage regulations.
[0060] The technical solution of this embodiment obtains the target user's data set to be detected, and determines the static data and dynamic data corresponding to the target user, so as to determine the target static features from the static data, and determine at least one group of dynamic features from the dynamic data. Static feature extraction is performed on the static data based on the static feature extraction model to obtain the target static features output by the static feature extraction model, and the static data is reconstructed by the static feature extraction model. When the loss value corresponding to the loss function is minimized, the obtained static data can be used as the target static features. Based on the dynamic data and the generation time corresponding to each dynamic data, the dynamic sequence data corresponding to each dynamic data is determined, and dynamic feature extraction is performed on the dynamic sequence data based on the dynamic feature extraction model to obtain at least one group of dynamic features. Based on each generation time corresponding to the dynamic data, the graph data structure corresponding to each time is determined, and further the target graph data structure can be obtained. Then, matrixization is performed based on the target graph data structure to obtain a target matrix, so as to determine at least one group of dynamic features based on the target matrix. Based on the target classification model, the target static features and the at least one set of dynamic features are processed to obtain a target classification result. The target static features and the at least one set of dynamic features are then fused to obtain a fused feature. The fused feature is then input into the target classification model, and the fused feature is classified based on preset labels to determine the target classification result corresponding to the target user. This solves the problem of low detection efficiency and accuracy when manually determining whether a user has abnormal electricity usage, and achieves the effect of quickly, accurately, and automatically detecting whether a user has electricity supply and use conditions.
[0061] Example 2
[0062] As an alternative embodiment of the above embodiment, Figure 2 This is a flow chart of a data processing method provided in the second embodiment of the present invention. Optionally, dynamic features are extracted from the dynamic sequence data based on the dynamic feature extraction model to obtain at least one set of dynamic features for refinement.
[0063] like Figure 4 As shown, the method includes:
[0064] S210: Obtain a target user's dataset to be tested.
[0065] S220 , performing static feature extraction on the static data based on a static feature extraction model to obtain target static features output by the static feature extraction model.
[0066] S230 : Determine dynamic sequence data corresponding to each dynamic data based on the dynamic data and the generation time corresponding to each dynamic data.
[0067] S240 , sorting the data to be sorted in the dynamic sequence data based on the dynamic feature extraction model, and determining target data.
[0068] When sorting dynamic data based on a dynamic feature extraction model, the order of the data to be sorted can be determined based on the degree of influence of each dynamic data on the model. The data to be sorted can be understood as the dynamic data corresponding to different moments in the dynamic sequence data, and the target data can be understood as the data to be sorted that has the greatest influence on the dynamic feature extraction model.
[0069] Specifically, in dynamic sequence data, each dynamic data has different degrees of influence on the dynamic feature extraction model. In order to extract dynamic features from dynamic data, dynamic features can be extracted from the dynamic data of the target user through graph convolution, and the target data can be determined from the data to be sorted.
[0070] Optionally, based on the dynamic feature extraction model, the data to be sorted in the dynamic sequence data are sorted, and the target data is determined, including: determining the importance of each data to be sorted in the dynamic sequence data, and sorting the data to be sorted according to the importance to obtain the data to be selected; based on a preset ratio, extracting the data to be selected that are ranked higher as the target data.
[0071] The importance can be understood as the influence of each data to be sorted on the dynamic feature extraction model. The greater the influence on the dynamic feature extraction model, the higher the importance, and vice versa. The data to be selected can be understood as the dynamic data after sorting the data to be sorted. The preset ratio can be understood as the preset ratio of target data to be selected when determining the target data from the data to be selected. For example, if the preset ratio is set to 50%, the number of data to be selected is 100, and the number of target data is 50.
[0072] Specifically, the dynamic data in the dynamic sequence data are ranked according to their influence on the dynamic feature extraction model. The greater the influence, the higher the ranking; the smaller the influence, the lower the ranking. Then, based on a graph convolution method, the importance of each data to be ranked is adaptively learned to obtain an importance score for each data to be ranked. Each data to be ranked is then ranked to obtain multiple data to be selected. According to a preset ratio, the data with the higher importance score and the higher ranking are selected from the multiple data to be selected as the target data.
[0073] S250: Perform at least one global mean pooling operation on the target data to obtain at least one set of dynamic features corresponding to the target data.
[0074] Among them, the global mean pooling operation can be understood as a pooling operation on the target data to reduce the dimension of the target data. For example, if there are 64 target data, after the global mean pooling operation is performed on the target data, the corresponding dynamic features include 16 target data. Furthermore, a further global mean pooling operation is performed on the target data after the first pooling operation to obtain the corresponding dynamic features. The dynamic features include 4 target data, and the target data is gradually reduced in dimension.
[0075] Specifically, a global mean pooling operation is performed on the target data based on the dynamic feature extraction model to obtain at least one set of dynamic features. Taking three global mean pooling operations on the target data as an example, the target data is input into the dynamic feature extraction model, updated based on the pooling layer, and a pooling result is obtained. A readout layer result R1 is then pooled based on the pooling layer to obtain a readout layer result R2. Finally, a pooling operation is performed on the readout layer result R2 based on the pooling layer to obtain a readout layer result R3. Three sets of dynamic features corresponding to the dynamic data are obtained, which are then fused with the target static features to obtain fused features. The fused features are then classified based on the target classification model.
[0076] S260. Based on the target classification model, process the target static features and the at least one group of dynamic features to obtain a target classification result; wherein the target classification result includes normal power usage or abnormal power usage.
[0077] The technical solution of this embodiment is to sort each data to be sorted in the dynamic sequence data based on the dynamic feature extraction model, and determine the target data, sort each data to be sorted according to the degree of influence of each data to be sorted on the dynamic feature extraction model, and determine the corresponding target data from each data based on a preset ratio. Perform at least one global mean pooling operation on the target data to obtain at least one set of dynamic features corresponding to the target data, so as to fuse the obtained at least one set of dynamic data with the target static features to obtain fused features. Furthermore, the fused features can be classified based on the target classification model to determine the target classification results corresponding to the target user. It solves the problem of low detection efficiency and low accuracy when manually determining whether a user has abnormal electricity consumption, and achieves the effect of quickly, accurately and automatically detecting whether the user has electricity supply and use conditions.
[0078] Example 3
[0079] In a specific example, Figure 5As shown, in order to determine whether each user has abnormal power consumption, the power consumption of each user can be determined one by one by analyzing the relevant data of each user. For the target user, obtain the target user's D = (d1, d2, ..., d n ) (i.e., the data set to be detected), which includes basic information corresponding to the target user (i.e., static data) and electricity-related information (i.e., dynamic data). The static features corresponding to the target user can be expressed as M i =(m i1 ,m i2 ,...,m ik ), where k represents the number of static features of the target user. i Input the autoencoder (i.e., static feature extraction model), perform unsupervised reconstruction of static feature data in the autoencoder, and reconstruct the feature M through the autoencoder neural network. i ′, and determine the target loss function of the self-encoder as the mean square loss function MSELoss (M i ,M i ′)=(M i -M i ′) 2 By training the autoencoder with the goal of reducing the loss function value, and extracting the implicit feature h from the middle hidden layer of the autoencoder after completing the reconstruction task i , used to represent the important representation information extracted from the static features, and each user d i The important features of the static data are saved and expressed as H.
[0080] For the dynamic data corresponding to the target user, the dynamic feature can be expressed as S = (s1, s2, ..., s n ), for each user d i , assuming that it has three dimensions of dynamic time series features (i.e., dynamic data), which can be represented as a, b, c, by taking the time node t as the intermediate node, the feature a t , b t , c t By connecting them as nodes, we can get the multi-dimensional feature dynamic time sequence graph structure corresponding to the current generation moment (i.e., the current integrated graph data structure). Based on the same method, we can get the graph data structure to be integrated corresponding to each generation moment, and then i According to the generation time t in the total time series, the graph data structure is constructed. i The graph structure data set (i.e., the target graph data structure), g i Represented as g i =(g it ,gi2 ,...,g iT ). In the same way, we can get the graph structure data set G corresponding to each user = (G1, G2, ..., G n ). Then, the graph structure data set corresponding to each user is input into the dynamic feature extraction model to determine the dynamic features corresponding to each user one by one.
[0081] The target user’s corresponding graph data structure is integrated to obtain the target graph data structure, and the adjacency matrix, graph node information, and graph edge information corresponding to the target graph data structure are constructed to jointly construct the graph dataset P (i.e., the target matrix). The graph dataset P is input into the dynamic feature extraction model, such as the self-attention pooling mechanism graph convolution model, which is used to extract the target user d through graph convolution. i The graph dataset p i Perform feature extraction, and adaptively learn the importance of graph nodes (i.e., data to be sorted) from the graph through graph convolution, thereby obtaining the importance score of the data to be sorted. And sort the importance scores of each data to be sorted to obtain the data to be selected. Then, according to the order of each data to be selected and the preset ratio, multiple target data are determined from each data to be selected. Further, perform a global mean pooling operation on the target data, update the graph through the self-attention pooling layer, obtain the pooling result, and obtain the readout layer result R1 through the readout mechanism, and then input the readout layer result R1 into the pooling layer again for updating to obtain the readout layer result R2; and input the readout layer result R2 into the pooling layer again for updating to obtain the readout layer result R3.
[0082] The obtained target static feature H and dynamic features R1, R2 and R3 are fused and spliced to obtain the fused feature, and the fused feature is input into the deep neural network (i.e., the target classification model) as the total feature. The fused feature is classified by the fully connected layer in the target classification model to obtain the final result (i.e., the target classification result) Y = (y1, y2, ..., y n ), and determine whether the target classification result corresponding to the target user is abnormal power consumption or normal power consumption according to the preset label.
[0083] The technical solution of this embodiment obtains the target user's data set to be detected, and determines the static data and dynamic data corresponding to the target user, so as to determine the target static features from the static data, and determine at least one group of dynamic features from the dynamic data. Static feature extraction is performed on the static data based on the static feature extraction model to obtain the target static features output by the static feature extraction model, and the static data is reconstructed by the static feature extraction model. When the loss value corresponding to the loss function is minimized, the obtained static data can be used as the target static features. Based on the dynamic data and the generation time corresponding to each dynamic data, the dynamic sequence data corresponding to each dynamic data is determined, and dynamic feature extraction is performed on the dynamic sequence data based on the dynamic feature extraction model to obtain at least one group of dynamic features. Based on each generation time corresponding to the dynamic data, the graph data structure corresponding to each time is determined, and further the target graph data structure can be obtained. Then, matrixization is performed based on the target graph data structure to obtain a target matrix, so as to determine at least one group of dynamic features based on the target matrix. Based on the target classification model, the target static features and the at least one set of dynamic features are processed to obtain a target classification result. The target static features and the at least one set of dynamic features are then fused to obtain a fused feature. The fused feature is then input into the target classification model, and the fused feature is classified based on preset labels to determine the target classification result corresponding to the target user. This solves the problem of low detection efficiency and accuracy when manually determining whether a user has abnormal electricity usage, and achieves the effect of quickly, accurately, and automatically detecting whether a user has abnormal electricity supply and use.
[0084] Example 4
[0085] Figure 6 A data processing device is provided in the fourth embodiment of the present invention, and the device includes: a to-be-detected data set acquisition module 310, a static feature determination module 320, a dynamic feature determination module 330 and a classification result determination module 340.
[0086] The module 310 for acquiring a data set to be detected is used to acquire a data set to be detected of a target user; wherein the data set to be detected includes static data and dynamic data, wherein the static data is basic information that does not change with time, and the dynamic data is electricity consumption-related data that changes with time;
[0087] A static feature determination module 320 is configured to extract static features from the static data based on a static feature extraction model to obtain target static features output by the static feature extraction model;
[0088] A dynamic feature determination module 330 is configured to determine, based on the dynamic data and the generation time corresponding to each dynamic data, dynamic sequence data corresponding to the dynamic data, and extract dynamic features from the dynamic sequence data based on a dynamic feature extraction model to obtain at least one set of dynamic features;
[0089] The classification result determination module 340 is used to process the target static features and the at least one group of dynamic features based on the target classification model to obtain a target classification result; wherein the target classification result includes normal power consumption or abnormal power consumption.
[0090] The technical solution of this embodiment obtains the target user's data set to be detected, and determines the static data and dynamic data corresponding to the target user, so as to determine the target static features from the static data, and determine at least one group of dynamic features from the dynamic data. Static feature extraction is performed on the static data based on the static feature extraction model to obtain the target static features output by the static feature extraction model, and the static data is reconstructed by the static feature extraction model. When the loss value corresponding to the loss function is minimized, the obtained static data can be used as the target static features. Based on the dynamic data and the generation time corresponding to each dynamic data, the dynamic sequence data corresponding to each dynamic data is determined, and dynamic feature extraction is performed on the dynamic sequence data based on the dynamic feature extraction model to obtain at least one group of dynamic features. Based on each generation time corresponding to the dynamic data, the graph data structure corresponding to each time is determined, and further the target graph data structure can be obtained. Then, matrixization is performed based on the target graph data structure to obtain a target matrix, so as to determine at least one group of dynamic features based on the target matrix. Based on the target classification model, the target static features and the at least one set of dynamic features are processed to obtain a target classification result. The target static features and the at least one set of dynamic features are then fused to obtain a fused feature. The fused feature is then input into the target classification model, and the fused feature is classified based on preset labels to determine the target classification result corresponding to the target user. This solves the problem of low detection efficiency and accuracy when manually determining whether a user has abnormal electricity usage, and achieves the effect of quickly, accurately, and automatically detecting whether a user has abnormal electricity supply and use.
[0091] Based on any optional technical solution in the embodiments of the present invention, optionally, the module for acquiring the dataset to be detected includes:
[0092] The submodule for acquiring data to be detected is used to acquire a data set to be detected corresponding to a target user and to acquire at least one data to be detected in the data set to be detected; wherein the at least one data to be detected includes static data and dynamic data;
[0093] The data determination submodule is used to determine the static data and dynamic data in each data to be detected based on the correspondence between each data to be detected and the data type in the target mapping table; wherein, each data to be detected in the target mapping table matches each data type, and the data type includes a static data type and a dynamic data type.
[0094] Based on any optional technical solution in the embodiments of the present invention, optionally, the static feature determination module includes:
[0095] A static feature extraction model determination submodule is used to adjust the model parameters of the static feature extraction model to be adjusted based on the target loss function to obtain the static feature extraction model;
[0096] The target static feature determination submodule is used to reconstruct the static data based on the static feature extraction model to obtain target static data and determine the target static features corresponding to the target static data; wherein the target static data is consistent with the static data.
[0097] Based on any optional technical solution in the embodiments of the present invention, optionally, the dynamic feature determination module includes:
[0098] a submodule for determining a current graph data structure to be integrated, configured to determine, based on a generation time of dynamic data, a current graph data structure to be integrated corresponding to the current generation time; wherein the current graph data structure to be integrated includes the current generation time and at least one dynamic data associated with the current generation time;
[0099] The target graph data structure determination submodule is used to integrate the graph data structures to be integrated corresponding to each generation moment to obtain the target graph data structure;
[0100] The dynamic sequence data determination submodule is used to construct a target matrix based on the target graph data structure, and determine the dynamic sequence data corresponding to the dynamic data based on the target matrix.
[0101] Based on any optional technical solution in the embodiments of the present invention, optionally, the dynamic feature determination module includes:
[0102] A target data determination submodule, configured to sort the data to be sorted in the dynamic sequence data based on the dynamic feature extraction model, and determine the target data;
[0103] The dynamic feature determination submodule is used to perform at least one global mean pooling operation on the target data to obtain at least one set of dynamic features corresponding to the target data.
[0104] Based on any optional technical solution in the embodiments of the present invention, optionally, the target data determination submodule includes:
[0105] a data-to-be-selected determining unit, configured to determine the importance of each data to be sorted in the dynamic sequence data, and sort the data to be sorted according to the importance to obtain the data to be selected;
[0106] The target data determining unit is used to extract the top-ranked to-be-selected data as target data based on a preset ratio.
[0107] Based on any optional technical solution in the embodiments of the present invention, optionally, the classification result determination module includes:
[0108] a fusion feature determination submodule, configured to fuse the target static feature with the at least one set of dynamic features to obtain a fusion feature;
[0109] The classification result determination submodule is used to input the fusion feature into the target classification model and determine the target classification result corresponding to the fusion feature based on the preset label.
[0110] The data processing device provided by the embodiment of the present invention can execute the data processing method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0111] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the embodiments of the present invention.
[0112] Example 5
[0113] Figure 7 This is a structural diagram of an electronic device provided in Example 5 of the present invention. Figure 7 A block diagram of an exemplary electronic device 40 suitable for implementing exemplary embodiments of the present invention is shown. Figure 7 The electronic device 40 shown is only an example and should not limit the functionality and scope of use of the embodiments of the present invention.
[0114] like Figure 7 As shown, electronic device 40 is a general-purpose computing device. Components of electronic device 40 may include, but are not limited to, one or more processors or processing units 401, system memory 402, and a bus 403 connecting various system components (including system memory 402 and processing unit 401).
[0115] Bus 403 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0116] The electronic device 40 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 40, including volatile and non-volatile media, removable and non-removable media.
[0117] System memory 402 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 404 and / or cache memory 405. Electronic device 40 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 406 may be used to read and write non-removable, non-volatile magnetic media ( Figure 7 Not shown, often called a "hard drive"). Although Figure 7 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 403 via one or more data medium interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.
[0118] A program / utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402. Such program modules 407 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 407 generally perform the functions and / or methods of the embodiments described herein.
[0119] The electronic device 40 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), and may also communicate with one or more devices that enable a user to interact with the electronic device 40, and / or any device that enables the electronic device 40 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 411. Furthermore, the electronic device 40 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 412. As shown, the network adapter 412 communicates with other modules of the electronic device 40 via the bus 403. It should be understood that although Figure 7 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 40, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0120] The processing unit 401 executes various functional applications and data processing by running programs stored in the system memory 402, such as implementing the data processing method provided by the embodiment of the present invention.
[0121] Example 6
[0122] Embodiment 6 of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to execute a data processing method, the method comprising: obtaining a data set to be detected of a target user; wherein the data set to be detected includes static data and dynamic data, the static data is basic information that does not change with time, and the dynamic data is electricity consumption-related data that changes with time; performing static feature extraction on the static data based on a static feature extraction model to obtain target static features output by the static feature extraction model; determining dynamic sequence data corresponding to each dynamic data based on the dynamic data and the generation time corresponding to each dynamic data, and performing dynamic feature extraction on the dynamic sequence data based on the dynamic feature extraction model to obtain at least one group of dynamic features; processing the target static features and the at least one group of dynamic features based on a target classification model to obtain a target classification result; wherein the target classification result includes normal electricity consumption or abnormal electricity consumption.
[0123] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0124] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0125] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0126] The computer program code for performing the operations of the embodiments of the present invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0127] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. A data processing method, characterized in that: include: Obtaining a target user's data set to be detected; wherein the data set to be detected includes static data and dynamic data, wherein the static data is basic information that does not change with time, and the dynamic data is electricity consumption-related data that changes with time; Performing static feature extraction on the static data based on a static feature extraction model to obtain target static features output by the static feature extraction model; Based on the dynamic data and the generation time corresponding to each dynamic data, determining dynamic sequence data corresponding to each dynamic data, and performing dynamic feature extraction on the dynamic sequence data based on a dynamic feature extraction model to obtain at least one set of dynamic features; Based on the target classification model, the target static features and the at least one set of dynamic features are processed to obtain a target classification result; wherein the target classification result includes normal power consumption or abnormal power consumption; The determining, based on the dynamic data and the generation time corresponding to each dynamic data, the dynamic sequence data corresponding to each dynamic data includes: Determining, for a generation moment of the dynamic data, a current graph data structure to be integrated corresponding to the current generation moment; wherein the current graph data structure to be integrated includes the current generation moment and dynamic data of multiple different dimensions associated with the current generation moment; Integrate the graph data structures to be integrated corresponding to each generation moment to obtain the target graph data structure; A target matrix is constructed based on the target graph data structure, and dynamic sequence data corresponding to the dynamic data is determined based on the target matrix.
2. The method according to claim 1, characterized in that The step of obtaining the target user's dataset to be detected includes: Acquire a data set to be detected corresponding to a target user, and acquire at least one data to be detected in the data set to be detected; wherein the at least one data to be detected includes static data and dynamic data; Based on the correspondence between each data to be detected and the data type in the target mapping table, the static data and dynamic data in the data to be detected are determined; wherein, the data to be detected in the target mapping table matches each data type, and the data types include static data types and dynamic data types.
3. The method according to claim 1, characterized in that The step of extracting static features from the static data based on a static feature extraction model to obtain target static features output by the static feature extraction model includes: Based on the target loss function, the model parameters of the static feature extraction model to be adjusted are adjusted to obtain the static feature extraction model; The static data is reconstructed based on the static feature extraction model to obtain target static data, and target static features corresponding to the target static data are determined; wherein the target static data is consistent with the static data.
4. The method according to claim 1, wherein The processing of the dynamic sequence data based on the dynamic feature extraction model to obtain at least one set of dynamic features includes: Based on the dynamic feature extraction model, sorting the data to be sorted in the dynamic sequence data and determining the target data; Perform at least one global mean pooling operation on the target data to obtain at least one set of dynamic features corresponding to the target data.
5. The method according to claim 4, characterized in that The step of sorting the data to be sorted in the dynamic sequence data based on the dynamic feature extraction model and determining the target data includes: Determining the importance of each data to be sorted in the dynamic sequence data, and sorting the data to be sorted according to the importance to obtain data to be selected; Based on the preset ratio, the top-ranked data to be selected are extracted as target data.
6. The method according to claim 1, wherein The target classification model is based on which the target static features and the at least one group of dynamic features are processed to obtain a target classification result, including: Fusing the target static feature with the at least one set of dynamic features to obtain a fused feature; The fused features are input into a target classification model, and a target classification result corresponding to the fused features is determined based on a preset label.
7. A data processing device, characterized in that: include: A module for acquiring a data set to be detected is used to obtain a data set to be detected of a target user; wherein the data set to be detected includes static data and dynamic data, wherein the static data is basic information that does not change with time, and the dynamic data is electricity consumption-related data that changes with time; A static feature determination module, configured to extract static features from the static data based on a static feature extraction model to obtain target static features output by the static feature extraction model; a dynamic feature determination module, configured to determine, based on the dynamic data and the generation time corresponding to each dynamic data, dynamic sequence data corresponding to the dynamic data, and extract dynamic features from the dynamic sequence data based on a dynamic feature extraction model to obtain at least one set of dynamic features; a classification result determination module, configured to process the target static features and the at least one set of dynamic features based on a target classification model to obtain a target classification result; wherein the target classification result includes normal power consumption or abnormal power consumption; The dynamic feature determination module includes: A submodule for determining a current graph data structure to be integrated, configured to determine a current graph data structure to be integrated corresponding to a current generation moment of dynamic data; wherein the current graph data structure to be integrated includes the current generation moment and dynamic data of multiple different dimensions associated with the current generation moment; The target graph data structure determination submodule is used to integrate the graph data structures to be integrated corresponding to each generation moment to obtain the target graph data structure; The dynamic sequence data determination submodule is used to construct a target matrix based on the target graph data structure, and determine the dynamic sequence data corresponding to the dynamic data based on the target matrix.
8. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method according to any one of claims 1 to 6.
9. A storage medium containing computer-executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to perform the data processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Image feature extraction method, device, equipment and storage medium
CN111382796A
Credit risk assessment method and device, computer equipment and storage medium
CN112116245A
Method, device and equipment for determining user information with abnormal electricity consumption and medium
CN114282618A