Power consumption data prediction method and device, electronic equipment and storage medium
By predicting and converting the current electricity consumption data of multiple users, the problem of low prediction accuracy of electricity consumption data in the prior art is solved, and higher prediction accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202411696644.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-21
AI Technical Summary
In the prior art, the accuracy of electricity consumption data prediction is low, especially when the data volume is insufficient, it is difficult to effectively solve this problem.
By obtaining the current electricity consumption data of multiple users, if its similarity is greater than the threshold, input the prediction model to predict, obtain the predicted electricity consumption data, and convert it into multiple frequency components to determine the target electricity consumption data.
The prediction accuracy of electricity consumption data is improved, and the long-term trend of user electricity consumption data can be analyzed based on short-cycle time series data, which enhances the reliability of prediction.
Smart Images

Figure CN119674928A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power systems and data prediction, and in particular to a method, device, electronic equipment and storage medium for predicting power consumption data. Background Art
[0002] In the operation of the power system, it is necessary to predict future power demand or power load in order to reasonably allocate power resources. Accurate power consumption forecasting provides an indispensable decision-making basis for the rational regulation of power resources, thereby enhancing the operating efficiency and reliability of the power system.
[0003] The existing prediction models need to extract time features to ensure the improvement of the propagation ability of electricity consumption data on the time axis. This relies on a large amount of electricity consumption data and has certain limitations. When the amount of data is insufficient, the prediction accuracy of electricity consumption data will be reduced.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] Embodiments of the present invention provide a method, device, electronic device and storage medium for predicting electricity consumption data, so as to at least solve the technical problem of low accuracy in predicting electricity consumption data in related technologies.
[0006] According to one aspect of an embodiment of the present invention, there is provided a method for predicting electricity usage data, comprising: obtaining current electricity usage data of multiple users, wherein the similarity of the current electricity usage data of the multiple users is greater than a threshold; inputting the current electricity usage data into a prediction model, and using the prediction model to predict the electricity usage data of the multiple users in a future time period to obtain predicted electricity usage data of the multiple users; converting the predicted electricity usage data into multiple frequency components, wherein different frequency components are used to characterize the frequency of electricity usage data of different users at different times; and determining target electricity usage data of the multiple users based on the multiple frequency components.
[0007] Optionally, obtaining current electricity usage data of multiple users includes: collecting initial electricity usage data of multiple users; and removing abnormal values from the initial electricity usage data to obtain current electricity usage data.
[0008] Optionally, outliers are removed from the initial power consumption data to obtain current power consumption data, including: detecting the initial power consumption data using the Lagerbus criterion to obtain outliers in the initial power consumption data; and removing outliers from the initial power consumption data to obtain current power consumption data.
[0009] Optionally, the above method also includes: obtaining historical electricity consumption data of multiple users; constructing training data based on the historical electricity consumption data, wherein the training data includes the training electricity consumption data and the actual electricity consumption data of the training electricity consumption data in a future time period; based on the training data, training the initial prediction model to obtain a prediction model.
[0010] Optionally, based on the training data, an initial prediction model is trained to obtain a prediction model, including: inputting the training electricity consumption data into the initial prediction model, using the initial prediction model to predict the electricity consumption data for a future time period to obtain output electricity consumption data; determining the error between the output electricity consumption data and the actual electricity consumption data; and adjusting the initial prediction model based on the error to obtain a prediction model.
[0011] Optionally, the predicted power consumption data is converted into multiple frequency components, including: converting the predicted power consumption data into multiple frequency components through discrete Fourier transform, wherein the amplitude of the frequency component is used to characterize the intensity of the frequency component, and the phase of the frequency component is used to characterize the start time of the frequency component.
[0012] Optionally, based on multiple frequency components, target electricity consumption data of multiple users are determined, including: performing frequency component analysis on the multiple frequency components to obtain a spectrum matrix, wherein the rows of the spectrum matrix are used to represent the frequency and the columns of the spectrum matrix are used to represent the time; based on the spectrum matrix, the target electricity consumption data is obtained.
[0013] Optionally, frequency component analysis is performed on the frequency components to obtain a spectrum matrix, including: performing frequency component analysis on multiple frequency components to obtain the total current; dividing the total current into multiple continuous segments of the same length; performing discrete Fourier transform on the continuous segments to obtain the spectrum matrix.
[0014] Optionally, obtaining target power consumption data based on the spectrum matrix includes: determining a first index of the target power consumption data in the time domain and a second index in the frequency domain in the spectrum matrix; and reading the target power consumption data from the spectrum matrix based on the first index and the second index.
[0015] According to another aspect of an embodiment of the present invention, there is also provided a device for predicting electricity consumption data, including: an acquisition module for acquiring current electricity consumption data of multiple users, wherein the similarity of the current electricity consumption data of the multiple users is greater than a threshold; a prediction module for inputting the electricity consumption data into a prediction model, and using the prediction model to predict the electricity consumption data of the multiple users in a future time period to obtain the predicted electricity consumption data of the multiple users; a conversion module for converting the predicted data into multiple frequency components, wherein the frequency components are used to characterize the frequency of the user's electricity consumption data at different times; and a determination module for determining the target electricity consumption data of the multiple users based on the multiple frequency components.
[0016] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the method in each embodiment of the present invention is executed when the program is running.
[0017] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0018] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0019] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0020] According to another aspect of the embodiments of the present invention, a computer program is further provided. When the computer program is executed by a processor, the methods in the embodiments of the present invention are implemented.
[0021] In an embodiment of the present invention, current electricity consumption data of multiple users are obtained, wherein the similarity of the current electricity consumption data of multiple users is greater than a threshold; the current electricity consumption data is input into a prediction model, and the prediction model is used to predict the electricity consumption data of multiple users in future time periods to obtain predicted electricity consumption data of multiple users; the predicted electricity consumption data is converted into multiple frequency components, wherein different frequency components are used to characterize the frequency of electricity consumption data of different users at different times; based on the multiple frequency components, the target electricity consumption data of multiple users is determined, thereby achieving accurate prediction of electricity consumption data. It is easy to notice that by converting the time series signal of the predicted electricity consumption data into a frequency domain signal, after the electricity consumption data is predicted by the prediction model, the predicted predicted electricity consumption data is converted into multiple frequency components, and then the user's future electricity consumption data is obtained based on the frequency components, so that the long-term trend of the user's electricity consumption data can be analyzed based on the short-period time series data, and the purpose of accurately predicting the electricity consumption data is achieved, thereby achieving the technical effect of improving the reliability of the predicted electricity consumption data, and thus solving the technical problem of low accuracy of electricity consumption data prediction in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0023] Figure 1 is a flow chart of a method for predicting electricity consumption data according to an embodiment of the present invention;
[0024] Figure 2 is a flowchart of a prediction model training method according to an embodiment of the present invention;
[0025] Figure 3 is a flow chart of an optional method for predicting electricity consumption data according to an embodiment of the present invention;
[0026] Figure 4 4 is a schematic diagram of a device for predicting electricity consumption data according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] According to an embodiment of the present invention, an embodiment of a method for predicting electricity consumption data is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0030] Figure 1is a flow chart of a method for predicting power consumption data according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0031] Step S102: obtaining current power usage data of multiple users, wherein the similarity of the current power usage data of the multiple users is greater than a threshold.
[0032] The above-mentioned user may refer to the account holder of the power system. The account can be opened by a resident or an enterprise or institution. There is no limitation on the user here and it can be determined as needed. If it is a resident account, a user usually refers to a family user, and a family user may include at least one family member. Then the current electricity consumption data of a user may refer to the electricity consumption data of all family members in the family.
[0033] The above-mentioned current electricity usage data can be used to characterize the user's current electricity usage. The current electricity usage data may include but is not limited to: power consumption, power, voltage, current, etc. The content of the current electricity usage data is not limited here and can be determined as needed. The current electricity usage data is recorded over time. The current electricity usage data contains at least one data point, and the data point corresponds to a timestamp. The current electricity usage data can be time domain data. By analyzing the current electricity usage data, it can be used to capture the user's electricity usage pattern and characteristics, so that the user's electricity usage data in the future time period can be predicted.
[0034] The similarity of the current electricity consumption data of the above-mentioned multiple users is greater than the threshold. The electricity consumption behaviors or patterns of multiple users are similar, rather than isolated users, which also facilitates the subsequent training and prediction of the prediction model to improve the prediction accuracy of electricity consumption data prediction. By selecting users with similar electrical equipment, the electricity consumption patterns or behaviors of specific electricity users can be captured more accurately, which can also reduce the impact of variables in the prediction model, thereby improving the refinement of the prediction. Because if the electrical equipment of multiple users is of the same type, then the electricity demand of these multiple users may show commonalities, which helps to establish a more accurate prediction model.
[0035] In an optional embodiment, the current electricity consumption data of multiple users can be reported separately through multiple smart meters. Smart meters are used to monitor the user's electricity consumption in real time, and report the current electricity consumption data through a wireless network at preset intervals. In another optional embodiment, the electricity consumption data of multiple power-consuming devices used by the user can be obtained through the Internet of Things technology, and the electricity consumption data of multiple power-consuming devices corresponding to the user can be integrated to obtain the current electricity consumption data. In yet another optional embodiment, the current electricity consumption data can also be obtained by manual recording. By accurately obtaining electricity consumption data, the user's electricity consumption pattern can be predicted more accurately, especially during peak electricity demand periods, which helps to do load management in advance and avoid grid overload.
[0036] Step S104, inputting the current power consumption data into the prediction model, using the prediction model to predict the power consumption data of multiple users in the future time period, and obtaining the predicted power consumption data of the multiple users.
[0037] The above-mentioned prediction model can be a model for predicting the user's electricity consumption data in the future time period. The prediction model can be pre-trained. The prediction model can be a statistical model, such as linear regression, time series analysis, etc., which makes predictions based on the statistical laws of historical data. The prediction model can also be a machine learning model, such as a support vector machine, a random forest, a deep learning model, etc. The prediction model is not limited here and can be determined as needed. The prediction model can predict the user's electricity consumption data in the future time period based on the current electricity consumption data.
[0038] The above-mentioned prediction may refer to the process of predicting the user's electricity consumption data in the future time period, so as to facilitate the planning of power resources for early allocation and scheduling. By accurately predicting the user's future electricity consumption data, it is easy to understand the future electricity demand, so as to reasonably arrange the power generation plan, improve the power generation scheduling, reduce the power generation cost and improve the power supply efficiency. By accurately predicting the user's future electricity consumption data, it is also possible to predict potential peak electricity consumption in advance, prepare for emergencies, adjust the power supply strategy in time, and reduce the risk of power outages.
[0039] The above-mentioned predicted power consumption data can be used to characterize the power consumption of users in future time periods. The predicted power consumption data can be time domain data. The predicted power consumption data can include but is not limited to: power consumption, power, voltage, current, etc. The content of the predicted power consumption data is not limited here and can be determined as needed. The predicted power consumption data can be predicted by the prediction model based on the current power consumption data.
[0040] In an optional embodiment, a prediction model can be constructed using a Back Propagation Through Time (BPTT) algorithm to predict the electricity consumption data of different users in future time periods, and obtain predicted electricity consumption data for multiple users. Specifically, the BPTT algorithm can be pre-trained with historical electricity consumption data to obtain a pre-trained prediction model. The prediction model can capture the long-term dependencies of electricity consumption data. The current electricity consumption data can be input into the trained prediction model, and the prediction model can predict the electricity consumption data of multiple users in future time periods to obtain predicted electricity consumption data for multiple users.
[0041] Step S106: converting the predicted power consumption data into multiple frequency components.
[0042] Among them, different frequency components are used to characterize the frequency of electricity consumption data of different users at different times.
[0043] The above-mentioned multiple frequency components can be used to characterize the frequency of electricity consumption data of different users at different times. Since the predicted electricity consumption data is time series data, the predicted electricity consumption data can be converted into frequency domain data, so as to more effectively analyze and extract periodic characteristics and long-term trends, so as to obtain the target prediction data more accurately. Through the frequency components, the periodic characteristics of the user's daily electricity consumption, seasonal electricity consumption, and electricity consumption at special times can be reflected.
[0044] In an optional embodiment, the predicted power consumption data can be converted into multiple frequency components by Fourier transform. Fourier transform can convert time domain signals into frequency domain signals. The idea of Fourier transform is to represent periodic discrete signals as a linear combination of a series of sine and cosine waves, that is, a superposition of a series of waves of different frequencies. Fourier transform can decompose a signal into multiple frequency components, and each frequency component has a corresponding amplitude and phase. In another optional embodiment, the predicted power consumption data can be converted into multiple frequency components by discrete Fourier transform. In yet another optional embodiment, the predicted power consumption data can be converted into multiple frequency components by fast Fourier transform.
[0045] Step S108: determining target power consumption data of multiple users based on multiple frequency components.
[0046] The target power consumption data mentioned above may be the power consumption data of the user in the future time period. The target power consumption data may include but is not limited to: power consumption, power, voltage, current, etc. The content of the target power consumption data is not limited here and can be determined as needed.
[0047] In an optional embodiment, target power consumption data corresponding to different users can be determined from multiple frequency components through a mapping relationship. Specifically, when the predicted power consumption data is converted into multiple frequency components, a mapping relationship between the frequency components and the power consumption data is simultaneously constructed, so as to determine the target power consumption data based on the mapping relationship.
[0048] In another optional embodiment, the target power consumption data corresponding to different users can be determined from multiple frequency components through a spectrogram matrix. Specifically, the spectrogram matrix can be constructed from multiple frequency components, the rows of the spectrogram matrix are used to represent the frequency, and the columns of the spectrogram matrix are used to represent the time, so that the target power consumption data of users in the future time period can be determined according to the spectrogram matrix.
[0049] In an embodiment of the present invention, current electricity consumption data of multiple users are obtained, wherein the similarity of the current electricity consumption data of multiple users is greater than a threshold; the current electricity consumption data is input into a prediction model, and the prediction model is used to predict the electricity consumption data of multiple users in future time periods to obtain predicted electricity consumption data of multiple users; the predicted electricity consumption data is converted into multiple frequency components, wherein different frequency components are used to characterize the frequency of electricity consumption data of different users at different times; based on the multiple frequency components, the target electricity consumption data of multiple users is determined, thereby achieving accurate prediction of electricity consumption data. It is easy to notice that by converting the time series signal of the predicted electricity consumption data into a frequency domain signal, after the electricity consumption data is predicted by the prediction model, the predicted predicted electricity consumption data is converted into multiple frequency components, and then the user's future electricity consumption data is obtained based on the frequency components, so that the long-term trend of the user's electricity consumption data can be analyzed based on the short-period time series data, and the purpose of accurately predicting the electricity consumption data is achieved, thereby achieving the technical effect of improving the reliability of the predicted electricity consumption data, and thus solving the technical problem of low accuracy of electricity consumption data prediction in the related technology.
[0050] Optionally, obtaining current electricity usage data of multiple users includes: collecting initial electricity usage data of multiple users; and removing abnormal values from the initial electricity usage data to obtain current electricity usage data.
[0051] The above-mentioned initial electricity usage data can be used to characterize the user's current electricity usage. The initial electricity usage data may include, but is not limited to: electricity consumption, power, voltage, current, etc. The content of the initial electricity usage data is not limited here and can be determined as needed. The initial electricity usage data is recorded over time. The initial electricity usage data contains at least one data point, and the data point corresponds to a timestamp. The initial electricity usage data can be time domain data. By collecting the initial electricity usage data, data resources can be provided for the subsequent capture of the user's electricity usage patterns and characteristics, so that the user's electricity usage data in the future time period can be predicted.
[0052] The above-mentioned outlier removal can refer to the process of deleting outliers in the initial electricity consumption data. Through outlier removal, it helps to ensure that the prediction results more truly reflect the characteristics of the electricity consumption data, helps to improve the accuracy and reliability of the data used for subsequent analysis and model prediction, and can also prevent the model from learning the wrong electricity consumption pattern. In addition, the appearance of outliers can sometimes indicate problems with the power system, such as equipment failure or communication problems. Therefore, through outlier removal, it is also easy to identify power system faults and perform maintenance in a timely manner.
[0053] In an optional embodiment, the initial electricity consumption data of multiple users can be collected by a smart meter. Then, the initial electricity consumption data is subjected to outlier removal to obtain the current electricity consumption data. Optionally, the outliers in the initial electricity consumption data can be identified by a detection algorithm, so as to remove the outliers and obtain the current electricity consumption data. The detection algorithm can be one of the following: isolation forest, autoencoder or support vector data description, etc. The detection algorithm is not limited here and can be determined as needed. It is also possible to use a clustering method to regard outliers or data points with a density lower than a preset threshold as outliers, thereby removing the outliers and obtaining the current electricity consumption data. By removing outliers, the accuracy of the prediction model can be improved, and the overall prediction results can be avoided from being affected by the abnormal electricity consumption behavior of individual users. It is suitable for power companies to monitor and analyze the electricity consumption data of large-scale users in real time.
[0054] Optionally, outliers are removed from the initial power consumption data to obtain current power consumption data, including: detecting the initial power consumption data using the Lagerbus criterion to obtain outliers in the initial power consumption data; and removing outliers from the initial power consumption data to obtain current power consumption data.
[0055] In an optional embodiment, the Lagerbus criterion may be used to detect abnormal values in the collected initial power consumption data. The idea of the Lagerbus criterion detection method is to use a data set iteration method to perform abnormal value screening on the maximum and minimum values in the initial power consumption data until all abnormal values are screened out.
[0056] Take the collected initial power consumption data as an example to illustrate. Calculate the standard score of the extreme value of the power consumption data set, and then compare the standard score with the preset critical value. In response to the standard score being greater than the preset critical value, the extreme value corresponding to the standard score is eliminated, and the execution is repeated until the standard score of the extreme value is less than the preset critical value.
[0057] Optionally, the above method also includes: obtaining historical electricity consumption data of multiple users; constructing training data based on the historical electricity consumption data, wherein the training data includes the training electricity consumption data and the actual electricity consumption data of the training electricity consumption data in a future time period; based on the training data, training the initial prediction model to obtain a prediction model.
[0058] The above training data can be used for model training. The training data can include training power consumption data and real power consumption data of the training power consumption data in a future time period. The initial prediction model can be trained with the training data to obtain a prediction model. The training power consumption data can be used to input into the initial prediction model to obtain output power consumption data. The real power consumption data can be used for error analysis to adjust the initial prediction model. The training data can be time series data.
[0059] In an optional embodiment, historical electricity consumption data of multiple users may be first obtained from a cloud storage platform. Then, the historical electricity consumption data may be divided according to a preset ratio to obtain training data, wherein the training data may include training electricity consumption data and actual electricity consumption data of the training electricity consumption data in a future time period. Further, the initial prediction model is trained using the training data to obtain a prediction model. By training the initial prediction model with the training data, the model can be more adapted to the user's electricity consumption pattern, facilitate long-term prediction of the user's electricity consumption behavior, and help optimize the allocation of power resources.
[0060] Figure 2 is a flowchart of a method for training a prediction model according to an embodiment of the present invention. Figure 2 As shown, the method includes:
[0061] Obtain initial historical electricity consumption data of multiple users.
[0062] The initial historical electricity consumption data is preprocessed to obtain historical electricity consumption data.
[0063] A training data set is divided from the historical electricity consumption data. The training data set can be divided according to a preset ratio.
[0064] The initial prediction model is trained using the training data set to obtain a prediction model. The prediction accuracy of the prediction model can be improved through training.
[0065] Use the prediction module to predict users' future electricity consumption data.
[0066] Optionally, based on the training data, an initial prediction model is trained to obtain a prediction model, including: inputting the training electricity consumption data into the initial prediction model, using the initial prediction model to predict the electricity consumption data for a future time period to obtain output electricity consumption data; determining the error between the output electricity consumption data and the actual electricity consumption data; and adjusting the initial prediction model based on the error to obtain a prediction model.
[0067] The above-mentioned initial prediction model can be a model for predicting the user's electricity consumption data in the future time period. The initial prediction model can be a machine learning model, such as a support vector machine, a random forest, a deep learning model, etc. The initial prediction model is not limited here and can be determined as needed. The initial prediction model can predict the user's electricity consumption data in the future time period based on the training electricity consumption data to obtain output electricity consumption data.
[0068] In an optional embodiment, the initial prediction model can be adjusted by a loss function. Specifically, the output power consumption data is predicted by the initial prediction model. Then, the loss function is constructed using the real power consumption data and the output power consumption data. Training based on error feedback can continuously optimize the prediction model and help improve the prediction model.
[0069] Optionally, the predicted power consumption data is converted into multiple frequency components, including: converting the predicted power consumption data into multiple frequency components through discrete Fourier transform, wherein the amplitude of the frequency component is used to characterize the intensity of the frequency component, and the phase of the frequency component is used to characterize the start time of the frequency component.
[0070] In an optional embodiment, the predicted power consumption data can be converted into multiple frequency components by discrete Fourier transform, wherein the amplitude of the frequency component can be used to characterize the intensity of the frequency component, and the phase of the frequency component can be used to characterize the start time of the frequency component. The periodic characteristics in the power consumption data can be revealed by discrete Fourier transform.
[0071] Optionally, based on multiple frequency components, target electricity consumption data of multiple users are determined, including: performing frequency component analysis on the multiple frequency components to obtain a spectrum matrix, wherein the rows of the spectrum matrix are used to represent the frequency and the columns of the spectrum matrix are used to represent the time; based on the spectrum matrix, the target electricity consumption data is obtained.
[0072] The above-mentioned spectrogram matrix can be obtained by performing frequency component analysis on multiple frequency components. The rows of the spectrogram matrix can be used to represent frequency, and the columns of the spectrogram matrix can be used to represent time.
[0073] In an optional embodiment, frequency component analysis can be performed on multiple frequency components to obtain a spectrum matrix, and then based on the spectrum matrix, the required target power consumption data can be obtained. By analyzing the frequency components, the frequency distribution of user power consumption can be more intuitively reflected.
[0074] Optionally, frequency component analysis is performed on the frequency components to obtain a spectrum matrix, including: performing frequency component analysis on multiple frequency components to obtain the total current; dividing the total current into multiple continuous segments of the same length; performing discrete Fourier transform on the continuous segments to obtain the spectrum matrix.
[0075] Taking the power consumption data as current as an example, the process of obtaining the spectrum matrix is explained. First, frequency component analysis is performed on multiple frequency components to obtain the total current.
[0076] Optionally, frequency component analysis can be performed using the following formula:
[0077] i a(t) =i 0(t) +∑ A m=1 i m(t) ;
[0078] In the formula, i a(t) represents the total current of M users at time t, a represents the total amount, t represents the time, i represents 0(t) represents the DC current at time t, ∑ represents the summation operation, A represents the number of frequency components, i m(t) represents the current value of the mth user at time t, where m is a positive integer, m={1, 2, ..., M}, and M refers to the total number of users.
[0079] Then the total current is divided into a plurality of continuous segments of the same length, which are sub-segments of the total current. Discrete Fourier transform is then performed on the continuous segments to obtain a spectrum matrix.
[0080] Optionally, a discrete Fourier transform is performed on the continuous segments using the following formula:
[0081]
[0082] In the formula, It is represented as the frequency domain value of the total current of the t-th continuous segment after discrete Fourier transform, a represents the total amount, ∑ represents the summation operation, p is the data point in the t-th continuous segment, N is the length of the t-th continuous segment, represents the time domain value of the total current in the tth continuous segment, e is a complex rotation factor, j represents a complex operator, π is pi, z is a constant, z is a positive integer, z={0, 1,…, (N-1)}.
[0083] Optionally, the spectrum matrix can be generated by the following formula:
[0084]
[0085] Where S is the spectrum matrix, represents the total current of the first continuous segment in the frequency domain, It represents the total current of the second continuous segment in the frequency domain, a represents the total amount, It represents the total current of the t-th continuous segment in the frequency domain, and T is the number of continuous segments.
[0086] Optionally, obtaining target power consumption data based on the spectrum matrix includes: determining a first index of the target power consumption data in the time domain and a second index in the frequency domain in the spectrum matrix; and reading the target power consumption data from the spectrum matrix based on the first index and the second index.
[0087] In an optional embodiment, the first index of the target power consumption data in the time domain of the spectrum map matrix can be determined through the columns of the spectrum map matrix. The second index of the target power consumption data in the frequency domain of the spectrum map matrix can be determined through the rows of the spectrum map matrix. Then, based on the first index and the second index, the data at the response position is read from the spectrum map matrix, which is the target power consumption data. Through index positioning, the target power consumption data can be obtained quickly and accurately, and it is also convenient for rapid query of power consumption data at a specific time point or a specific frequency, thereby improving prediction efficiency.
[0088] Since the spectrum matrix is obtained after discrete Fourier transform, after reading the data at any row and column position, it is necessary to map the frequency domain signal to the time domain signal through inverse discrete Fourier transform to determine the target power consumption data.
[0089] Optionally, an inverse discrete Fourier transform can be performed using the following formula:
[0090]
[0091] In the formula, i k(tp) represents the result after inverse transformation, TP represents the length of the time series, ∑ represents the summation operation, k represents the frequency domain index, tp represents the time domain index, I(k) represents the value of the kth frequency component in the frequency domain, e represents the complex rotation factor, j represents the complex operator, π is pi, and * represents the product operation.
[0092] Figure 3 is a flowchart of an optional method for predicting power consumption data according to an embodiment of the present invention. Figure 3 As shown, the method includes:
[0093] Collect multiple user electricity usage samples. The similarity of the electrical devices used by these multiple users is greater than a threshold.
[0094] The meter data of multiple smart meters used by multiple users are collected and initial time series data is generated. Optionally, the power consumption can be obtained based on the meter data, thereby constructing the initial time series data of the power consumption.
[0095] Eliminate outliers from the initial time series data to obtain the target time series data.
[0096] The target time series data is learned through the BPTT algorithm and forecast data is generated.
[0097] The predicted data is calculated through discrete Fourier transform to obtain the user's electricity consumption in the future time period.
[0098] According to an embodiment of the present invention, an embodiment of a device for predicting electricity usage data is provided. It should be noted that the device can be used to execute the above-mentioned method for predicting electricity usage data.
[0099] Figure 4 is a schematic diagram of a device for predicting power consumption data according to an embodiment of the present invention. Figure 4 As shown, the device includes: an acquisition module 40, used to acquire current electricity consumption data of multiple users, wherein the similarity of the current electricity consumption data of multiple users is greater than a threshold; a prediction module 42, used to input the electricity consumption data into a prediction model, and use the prediction model to predict the electricity consumption data of multiple users in a future time period to obtain the predicted electricity consumption data of multiple users; a conversion module 44, used to convert the predicted data into multiple frequency components, wherein the frequency components are used to characterize the frequency of the user's electricity consumption data at different times; a determination module 46, used to determine the target electricity consumption data of multiple users based on the multiple frequency components.
[0100] Optionally, the acquisition module is also used to collect initial electricity consumption data of multiple users; remove abnormal values from the initial electricity consumption data to obtain current electricity consumption data.
[0101] Optionally, the acquisition module is further used to detect the initial power consumption data through the Lagerbus criterion to obtain abnormal values in the initial power consumption data; and remove the abnormal values from the initial power consumption data to obtain current power consumption data.
[0102] Optionally, the above device also includes a training module.
[0103] Optionally, a training module is used to obtain historical electricity consumption data of multiple users; based on the historical electricity consumption data, construct training data, wherein the training data includes training electricity consumption data and actual electricity consumption data of the training electricity consumption data in a future time period; based on the training data, train the initial prediction model to obtain a prediction model.
[0104] Optionally, the training module is also used to input the training electricity consumption data into the initial prediction model, use the initial prediction model to predict the electricity consumption data for the future time period, and obtain output electricity consumption data; determine the error between the output electricity consumption data and the actual electricity consumption data; and adjust the initial prediction model based on the error to obtain a prediction model.
[0105] Optionally, the conversion module is further used to convert the predicted electricity consumption data into multiple frequency components through discrete Fourier transform, wherein the amplitude of the frequency component is used to characterize the intensity of the frequency component, and the phase of the frequency component is used to characterize the starting time of the frequency component.
[0106] Optionally, the determination module is also used to perform frequency component analysis on multiple frequency components to obtain a spectrum matrix, wherein the rows of the spectrum matrix are used to represent the frequency and the columns of the spectrum matrix are used to represent the time; based on the spectrum matrix, the target power consumption data is obtained.
[0107] Optionally, the determination module is further used to perform frequency component analysis on multiple frequency components to obtain the total current; divide the total current into multiple continuous segments of the same length; perform discrete Fourier transform on the continuous segments to obtain a spectrum matrix.
[0108] Optionally, the determination module is further used to determine a first index in the time domain and a second index in the frequency domain of the target power consumption data in the spectrum matrix; based on the first index and the second index, read the target power consumption data from the spectrum matrix.
[0109] An embodiment of the present application further provides an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of the present invention when running.
[0110] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0111] An embodiment of the present application further provides a computer program product, including a computer program, which implements the methods in various embodiments of the present invention when executed by a processor.
[0112] An embodiment of the present application further provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0113] The embodiments of the present application further provide a computer program, which implements the methods in the above-mentioned embodiments of the present invention when executed by a processor.
[0114] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0115] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0117] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0118] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0119] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for predicting electricity consumption data, characterized in that: include: Acquire current power usage data of multiple users, wherein the similarity of the current power usage data of the multiple users is greater than a threshold; Inputting the current electricity consumption data into a prediction model, and using the prediction model to predict the electricity consumption data of the multiple users in a future time period to obtain predicted electricity consumption data of the multiple users; Converting the predicted power consumption data into multiple frequency components, wherein different frequency components are used to characterize the frequency of power consumption data of different users at different times; Based on the multiple frequency components, target power usage data of the multiple users are determined.
2. The method according to claim 1, characterized in that The obtaining of current electricity consumption data of multiple users includes: Collecting initial electricity consumption data of the multiple users; Outliers are removed from the initial power consumption data to obtain the current power consumption data.
3. The method according to claim 2, characterized in that The step of removing abnormal values from the initial power consumption data to obtain the current power consumption data includes: Detecting the initial power consumption data by using the Lagerbus criterion to obtain abnormal values in the initial power consumption data; The abnormal value is removed from the initial power consumption data to obtain the current power consumption data.
4. The method according to claim 1, characterized in that: Also includes: Acquiring historical electricity consumption data of the multiple users; Based on the historical power consumption data, construct training data, wherein the training data includes the training power consumption data and the actual power consumption data of the training power consumption data in a future time period; Based on the training data, the initial prediction model is trained to obtain the prediction model.
5. The method according to claim 4, characterized in that The step of training the initial prediction model based on the training data to obtain the prediction model includes: Inputting the training power consumption data into the initial prediction model, using the initial preset model to predict the power consumption data in the future time period, and obtaining output power consumption data; Determining an error between the output power consumption data and the actual power consumption data; The initial prediction model is adjusted based on the error to obtain the prediction model.
6. The method according to claim 1, characterized in that The step of converting the predicted power consumption data into a plurality of frequency components comprises: The predicted power consumption data is converted into a plurality of frequency components by discrete Fourier transform, wherein the amplitude of the frequency component is used to characterize the intensity of the frequency component, and the phase of the frequency component is used to characterize the starting time of the frequency component.
7. The method according to claim 6, characterized in that The determining target power consumption data of the plurality of users based on the plurality of frequency components comprises: Performing frequency component analysis on the multiple frequency components to obtain a spectrogram matrix, wherein rows of the spectrogram matrix are used to represent frequencies, and columns of the spectrogram matrix are used to represent time; Based on the frequency spectrum matrix, the target power consumption data is obtained.
8. The method according to claim 7, characterized in that The performing frequency component analysis on the frequency components to obtain a spectrum matrix includes: Performing frequency component analysis on the multiple frequency components to obtain a total current; dividing the total amount of current into a plurality of continuous segments of equal length; The continuous segments are subjected to discrete Fourier transform to obtain the spectrum map matrix.
9. The method according to claim 8, characterized in that The step of obtaining the target power consumption data based on the spectrum matrix includes: Determine a first index of the target power consumption data in the time domain and a second index in the frequency domain in the spectrum matrix; Based on the first index and the second index, the target power usage data is read out from the spectrum map matrix.
10. A device for predicting electricity consumption data, characterized in that: include: An acquisition module, used to acquire current power usage data of multiple users, wherein the similarity of the current power usage data of the multiple users is greater than a threshold; A prediction module, configured to input the power consumption data into a prediction model, and use the prediction model to predict the power consumption data of the multiple users in a future time period to obtain predicted power consumption data of the multiple users; A conversion module, used to convert the predicted data into a plurality of frequency components, wherein the frequency components are used to characterize the frequency of the user's electricity consumption data at different times; A determination module is used to determine target power consumption data of the multiple users based on the multiple frequency components.
11. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 9 when running.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 9.
13. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 9.