Power change factor analysis method and device, computer device and storage medium
By performing multi-layer neural network fitting calculations on the power change factor analysis model, the problem of low correlation between factor variables and power change values in existing technologies has been solved, thereby improving the accuracy of power change analysis and providing higher analytical reference value.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTHERN POWER GRID DIGITAL GRID RESEARCH INSTITUTE CO LTD
- Filing Date
- 2022-04-15
- Publication Date
- 2026-07-21
AI Technical Summary
Existing methods for analyzing factors affecting electricity consumption rely on the quantitative analysis of the relationship between a single variable and electricity consumption, resulting in low accuracy of the correlation between factor variables and electricity consumption values, and poor analytical reference effectiveness.
By acquiring raw electricity-related data within the target time series, preprocessing it, and then inputting it into a pre-trained electricity change factor analysis model, a multi-layer neural network is used for fitting calculations to determine the electricity components corresponding to each influencing factor, taking into account the impact of multiple influencing factors on electricity changes.
It improves the accuracy of quantitative influencing factors in determining electricity consumption changes, providing greater reference value for analyzing regional and industry electricity consumption status.
Smart Images

Figure CN114998048B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power technology, and in particular to a method, apparatus, computer equipment, storage medium, and computer program product for analyzing factors of power variation. Background Technology
[0002] With the rapid development of society and the economy, the level of electrification is constantly increasing. The introduction of "dual-carbon" targets also indicates that electricity, as a clean and efficient secondary energy source, will play a more important role in supporting socio-economic development, serving the energy needs of people's livelihoods, and building a clean, low-carbon, safe, and efficient energy system. Electricity load is influenced by many complex factors, exhibiting a complex pattern of change. Quantifying the impact of key factors on electricity consumption changes is beneficial for timely understanding regional and industry-specific electricity consumption dynamics and identifying the main factors influencing electricity consumption changes, thus playing a significant role in ensuring a balance between electricity supply and demand.
[0003] Currently, the commonly used methods for analyzing factors of electricity changes in the power sector rely solely on the relationship between a single variable and electricity for quantitative analysis and calculation. As a result, the accuracy of the correlation between the obtained factor variables and electricity change values is low, and the analytical reference effect is not good. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for analyzing electricity change factors that can improve the accuracy of quantifying the influence of influencing factors on electricity change values, in order to address the above-mentioned technical problems.
[0005] In a first aspect, this application provides a method for analyzing factors affecting electricity variation, the method comprising:
[0006] Obtain raw electricity-related data within the target time series;
[0007] The raw data related to electricity consumption are preprocessed to obtain key factor feature data;
[0008] The key factor feature data is input into a pre-trained power change factor analysis model, and the key factor feature data is fitted and calculated to obtain the power component corresponding to each preset dimension of the influencing factor in the key factor feature data; wherein, the power change factor analysis model includes a first feature input layer and a first hidden layer, and the first hidden layer is set with a fitting function corresponding to each influencing factor, which is used to calculate and output the power component corresponding to each influencing factor.
[0009] Based on the electrical quantity components corresponding to each of the aforementioned influencing factors, the impact of each of the aforementioned influencing factors on the change in electrical quantity within the target time series is determined.
[0010] Secondly, this application also provides a device for analyzing factors of electricity variation, the device comprising:
[0011] The raw data acquisition module is used to acquire raw data related to electricity consumption within the target time series.
[0012] The preprocessing module is used to preprocess the raw data related to electricity to obtain key factor feature data;
[0013] The power component calculation module is used to input the key factor feature data into a pre-trained power change factor analysis model, perform fitting calculation on the key factor feature data, and obtain the power component corresponding to each preset dimension of the influencing factor in the key factor feature data; wherein, the power change factor analysis model includes a first feature input layer and a first hidden layer, the first hidden layer is set with fitting functions corresponding to each influencing factor, used to calculate and output the power component corresponding to each influencing factor.
[0014] The influence determination module is used to determine the influence of each of the influencing factors on the change in electricity within the target time interval based on the electricity component corresponding to each of the influencing factors.
[0015] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.
[0016] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0017] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0018] The aforementioned methods, devices, computer equipment, storage media, and computer programs for analyzing electricity consumption changes acquire raw electricity consumption data within a target time series. From this raw data, key factor characteristic data influencing electricity consumption changes are processed. This key factor characteristic data is then input into a pre-trained electricity consumption change factor analysis model. The model fits and calculates the key factor characteristic data to obtain the electricity consumption components corresponding to each preset dimension of the influencing factors within the key factor characteristic data. When analyzing the causes of electricity consumption changes over a specific period, the impact of each influencing factor on electricity consumption changes within the target time series can be determined based on the corresponding electricity consumption components. By considering the influence of multiple factors on electricity consumption changes, the accuracy of quantifying the impact of these factors on electricity consumption change values is improved, providing high reference value for subsequent analyses of regional and industry electricity consumption status. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating a method for analyzing factors affecting electricity changes in one embodiment;
[0020] Figure 2 This is a flowchart illustrating the steps of preprocessing raw electricity-related data to obtain key factor feature data in one embodiment.
[0021] Figure 3 This is a graph showing the actual temperature function of a region in one embodiment;
[0022] Figure 4 This is a graph showing the actual temperature function of another region in one embodiment;
[0023] Figure 5 Here is a graph of the temperature component function fitted to a region in one embodiment;
[0024] Figure 6 Fit a temperature component function curve to another region in one embodiment;
[0025] Figure 7 This is a flowchart illustrating the training process steps of a power variation factor analysis model in one embodiment.
[0026] Figure 8 This is a flowchart illustrating the steps of preprocessing the original training dataset to obtain the training feature dataset in one embodiment.
[0027] Figure 9 This is a flowchart illustrating the steps of encoding historical date data to obtain historical holiday encoded data in one embodiment.
[0028] Figure 10 This is a flowchart illustrating the method for analyzing factors of electricity variation in another embodiment;
[0029] Figure 11 This is a structural block diagram of the initial analysis model in one embodiment;
[0030] Figure 12 This is a structural block diagram of a power variation factor analysis model in one embodiment;
[0031] Figure 13 This is a structural block diagram of a power variation factor analysis device in one embodiment;
[0032] Figure 14 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0034] In one embodiment, such as Figure 1 As shown, a method for analyzing factors affecting electricity consumption is provided. This embodiment illustrates the method's application to a terminal. It is understood that this method can also be applied to a server, and to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0035] Step 102: Obtain raw data related to electricity consumption within the target time series.
[0036] Among them, the raw data related to electricity consumption refers to all raw data related to changes in electricity consumption within the target time interval and target area. It is obtained by arranging all raw data within the preset time interval in a time series.
[0037] Specifically, the process involves acquiring raw data related to electricity consumption within the target time series. This raw data comprises all data related to changes in electricity consumption in the target region within the target time interval. For example, if it is necessary to analyze the factors affecting changes in electricity consumption in five southern provinces (Guangdong, Guangxi, Yunnan, Guizhou, and Hainan) over the past two years, then the daily total electricity consumption data, temperature data, and electricity-related policy data for the five southern provinces over the past two years would be acquired as raw data. The raw data would then be arranged according to the time series to obtain the raw data related to electricity consumption.
[0038] In one embodiment, the temperature data may be a collection of daily average temperature data.
[0039] Step 104: Preprocess the raw data related to electricity consumption to obtain key factor feature data.
[0040] Among them, the key factor feature data refers to the feature data corresponding to each factor that has a key impact on changes in electricity volume. It can be understood that the key factor feature data includes feature data corresponding to influencing factors across multiple preset dimensions.
[0041] Specifically, after obtaining the raw electricity-related data within the target time series, the raw data is preprocessed to obtain feature data corresponding to each factor that has a key impact on electricity changes. Understandably, preprocessing the raw electricity-related data can involve handling missing values, performing feature encoding, or standardizing the data.
[0042] Step 106: Input the key factor feature data into the pre-trained power change factor analysis model, perform fitting calculation on the key factor feature data, and obtain the power component corresponding to each preset dimension of the influencing factor in the key factor feature data; wherein, the power change factor analysis model includes a first feature input layer and a first hidden layer, the first hidden layer is set with fitting functions corresponding to each influencing factor, which are used to calculate and output the power component corresponding to each influencing factor.
[0043] The electricity variation factor analysis model is pre-trained from the initial analysis and is a deep learning model that calculates the electricity components corresponding to each influencing factor after processing the input key factor feature data. The electricity variation factor analysis template includes a first feature input layer and a first hidden layer. The first hidden layer contains fitting functions for each influencing factor, which can fit and calculate the feature data corresponding to each preset dimension of the input influencing factor to obtain and output the electricity components corresponding to each influencing factor. Understandably, the type of initial analysis model can be selected based on the actual situation.
[0044] The influencing factors for each preset dimension refer to factors in different dimensions that affect changes in electricity consumption. Understandably, preset dimensions can be selected based on the actual situation of the target region and target time period. For example, if it is necessary to analyze the reasons for changes in electricity consumption in Guangdong Province over the past three months, the preset dimensions could be temperature, policy, economic factors, etc.; if it is necessary to analyze the reasons for changes in electricity consumption in a factory over the past year, the preset dimensions could be factory profitability, holidays, etc.
[0045] The fitting function is the accurate expression of the function obtained by fitting the function in the initial neural network. Specifically, the initial function in the initial model is iteratively calculated, and the parameters of the initial function are updated and replaced based on the output results to obtain the accurate expression of the fitting function. It is understandable that, since the influencing factors belong to different preset dimensions, each preset dimension of the influencing factor in the electricity change factor analysis model has a corresponding fitting function.
[0046] Specifically, the key factor feature data is input into the first feature input layer of the pre-trained power change factor analysis model. The first feature input layer inputs the feature data of each influencing factor into the fitting function set in the first hidden layer according to the dimension to which the influencing factor belongs. The fitting function performs fitting calculation on the feature data of each influencing factor and outputs the power component corresponding to each influencing factor.
[0047] In one embodiment, the initial analysis model can be a BP (Back Propagation) neural network model. The basic principle of the BP neural network model is to transform an input vector through a series of transformations in the hidden layers to obtain an output vector, thereby realizing a mapping relationship between the input and output data. The forward propagation of input information and the backward propagation of output error constitute the information loop of the BP network.
[0048] Step 108: Based on the electricity components corresponding to each influencing factor, determine the impact of each influencing factor on electricity changes within the target time series.
[0049] Specifically, based on the electrical quantity components corresponding to each influencing factor output by the first hidden layer, the degree of influence of each influencing factor on the change in electrical quantity within the target time series can be determined.
[0050] In one embodiment, determining the impact of each influencing factor on electricity changes within a target time series, based on the electricity components corresponding to each influencing factor, includes: calculating the sum of the electricity components corresponding to each influencing factor within the target time series to obtain each first total electricity component corresponding to each influencing factor; calculating the difference between each first total electricity component and each second total electricity component corresponding to each influencing factor within a control time series; and determining the degree of influence of each influencing factor on electricity changes within the target time series based on the difference. The control time series is the time series used to determine electricity change values relative to the target time series. It is understood that the second total electricity components can be pre-stored or obtained by inputting key factor characteristic data from the control time series into the electricity change factor analysis model.
[0051] For example, to determine the impact of various influencing factors on electricity consumption changes in Guangdong Province in April 2021 compared to April 2020, the target time series is the entire month of April 2021 in Guangdong Province, and the reference time series is the entire month of April 2020 in Guangdong Province. The key factor characteristic data for each day in April 2021 are input into the electricity consumption change factor analysis model to obtain the electricity component corresponding to each influencing factor for each day. The electricity components corresponding to each influencing factor are then added together to obtain the first total electricity component for the entire month of April for each influencing factor. At this point, the second total electricity component corresponding to each influencing factor for the entire month of April 2020 is obtained. The difference between each first total electricity component and each second total electricity component is calculated. If the first total electricity component is 2 million units and the second total electricity component is 2.5 million units, then it can be quantified that the change in temperature in April 2021 compared to April 2020 increased electricity consumption in Guangdong Province by 500,000 units.
[0052] In one embodiment, determining the impact of each influencing factor on the change in electricity volume within the target time series based on the electricity volume component corresponding to each influencing factor includes: calculating the proportion of each influencing factor in the change in electricity volume based on the electricity volume component corresponding to each influencing factor, determining the proportion of each influencing factor on the change in electricity volume within the target time series, and determining the impact of each influencing factor on the change in electricity volume within the target time series based on the proportion of ... influence of the influencing factor on the change in electricity volume within the target time series.
[0053] The above-described method for analyzing electricity consumption variation factors involves acquiring raw electricity consumption data within a target time series, processing the raw data to obtain key factor characteristic data influencing electricity consumption variation, inputting this key factor characteristic data into a pre-trained electricity consumption variation factor analysis model, and performing fitting calculations on the key factor characteristic data to obtain the electricity consumption components corresponding to each preset dimension of the influencing factors in the key factor characteristic data. Based on the electricity consumption components corresponding to each influencing factor, the impact of each influencing factor on electricity consumption variation within the target time series is determined. When it is necessary to analyze the causes of electricity consumption variation during a certain period, the impact of each influencing factor on the electricity consumption variation during that period can be determined according to its corresponding influence. By considering the impact of multiple influencing factors on electricity consumption variation, the accuracy of quantifying the impact of influencing factors on electricity consumption variation values is improved, providing high reference value for subsequent analysis of regional and industry electricity consumption status.
[0054] In one embodiment, the raw electricity-related data includes electricity consumption data, temperature data, and electricity-related policy data; key factor characteristic data includes temperature characteristic data, holiday characteristic data, trend characteristic data, and policy characteristic data. For example... Figure 2 As shown, the preprocessing of raw electricity-related data to obtain key factor feature data includes the following steps:
[0055] Step 202: Encode the raw data related to electricity based on the preset coding mapping relationship to obtain feature coding data. The feature coding data includes temperature coding data, first holiday coding data, trend coding data, and policy coding data.
[0056] The pre-defined encoding mapping relationship is the correspondence between the original data and the feature-encoded data. Through this pre-defined mapping relationship, the corresponding feature-encoded data can be obtained from the original data. Specifically, the pre-defined encoding mapping relationship is obtained after encoding the training data during the initial model training. This pre-defined encoding mapping relationship is stored in the preprocessing module. When the original data needs to be preprocessed in actual applications, the preprocessing module will process the original data according to the pre-defined encoding mapping relationship. It can be understood that the pre-defined encoding mapping relationship can be a pre-defined encoding rule, a pre-defined encoding correspondence table, etc., and each dimension's influencing factors have a corresponding pre-defined encoding mapping relationship.
[0057] Among them, the temperature coding data is the coded data obtained by processing the temperature data in the original data related to electricity according to a preset coding mapping relationship.
[0058] The first holiday coding data is generated based on the dates corresponding to the original electricity consumption data. The first holiday coding data is obtained according to the holiday coding mapping relationship between dates and preset coding relationships. Specifically, the dates in the target time interval are sorted according to time sequence, and the holiday type for each date is determined based on the corresponding public holiday. Each date is then coded according to the holiday type and the preset coding mapping relationship to obtain the first holiday coding data. For example, holiday types can include weekdays, weekends, short holidays, long holidays, and the Spring Festival (Chinese New Year).
[0059] The trend-coded data is generated based on the dates corresponding to the original electricity consumption data. The dates within the target time interval are sorted according to their time sequence, and the trend-coded data is obtained based on the trend coding mapping relationship between the dates and the preset coding relationship. For example, as my country's economic and social development steadily progresses, electricity consumption generally shows an upward trend over time. Therefore, the dates within the target time interval are sorted according to their time sequence, and the date corresponding to the smallest year and month is selected as the base period code. The dates within the target time interval are then coded according to the upward trend to obtain the trend-coded data.
[0060] The policy coding data is generated based on electricity-related policy data from the original electricity-related data and their corresponding dates. After arranging the dates in the target time interval according to the time sequence, the policy coding data is obtained based on the policy data corresponding to the dates and the policy coding mapping relationship in the preset coding mapping relationship.
[0061] Specifically, the raw data related to electricity consumption are encoded based on a preset coding mapping relationship to obtain corresponding temperature coding data, first holiday coding data, trend coding data, and policy coding data.
[0062] Step 204: Normalize each feature code data according to the normalization parameters corresponding to each feature code data to obtain temperature feature data, holiday feature data, trend feature data, and policy feature data.
[0063] Normalization is performed to facilitate subsequent data processing and accelerate program convergence by limiting the data to a certain range. Its specific function is to standardize the statistical distribution of the samples. Normalization between 0 and 1 represents a statistical probability distribution, while normalization within a certain interval represents a statistical coordinate distribution.
[0064] Specifically, based on the normalization parameters corresponding to each feature code data, the feature code data is normalized to obtain temperature feature data, holiday feature data, trend feature data, and policy feature data.
[0065] In this embodiment, the acquired raw electricity-related data is encoded based on a preset coding mapping relationship to obtain the characteristic coding data corresponding to each influencing factor. Then, the coded data is normalized to obtain temperature characteristic data, holiday characteristic data, trend characteristic data, and policy characteristic data corresponding to the influencing factors. The preprocessed data classification is clearer, and subsequent input into the model for processing is more convenient, providing a data foundation for obtaining the electricity components corresponding to each influencing factor through the electricity change factor analysis model.
[0066] Currently, traditional methods for fitting temperature components often employ polynomial functions (generally linear and quadratic functions). However, repeated visualization analyses of daily electricity consumption and average daily temperature in experiments have revealed that the relationship between daily electricity consumption and average daily temperature cannot be simply fitted using linear or quadratic functions. For example, daily electricity consumption in Guangdong, Guangxi, and Hainan is highly sensitive to high-temperature ranges. Specifically, in Guangdong, daily electricity consumption is less sensitive to average daily temperature in low-temperature ranges (below 22°C), decreasing slightly as the average daily temperature decreases. However, in high-temperature ranges (above 22°C), daily electricity consumption is highly sensitive to average daily temperature, increasing significantly as the average daily temperature rises. Figure 3 As shown; however, daily electricity consumption in Yunnan and Guizhou is more sensitive to low-temperature ranges. Specifically, in Yunnan, daily electricity consumption is highly sensitive to the average daily temperature during low-temperature ranges (below 22℃), increasing significantly as the average daily temperature decreases. However, in high-temperature ranges (above 22℃), daily electricity consumption is less sensitive to the average daily temperature, increasing only slightly as the average daily temperature rises. Figure 4 As shown.
[0067] Therefore, in one embodiment, the fitting function corresponding to the temperature feature data uses a piecewise quadratic fitting function trained based on daily temperature and daily electricity consumption.
[0068] The piecewise quadratic fitting function is a function that has different analytical expressions for different ranges of values of the independent variable. The formula is as follows:
[0069]
[0070] Among them, T t The electrical component affected by temperature factors. The preprocessed temperature characteristic data; (h temp ,k temp Let ) be the common vertex of the two piecewise quadratic function curves, where To define the boundary of the piecewise function, the initial analysis model needs to be trained and optimized; (a_l temp ,a_r temp The parameters of the two piecewise quadratic function curves are used to control the sensitivity of daily electricity consumption and daily temperature, and need to be optimized using a BP neural network. The daily temperature can be the daily average temperature.
[0071] Using a piecewise quadratic fitting function Figure 3 The Guangdong temperature data was fitted to the curve, and the resulting fitted curve is shown below. Figure 5 As shown; for Figure 4 The Yunnan temperature data was fitted to the curve, and the resulting fitted curve is shown below. Figure 6 As shown in the figure, using a piecewise quadratic fitting function to fit the temperature characteristic data results in higher fitting accuracy and more precise fitting results.
[0072] In one embodiment, the fitting function corresponding to the holiday feature data is a quadratic function.
[0073] Specifically, the formula for the holiday fitting function is as follows:
[0074]
[0075] Among them, H t The weight of the impact of holiday factors; The preprocessed holiday feature data; a holiday b holiday c holiday The parameters of the fitting function need to be optimized using the initial analysis model.
[0076] In one embodiment, the fitting function corresponding to the trend feature data is a linear function.
[0077] Specifically, the formula for the trend fitting function is as follows:
[0078]
[0079] Among them, C t The weight of the impact of holiday factors; For preprocessed trend feature data; a trend b trend The parameters of the fitting function need to be optimized using the initial analysis model.
[0080] In one embodiment, the fitting function corresponding to the policy feature data is a quadratic function.
[0081] Specifically, the formula for the policy fitting function is as follows:
[0082]
[0083] Among them, P t The weight of the impact of holiday factors; For the processed policy characteristic data; a policy b policy c policy The parameters of the fitting function need to be optimized using the initial analysis model.
[0084] In one embodiment, such as Figure 7 As shown, the training process of the electricity variation factor analysis model includes the following steps:
[0085] Step 702: Obtain the original training dataset.
[0086] Specifically, historical data related to electricity consumption in different regions within a preset time series are obtained as the original training dataset 1.
[0087] Step 704: Preprocess the original training dataset to obtain the training feature dataset.
[0088] Specifically, after obtaining the original training dataset, it is preprocessed to obtain training feature data corresponding to each factor that has a key impact on changes in electricity consumption. Understandably, preprocessing the original training dataset can involve handling missing values, performing feature encoding, or standardizing the data.
[0089] Step 706: Input the training feature dataset into the initial analysis model for fitting calculation. Obtain the fitted electric charge value through the output layer of the initial analysis model. The initial analysis model includes a second feature input layer, a second hidden layer, and an output layer.
[0090] The initial analysis model is a pre-built neural network model, including a second feature input layer, a second hidden layer, and an output layer.
[0091] Specifically, the second feature input layer of the initial analysis model is connected to the second hidden layer. After receiving the input training feature data, the second feature input layer inputs the training feature data into the fitting function set in the second hidden layer according to the influencing factor dimension corresponding to the training feature data. After the second hidden layer performs fitting calculation on each training feature data, it outputs the electric power component corresponding to each influencing factor and inputs each electric power component into the output layer. The output layer obtains the fitted electric power value based on the sum of each electric power component.
[0092] Step 708: Adjust the parameters of the second feature input layer, the second hidden layer, and the output layer in the initial analysis model according to the deviation between the fitted power value and the actual power value in the historical power data, update the initial analysis model based on the fitted power value and the actual power value in the historical power data, and determine whether the current initial analysis model meets the requirements.
[0093] The actual electricity consumption value is the real electricity consumption value within the training area. Specifically, the corresponding actual electricity consumption value can be found from historical electricity consumption data based on the date corresponding to the fitted electricity consumption value.
[0094] Specifically, the fitted energy value output by the initial analysis model is compared with the actual energy value corresponding to the fitted energy value. Based on the deviation between the fitted energy value and the actual energy value, the parameters of the second feature input layer, the second hidden layer, and the output layer in the initial analysis model are adjusted to update the initial analysis model.
[0095] In one embodiment, adjusting the parameters of the second feature input layer, the second hidden layer, and the output layer in the initial analysis model based on the deviation between the fitted energy value and the actual energy value includes: inputting the fitted energy value and the actual energy value into the objective function to obtain the objective function value; if the objective function value does not meet the preset objective function difference, it is determined that the current initial analysis model does not meet the requirements; and using the backpropagation mechanism of the initial analysis model error, combined with the gradient descent optimization algorithm, adjusting the parameters of the second feature input layer, the second hidden layer, and the output layer in the initial analysis model.
[0096] In one embodiment, adjusting the parameters of the second feature input layer, the second hidden layer, and the output layer in the initial analysis model based on the deviation between the fitted power value and the actual power value includes: calculating the difference between the fitted power value and the actual power value; comparing the difference with a preset difference; if the difference does not meet the preset difference, determining that the current initial analysis model does not meet the requirements; and adjusting the parameters of the second feature input layer, the second hidden layer, and the output layer in the initial analysis model using the backpropagation mechanism of the initial analysis model error combined with the gradient descent optimization algorithm.
[0097] Step 710: Iterate back to the step of inputting the training feature dataset into the initial analysis model for fitting calculation to obtain the fitted electricity value, and continue training until the training termination condition is met to obtain the trained electricity change factor analysis model.
[0098] Specifically, after adjusting the parameters of the second feature input layer, the second hidden layer, and the output layer in the initial analysis model, the process iteratively returns to the step of inputting the training feature dataset into the initial analysis model for fitting calculations to obtain the fitted electricity value. Training continues until the training termination condition is met. When the training termination condition is met, it indicates that using the parameters of each fitting function in the second hidden layer to fit the input feature data can yield accurate electricity component values. Therefore, the fitted electricity value output by the output layer can more closely approximate the true electricity value. Once the current initial analysis model is deemed to meet the requirements, the output layer of the current initial analysis model is removed, and the initial analysis model with the output layer removed is determined as the electricity variation factor analysis model.
[0099] In one embodiment, the fitted battery value and the actual battery value are input into the objective function to obtain the objective function value. If the objective function value satisfies the preset objective function difference, it is determined that the current initial analysis model meets the training termination condition.
[0100] In one embodiment, the difference between the fitted power value and the actual power value is calculated, and the difference is compared with a preset difference. If the difference meets the preset difference, it is determined that the current initial analysis model meets the training termination condition.
[0101] In this implementation, the obtained original training dataset is preprocessed to obtain a training feature dataset. The training feature dataset is then input into the initial analysis model, and the initial analysis model is iteratively trained to obtain an analysis model of electricity change factors that can accurately calculate the electricity components corresponding to each influencing factor. This effectively improves the accuracy of quantifying the impact of influencing factors on electricity change values.
[0102] In one embodiment, the original training dataset includes historical electricity consumption data, historical temperature data, and historical electricity-related policy data within a preset time series. The training feature dataset includes training temperature feature data, training holiday feature data, training trend feature data, and training policy feature data. As shown in Figure 8, the original training dataset is preprocessed to obtain the training feature dataset, including the following steps:
[0103] Step 802: Calculate the historical temperature data using an exponentially weighted moving average to obtain the historical temperature coded data.
[0104] Exponentially weighted moving averages are used to estimate the local mean of variables, making the updates of variables related to their historical values over a period of time. Calculating exponentially weighted moving averages of historical temperature data can effectively increase the robustness of the model and fully extract temperature characteristic information.
[0105] Specifically, the formula for calculating the index-weighted moving average temperature is as follows:
[0106]
[0107] Among them, temp_ewm t temp is the index-weighted moving average temperature on day t. t t represents the true average temperature on day t; β is the decay factor, and its specific value can be set according to the actual situation. In this embodiment, β is set to 2 / 3.
[0108] The historical temperature data is calculated by using the above-mentioned exponentially weighted moving average temperature calculation formula to obtain the historical temperature coded data.
[0109] Step 804: Obtain historical date data based on a preset time series, encode the historical date data, and obtain historical holiday coded data and historical trend coded data.
[0110] The historical date data is obtained based on a preset time series. In other words, historical date data is derived from a set of dates within a preset time series.
[0111] Specifically, the set of dates in the preset time series is used to obtain historical date data, and historical holiday code data and historical trend code data are obtained by encoding the obtained historical date data.
[0112] In one embodiment, obtaining historical trend encoded data based on historical date data includes: encoding the historical date data using an ordinal encoder rule to obtain historical trend encoded data. Specifically, the date data with the shortest year and month in the historical date data is used as the base period code, with a base period code value of 1, the code value of the next month being 2, and so on, to obtain the historical trend encoded data.
[0113] Step 806: Encode the historical policy data to obtain coded historical policy data.
[0114] Historical policy data refers to policy data related to historical electricity consumption within a preset time series. It is understandable that the policies in the historical policy data correspond to one or more dates in the historical timeline.
[0115] Specifically, historical policy data is encoded to obtain coded historical policy data. Encoding can be done automatically using preset encoding functions or tables, or manually using annotation.
[0116] For example, during certain periods, policies have a significant impact on electricity consumption. For instance, in the second half of 2021, Yunnan Province faced a very tense power supply and demand situation, as well as energy consumption control measures. The government, in conjunction with power grid companies, implemented two rounds of power rationing and production restrictions. The first round, concentrated in May and June, focused on orderly electricity consumption, primarily addressing the power shortage caused by insufficient thermal power plant operation and hydropower shortages during the dry season. The second round of energy consumption control measures began in September, aiming to curb the blind development of high-energy-consuming and high-polluting projects and strengthen control over key industries such as steel, cement, yellow phosphorus, electrolytic aluminum, industrial silicon, and coal. During these two rounds of power rationing and production restrictions, daily electricity consumption decreased significantly. Therefore, manual coding can be used based on the scope of policy impact. For example, in Yunnan, dates unaffected by the policy are coded as 1, the first round of power rationing is coded as 0.75, and the second round as 0.8.
[0117] Step 808: Normalize each encoded data to obtain training temperature feature data, training holiday feature data, training trend feature data, and training policy feature data.
[0118] Normalization is performed to facilitate subsequent data processing and accelerate program convergence by limiting the data to a certain range. Its specific function is to standardize the statistical distribution of the samples. Normalization between 0 and 1 represents a statistical probability distribution, while normalization within a certain interval represents a statistical coordinate distribution.
[0119] Specifically, the historical temperature coding data is normalized using the following formula:
[0120]
[0121] in, The training temperature feature data for day t after normalization; temp_ewm t This refers to the historical temperature coding data for day t. For all temp_ewm in this region t The average value; For all temp_ewm in this region t The standard deviation.
[0122] The historical holiday coding data is normalized using the following formula:
[0123]
[0124] in, The training holiday feature data for day t after normalization; holiday t This is the historical holiday coding data for day t; For all holidays in this area tThe average value; For all holidays in this area t The standard deviation.
[0125] The historical trend coding data is normalized using the following formula:
[0126]
[0127] in, The training trend feature data for day t after normalization; trend t Encode the historical trend data for day t; For all trends in this region t The average value; For all trends in this region t The standard deviation.
[0128] The historical policy coding data is normalized using the following formula:
[0129]
[0130] in, For normalized training policy feature data for day t; trend t Historical policy coding data for the index on day t; For all trends in this region t The average value; For all trends in this region t The standard deviation.
[0131] In this implementation, the original training dataset is encoded to obtain coded feature data corresponding to each influencing factor. These coded feature data are then normalized to obtain training temperature feature data, training holiday feature data, training trend feature data, and training policy feature data corresponding to the influencing factors. The preprocessed data is more clearly categorized, making subsequent input into the model easier and providing a data foundation for obtaining the final electricity change factor analysis model through training the initial analysis model.
[0132] When obtaining historical holiday coding data, if the electricity consumption corresponding to the historical date data is directly used as the target for coding, extreme coding data may easily occur. For example, in Yunnan and Guizhou, the peak electricity consumption occurs in winter, and the electricity consumption surges due to heating. Therefore, the electricity consumption during the Spring Festival travel rush is generally greater than that in non-winter periods. Directly targeting the electricity consumption will result in excessively large coding values for the Spring Festival travel rush.
[0133] Therefore, in one embodiment, such as Figure 9As shown, encoding historical date data to obtain historical holiday coded data includes the following steps:
[0134] Step 902: Classify the historical date data according to the holiday type corresponding to each date, and set holiday labels for each date.
[0135] Specifically, each date has a corresponding holiday type. Each date is bound to its corresponding holiday type, and a holiday label is assigned to each date. These holiday labels include weekdays, Saturdays, Sundays, short holidays (New Year's Day, Qingming Festival, Dragon Boat Festival, Mid-Autumn Festival), long holidays (Labor Day, National Day), Spring Festival (two weeks before Spring Festival, Spring Festival itself, two weeks after Spring Festival), and the Spring Festival travel rush. Short holidays are further divided into the first day, second day, and third day; long holidays are divided into the first day, second day, and so on up to the seventh day; and the Spring Festival travel rush is divided into the first day, second day, and so on up to the thirty-fifth day.
[0136] Step 904: Based on the holiday labels corresponding to each date, determine the second holiday code value corresponding to each date from the preset code value table, and collect the second holiday code data.
[0137] The preset code value table is a code value table that is pre-set based on actual experience and circumstances. Each holiday label can be found in the preset code value table.
[0138] Specifically, based on the holiday labels corresponding to each date, the second holiday code value corresponding to each date is queried and determined from the preset code value table, and the set of each second holiday code value is used to obtain the second holiday code data.
[0139] For example, in the preset encoding value table, the encoding value for a weekday is 1; the encoding value for Saturday is 0.75; the encoding value for Sunday is 0.5; the encoding value for the first day of a short holiday or long holiday is 0; the dates from the first day of the holiday to the first working day after the holiday are encoded using an arithmetic progression array in the interval [0,1]; the encoding value for Lunar New Year's Eve during the Spring Festival holiday is 0; the dates from the last working day before the Spring Festival travel rush to Lunar New Year's Eve are encoded using an arithmetic progression array in the interval [1,0]; and the dates from Lunar New Year's Eve to the first working day after the Spring Festival travel rush are encoded using an arithmetic progression array in the interval [0,1].
[0140] Step 906: Input the second holiday coding data, historical temperature coding data, historical trend coding data, and historical policy coding data into the initial analysis model to obtain the first holiday electricity component output by the hidden layer of the initial analysis model.
[0141] Specifically, the second holiday coding data, historical temperature coding data, historical trend coding data, and historical policy coding data are input into the initial analysis model. A fitting function set in the hidden layer of the initial analysis model is used to fit and calculate the electricity components corresponding to each influencing factor. The electricity component corresponding to the first holiday factor is then obtained.
[0142] Step 908: Target encoding is performed on the electricity component of the first holiday to obtain the encoding value of the third holiday. The encoding value of the third holiday is then input into the initial analysis model for iterative training. When the termination condition is met, the historical holiday encoding data is obtained.
[0143] Target encoding is a highly effective method for representing categorical columns, and it occupies only one feature space, also known as mean encoding. Each value in this column is replaced by the average target value for that category. This more directly represents the relationship between the categorical and target variables.
[0144] Specifically, the electricity consumption component of the first holiday output from the hidden layer of the initial analysis model is encoded using a target encoding method to obtain the encoded value for the third holiday. This third holiday encoded value, along with the encoded values corresponding to other influencing factors, is then input back into the initial analysis model for iterative training. When a termination condition is met, historical holiday encoded data is obtained. The termination condition is that the difference between the holiday electricity consumption component output by the initial analysis model and the holiday electricity consumption component output during the previous training is less than a preset threshold. At this point, the encoded values can be considered to have stabilized.
[0145] Taking a preset time series from January 1, 2020 to October 8, 2020 as an example, the following is a data table for encoding the second holiday:
[0146] date Holiday Name Holiday tags Holiday Codes 2020-01-01 New Year's Day Short holiday_1 -0.287160 2020-01-02 weekdays weekdays 0.488444 2020-01-04 Saturday Saturday 0.026795 2020-01-05 Sunday Sunday -0.100472 2020-01-10 weekdays Spring Festival Travel Rush_1 1.325628 2020-01-11 Saturday Spring Festival Travel Rush_2 1.055234 2020-02-12 weekdays Spring Festival Travel Rush_34 -1.456229 2020-02-13 weekdays Spring Festival travel rush_35 -1.510380 2020-04-04 Qingming Festival Short holiday_1 -0.116852 2020-04-05 Qingming Festival Short holiday_2 -0.116852 2020-04-06 Qingming Festival Short holiday_3 0.025990 2020-10-01 National Day Long holiday_1 -1.343969 2020-10-02 National Day Long holiday_2 -1.223036 2020-10-08 National Day Long holiday_8 -0.035673
[0147] In this embodiment, each date is first initially encoded using a preset encoding value table to obtain the second holiday encoding data. This second holiday encoding data is then input into the initial analysis model. After removing electricity consumption affected by factors such as temperature, trends, and policies, target encoding is performed. Using the method in this embodiment ensures accurate holiday encoding data. This provides a data foundation for subsequent training of the initial analysis model to obtain an analysis model of electricity consumption change factors.
[0148] In one embodiment, such as Figure 10 As shown, a method for analyzing factors affecting electricity variation is provided, including the following steps:
[0149] First, we build a BP neural network model as the initial analysis model, such as... Figure 11As shown, the model generally consists of three layers: an input layer, a hidden layer, and an output layer. The entire model can be represented by the following formula:
[0150]
[0151] in, The electricity consumption on day t is the model's fitted value; T t The electrical component affected by temperature in the model fitting is hereinafter referred to as the temperature component; H t The electricity component affected by holiday factors in the model fit, hereinafter referred to as the holiday component; C t The electrical quantity component influenced by the trend factors in the model fitting, hereinafter referred to as the trend component; P t The electricity component affected by policy factors in the model fitting is referred to as the policy component.
[0152] The objective function for optimization is MAPE:
[0153]
[0154] Where t is day t, and n is the total number of days in the training set; Y represents the electricity consumption on day t, which is fitted to the model. t This represents the actual electricity consumption on day t.
[0155] Next, the original training dataset is obtained, which includes historical electricity consumption data, historical temperature data, historical date data, and historical policy data within a preset time series. The original training dataset is encoded to obtain historical temperature encoded data, historical holiday encoded data, historical trend encoded data, and historical policy encoded data. Each encoded data is normalized to obtain training temperature feature data, training holiday feature data, training trend feature data, and training policy feature data. Each training feature data is input into the input layer corresponding to the initial analysis model. The input layer then inputs the training feature data into the hidden layer, where various fitting functions are set in the hidden layer to perform fitting calculations, obtaining training temperature fitting components, training holiday fitting components, training trend fitting components, and training policy fitting components. These components are then summed to obtain the daily electricity consumption fitting component. The daily electricity consumption fitting component and its corresponding daily electricity consumption are input into the objective function. If the calculated objective function value does not meet the preset objective function threshold, the backpropagation mechanism of the BP neural network, combined with the gradient descent optimization algorithm, is used to iteratively update the model parameters to minimize the objective function. Update the parameters of the fitting functions for each component until the obtained objective function value satisfies the objective function threshold of 1. Then, remove the output layer from the initial analysis model at this point, and determine it as the power variation factor analysis model. The power variation factor analysis model is as follows: Figure 12As shown. Save the preprocessed data at this time to the preprocessing module. The preprocessed data consists of the parameters and tables used for encoding and normalizing the data.
[0156] In practical applications, raw electricity-related data within the target time series is acquired, including electricity consumption data, temperature data, and electricity-related policy data. The raw electricity-related data is preprocessed using a preprocessing module, which encodes the raw data and then normalizes it to obtain key factor feature data. This key factor feature data includes temperature feature data, holiday feature data, trend feature data, and policy feature data. This key factor feature data is then input into the electricity change factor analysis model to obtain temperature-fitted electricity components, holiday-fitted electricity components, trend-fitted electricity components, and policy-fitted electricity components. Based on these electricity components, the impact of each influencing factor on electricity changes within the target time series is determined. Specifically, the sum of the electricity components corresponding to each influencing factor within the target time series is calculated to obtain the first total electricity component for each influencing factor. The difference between each first total electricity component and the second total electricity component corresponding to each influencing factor in the control time series is calculated, and the degree of influence of each influencing factor on electricity changes within the target time series is determined based on the difference. The control time series is the time series with which the electricity change value was determined compared to the target time series. Understandably, the second total electricity component can be pre-stored or obtained by inputting key factor characteristic data from the control time series into the electricity change factor analysis model.
[0157] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0158] Based on the same inventive concept, this application also provides a power variation factor analysis device for implementing the power variation factor analysis method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more embodiments of the power variation factor analysis device provided below can be found in the limitations of the power variation factor analysis method described above, and will not be repeated here.
[0159] In one embodiment, such as Figure 13 As shown, a device 1300 for analyzing factors of electricity variation is provided, including: a raw data acquisition module 1301, a preprocessing module 1302, an electricity component calculation module 1303, and an influence determination module 1304, wherein:
[0160] The raw data acquisition module 1301 is used to acquire raw data related to electricity consumption within the target time series.
[0161] The preprocessing module 1302 is used to preprocess the raw data related to electricity to obtain key factor feature data.
[0162] The power component calculation module 1303 is used to input key factor feature data into a pre-trained power change factor analysis model, perform fitting calculation on the key factor feature data, and obtain the power components corresponding to each preset dimension of the influencing factors in the key factor feature data; wherein, the power change factor analysis model includes a first feature input layer and a first hidden layer, the first hidden layer is set with fitting functions corresponding to each influencing factor, which are used to calculate and output the power components corresponding to each influencing factor.
[0163] The influence determination module 1304 is used to determine the influence of each influencing factor on the change of electricity within the target time interval based on the electricity component corresponding to each influencing factor.
[0164] The aforementioned power consumption change factor analysis device acquires raw power consumption data within a target time series, processes the raw data to obtain key factor feature data influencing power consumption changes, and inputs this key factor feature data into a pre-trained power consumption change factor analysis model. The model then performs fitting calculations on the key factor feature data to obtain the power consumption components corresponding to each preset dimension of the influencing factors within the key factor feature data. When it is necessary to analyze the causes of power consumption changes during a specific period, the impact of each influencing factor on power consumption changes within the target time series can be determined based on the power consumption components corresponding to each influencing factor. By considering the impact of multiple influencing factors on power consumption changes, the accuracy of quantifying the influence of influencing factors on power consumption change values is improved, providing high reference value for subsequent analysis of regional and industry power consumption status.
[0165] In one embodiment, the preprocessing module is further configured to: encode the electricity-related raw data based on a preset encoding mapping relationship to obtain feature-encoded data, the feature-encoded data including temperature-encoded data, first holiday-encoded data, trend-encoded data, and policy-encoded data; and perform normalization processing on each feature-encoded data according to the normalization processing parameters corresponding to each feature-encoded data to obtain temperature feature data, holiday feature data, trend feature data, and policy feature data.
[0166] In one embodiment, the power consumption change factor analysis device further includes: a model training module, used to acquire an original training dataset; preprocess the original training dataset to obtain a training feature dataset; input the training feature dataset into an initial analysis model for fitting calculation to obtain a fitted power consumption value, wherein the initial analysis model includes a second feature input layer, a second hidden layer, and an output layer; based on the fitted power consumption value and the actual power consumption value in the historical power consumption data, determine whether the current initial analysis model meets the requirements; if the initial analysis model meets the requirements, then the initial analysis model with the output layer removed is determined as the power consumption change factor analysis model.
[0167] In one embodiment, the model training module is further configured to: calculate the exponentially weighted moving average temperature from the historical temperature data to obtain historical temperature coded data; obtain historical date data based on the preset time series, encode the historical date data to obtain historical holiday coded data and historical trend coded data; encode the historical policy data to obtain historical policy coded data; and normalize each coded data to obtain training temperature feature data, training holiday feature data, training trend feature data, and training policy feature data.
[0168] In one embodiment, the model training module is further configured to: classify the historical date data according to the holiday types corresponding to each date, and assign holiday labels to each date; determine the second holiday code value corresponding to each date from a preset code value table based on the holiday labels corresponding to each date, and collect the second holiday code data; input the second holiday code data, historical temperature code data, historical trend code data, and historical policy code data into the initial analysis model to obtain the first holiday electricity consumption component output by the hidden layer of the initial analysis model; perform target encoding on the first holiday electricity consumption component to obtain the third holiday code value, input the third holiday code value into the initial analysis model, iteratively train, and obtain the historical holiday code data when the termination condition is met.
[0169] Each module in the aforementioned power variation factor analysis device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0170] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 14As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores key factor characteristics, fitting functions, preprocessing data, etc. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for analyzing electrical quantity variation factors.
[0171] Those skilled in the art will understand that Figure 14 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0172] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of power variation factor analysis of the above embodiments.
[0173] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of power variation factor analysis in the above embodiments.
[0174] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of power variation factor analysis of the above embodiments.
[0175] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0176] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0177] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0178] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for analyzing factors affecting electricity variation, characterized in that, The method includes: Obtain raw electricity-related data within the target time series; the raw electricity-related data includes electricity consumption data, temperature data, and electricity-related policy data; The raw electricity-related data is preprocessed to obtain key factor feature data, which includes temperature feature data, holiday feature data, trend feature data, and policy feature data. The key factor feature data is input into a pre-trained power change factor analysis model, and the key factor feature data is fitted and calculated to obtain the power component corresponding to each preset dimension of the influencing factor in the key factor feature data. The power change factor analysis model includes a first feature input layer and a first hidden layer. The first hidden layer is configured with fitting functions corresponding to each influencing factor, used to calculate and output the power component corresponding to each influencing factor. For each influencing factor, the first feature input layer is used to input the key factor feature data of the influencing factor into the fitting function corresponding to the influencing factor in the first hidden layer according to the dimension to which the influencing factor belongs. Based on the electricity component corresponding to each of the aforementioned influencing factors, determine the impact of each of the aforementioned influencing factors on the change in electricity within the target time series; The training process of the power variation factor analysis model includes: Obtain the original training dataset; The original training dataset is preprocessed to obtain the training feature dataset; The training feature dataset is input into the initial analysis model for fitting calculation. The fitted electric charge value is obtained through the output layer of the initial analysis model. The initial analysis model includes a second feature input layer, a second hidden layer, and the output layer. The parameters of the second feature input layer, the second hidden layer, and the output layer in the initial analysis model are adjusted based on the deviation between the fitted power value and the actual power value in the historical power data, and the initial analysis model is updated. The iteration returns to the step of inputting the training feature dataset into the initial analysis model for fitting calculation to obtain the fitted electricity value, and continues training until the training termination condition is met. Then, the output layer of the initial analysis model in the current iteration is removed to obtain the trained electricity change factor analysis model.
2. The method according to claim 1, characterized in that, The preprocessing of the raw data related to the electricity consumption to obtain key factor feature data includes: The original electricity-related data is encoded based on a preset encoding mapping relationship to obtain feature-encoded data, which includes temperature-encoded data, first holiday-encoded data, trend-encoded data, and policy-encoded data. Based on the normalization parameters corresponding to each of the feature-coded data, normalization processing is performed on each of the feature-coded data to obtain temperature feature data, holiday feature data, trend feature data, and policy feature data.
3. The method according to claim 2, characterized in that, The fitting function corresponding to the temperature feature data is a piecewise quadratic fitting function obtained by training based on daily temperature and daily electricity consumption.
4. The method according to claim 1, characterized in that, The original training dataset includes historical electricity consumption data, historical temperature data, and historical policy data related to electricity consumption within a preset time series. The training feature dataset includes training temperature feature data, training holiday feature data, training trend feature data, and training policy feature data. The original training dataset is preprocessed to obtain a training feature dataset, including: The historical temperature data is calculated by performing an exponentially weighted moving average temperature calculation to obtain historical temperature coded data; Historical date data is obtained based on the preset time series, and the historical date data is encoded to obtain historical holiday encoded data and historical trend encoded data. The historical policy data is encoded to obtain historical policy coded data; Each coded data is normalized to obtain training temperature feature data, training holiday feature data, training trend feature data, and training policy feature data.
5. The method according to claim 4, characterized in that, The process of encoding the historical date data to obtain historical holiday encoded data includes: The historical date data is categorized according to the holiday types corresponding to each date, and holiday tags are assigned to each date. Based on the holiday labels corresponding to each date, the second holiday code value corresponding to each date is determined from the preset code value table, and the second holiday code data is obtained by combining them. The second holiday coding data, historical temperature coding data, historical trend coding data, and the historical policy coding data are input into the initial analysis model to obtain the first holiday electricity component output by the hidden layer of the initial analysis model; The electricity consumption component of the first holiday is target-encoded to obtain the code value of the third holiday. The code value of the third holiday is input into the initial analysis model and trained iteratively. When the termination condition is met, the historical holiday code data is obtained.
6. A device for analyzing factors of electrical quantity variation, characterized in that, The device includes: The raw data acquisition module is used to acquire raw electricity-related data within a target time series; the raw electricity-related data includes electricity consumption data, temperature data, and electricity-related policy data. The preprocessing module is used to preprocess the raw electricity-related data to obtain key factor feature data; the key factor feature data includes temperature feature data, holiday feature data, trend feature data, and policy feature data. The power component calculation module is used to input the key factor feature data into a pre-trained power change factor analysis model, and perform fitting calculations on the key factor feature data to obtain the power components corresponding to the influencing factors of each preset dimension in the key factor feature data. The power change factor analysis model includes a first feature input layer and a first hidden layer. The first hidden layer is configured with fitting functions corresponding to each influencing factor, used to calculate and output the power components corresponding to each influencing factor. For each influencing factor, the first feature input layer is used to input the key factor feature data of the influencing factor into the fitting function corresponding to the influencing factor in the first hidden layer according to the dimension to which the influencing factor belongs. The influence determination module is used to determine the influence of each of the influencing factors on the change in electricity within the target time interval based on the electricity component corresponding to each of the influencing factors. The model training module is used to acquire the original training dataset; preprocess the original training dataset to obtain a training feature dataset; input the training feature dataset into an initial analysis model for fitting calculation, and obtain the fitted electricity value through the output layer of the initial analysis model, which includes a second feature input layer, a second hidden layer, and the output layer; adjust the parameters of the second feature input layer, the second hidden layer, and the output layer of the initial analysis model according to the deviation between the fitted electricity value and the actual electricity value in historical electricity data, and update the initial analysis model; iteratively return to the step of inputting the training feature dataset into the initial analysis model for fitting calculation to obtain the fitted electricity value, and continue training until the training termination condition is met to obtain a trained electricity change factor analysis model.
7. The apparatus according to claim 6, characterized in that, The preprocessing module is used to: encode the raw electricity-related data based on a preset encoding mapping relationship to obtain feature-encoded data, which includes temperature-encoded data, first holiday-encoded data, trend-encoded data, and policy-encoded data; and perform normalization processing on each feature-encoded data according to the normalization processing parameters corresponding to each feature-encoded data to obtain temperature feature data, holiday feature data, trend feature data, and policy feature data.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.