Electric power data processing method, electronic equipment and storage medium

By decomposing and selecting the characteristic data of the influence of electricity demand in small electricity consumption areas and inputting a preset power demand prediction model, the problem of insufficient data accumulation is solved, more accurate electricity demand prediction is achieved, and the model is improved ability to transform.

CN119474805APending Publication Date: 2025-02-18CIVIL AVIATION UNIV OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411512829.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

Small electricity consumption areas such as campuses have insufficient data accumulation in electricity demand forecasts, resulting in the inability to formulate energy-saving measures in a timely manner, control energy expenditures, and be unable to evaluate the energy efficiency and carrying capacity of existing facilities, or for future facilities renovation and expansion. Provide data support.

Method used

By obtaining the power consumption demand impact feature data of the target area, decompose the first type of impact feature data to obtain the initial sub-feature data, filter the key sub-feature data based on the feature selection model, and input it into the preset power with the second type of impact feature data. Demand forecast model, conduct power demand forecasts in future time periods.

Benefits of technology

This method can more comprehensively capture local features and trend changes in the data, solve the modal aliasing problem, reduce data dimensions, improve the generalization ability of the model, and provide more accurate predictions of electricity demand.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474805A_ABST
    Figure CN119474805A_ABST
Patent Text Reader

Abstract

The invention provides a power data processing method, electronic equipment and a storage medium, and the method comprises the steps: classifying power demand influence feature data, and dividing the data into a first type of influence features and a second type of influence features according to whether the data stability is lower than a set threshold value or not; decomposing the first type of influence features to obtain initial sub-feature data, and screening out key sub-feature data; and then, inputting the key sub-feature data of the first type of influence features and the second type of influence feature data into a preset power demand prediction model, and performing power demand prediction so as to obtain a prediction value. According to the method, the original data characteristics are decomposed into a plurality of sub-characteristic data, so that local characteristics and trend changes in the data can be captured more comprehensively, and the possible modal aliasing problem is solved. Besides, the sub-feature data is screened to extract a variable which contributes to model prediction to the greatest extent, so that the data dimension can be effectively reduced, and the generalization ability of the model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a power data processing method, electronic equipment and storage medium. Background Art

[0002] With the rapid development of science and technology and the continuous growth of social economy, the demand for electricity, as a core resource to promote the development of various fields, is increasing. However, the excessive reliance on fossil fuels in electricity production has not only aggravated environmental pollution and resource depletion, but also made the global climate change problem more serious. In this context, optimizing energy supply planning and rationally utilizing resources by analyzing and processing historical electricity consumption data to obtain forecasting technology for future electricity demand has become a research topic that has attracted much attention. At present, the forecasting of electricity demand basically relies on large-scale data sets, which require years of accumulation to reach the quantitative standard. In some electricity consumption scenarios, for example, small electricity consumption areas such as campuses or newly built campuses have the same urgent need for electricity demand forecasting, but due to insufficient data accumulation, it is impossible to formulate energy-saving measures and control energy expenditure in a timely manner, and it is impossible to provide data support for evaluating the energy efficiency and carrying capacity of existing facilities and for future facility renovation and expansion. Summary of the invention

[0003] In view of the above technical problems, the technical solution adopted by the present invention is:

[0004] According to a first aspect of the present invention, a method for processing power data is provided, the method comprising the following steps:

[0005] S100, obtaining electricity demand impact characteristic data of a target area within a set historical time period.

[0006] S200, decomposing the first type of influencing characteristic data in the electricity demand influencing characteristic data to obtain corresponding initial sub-characteristic data.

[0007] S300, based on the set feature selection model, the feature data in the initial sub-feature data are screened to obtain corresponding screening results as the first type of key sub-feature data affecting the feature data.

[0008] S400, inputting the key sub-feature data of the first type of influencing feature data and the second type of influencing feature data into a preset power demand forecasting model, forecasting the power demand of the target area within a future set time period, and obtaining a predicted value of the power demand of the target area within a future set time period.

[0009] The first type of influencing characteristic data is characteristic data whose data stability is less than a set stability, and the second type of influencing characteristic data is characteristic data whose data stability is greater than or equal to the set stability. According to a second aspect of the present invention, an electronic device is provided, comprising a processor and a memory; the processor is used to execute the steps of the method described in the first aspect of the present invention by calling a program or instruction stored in the memory.

[0010] According to a second aspect of the present invention, there is provided a computer-readable storage medium storing a program or instructions, wherein the program or instructions enable a computer to execute the steps of the method according to the first aspect of the present invention.

[0011] The present invention has at least the following beneficial effects:

[0012] An electric power data processing method provided by an embodiment of the present invention comprises the following steps: first, decomposing the first type of influencing characteristic data in the characteristic data affecting electricity demand to obtain the corresponding initial sub-characteristic data; then, based on the set feature selection model, filtering the characteristic data in the initial sub-characteristic data to obtain the corresponding filtering result and use it as the key sub-characteristic data of the first type of influencing characteristic data; then, inputting the key sub-characteristic data of the first type of influencing characteristic data and the second type of influencing characteristic data into the preset electric power demand prediction model to predict the electric power demand of the target area in the future set time period, and obtaining the predicted value of the electric power demand of the target area in the future set time period, wherein the first type of influencing characteristic data is the characteristic data whose data stability is less than the set stability in the characteristic data affecting electricity demand, and the second type of influencing characteristic data is the characteristic data whose data stability is greater than or equal to the set stability in the characteristic data affecting electricity demand. The present invention decomposes the original data features into multiple sub-characteristic data, more comprehensively captures the local features and trend changes in the data, and solves the possible modal aliasing problem. In addition, filtering the sub-characteristic data to filter out the variables that contribute most to the model prediction can effectively reduce the data dimension and improve the generalization ability of the model.

[0013] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0015] Figure 1 A flowchart of a power data processing method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0016] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.

[0018] It should be noted that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0019] The embodiment of the present invention provides a method for processing power data. Figure 1 As shown, the method may include the following steps:

[0020] S100, obtaining electricity demand impact characteristic data of a target area within a set historical time period.

[0021] In the embodiment of the present invention, the power demand impact characteristic data D in the historical time period is set to be {D i} i=1……n ;D i is the characteristic data set of electricity demand impact in the i-th unit time, i ranges from 1 to n, n is the number of unit time in the set historical time period, D i =(D ij ) j=1……m , D ij D i The j-th electricity demand impact characteristic data in , where j ranges from 1 to m, and m is the number of electricity demand impact characteristic data.

[0022] In an embodiment of the present invention, the target area can be determined based on actual needs. In a preferred embodiment, the target area can be a university campus. In a more preferred embodiment, the target area can be a small campus with a population less than a set population or a newly built university campus.

[0023] In an embodiment of the present invention, the electricity demand impact characteristic data may be determined based on the actual situation of the target area, and may be the impact characteristics on electricity consumption. When the target area is a university campus, the electricity demand impact characteristic data may include daily electricity consumption, the number of students, the maximum temperature, the minimum temperature, the length of day and the date type. Among them, the number of students is directly related to the daily electricity demand of the dormitory living area, the temperature change affects the operation of the air-conditioning equipment, the length of day determines the use time of the lighting equipment, and the date type includes study days, weekends, winter and summer vacations, and statutory holidays, which may cause a large number of students to return home or changes in electricity policies. These factors will have an impact on electricity consumption.

[0024] In the embodiment of the present invention, the set time period can be set based on actual needs. In an exemplary embodiment, the set time period can be one year. The unit time can be one day.

[0025] In the embodiment of the present invention, the number of students in school can be determined by the number of Wi-Fi connections.

[0026] S200, decomposing the first type of influencing characteristic data in the electricity demand influencing characteristic data to obtain corresponding initial sub-characteristic data.

[0027] In the embodiment of the present invention, the first type of influencing characteristic data is characteristic data whose data stability is less than the set stability, and the second type of influencing characteristic data is characteristic data whose data stability is greater than or equal to the set stability.

[0028] In the embodiment of the present invention, the set smoothness may be an empirical value. In an exemplary embodiment, the set smoothness may be 0.05.

[0029] The stationarity of a time series refers to the property that its statistical characteristics do not change over time. Non-stationary data usually have misleading trends and seasonal components, making it difficult for the model to capture the true dynamics of the data, thus affecting the prediction results. To this end, it is necessary to determine whether the relevant features used for electricity consumption prediction are stationary and decompose the non-stationary time series. Decomposition can more effectively reveal the dynamic characteristics behind complex non-stationary time series and help subsequent models better identify potential patterns in the data.

[0030] In an embodiment of the present invention, an existing method may be used to obtain data stability, for example, a KPSS test method may be used to obtain the stability of characteristic data. It is known to those skilled in the art that any method for obtaining the data stability of each power demand-affecting characteristic data based on the KPSS test method falls within the protection scope of the present invention.

[0031] Furthermore, S200 specifically includes:

[0032] S201, set counter r=1.

[0033] S202, if r≤m1, m1 is the number of the first type of influencing characteristic data, execute S203, otherwise, obtain the sub-characteristic data of all the first type of influencing characteristic data, and exit the current control program.

[0034] S203, adding the gth white noise to the original sequence corresponding to the rth first-category impact characteristic data to obtain the corresponding white noise sequence DN rg ; The initial value of g is 1.

[0035] In the embodiment of the present invention, the added white noise has zero mean and fixed standard deviation and is randomly generated. Since the added white noise has zero mean and fixed standard deviation, and the value at any time point is random and independent, it will not have a systematic impact on the original structure and pattern of the signal.

[0036] S204, obtain DN rg The corresponding pth noise sequence to be decomposed NS rg p The local maximum and local minimum in are obtained, and the corresponding upper envelope is constructed based on the obtained local maximum and the corresponding lower envelope is constructed based on the obtained local minimum; the initial value of p is 1.

[0037] It is known to those skilled in the art that any rg The corresponding pth noise sequence to be decomposed NS rg p The methods for determining the local maximum and local minimum in the method all belong to the protection scope of the present invention.

[0038] In the embodiment of the present invention, the upper envelope and the lower envelope may be constructed using a spline interpolation method.

[0039] S205, Get NS rg p The corresponding upper and lower envelope mean m rg pp .

[0040] It is known to those skilled in the art that any acquisition of NS rg pThe corresponding upper and lower envelope mean m rg pp The methods all belong to the protection scope of the present invention.

[0041] S206, NS rg p and m rg pp Subtract and get DN rg The corresponding pth first decomposition result RS1 rg p And join to DN rg In the corresponding first candidate decomposition result set, the initial value of the first candidate decomposition result set is empty.

[0042] S207, NS rg p and RS1 rg p Subtract and get DN rg The corresponding p-th second decomposition result RS2 rg p , if RS2 rg p When the set conditions are met, RS2 rg p Join DN rg In the corresponding first candidate decomposition result set, DN is obtained rg The corresponding candidate decomposition result set executes S206, otherwise, sets p=p+1 and sets NS rg p =RS2 rg p-1 , execute S202.

[0043] S208, set g=g+1, if g≤g0, execute S203, otherwise, execute S209; g0 is a preset number threshold, which can be an empirical value.

[0044] S209, obtaining the initial sub-feature data SF corresponding to the rth first-category influencing feature data r =(SF ri ) i=1……n , SF ri is the initial sub-feature data corresponding to the rth first-category impact feature data corresponding to the i-th unit time, SF ri =(SF ri h ) h=1……q , SF ri h For SF ri The hth sub-feature data in , where h ranges from 1 to q, and q is DN rgThe number of decomposition results in the corresponding candidate decomposition result set, SF ri h =(∑ g0 g=1 d rg hi ) / g0,d rg hi DN rg The initial sub-feature data belonging to the ith unit time in the hth decomposition result in the corresponding candidate decomposition result set; set r=r+1, and execute S202.

[0045] In the embodiment of the present invention, taking sequence A=[100, 150, 160, ...], N=2 as an example, through the above steps, assuming that A with the first noise added is subjected to eigendecomposition and the candidate decomposition result set obtained is (RS11, RS12, RS13, ...), and A with the second noise added is subjected to eigendecomposition and the candidate decomposition result set obtained is (RS21, RS22, RS23, ...), wherein RS11=(3, 47, 50), RS12=(-5, 53, 108), RS13=(5, 55, 100), RS21=(1, 49, 50), RS22 = (-7, 51, 112), RS23 = (3, 57, 100), so the sub-feature data of 100 is ((3+1) / 2, (47+49) / 2, (50+50) / 2), which is (2, 48, 50), the sub-feature data of 150 is ((-5-7) / 2, (53+81) / 2, (108+112) / 2), which is (-6, 52, 110), and the sub-feature data of 160 is ((5+3) / 2, (55+57) / 2, (100+100) / 2), which is (4, 56, 100).

[0046] S300, based on the set feature selection model, the feature data in the initial sub-feature data are screened to obtain corresponding screening results as the first type of key sub-feature data affecting the feature data.

[0047] In the embodiment of the present invention, the setting feature data selection model may satisfy the following conditions:

[0048] minL(β)=(1 / 2n)∑ n i=1 (y i -x i T β) 2 +λ∑ m1 r=1 |β r |;

[0049] Among them, L(β) is the objective function, yi For x i The corresponding actual power consumption, x i is the initial sub-feature data corresponding to the first type of impact feature data corresponding to the i-th unit time, x i =(x ir ) r=1……m1 , x ir is the rth first-class impact characteristic data corresponding to the i-th unit time; β is the weight vector, β=(β r ) r=1……m1 , β r is the weight corresponding to the rth first-class influencing feature data, and λ is the regularization parameter.

[0050] In an embodiment of the present invention, the key sub-feature data is the initial sub-feature data corresponding to all non-zero weights in the weight vector corresponding to the optimal value of the objective function, that is, the key sub-feature data is the initial sub-feature data corresponding to all non-zero weights in the weight vector corresponding to the optimal value obtained after solving the set feature data selection model.

[0051] In the embodiment of the present invention, the objective function can be optimized by using the coordinate axis descent method to obtain the optimal value.

[0052] In the embodiment of the present invention, the optimal λ can be selected through cross-validation, which can avoid the trouble of manually adjusting the regularization parameter. Specifically, the following steps may be included:

[0053] Step 1: Generate a set of candidate λ values, which are usually from large to small, to control the regularization strength.

[0054] Step 2: For each candidate λ value, perform the following k-fold cross validation:

[0055] (1) Divide the data set into k parts. For example, a five-fold cross validation is to divide the data set into five parts. Each cross validation will use one part of the data as the validation set and the other four parts as the training set.

[0056] (2) For each validation set, use the coordinate axis descent method to optimize the objective function and obtain the objective function value.

[0057] (3) Based on the results of all cross-validation, i.e., the objective function value, a λ value is selected that minimizes the model error. Since this optimal λ value is obtained after multiple verifications, it can have better generalization ability on the test data.

[0058] S400, inputting the key sub-feature data of the first type of influencing feature data and the second type of influencing feature data into a preset power demand forecasting model, forecasting the power demand of the target area in a future set time period, and obtaining a predicted value of the power demand of the target area in a future set time period, wherein the first type of influencing feature data is feature data in the power demand influencing feature data whose data smoothness is less than the set smoothness, and the second type of influencing feature data is feature data in the power demand influencing feature data whose data smoothness is greater than or equal to the set smoothness.

[0059] In an embodiment of the present invention, the preset power demand prediction model may be a deep neural network model. In a specific example, it may be an improved GRU, which may include a fusion module, a first feature extraction module, a second feature extraction module and a prediction module, wherein the output of the fusion module satisfies the following conditions:

[0060] Fc t =σ(W1×[F2 t-1 ,x t ]+b1);

[0061] Fc t is the output of the fusion module at time t, W1 is the first learnable weight matrix, b1 is the first learnable bias term, F2 t-1 is the output of the second feature extraction module at time (t-1), x t is the input data at time t, σ() is the Sigmoid activation function;

[0062] The output of the first feature extraction module satisfies the following conditions:

[0063] F1 t =tanh(W1×[Fc t ⊙F2 t-1 ,x t ]);

[0064] F1 t is the output of the first feature extraction module at the current time step, ⊙ represents the dot product, and tanh() is the hyperbolic tangent function;

[0065] The output of the second feature extraction module satisfies the following conditions:

[0066] F2 t =Fc t ⊙F2 t-1 +(1-Fc t )⊙F1 t ;

[0067] F2 t is the output of the second feature extraction module at time t;

[0068] The output of the prediction module meets the following conditions:

[0069] y t =W2×F2 t +b2;

[0070] y t is the output of the prediction module at time t, W2 is the second learnable weight matrix, and b2 is the second learnable bias item.

[0071] The preset power demand forecasting model provided by the embodiment of the present invention can simplify the control logic of the model compared with the existing standard GRU because only one fusion gate (i.e., fusion module) is calculated. Since the number of gates is reduced, the computational complexity and the number of parameters can be reduced. Because the model is relatively simple, the computational efficiency is also higher, which is more suitable for small data sets and scenarios with limited resources, and can enhance the generalization ability and prevent the occurrence of overfitting.

[0072] Furthermore, the hyperparameters of the preset power demand prediction model are obtained through the following steps:

[0073] S401, construct Z hyperparameter combinations and set the iteration counter t=1.

[0074] The value of Z can be set based on actual needs, Z>1.

[0075] S402, obtain the fitness of the preset power demand prediction model under the current Z hyperparameter combinations, obtain Z fitnesses, sort the obtained Z fitnesses in descending order and use the hyperparameter combinations corresponding to the top k fitnesses among the sorted Z fitnesses as the current reference combinations, and use the remaining (Zk) hyperparameter combinations as the current combinations to be adjusted, 1<k<Z.

[0076] In an embodiment of the present invention, the training set may be input into a preset power demand forecasting model to train the model to obtain the corresponding fitness, and the specific acquisition method may adopt an existing method.

[0077] The value of k can be set based on actual needs. In an exemplary embodiment, k=3.

[0078] S403, if t>T or the current Z fitnesses meet the set conditions, the hyperparameter combination corresponding to the maximum fitness among the current Z fitnesses is used as the hyperparameter of the preset power demand prediction model; otherwise, execute S404, T is the total number of iterations.

[0079] In the embodiment of the present invention, T can be set based on actual needs. The setting condition can be set based on actual needs, for example, the maximum fitness is greater than a set fitness threshold.

[0080] S404, obtaining the adjustment factor A of the u-th reference combination for the v-th combination to be adjusted at the current iteration number t uv (t) and the guiding factor C uv (t), A uv (t) = (2 × r uv (t)-1)×(a max -(a max -a min )×(t / T) 2 ), C uv (t) = 2 × r uv (t)×(c max -(c max -c min )×(t / T) 2 ), where a max is the maximum adjustment value, a max is the minimum adjustment value, c max is the maximum bootstrap value, c min is the minimum bootstrap value, r uv (t) is the random factor of the u-th reference combination for the v-th combination to be adjusted at the current iteration number t, T is the total number of iterations; the value of u ranges from 1 to k, and the value of v ranges from 1 to Zk.

[0081] In an embodiment of the present invention, the adjustment factor is used to control the search direction (positive or negative) and the step size (size), that is, whether to approach (biased towards local search) or move away (biased towards global search) the reference combination. This approach and distance are converted into numerical values, which are positive and negative. For example, for the same distance 1, moving in the direction of approaching the reference combination is +1, and moving in the direction of moving away from the reference combination is -1. The introduction factor is used to adjust the search range of the wolf pack relative to the reference combination, and does not involve changes in positive and negative directions. The role of the random factor is to increase the randomness and diversity of the search. Through this random disturbance, the behavior of each individual will be slightly different. For example, there are 20 combinations to be adjusted and 3 reference combinations. If there is no random factor, the information obtained by these 20 combinations to be adjusted, the direction of advance, the intensity of influence, etc. are completely consistent, but there is a random factor for each combination to be adjusted, which can make them show different behaviors and increase the possibility of searching for the optimal solution.

[0082] In the embodiment of the present invention, the specific meanings of close to and far away from are: for example, four points ABCD are arranged in sequence, A is the combination to be adjusted, and C is the reference combination, then "close to" C refers to position B, which is between C and A, and "far away from" C refers to position D, which is on the other side of C.

[0083] In the embodiment of the present invention, the range of the random factor is 0-1. Since the range of the random factor is 0-1, if the random factor is multiplied by 2, the range becomes 0-2, which may be larger or smaller than the guide factor, thereby making the results richer and further expanding the search space.

[0084] S405, update the combination to be adjusted among the current Z hyperparameter combinations to obtain the updated Z hyperparameter combinations, and use the updated Z hyperparameter combinations as the current Z hyperparameter combinations, set t=t+1, and execute S402.

[0085] Among them, the updated vth combination to be adjusted X v new Meet the following conditions: X v new =(1 / k)×∑ k u=1 (X u temp (t)), X u temp (t) is the temporary combination of the vth combination to be adjusted relative to the uth reference combination, X u temp (t) = X u (t)-A uv (t)×D uv (t), X u (t) is the hyperparameter combination corresponding to the u-th reference combination, D uv (t) is the distance between the uth reference combination and the vth combination to be adjusted.

[0086] In the embodiment of the present invention, X u temp The adjustment factor A is introduced in the calculation process of (t) uv (t) is to adjust the distance D uv (t) is scaled to adjust the magnitude and direction of each position update, thereby controlling how the combination to be adjusted moves around the reference combination. uv (t)×D uv (t) Because this term is preceded by a negative sign, A uv When (t) is also negative, it will move away from the leader wolf, A uv When (t) is positive, it will move closer to the leader wolf. The adjustment range is determined by A uvThe value of (t) is determined.

[0087] In the embodiment of the present invention, D uv (t) The following conditions are met:

[0088] D uv (t)=|C uv (t)×X u (t)-X v (t)|;

[0089] Among them, X v (t) is the hyperparameter combination corresponding to the current vth combination to be adjusted.

[0090] In the embodiment of the present invention, the combination and the addition and subtraction of the combination means that each corresponding element in the combination is added and subtracted, for example, the hyperparameter combination (2, 3) plus the hyperparameter combination (4, 2) = (2 + 4, 3 + 2) = (6, 5). That is, X u temp (t) can be specifically expressed as: X u temp (t) = (X u 1 (t)-A uv (t)×D uv 1 (t), ..., X u w (t)-A uv (t)×D uv w (t), ..., X u Q (t)-A uv (t)×D uv Q (t)), X u w (t) is X u The wth hyperparameter in (t), w ranges from 1 to Q, Q is the number of hyperparameters in the hyperparameter combination, D uv w (t) is D uv The wth element in (t). D uv (t) can be specifically expressed as: D uv (t)=(|C uv (t)×X u 1 (t)-X v 1 (t)|,……,|C uv (t)×X u w (t)-X v w(t)|,……,|C uv (t)×X u Q (t)-X v Q (t)|), X v w (t) is X v The wth hyperparameter in (t). X v new It can be specifically expressed as: X v new =((1 / k)×∑ k u=1 (X u temp-1 (t)), ..., (1 / k) × ∑ k u=1 (X u temp-w (t)), ..., (1 / k) × ∑ k u=1 (X u temp-Q (t))), X u temp-w (t) is X u temp The wth element in (t), namely X u w (t)-A uv (t)×D uv w (t).

[0091] In the embodiment of the present invention, since the distance difference between the combination to be adjusted and the product of the reference combination and the corresponding guiding factor is used as the distance between the combinations, the search space can be expanded and the global optimization effect is good. For example, if the reference combination is (1, 1) and the combination to be adjusted is (4, 1), if the corresponding guiding factor is greater than 1, then the distance calculated by the above formula will be greater than the original true distance (3, 0). Assume that the hyperparameter combination corresponding to a combination to be adjusted is (1, 1), and the hyperparameter combination corresponding to the reference combination is (5, 5), and the adjustment factor of the reference combination corresponding to the combination to be adjusted is 1.2, and the guiding factor is 0.8. Then the distance between the two is (5×0.8, 5×0.8)-(1, 1)=(3, 3), and the temporary combination of the combination to be adjusted relative to the reference combination is (5, 5)-(1.2×3, 1.2×3)=(1.4, 1.4).

[0092] In the embodiment of the present invention, by dynamically adjusting the balance between the search and development phases, a more effective search strategy can be implemented to determine a hyperparameter combination that is more suitable for the prediction model, which can significantly improve the prediction accuracy and convergence speed of the model.

[0093] (Example)

[0094] The actual electricity consumption data used in the embodiments of the present invention covers a complete annual cycle, with a time span from March 1, 2023 to February 29, 2024, with a total of 352 valid records.

[0095] The KPSS test method was used to test 352 valid records. The test results are shown in Table 1. The P value of the number of students, the highest temperature, the lowest temperature and the length of day is 0.01, which is less than the significance level of 0.05, and the statistics are all greater than any critical value, which further supports the conclusion of non-stationarity. The statistics of the holiday type are greater than the most stringent critical value between 1% and 2.5%. Considering that the key P value also meets the condition of less than 0.05 significance level, in order to ensure the accuracy and reliability of the model establishment, it is determined that the five related features need to be subsequently decomposed and selected.

[0096] Table 1 KPSS test results

[0097]

[0098]

[0099] After decomposing the non-stationary features, a total of 37 sub-feature data are obtained. There may be redundant information in this data, which will affect the subsequent prediction accuracy. Therefore, the aforementioned set feature selection model is used to select the 37 sub-feature data, and the insignificant features are eliminated through the penalty term, and the variables that contribute more to the prediction are selectively retained. The final number of retained features is 78.4% of the original number, which is 29 sub-feature data.

[0100] The input of the electricity demand forecasting model consists of 29 new features after screening. All feature vectors have been normalized in the data preprocessing part to ensure the stability of the gradient and the training efficiency of the model, thereby improving the robustness and generalization ability of the model under different data distributions, and effectively modeling long-term dependencies through the gating mechanism inside the model.

[0101] Subsequently, the hyperparameters of the model are adjusted based on the contents defined in the aforementioned S401-S405, namely the number of layers, the number of units, the learning rate, the batch size, and the dropout rate. The obtained parameter adjustment results are shown in Table 2.

[0102] Table 2

[0103] Hyperparameters scope result Number of layers [1,3] 3 Number of units [16,128] 32 Learning Rate [0.0001,0.01] 0.01 Batch size [8,64] 8 Dropout rate [0.01,0.3] 0.014

[0104] The final parameter combination shows that the model uses a three-layer structure, which can better learn nonlinear relationships and long-term dependencies in the data; 32 units can provide sufficient expressive power while avoiding excessive model complexity; a learning rate of 0.01 enables the model to quickly adapt to the data and accelerate the parameter optimization process; a batch size of 8 may introduce more noise during the weight update process, which helps to jump out of the local optimal solution; a dropout rate of 0.014 provides regularization while avoiding excessive discarding. The lower value here may indicate that the model already has good generalization ability. Overall, the parameters selected by AGWO balance the model complexity and training efficiency, make full use of limited sample data, ensure good prediction performance and avoid overfitting.

[0105] The present invention uses mean absolute error (MAE), root mean square error (RMSE), mean absolute percentage error (MAPE) and coefficient of determination (R 2 ) are used to evaluate the performance of the prediction model. MAE gives equal weight to all errors, providing a more intuitive average error measure; RMSE is used to measure the deviation between the predicted value and the true value, which can better reflect the impact of large errors on model performance; MAPE evaluates the average percentage error of the predicted value relative to the true value, which is convenient for understanding the relative size of the error; R 2 Measures how well the model fits the data. The closer the value is to 1, the better the model fits.

[0106] By combining these indicators, we can comprehensively evaluate the performance of the model in all aspects, avoid overfitting of the model on a single indicator, and thus improve the robustness and generalization ability of the model in different scenarios.

[0107] In order to verify the necessity of using feature decomposition and feature selection as preprocessing steps in the present invention, the present invention conducted multiple groups of comparative experiments based on the electricity demand prediction model provided by the present invention. The experimental results are shown in Table 3 below.

[0108] Table 3

[0109]

[0110] It can be seen from Table 3 that when the original data is used, the prediction model has a large prediction error and it is difficult to fully capture the data features. After only using the feature decomposition of the present invention to preprocess the data, the model performance is further optimized, the mode aliasing is effectively suppressed, and the three error indicators are significantly reduced, R 2 However, after combining feature selection, the model not only reduces redundant features but also enhances the ability to identify important features. MAE is reduced to 0.0393, RMSE and MAPE are 0.0557 and 0.1046 respectively, and R 2It is 0.9131, which verifies the necessity of using feature decomposition and feature selection as preprocessing steps in the present invention.

[0111] The prediction performance of the traditional GRU and the power demand prediction model provided by the present invention are tested using the data of this embodiment. The test results are shown in Table 4 below:

[0112] Table 4

[0113] Model MAE RMSE MAPE <![CDATA[R 2 ]]> GRU 0.0475 0.0616 0.1456 0.8938 The model provided by the present invention 0.0297 0.0464 0.0782 0.9396

[0114] It can be seen from Table 4 that compared with the GRU model, the MAE, RMSE and MAPE of the prediction model provided by the present invention are reduced by 37.47%, 24.68% and 46.29% respectively, and R 2 The improvement was 5.12%, and the four statistical indicators were comprehensively improved. This shows that the electricity demand forecasting model provided by the present invention has more obvious advantages in convergence speed and forecasting performance, and proves the effectiveness of the parameter adjustment method defined in S401 to S405.

[0115] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the method described in the embodiment of the present invention.

[0116] The embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer instructions are used to execute the method described in the embodiment of the present invention.

[0117] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document does not limit this.

[0118] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for processing power data, characterized in that: The method comprises the following steps: S100, obtaining the electricity demand impact characteristic data of the target area within a set historical time period; S200, decomposing the first type of influencing characteristic data in the electricity demand influencing characteristic data to obtain corresponding initial sub-characteristic data; S300, based on the set feature selection model, the feature data in the initial sub-feature data are screened to obtain corresponding screening results as the first type of key sub-feature data affecting the feature data; S400, inputting the key sub-feature data of the first type of influencing feature data and the second type of influencing feature data into a preset power demand forecasting model, forecasting the power demand of the target area in a future set time period, and obtaining a power demand forecast value of the target area in the future set time period; Among them, the first type of influencing characteristic data is characteristic data whose data stability is less than the set stability, and the second type of influencing characteristic data is characteristic data whose data stability is greater than or equal to the set stability.

2. The method according to claim 1, characterized in that S200 specifically includes: S201, set counter r=1; S202, if r≤m1, m1 is the number of the first type of influencing characteristic data, execute S203, otherwise, obtain all the sub-characteristic data of the first type of influencing characteristic data, and exit the current control program; S203, adding the gth white noise to the original sequence corresponding to the rth first-category impact characteristic data to obtain the corresponding white noise sequence DN rg ;The initial value of g is 1; S204, obtain DN rg The corresponding pth noise sequence to be decomposed NS rg p The local maximum and local minimum in are obtained, and the corresponding upper envelope is constructed based on the obtained local maximum and the corresponding lower envelope is constructed based on the obtained local minimum; the initial value of p is 1; S205, Get NS rg p The corresponding upper and lower envelope mean m rg pp ; S206, NS rg p and m rg pp Subtract and get DN rg The corresponding pth first decomposition result RS1 rg p And join to DN rg In the corresponding first candidate decomposition result set, the initial value of the first candidate decomposition result set is empty; S207, NS rg p and RS1 rg p Subtract and get DN rg The corresponding p-th second decomposition result RS2 rg p , if RS2 rg p When the set conditions are met, RS2 rg p Join DN rg In the corresponding first candidate decomposition result set, DN is obtained rg Corresponding candidate decomposition result set, execute S206, otherwise, set p=p+1, set NS rg p =RS2 rg p-1 , execute S202; S208, set g=g+1, if g≤g0, execute S203, otherwise, execute S209; g0 is the preset number threshold; S209, obtaining the initial sub-feature data SF corresponding to the rth first-category influencing feature data r =(SF ri ) i=1……n , SF ri is the initial sub-feature data corresponding to the rth first-category impact feature data corresponding to the i-th unit time, SF ri =(SF ri h ) h=1……q , SF ri h For SF ri The hth sub-feature data in , where h ranges from 1 to q, and q is DN rg The number of decomposition results in the corresponding candidate decomposition result set, SF ri h =(∑ g0 g=1 d rg hi ) / g0,d rg hi DN rg The initial sub-feature data belonging to the ith unit time in the hth decomposition result in the corresponding candidate decomposition result set; set r=r+1, and execute S202.

3. The method according to claim 1, characterized in that The feature data selection model is set to meet the following conditions: minL(β)=(1 / 2n)∑ n i=1 (y i -x i T β) 2 +λ∑ m1 r=1 |β r |; Among them, L(β) is the objective function, y i For x i The corresponding actual power consumption, x i is the feature vector formed by the initial sub-feature data corresponding to the first type of influencing feature data corresponding to the i-th unit time, β is the weight vector, β = (β r ) r=1……m1 , β r is the weight corresponding to the rth first-class influencing feature data, and λ is the regularization parameter; The key sub-feature data are initial sub-feature data corresponding to all non-zero weights in the weight vector corresponding to the optimal value of the objective function.

4. The method according to claim 1, characterized in that: The preset power demand prediction model includes a fusion module, a first feature extraction module, a second feature extraction module and a prediction module, and the output of the fusion module meets the following conditions: Fc t =σ(W1×[F2 t-1 ,x t ]+b1); Fc t is the output of the fusion module at time t, W1 is the first learnable weight matrix, b1 is the first learnable bias term, F2 t-1 is the output of the second feature extraction module at time (t-1), x t is the input data at time t, σ() is the Sigmoid activation function; The output of the first feature extraction module satisfies the following conditions: F1 t =tanh(W1×[Fc t ⊙F2 t-1 ,x t ]); F1 t is the output of the first feature extraction module at the current time step, ⊙ represents the dot product, and tanh() is the hyperbolic tangent function; The output of the second feature extraction module satisfies the following conditions: F2 t =Fc t ⊙F2 t-1 +(1-Fc t )⊙F1 t ; F2 t is the output of the second feature extraction module at time t; The output of the prediction module meets the following conditions: y t =W2×F2 t +b2; y t is the output of the prediction module at time t, W2 is the second learnable weight matrix, and b2 is the second learnable bias item.

5. The method according to claim 4, characterized in that The hyperparameters of the preset power demand prediction model are obtained by the following steps: S401, construct Z hyperparameter combinations and set the iteration counter t=1; S402, obtaining the fitness of the preset power demand forecasting model under the current Z hyperparameter combinations, obtaining Z fitnesses, and sorting them in descending order, and taking the hyperparameter combinations corresponding to the top k fitnesses among the sorted Z fitnesses as the current reference combinations, and taking the remaining (Zk) hyperparameter combinations as the current combinations to be adjusted, 1<k<Z; S403, if t>T or the current Z fitnesses meet the set conditions, the hyperparameter combination corresponding to the maximum fitness among the current Z fitnesses is used as the hyperparameter of the preset power demand prediction model; Otherwise, execute S404; T is the total number of iterations; S404, obtaining the adjustment factor A of the u-th reference combination for the v-th combination to be adjusted at the current iteration number t uv (t) and the guiding factor C uv (t), A uv (t) = (2 × r uv (t)-1)×(a max -(a max -a min )×(t / T) 2 ), C uv (t) = 2 × r uv (t)×(c max -(c max -c min )×(t / T) 2 ), where a max is the maximum adjustment value, a max is the minimum adjustment value, c max is the maximum bootstrap value, c min is the minimum bootstrap value, r uv (t) is the random factor of the u-th reference combination for the v-th combination to be adjusted at the current iteration number t, where u ranges from 1 to k and v ranges from 1 to Zk; S405, updating the combination to be adjusted among the current Z hyperparameter combinations to obtain the updated Z hyperparameter combinations, and taking the updated Z hyperparameter combinations as the current Z hyperparameter combinations, setting t=t+1, and executing S402; wherein the updated vth combination to be adjusted X v new Meet the following conditions: X v new =(1 / k)×∑ k u=1 (X u temp (t)), X u temp (t) is the temporary combination of the vth combination to be adjusted relative to the uth reference combination, X u temp (t) = X u (t)-A uv (t)×D uv (t), X u (t) is the hyperparameter combination corresponding to the u-th reference combination, D uv (t) is the distance between the uth reference combination and the vth combination to be adjusted.

6. The method according to claim 1, characterized in that The target area is a university campus.

7. The method according to claim 6, characterized in that The electricity demand influencing characteristic data include daily electricity consumption, number of students in school, maximum temperature, minimum temperature, day length and date type, and the date type includes study days, weekends, winter and summer vacations and statutory holidays.

8. The method according to claim 1, characterized in that The data stability in the electricity demand impact characteristic data is obtained through the KPSS test method.

9. An electronic device, characterized in that: including a processor and a memory; The processor is used to execute the steps of the method according to any one of claims 1 to 8 by calling the program or instruction stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a program or an instruction, wherein the program or the instruction enables a computer to execute the steps of the method according to any one of claims 1 to 8.