Intelligent electricity utilization real-time metering and data analysis method and system based on Internet of Things

Through the intelligent real-time measurement and data analysis method of electricity use based on the Internet of Things, the feature vectors of power use data are extracted and nonlinear regression prediction is performed, which solves the problems of low data utilization rate and insufficient prediction accuracy of power use management systems in the prior art. , realizes optimized distribution of power grid load and efficient power management.

CN119227884APending Publication Date: 2024-12-31TIANJIN ZHONGLING SHINENG TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411292218.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing power consumption management system has problems such as low data utilization, insufficient prediction accuracy and slow response speed in data processing, making it difficult to achieve refined power consumption management and optimized distribution of power grid load.

Method used

Using intelligent real-time measurement and data analysis methods for electricity use based on the Internet of Things, the user's power usage data is collected, and the feature vectors are extracted using preset analysis models, and the next time period is predicted based on the nonlinear regression model. Power consumption, optimize the power consumption mode to adjust the grid load distribution.

Benefits of technology

It improves the operating efficiency of the power system, optimizes the load distribution of the power grid, enhances the prediction ability and response speed of electricity consumption trends, and meets the needs of refined electricity consumption management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227884A_ABST
    Figure CN119227884A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent electricity utilization real-time metering and data analysis method and system based on the Internet of Things. The method comprises the steps of collecting power use data of a plurality of users; segmenting the power use data according to a time sequence to obtain data segments of a plurality of time periods; performing feature extraction on the data fragments by using a preset analysis model to obtain feature vectors used by power in each time period; predicting the power consumption in the next time period according to the feature vector and a preset power consumption mode; wherein the feature vector is used for optimizing the preset power utilization mode, and adjusting power grid load distribution according to the optimized power utilization mode. According to the technical scheme, power grid load distribution can be optimized, and the operation efficiency of a power system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to a method and system for real-time intelligent electricity metering and data analysis based on the Internet of Things. Background Art

[0002] With the popularization of the concepts of smart cities and smart homes, intelligent management of power systems has become a development trend. Especially in residential, commercial and industrial areas, how to collect power usage data in real time through IoT devices such as smart meters, and effectively analyze and process it, and then achieve refined power management and prediction, has become an urgent problem to be solved. Through in-depth analysis of users' power consumption behavior, we can better guide the rational allocation of power resources and avoid power waste, and also provide users with personalized energy-saving suggestions.

[0003] Currently, many regions have begun to deploy smart grids, using smart meters to automatically read user electricity consumption data and transmit the data to data centers through wireless communication technology. The data center will perform preliminary processing on the data, such as calculating electricity bills and detecting abnormal electricity consumption. However, in most cases, this processing method is still relatively passive, mainly post-statistical analysis, lacking the ability to predict future electricity consumption trends, and making it difficult to respond to changes in user electricity consumption patterns in a timely manner.

[0004] The deficiencies of traditional power management systems in data processing are reflected in several aspects: first, the data utilization rate is not high, and a large amount of power consumption data has not been effectively mined and utilized; second, the prediction accuracy is not enough, and the existing prediction models can often only provide a relatively rough estimate of power consumption, which cannot meet the needs of refined management; third, the response speed is slow, and it is difficult for the existing system to make rapid adjustments to sudden peaks or valleys in power consumption. Therefore, a more intelligent method is needed to collect users' power usage data in real time, and accurately predict future power consumption through time series analysis and feature extraction, so as to optimize the load distribution of the power grid and improve the operating efficiency of the power system. Summary of the invention

[0005] The embodiments of the present application provide a method and system for real-time intelligent electricity metering and data analysis based on the Internet of Things, which are used to solve the problem of poor power grid load distribution efficiency in the prior art.

[0006] In a first aspect, the embodiment of the present application provides a smart electricity real-time metering and data analysis method based on the Internet of Things, including:

[0007] Collect electricity usage data of multiple users;

[0008] Segmenting the power usage data according to time series to obtain data segments for multiple time periods;

[0009] Extracting features from the data segments using a preset analysis model to obtain a feature vector of power usage in each time period;

[0010] Predicting the power consumption in the next time period based on the characteristic vector and the preset power consumption pattern;

[0011] The characteristic vector is used to optimize the preset power consumption mode and adjust the power grid load distribution according to the optimized power consumption mode.

[0012] Optionally, collecting power usage data of multiple users includes:

[0013] Real-time monitoring of users’ electricity consumption through IoT devices;

[0014] Power consumption information transmitted from the IoT device is received and recorded as the power usage data.

[0015] Optionally, the extracting features of the data segments using a preset analysis model to obtain a feature vector of power usage in each time period includes:

[0016] identifying statistical features in the data segment, the statistical features comprising at least a peak value, a mean value, and a standard deviation;

[0017] The statistical features are weighted averaged using a machine learning algorithm to obtain the feature vector.

[0018] Optionally, predicting the power consumption in the next time period according to the feature vector and a preset power consumption pattern includes:

[0019] Based on the characteristic vector, a nonlinear regression model is constructed to estimate the power consumption in the next time period through the nonlinear regression model;

[0020] The nonlinear regression model uses the least square method to fit the relationship between the characteristic vector and the actual power consumption.

[0021] Optionally, constructing a nonlinear regression model based on the characteristic vector to estimate the power consumption in the next time period through the nonlinear regression model includes:

[0022] The power consumption in the next time period is estimated by predicting the power consumption function, wherein the predicted power consumption function is defined as:

[0023]

[0024] Wherein, f(x, e, h, t) represents the estimated power consumption in the next time period, i.e., the predicted power consumption, x represents the feature vector, e represents the external environment condition vector, h represents the historical holiday impact vector, t represents the timestamp, n is the number of elements in the feature vector or the number of features in the nonlinear regression model, ω i (t) represents the dynamic weight that changes over time, g(x; α i , e, h, t) represents the nonlinear basis function, α i represents the model parameters of the nonlinear regression model, and b(t) represents the bias term that changes with time.

[0025] Optionally, the nonlinear basis function g(x; α i , e, h, t) are defined as:

[0026] g(x; α i , e, h, t) = MultiHeadAttention (x, e, h, t; W Q , W K , W V )

[0027] Among them, g(x; α i , e, h, t) is a nonlinear basis function, MultiHeadAttention is a multi-head attention mechanism, Q, K, V are query matrix, key matrix and value matrix respectively, which are obtained by linear transformation of feature vector x, external environment condition vector e, historical holiday impact vector h, and timestamp t, W Q , W K , W V It is a transformation matrix used to convert the feature vector x, the external environmental condition vector e, the historical holiday impact vector h, and the timestamp t into the query matrix Q, the key matrix K and the value matrix V.

[0028] Optionally, the least square method for fitting the relationship between the characteristic vector and the actual power consumption includes:

[0029]

[0030] Among them, min w,b(t),Ω(t) is the minimization objective function, y t is the actual power consumption at the t-th time point, λ(t) is the regularization coefficient that varies with time, w is the weight vector, γ is the smoothing factor, and t is the time window size;

[0031] in, is the first part of the loss function, which represents the predicted power consumption f(x t ,e t ,h t,t) and actual power consumption y t The sum of the squared errors at all time points t, λ(t)||w|| 2 is part of the regularization term, which is used to penalize large weight values ​​w, and λ(t) is the regularization coefficient that changes over time. is the smoothness penalty term for the bias term b(t), is the penalty term for the absolute value of each element in the environmental condition vector e, η is the coefficient of the penalty term, ||Ω(t)|| 2 is the regularization term for the dynamic weight matrix Ω(t), and ζ is the coefficient of the regularization term.

[0032] In a second aspect, the present application embodiment provides a method and system for real-time intelligent electricity metering and data analysis based on the Internet of Things, including:

[0033] A collection module, used to collect power usage data of multiple users;

[0034] A segmentation module, used to segment the power usage data according to time series to obtain data segments for multiple time periods;

[0035] A feature extraction module, used to extract features from the data segments using a preset analysis model to obtain a feature vector of power usage in each time period;

[0036] A prediction module is used to predict the power consumption in the next time period based on the characteristic vector and the preset power consumption pattern; wherein the characteristic vector is used to optimize the preset power consumption pattern and adjust the power grid load distribution according to the power consumption pattern.

[0037] In a third aspect, an embodiment of the present application provides a computing device, comprising a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement a smart electricity real-time metering and data analysis method based on the Internet of Things as described in any one of the first aspects above.

[0038] In a fourth aspect, an embodiment of the present application provides a computer storage medium storing a computer program. When the computer program is executed by a computer, it implements a smart electricity real-time metering and data analysis method based on the Internet of Things as described in any one of the first aspects above.

[0039] In the embodiment of the present application, the power usage data of multiple users are collected; the power usage data is segmented according to the time series to obtain data segments of multiple time periods; the data segments are feature extracted using a preset analysis model to obtain a feature vector of power usage in each time period; the power consumption in the next time period is predicted based on the feature vector and the preset power usage mode; wherein the feature vector is used to optimize the preset power usage mode, and the power grid load distribution is adjusted according to the optimized power usage mode. The technical solution provided by the present application can optimize the power grid load distribution and improve the operating efficiency of the power system.

[0040] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1 A flowchart of a smart electricity real-time metering and data analysis method based on the Internet of Things provided in an embodiment of the present application;

[0043] Figure 2 A schematic diagram of the structure of an intelligent real-time electricity metering and data analysis system based on the Internet of Things provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0046] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0048] Figure 1 A flowchart of a smart electricity real-time metering and data analysis method based on the Internet of Things is provided for the embodiment of the present application, such as Figure 1 As shown, the method includes:

[0049] 101. Collecting electricity usage data of multiple users;

[0050] Optionally, the "collecting power usage data of multiple users" in step 101 includes: monitoring the power consumption of users in real time through an IoT device; receiving power consumption information transmitted from the IoT device, and recording it as the power usage data.

[0051] This step refers to the process of real-time monitoring of the user's electricity consumption through IoT devices, receiving the electricity consumption information transmitted from these devices, and recording it as electricity usage data. Specifically, IoT devices can be smart meters, sensors or other devices that can measure electricity consumption. They are deployed in the network and can collect users' electricity usage regularly or continuously. These devices transmit the collected data to a central server or cloud platform via wireless or wired networks for subsequent data processing and analysis.

[0052] In the embodiment of the present application, it is assumed that a power company has deployed a large number of smart meters (SM) in its service area. These smart meters can record the user's power consumption every 15 minutes and send the data to the power company's data center through a wireless communication module (WCM). The data center is equipped with data processing software that can automatically receive and store power consumption information from each smart meter to form power usage data.

[0053] Here is a specific example:

[0054] Smart meter: Installed at each user's home or business electricity access point, it can accurately measure and record the user's electricity consumption.

[0055] Wireless Communication Module (WCM): Integrated in the smart meter, it is responsible for transmitting the measured data to the data center via a wireless network.

[0056] Data center: Equipped with data processing software and storage devices, used to receive, store and process data from smart meters.

[0057] Real-time monitoring: Smart meters automatically record the user's electricity consumption every 15 minutes and transmit the data to the data center through the built-in wireless communication module.

[0058] Data reception: The data processing software in the data center receives power consumption information from smart meters in real time through a dedicated interface.

[0059] Data recording: The received data is recorded in the database of the data center to form a complete data record of power usage.

[0060] Assume that the power consumption data of a user every 15 minutes in a day is shown in Table 1 below:

[0061] Table 1

[0062] Time period Power consumption (kWh) 00:00-00:15 0.5 00:15-00:30 0.6 ... ... 23:45-00:00 0.4

[0063] At the end of each time period, the smart meter records the power consumption during that time period and sends this data to the data center through the wireless communication module. After receiving this data, the data processing software in the data center records it in the database. For example, the above data may be recorded as:

[0064]

[0065]

[0066] In this way, the data center can monitor and record the electricity usage data of all users in real time, laying the foundation for subsequent data analysis and electricity consumption forecasting.

[0067] 102. Segment the power usage data according to time series to obtain data segments of multiple time periods;

[0068] This step involves dividing the electricity usage data collected from users into a series of continuous data segments according to a certain time interval. This helps to analyze the data in more detail and facilitates subsequent feature extraction and prediction. Time series segmentation can be performed at different granularities according to actual needs, such as segmenting by hour, day, week, etc.

[0069] In the embodiment of the present application, it is assumed that the data center has collected electricity usage data from multiple users, and needs to segment these data according to time series for subsequent feature extraction and electricity consumption prediction.

[0070] The specific embodiments are as follows:

[0071] Data import: First, import the electricity usage data of all users from the database.

[0072] Time series segmentation: divide the data into data segments of multiple time periods according to a certain granularity (for example, every hour).

[0073] Data storage: Store the segmented data segments for subsequent processing.

[0074] Assume that the data center has collected the following user power usage data as shown in Table 2:

[0075] Table 2

[0076]

[0077]

[0078] Data import: Import the above data into the data processing software.

[0079] Time series segmentation: Assuming that we want to segment the data at an hourly granularity, we can merge the data within each hour into one data segment. For example, merge the data from 00:00:00 to 00:59:59 into the data segment for the first hour.

[0080] The specific segmentation process is as follows:

[0081] 00:00:00 to 00:59:59

[0082] Average power consumption:

[0083] 01:00:00 to 01:59:59

[0084] Average power consumption:

[0085] And so on, until all the data has been processed.

[0086] The segmented data segments can be stored in the format shown in Table 3 below:

[0087] Table 3

[0088]

[0089] Through such time series segmentation, the original electricity usage data can be organized into a form that is easier for subsequent feature extraction and analysis, thereby improving the accuracy and efficiency of prediction.

[0090] 103. Extract features from the data segments using a preset analysis model to obtain feature vectors of power usage in each time period;

[0091] Optionally, the step 103 of "using a preset analysis model to extract features from the data segments to obtain a feature vector of electricity usage in each time period" includes: identifying statistical features in the data segments, the statistical features including at least a peak value, a mean value, and a standard deviation; and using a machine learning algorithm to perform weighted averaging on the statistical features to obtain the feature vector.

[0092] This step is to analyze the segmented data segments, extract key features that can reflect the characteristics of electricity usage during the time period, and combine these features into a vector for subsequent prediction model use. Specifically, this step includes two main parts:

[0093] Identify statistical features in the data segments: Extract statistical features from the data segments of each time period, which at least include peak value, mean value and standard deviation. These statistical features can help the model understand and capture the basic pattern of electricity use.

[0094] The statistical features are weighted averaged using a machine learning algorithm to obtain the feature vector: The extracted statistical features are weighted by a machine learning algorithm to form a feature vector. This feature vector can comprehensively reflect the characteristics of power usage during the time period and serve as an input for subsequent prediction models.

[0095] In the embodiment of this application, we will introduce in detail how to use the preset analysis model to extract features from data segments and obtain the feature vector of power usage in each time period. The specific embodiment is as follows:

[0096] Assuming that we have completed data collection and segmentation, we now need to extract features from the electricity usage data in each time period.

[0097] 1. Identify statistical features in the data segment

[0098] First, we need to extract statistical features from the data segments in each time period. Taking the data segments in hourly units as an example, we will extract the following statistical features:

[0099] Peak: The maximum power consumption during this time period.

[0100] Mean: The average power consumption during this period.

[0101] Standard Deviation: The degree of dispersion of power consumption data within this time period.

[0102] Assume that the hourly electricity consumption data of a user on a certain day is shown in Table 4 below:

[0103] Table 4

[0104] Time period Power consumption (kWh) 00:00-00:59 0.5,0.6,0.7,0.8,0.9 01:00-01:59 1.0,1.1,1.2,1.3,1.4 ... ... 23:00-23:59 2.5,2.6,2.7,2.8,2.9

[0105] For the time period 00:00-00:59, we calculate the statistical features as follows:

[0106] Peak: 0.9kWh

[0107] Mean:

[0108] Standard Deviation:

[0109]

[0110] 2. Use a machine learning algorithm to perform weighted averaging on the statistical features to obtain the feature vector

[0111] Next, we use machine learning algorithms to weight the extracted statistical features to form a feature vector. Assume that we use a simple linear weighted average method, and the weights can be pre-set according to the importance. For example, we set the importance weight of the peak value to 0.5, the importance weight of the mean to 0.3, and the importance weight of the standard deviation to 0.2.

[0112] For the time period 00:00-00:59, the feature vector is calculated as follows:

[0113] V=0.5×Peak+0.3×Mean+0.2×Standard Deviationv

[0114] V=0.5×0.9+0.3×0.7+0.2×0.1414

[0115] V=0.45+0.21+0.02828

[0116] V=0.68828

[0117] Therefore, for the time period 00:00-00:59, we obtain a feature vector V = 0.68828.

[0118] By using a similar method, we can extract features from data segments of other time periods and form corresponding feature vectors. These feature vectors will be used in subsequent power consumption prediction models to improve the accuracy and reliability of predictions.

[0119] 104. Predicting the power consumption in the next time period according to the characteristic vector and the preset power consumption mode;

[0120] Optionally, the "predicting the power consumption in the next time period based on the characteristic vector and the preset power consumption pattern" in step 104 includes: constructing a nonlinear regression model based on the characteristic vector to estimate the power consumption in the next time period through the nonlinear regression model; wherein the nonlinear regression model uses the least squares method to fit the relationship between the characteristic vector and the actual power consumption.

[0121] Optionally, in step 104, “building a nonlinear regression model based on the feature vector to estimate the power consumption in the next time period through the nonlinear regression model” includes:

[0122] The power consumption in the next time period is estimated by predicting the power consumption function, wherein the predicted power consumption function is defined as:

[0123]

[0124] Wherein, f(x,e,h,t) represents the estimated power consumption in the next time period, i.e., the predicted power consumption, x represents the feature vector, e represents the external environment condition vector, h represents the historical holiday impact vector, t represents the timestamp, n is the number of elements in the feature vector or the number of features in the nonlinear regression model, ω i (t) represents the dynamic weight that changes over time, g(x; α i,e,h,t) represents the nonlinear basis function, α i represents the model parameters of the nonlinear regression model, and b(t) represents the bias term that changes with time.

[0125] Constructing a nonlinear regression model: Constructing a nonlinear regression model based on the feature vector, which can estimate the power consumption in the next time period through the feature vector.

[0126] Least squares fitting: Least squares method is used to fit the relationship between the feature vector and the actual power consumption, so as to optimize the model parameters.

[0127] In the embodiments of the present application, we will introduce in detail how to use the nonlinear regression model to predict the electricity consumption in the next time period and give specific embodiments.

[0128] Assuming that we have completed data collection, segmentation, and feature extraction, we now need to use a nonlinear regression model to predict electricity consumption in the next time period.

[0129] 1. Constructing a nonlinear regression model

[0130] First, we need to build a nonlinear regression model based on the feature vector. The form of the model is as follows:

[0131]

[0132] in:

[0133] f(x,e,h,t) represents the estimated power consumption in the next time period (forecasted power consumption).

[0134] x represents a feature vector, which contains the statistical features of the time period, such as peak value, mean value, standard deviation, etc.

[0135] e represents the external environmental condition vector, such as weather conditions, holidays, etc.

[0136] h represents the historical holiday impact vector, which is used to reflect the impact of historical holidays on electricity consumption.

[0137] t represents the timestamp, which identifies the current time period.

[0138] n is the number of elements in the feature vector or the number of features in a nonlinear regression model.

[0139] ω i (t) represents the dynamic weight that changes over time, reflecting the importance of different features at different time points.

[0140] g(x; α i ,e,h,t) represents the nonlinear basis function, which is used to calculate the output of the eigenvector under specific parameters.

[0141] α i represents the model parameters of the nonlinear regression model.

[0142] b(t) represents the bias term that changes over time and is used to adjust the prediction baseline of the overall model.

[0143] 2. Least squares fitting

[0144] Next, we use the least squares method to fit the relationship between the feature vector and the actual power consumption. The goal of the least squares method is to minimize the sum of squared errors between the predicted value and the actual value. The specific form is as follows:

[0145]

[0146] in:

[0147] w represents the weight vector, which contains all the parameters in the model.

[0148] b(t) represents the bias term that varies with time.

[0149] Ω(t) represents the dynamic weight matrix that changes over time.

[0150] T represents the total time window size, that is, the total number of prediction time periods.

[0151] y t Represents the actual power consumption at the tth time point.

[0152] λ(t) represents the time-varying regularization coefficient.

[0153] γ represents the smoothing factor.

[0154] n represents the coefficient of the environmental condition vector penalty term.

[0155] ζ represents the coefficient of the regularization term of the dynamic weight matrix.

[0156] Assume that we have collected the data segments shown in Table 5 below:

[0157] Table 5

[0158]

[0159] For the time period 00:00-00:59, we have calculated the feature vector x as [0.9, 0.7, 0.1414], the external environmental condition vector e as [sunny, no], the historical holiday impact vector h as [no], and the timestamp t as 2024-09-05 00:00:00.

[0160] Assume that we have trained a nonlinear regression model with the following parameters:

[0161] α i : Model parameters, assumed to be [1, 0.5, 0.2].

[0162] ω i (t): Dynamic weight that changes over time, assumed to be [0.5, 0.3, 0.2].

[0163] b(t): bias term that varies with time, assumed to be 0.1.

[0164] b(t): Regularization coefficient that varies with time, assumed to be 0.01.

[0165] γ: smoothing factor, assumed to be 0.001.

[0166] n: coefficient of the environmental condition vector penalty term, assumed to be 0.001.

[0167] ξ: coefficient of the regularization term of the dynamic weight matrix, assumed to be 0.001.

[0168] We can calculate the predicted electricity consumption for the next time period (01:00-01:59) by following the steps below:

[0169] Calculate the nonlinear basis function: g(x; α i , e, h, t) = MultiHeadAttention (x, e, h, t; W Q , W K , W V )

[0170] Assume that the output of MultiHeadAttentionMultiHeadAttention is [0.8, 0.6, 0.4].

[0171] Calculate the predicted electricity consumption:

[0172]

[0173] f(x,e,h,t)=0.5·0.8+0.3·0.6+0.2·0.4+0.1

[0174] f(x,e,h,t)=0.4+0.18+0.08+0.1f(x,e,h,t)=0.76

[0175] Therefore, we predict that the electricity consumption in the next time period (01:00-01:59) will be 0.76kWh.

[0176] In this way, we can use the nonlinear regression model to predict the electricity consumption in the next time period, and continuously optimize the model parameters through the least squares method to improve the accuracy of the prediction.

[0177] 105. The characteristic vector is used to optimize the preset power usage pattern and adjust the grid load distribution according to the optimized power usage pattern.

[0178] This step refers to using the feature vectors extracted from historical data to improve the original power consumption pattern, and then adjusting the load distribution of the power grid according to the optimized power consumption pattern. Specifically, this step includes two main parts:

[0179] Optimize power usage mode: Use feature vectors to optimize the preset power usage mode to make it more consistent with actual power usage.

[0180] Adjust the load distribution of the power grid: According to the optimized power consumption pattern, adjust the load distribution of the power grid to ensure the stability and efficiency of power supply.

[0181] In the embodiments of this application, we will introduce in detail how to use the characteristic vector to optimize the power consumption mode and adjust the grid load distribution according to the optimized power consumption mode. The specific embodiments are as follows:

[0182] Assume that we have completed data collection, segmentation, feature extraction, and power consumption prediction using a nonlinear regression model. Now we need to optimize the power consumption pattern based on the prediction results and adjust the grid load distribution accordingly.

[0183] 1. Optimize power usage mode

[0184] First, we need to use the feature vector to optimize the preset power consumption pattern. Assume that we already have a preliminary power consumption pattern, which is based on historical data and experience. Now we use the feature vector to further optimize this pattern.

[0185] Assume that we have calculated a series of feature vectors, such as shown in Table 6 below:

[0186] Table 6

[0187] Time period Eigenvector (x,e,h,t) 00:00-00:59 [0.9,0.7,0.1414] 01:00-01:59 [1.2,0.8,0.2] 02:00-02:59 [0.9,0.7,0.1414] ... ...

[0188] These feature vectors include the statistical characteristics (peak value, mean value, standard deviation) of the time period, external environmental conditions (weather conditions, holidays, etc.), and the impact of historical holidays.

[0189] 2. Adjust the grid load distribution according to the optimized power consumption pattern

[0190] Next, we need to adjust the grid load distribution according to the optimized power consumption pattern. The specific steps are as follows:

[0191] Calculate optimized power usage pattern: Use the feature vector to re-evaluate the power usage in each time period and optimize the power usage pattern accordingly.

[0192] Adjust load distribution: According to the optimized power consumption pattern, adjust the load distribution of the power grid to ensure the stability and efficiency of power supply.

[0193] Assume that we have calculated the optimized power consumption pattern, as shown in Table 7 below:

[0194] Table 7

[0195] Time period Optimized power consumption (kWh) 00:00-00:59 0.7 01:00-01:59 1.2 02:00-02:59 0.9 ... ...

[0196] Assume that we have obtained the optimized power consumption patterns and need to adjust the grid load distribution according to these patterns. The specific steps are as follows:

[0197] Calculate the optimized power consumption pattern: We have optimized the power consumption pattern using the feature vector and obtained the optimized power consumption in each time period.

[0198] Adjust load distribution: According to the optimized power consumption pattern, we need to adjust the load distribution of the power grid. Assume that there are three power stations (StationA, B, C) in the power grid, and we need to distribute power according to the power consumption.

[0199] Assume that the power generation capacities of the three power stations in the power grid are as shown in Table 8 below:

[0200] Table 8

[0201] Power Station Maximum power generation (kWh) A 50 B 40 C 30

[0202] We need to adjust the load distribution according to the optimized power consumption pattern so that the load on the power grid is balanced and does not exceed the maximum power generation capacity of each power station.

[0203] Assume that we have calculated that the optimal power consumption for the next time period (01:00-01:59) is 1.2 kWh. We need to adjust the grid load distribution based on this power consumption.

[0204] Assume that the objective function of power grid load distribution is:

[0205]

[0206] in:

[0207] P i represents the power generation of the i-th power station.

[0208] Represents the total power generation of all power stations.

[0209] We can obtain the optimal load distribution solution by solving the above optimization problem. Assume that the optimal load distribution solution obtained after solving is as shown in Table 9:

[0210] Table 9

[0211] Power Station Power generation (kWh) A 0.5 B 0.4 C 0.3

[0212] Therefore, we adjusted the grid load distribution according to the optimized power consumption pattern, so that power station A generated 0.5kWh, power station B generated 0.4kWh, and power station C generated 0.3kWh, thus achieving a reasonable distribution of the grid load and ensuring the stability and efficiency of power supply.

[0213] In this way, we can use the feature vector to optimize the power consumption pattern and adjust the grid load distribution according to the optimized power consumption pattern, thereby improving the operation efficiency and service quality of the power system.

[0214] Optionally, the nonlinear basis function g(x; α i , e, h, t) are defined as:

[0215] g(x; α i , e, h, t) = MultiHeadAttention (x, e, h, t; W Q , W K , W V )

[0216] Among them, g(x; α i , e, h, t) is a nonlinear basis function, MultiHeadAttention is a multi-head attention mechanism, Q, K, V are query matrix, key matrix and value matrix respectively, which are obtained by linear transformation of feature vector x, external environment condition vector e, historical holiday impact vector h, and timestamp t, W Q , W K , W V It is a transformation matrix used to convert the feature vector x, the external environmental condition vector e, the historical holiday impact vector h, and the timestamp t into the query matrix Q, the key matrix K and the value matrix V.

[0217] Multi-Head Attention (MHA): is an advanced mechanism for processing sequence data, which allows the model to focus on different positions of the input sequence and give different weights according to the importance of the context. This method is very common in natural language processing and other sequence tasks.

[0218] Query matrix Q: The matrix obtained by linearly transforming the input vector, used to find relevant information in the attention mechanism.

[0219] Key matrix K: A matrix obtained by linearly transforming the input vector, used to measure the correlation between the query vector and each input position.

[0220] Value matrix V: It is also a matrix obtained by linear transformation of the input vector. The final output is the weighted sum of the value vector according to the relevance of the query vector and the key vector.

[0221] Transformation matrix W Q , W K , W V : Used to convert feature vectors, external environment condition vectors, historical holiday impact vectors, and timestamps into query matrix, key matrix, and value matrix respectively.

[0222] In the embodiments of this application, we will introduce in detail how to use the multi-head attention mechanism to process the feature vector, and convert it into a query matrix, a key matrix and a value matrix through a linear transformation, thereby realizing the definition of a nonlinear basis function.

[0223] Assume that we have completed data collection, segmentation and feature extraction, and need to use a multi-head attention mechanism to process the feature vector for the next prediction.

[0224] 1. Construct nonlinear basis functions

[0225] First, we need to define the nonlinear basis function g(x; α i , e, h, t) is the output of the multi-head attention mechanism.

[0226] Suppose we have the following eigenvectors and correlation vectors:

[0227] Feature vector x: [0.9, 0.7, 0.1414];

[0228] External environment condition vector e: [0.8, 0.5];

[0229] Historical holiday impact vector h: [0.3];

[0230] Timestamp t: 2024-09-0501:00:00;

[0231] 2. Linear transformation

[0232] We need to transform these vectors into query matrix Q, key matrix K and value matrix V through linear transformation.

[0233] Suppose we have the following transformation matrix:

[0234] Query the matrix transformation matrix W Q :

[0235] Key matrix transformation matrix W K :

[0236] Value matrix transformation matrix W V :

[0237] We first calculate the query matrix Q, key matrix K and value matrix V:

[0238]

[0239] Calculate the key matrix K:

[0240]

[0241] Calculate the value matrix V:

[0242]

[0243] 3. Multi-head attention mechanism

[0244] Next, we use the multi-head attention mechanism to calculate the final nonlinear basis function g(x; α i , e, h, t):

[0245] g(x; α i , e, h, t) = MultiHeadAttention (x, e, h, t; W Q , W K , W V )

[0246] The calculation steps of the multi-head attention mechanism are as follows:

[0247]

[0248] where d k is the dimension of the key vector.

[0249]

[0250] Compute the weighted sum:

[0251] WeightedSum=AttentionScore·V

[0252]

[0253] Final output: g(x; α i , e, h, t) = WeightedSum

[0254] In this way, we process the feature vector using the multi-head attention mechanism and transform it into query matrix, key matrix and value matrix through linear transformation, thus realizing the definition of nonlinear basis function. This method can more effectively capture the complex relationship between features and improve the accuracy and robustness of the prediction model.

[0255] Optionally, the least square method for fitting the relationship between the characteristic vector and the actual power consumption includes:

[0256]

[0257] Among them, min w,b(t),Ω(t) is the minimization objective function, y t is the actual power consumption at the t-th time point, λ(t) is the regularization coefficient that varies with time, w is the weight vector, γ is the smoothing factor, and t is the time window size;

[0258] in, is the first part of the loss function, which represents the predicted power consumption f(x t ,e t ,h t ,t) and actual power consumption y t The sum of the squared errors at all time points t, λ(t)||w|| 2 is part of the regularization term, which is used to penalize large weight values ​​w, and λ(t) is the regularization coefficient that changes over time. is the smoothness penalty term for the bias term b(t), is the penalty term for the absolute value of each element in the environmental condition vector e, η is the coefficient of the penalty term, ||Ω(t)|| 2 is the regularization term for the dynamic weight matrix Ω(t), and ζ is the coefficient of the regularization term.

[0259] This step refers to optimizing the relationship between the feature vector and the actual power consumption by the least squares method, so that the predicted power consumption is as close to the actual power consumption as possible. Specifically, this step involves minimizing an objective function that contains multiple parts, which aims to penalize prediction errors, large weight values, insufficient temporal smoothness of the bias term, large absolute values ​​of the elements of the environmental condition vector, and the size of the dynamic weight matrix.

[0260] Minimize objective function: Optimize model parameters by minimizing an objective function containing multiple penalty terms.

[0261] The first part of the loss function: represents the sum of squared errors between the predicted power consumption and the actual power consumption.

[0262] Regularization term: used to penalize large weight values ​​to avoid overfitting.

[0263] Smoothness penalty for bias term: used to penalize the non-smoothness of the bias term over time.

[0264] Penalty term of environmental condition vector: used to penalize the absolute value of each element in the environmental condition vector being too large.

[0265] Regularization term of the dynamic weight matrix: used to penalize the size of the dynamic weight matrix to avoid overfitting.

[0266] In the embodiments of the present application, we will introduce in detail how to use the least squares method to fit the relationship between the characteristic vector and the actual power consumption, and give a specific embodiment.

[0267] Assume that we have completed data collection, segmentation, feature extraction, and used nonlinear regression model to predict electricity consumption. Now we need to use the least squares method to fit the relationship between the feature vector and the actual electricity consumption to optimize the model parameters.

[0268] We need to minimize the following objective function:

[0269]

[0270] in:

[0271] w: weight vector.

[0272] b(t): bias term that varies with time.

[0273] Ω(t): Dynamic weight matrix that changes over time.

[0274] T: time window size.

[0275] y t : The actual power consumption at the tth time point.

[0276] λ(t): time-varying regularization coefficient.

[0277] γ: smoothing factor.

[0278] n: coefficient of the environmental condition vector penalty term.

[0279] ξ: coefficient of the regularization term of the dynamic weight matrix.

[0280] The first part of the loss function represents the predicted power consumption f(x t , e t ,h t , t) and actual power consumption y t The sum of the squared errors at all time points t.

[0281] Assume that we have the following data shown in Table 10:

[0282] Table 10

[0283]

[0284] Assume that we have calculated the predicted power consumption f(x t , e t ,h t , t) are shown in Table 11 below:

[0285] Table 11

[0286] Time period <![CDATA[Predicted power consumption f(x t , e t , h t , t)]]> 00:00-00:59 0.75 01:00-01:59 1.15 02:00-02:59 0.95 … …

[0287] Calculate the first part of the loss function:

[0288]

[0289] 3. Regularization term

[0290] The regularization term is used to penalize large weight values ​​to avoid overfitting. Assume that the weight vector w is [0.5, 0.3, 0.2] and the regularization coefficient λ(t) is 0.01.

[0291] λ(t)||w|| 2 =0.01×(0.5 2 +0.3 2 +0.2 2 )=0.01×(0.25+0.09+0.04)=0.01×0.38=0.0038

[0292] 4. Smoothness Penalty of Bias Term

[0293] Assume that the time derivative of the bias term b(t) is 0.02 and the smoothing factor γ is 0.001.

[0294]

[0295] 5. Penalty term of environmental condition vector

[0296] Assume that the environmental condition vector e t The absolute values ​​of the elements are 0.8 and 0.5 respectively, and the penalty coefficient η is 0.001.

[0297]

[0298] 6. Regularization term of dynamic weight matrix

[0299] Assume that the dynamic weight matrix Ω(t) is [[0.1, 0.2], [0.3, 0.4]] and the regularization coefficient ζ is 0.001.

[0300] ζ||Ω(t)||2 =0.001×(0.1 2 +0.2 2 +0.3 2 +0.4 2 )=0.001×(0.01+0.04+0.09+0.16)=0.001×0.3=0.0003

[0301] Comprehensive objective function

[0302] Add the above items together to get the final objective function value:

[0303] Objective function = 0.0075 + 0.0038 + 0.000004 + 0.0013 + 0.0003 = 0.012604.

[0304] By minimizing this objective function, we can optimize the model parameters to make the predicted electricity consumption as close as possible to the actual electricity consumption while avoiding overfitting and other potential problems.

[0305] Figure 2 A structural diagram of a smart electricity real-time metering and data analysis method based on the Internet of Things is provided for the embodiment of the present application, such as Figure 2 As shown, the device comprises:

[0306] A collection module 21, used to collect power usage data of multiple users;

[0307] A segmentation module 22, used to segment the power usage data according to a time series to obtain data segments for multiple time periods;

[0308] A feature extraction module 23 is used to extract features from the data segments using a preset analysis model to obtain a feature vector of power usage in each time period;

[0309] The prediction module 24 is used to predict the power consumption in the next time period according to the characteristic vector and the preset power consumption pattern; wherein the characteristic vector is used to optimize the preset power consumption pattern and adjust the grid load distribution according to the power consumption pattern.

[0310] Figure 2 The intelligent real-time electricity metering and data analysis system based on the Internet of Things can be executed Figure 1 The implementation principle and technical effect of the method for real-time intelligent electricity consumption metering and data analysis based on the Internet of Things described in the embodiment shown are not repeated here. The specific way in which each module and unit performs operations in the system for real-time intelligent electricity consumption metering and data analysis based on the Internet of Things in the above embodiment has been described in detail in the embodiment of the method, and will not be elaborated here.

[0311] In one possible design, Figure 2 The embodiment shown in the figure is a smart real-time electricity metering and data analysis system based on the Internet of Things, which can be implemented as a computing device, such as Figure 3 As shown, the computing device may include a storage component 31 and a processing component 32;

[0312] The storage component 31 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 32 .

[0313] The processing component 32 is used to: collect electricity usage data of multiple users; segment the electricity usage data according to time series to obtain data segments of multiple time periods; use a preset analysis model to extract features of the data segments to obtain a feature vector of electricity usage in each time period; predict the electricity consumption in the next time period based on the feature vector and a preset power usage pattern; wherein the feature vector is used to optimize the preset power usage pattern and adjust the grid load distribution according to the optimized power usage pattern.

[0314] The processing component 32 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0315] The storage component 31 is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0316] Of course, the computing device may also include other components, such as input / output interfaces, display components, communication components, etc.

[0317] The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc.

[0318] The communication component is configured to facilitate, among other things, wired or wireless communications between the computing device and other devices.

[0319] Among them, the computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the computing device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.

[0320] The present application also provides a computer storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 1 The illustrated embodiment is a method for real-time intelligent electricity metering and data analysis based on the Internet of Things.

[0321] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0322] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0323] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0324] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A smart real-time electricity metering and data analysis method based on the Internet of Things, characterized in that: include: Collect electricity usage data of multiple users; Segmenting the power usage data according to time series to obtain data segments for multiple time periods; Extracting features from the data segments using a preset analysis model to obtain a feature vector of power usage in each time period; Predicting the power consumption in the next time period based on the characteristic vector and the preset power consumption pattern; The characteristic vector is used to optimize the preset power consumption mode and adjust the power grid load distribution according to the optimized power consumption mode.

2. The method according to claim 1, characterized in that The collecting of power usage data of multiple users includes: Real-time monitoring of users’ electricity consumption through IoT devices; Power consumption information transmitted from the IoT device is received and recorded as the power usage data.

3. The method according to claim 2, characterized in that The method of extracting features from the data segments using a preset analysis model to obtain a feature vector of power usage in each time period includes: identifying statistical features in the data segment, the statistical features comprising at least a peak value, a mean value, and a standard deviation; The statistical features are weighted averaged using a machine learning algorithm to obtain the feature vector.

4. The method according to claim 3, characterized in that The predicting the power consumption in the next time period according to the feature vector and the preset power consumption mode includes: Based on the characteristic vector, a nonlinear regression model is constructed to estimate the power consumption in the next time period through the nonlinear regression model; The nonlinear regression model uses the least square method to fit the relationship between the characteristic vector and the actual power consumption.

5. The method according to claim 4, characterized in that The constructing a nonlinear regression model based on the characteristic vector to estimate the power consumption in the next time period by the nonlinear regression model includes: The power consumption in the next time period is estimated by predicting the power consumption function, wherein the predicted power consumption function is defined as: Wherein, f(x,e,h,t) represents the estimated power consumption in the next time period, i.e., the predicted power consumption, x represents the feature vector, e represents the external environment condition vector, h represents the historical holiday impact vector, t represents the timestamp, n is the number of elements in the feature vector or the number of features in the nonlinear regression model, ω i (t) represents the dynamic weight that changes over time, g(x; α i ,e,h,t) represents the nonlinear basis function, α i represents the model parameters of the nonlinear regression model, and b(t) represents the bias term that changes with time.

6. The method according to claim 5, characterized in that The nonlinear basis function g(x; α i ,e,h,t) is defined as: g(x;α i ,e,h,t)=MultiHeadAttention(x,e,h,t;W Q ,W K ,W V ) Among them, g(x; α i ,e,h,t) is a nonlinear basis function, MultiHeadAttention is a multi-head attention mechanism, Q, K, V are query matrix, key matrix and value matrix respectively, which are obtained by linear transformation of feature vector x, external environment condition vector e, historical holiday impact vector h, and timestamp t, W Q ,W K ,W V It is a transformation matrix used to convert the feature vector x, the external environmental condition vector e, the historical holiday impact vector h, and the timestamp t into the query matrix Q, the key matrix K and the value matrix V.

7. The method according to claim 6, characterized in that The least square method is used to fit the relationship between the characteristic vector and the actual power consumption, including: Among them, min w,b(t),Ω(t) is the minimization objective function, y t is the actual power consumption at the t-th time point, λ(t) is the regularization coefficient that varies with time, w is the weight vector, γ is the smoothing factor, and t is the time window size; in, is the first part of the loss function, which represents the predicted power consumption f(x t ,e t ,h t ,t) and actual power consumption y t The sum of the squared errors at all time points t, λ(t)||w|| 2 is part of the regularization term, which is used to penalize large weight values ​​w, and λ(t) is the regularization coefficient that changes over time. is the smoothness penalty term for the bias term b(t), is the penalty term for the absolute value of each element in the environmental condition vector e, η is the coefficient of the penalty term, ∥Ω(t)∥ 2 is the regularization term for the dynamic weight matrix Ω(t), and ζ is the coefficient of the regularization term.

8. A method and system for real-time intelligent electricity consumption measurement and data analysis based on the Internet of Things, characterized in that: include: A collection module, used to collect power usage data of multiple users; A segmentation module, used to segment the power usage data according to time series to obtain data segments for multiple time periods; A feature extraction module, used to extract features from the data segments using a preset analysis model to obtain a feature vector of power usage in each time period; A prediction module is used to predict the power consumption in the next time period based on the characteristic vector and the preset power consumption pattern; wherein the characteristic vector is used to optimize the preset power consumption pattern and adjust the power grid load distribution according to the power consumption pattern.

9. A computing device, characterized in that It comprises a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement a smart electricity real-time metering and data analysis method based on the Internet of Things as described in any one of claims 1 to 7.

10. A computer storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a computer, an intelligent real-time electricity metering and data analysis method based on the Internet of Things as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Power load scheduling method and system based on big data

    CN116646933A

  • Power consumer side load prediction method and system

    CN116914747A

  • Light brightness control method and device of LED lamp, equipment and storage medium

    CN117545121A

  • Load imbalance intelligent early warning regulation and control system based on cloud edge computing

    CN118199264A

  • Internet of vehicles data analysis method based on machine learning and related device thereof

    CN118349877A