Power system climbing demand prediction method, system, equipment and medium
Through the adaptive trend judgment algorithm and the improved TimeXer model, combined with the minimum redundancy maximum correlation feature selection method, the problem of the influence of meteorological factors not being taken into account in the new energy ramp-up demand forecast is solved, and a higher precision and more accurate provincial ramp-up demand forecast is achieved.
Patent Information
- Application Number
- CN202510750091.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-10-17
AI Technical Summary
Existing technologies fail to effectively consider the spatiotemporal heterogeneity of meteorological factors in forecasting the ramp-up demand of new energy, resulting in high forecast uncertainty under extreme weather conditions. Existing methods are mostly limited to specific wind power or photovoltaic sites and cannot be extended to provincial-level applications.
An adaptive trend judgment algorithm based on volatility adjustment is adopted, combined with the minimum redundancy maximum correlation feature selection method and the improved TimeXer prediction model. Meteorological features are integrated through the attention mechanism to output the mean and variance of the climbing demand to capture the uncertainty under extreme weather conditions.
The prediction accuracy was improved by 18.4%, the interval coverage rate reached 92.5%, and the impact of meteorological factors on climbing requirements under extreme weather conditions was more accurately reflected. The model performed better than existing methods.
Smart Images

Figure CN120805022A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power systems, and particularly relates to a power system climbing demand prediction method, system, device and medium. BACKGROUND
[0002] At present, the "full-network conventional power source negative reserve" mode adopted by the northwest power grid in China provides a significant increase in space for new energy (about 23 billion kW·h) in 2020, but this mode of giving the decision-making power of power grid balance to new energy and formulating a reserve plan according to the independent principle of dispatching area, in response to high-risk events such as new energy climbing, may cause loss of load due to insufficient reserve resources in some risk areas.
[0003] Practice shows that market mechanisms are an effective way to solve the supply and demand contradiction of climbing resources: for example, through flexible climbing products (FRPs) to realize the day-ahead-real-time market joint optimization of climbing capacity; or relying on a 15-minute intra-day climbing capacity auction mechanism, the wind and light output prediction error is included in the market clearing price formation process. The power climbing auxiliary service market of a province in China also started trial operation in March 2024, aiming to manage the volatility of net load by providing climbing services (such as rapidly increasing or decreasing power output) to ensure stable operation of the power system.
[0004] However, existing market mechanisms generally simplify uncertain climbing demand into a fixed confidence interval, ignoring the spatio-temporal heterogeneity characteristics driven by meteorological factors. International research shows that in the RCP 8.5 scenario, a temperature change of only 2℃ causes a 1% decrease in photovoltaic output, while a change in irradiance (±30 W / m 2 ) causes ±10% fluctuations, and the wind speed and wind power climbing event occurrence probability are nonlinearly related.
[0005] Currently, in the field of new energy output prediction, relevant research has made significant progress, and methods such as support vector machine (SVM), deep neural network, and hybrid algorithm are widely used. In the field of climbing demand prediction, some scholars have proposed a post-processing adjustment technology based on ensemble learning, which improves the accuracy of solar climbing rate prediction by integrating multiple models. Similarly, other scholars have developed a graph attention network combined with wind propagation maps to predict wind power climbing events. In addition, various machine learning techniques have been used to directly predict wind power climbing rates, including SVM for climbing event classification, random forests based on meteorological data, short-term statistical models such as conditional autoregressive logistic-generalized autoregressive conditional heteroskedasticity (CARL-GARCH), epsilon-insensitive SVM combined with Copula function to model climbing rate and error distribution, and advanced methods such as gradient boosting trees and neural networks. However, these methods are usually limited to specific wind or photovoltaic sites and have not been extended to provincial-scale applications. In contrast, some scholars have proposed a Bayesian deep learning-long short-term memory (BD-LSTM) model for predicting uncertain climbing demand for an entire province, but this method ignores the influence of meteorological factors.
[0006] Therefore, how to provide a power system climbing demand prediction method, system, device and medium is a problem to be solved at present. SUMMARY
[0007] The embodiments of the present application provide a power system climbing demand prediction method, system, device and medium to solve the above technical problems in the prior art.
[0008] The following is a simple summary in order to have a basic understanding of some aspects of the disclosed embodiments. This summary is not a general review, nor is it intended to determine key / important components or delineate the scope of protection of these embodiments. Its only purpose is to present some concepts in a simple form as a prelude to the detailed description that follows.
[0009] According to a first aspect of the embodiments of the present application, a power system climbing demand prediction method is provided.
[0010] In one embodiment, the power system climbing demand prediction method comprises:
[0011] An adaptive trend judgment algorithm based on volatility adjustment is used to extract the trend characteristics of climbing up and climbing down;
[0012] A minimum redundancy maximum relevance feature selection method is used to screen meteorological features related to climbing demand in meteorological data; extreme value thresholds of meteorological features are determined according to the distribution characteristics of historical meteorological data, and binary feature labels are created for each time step to mark extreme weather;
[0013] The improved TimeXer prediction model is used to capture the long-term dependence of weather time series, and the attention mechanism is used to fuse meteorological features, and the mean and variance of the climbing demand are output to capture the uncertainty under extreme weather.
[0014] In one embodiment, the adaptive trend judgment algorithm based on volatility adjustment extracts the trend features of the up-climbing and down-climbing:
[0015] According to the volatility of the climbing demand data, the window size of the adaptive trend judgment algorithm is dynamically adjusted, and a trend strength evaluation mechanism and a retention strategy are introduced to improve the adaptive trend judgment algorithm.
[0016] The improved adaptive trend judgment algorithm is used to extract the trend features of the up-climbing and down-climbing.
[0017] In one embodiment, the adaptive trend judgment algorithm based on the volatility of the climbing demand data dynamically adjusts the window size, and introduces a trend strength evaluation mechanism and a retention strategy to improve the adaptive trend judgment algorithm, which includes:
[0018] The volatility rate factor is determined according to the data volatility in the current time window, the minimum volatility and the maximum volatility in the historical data, and the adaptive window of the adaptive trend judgment algorithm is obtained by dynamically adjusting the initial window using the volatility rate factor.
[0019] The trend slope is obtained by linear regression fitting of the trend line, and the trend strength is determined by combining the duration of the trend and the trend strength adjustment coefficient; the importance of the trend feature is quantified based on the trend strength, and the retention strategy is formulated by comparing the importance of overlapping trends.
[0020] In one embodiment, the dynamic adjustment formula of the adaptive window is:
[0021] w a =w b ×(1+v)
[0022]
[0023] The calculation formula of the trend strength is:
[0024]
[0025] In the formula, w a represents the adaptive window, w b represents the initial window, v represents the volatility rate factor, v c represents the data volatility in the current time window, v min represents the minimum volatility in the historical data, and v maxrepresents the maximum volatility in the historical data, I represents the trend strength, s represents the slope of the trend, and t represents the trend duration d represents the trend duration, c p represents the trend strength adjustment coefficient, p value represents the slope significance probability value obtained based on the linear regression t test.
[0026] In one embodiment, the minimum redundancy maximum correlation feature selection method is used to screen the weather features related to the climbing demand in the weather data; the extreme value threshold of the weather feature is determined according to the distribution characteristics of the historical weather data, and a binary feature is created for each time step to mark the extreme weather, including:
[0027] The weather data is obtained and discretized and normalized; the mutual information between the weather features and the climbing demand and the mutual information between the weather feature pairs are calculated;
[0028] According to the mutual information between the weather features and the climbing demand, the maximum correlation between the weather features and the climbing demand is calculated, and based on the mutual information between the weather feature pairs, the minimum redundancy between the weather features is calculated;
[0029] Based on the maximum correlation between the weather features and the climbing demand and the minimum redundancy between the weather features, the key features related to the climbing demand in the weather data are screened;
[0030] According to the distribution characteristics of the historical weather data, the extreme threshold of the extreme weather is determined, the upper and lower limits of the historical threshold of each weather feature in the historical data are calculated, and based on the historical threshold upper and lower limits, a binary feature is created for each time step to mark the extreme weather.
[0031] In one embodiment, the calculation formula of the mutual information between the weather features and the climbing demand is:
[0032]
[0033] The calculation formula of the mutual information between the weather feature pairs is:
[0034]
[0035] The calculation formula of the maximum correlation between the weather features and the climbing demand is:
[0036]
[0037] The calculation formula of the minimum redundancy between the weather features is:
[0038]
[0039] The objective function of the minimum redundancy maximum correlation is:
[0040] maxΦ(D,R),Φ=D-R
[0041] where I(f i ; c) denotes the mutual information between the set of weather features f i and the set of climbing demand c, f i denotes the set of all weather feature data, c denotes the set of all climbing demand data, p(x,y) denotes the joint probability distribution of weather feature x and climbing demand y, p(x) denotes the marginal probability distribution of weather feature x, p(y) denotes the marginal probability distribution of climbing demand y, I(f i ; f j ) denotes the mutual information between the set of weather features f i and the set of weather features f j , max D(S,c), D denotes the maximum correlation between weather features and climbing demand, D(S,c) denotes the correlation distance between the selected feature subset S and the set of climbing demand c, min R(S) denotes the minimum redundancy information, R(S) denotes the redundancy information measure, and Φ(D,R) denotes the difference between correlation and redundancy.
[0042] In one embodiment, the improved TimeXer prediction model is used to capture the long-term dependence of weather time series and fuse weather features through an attention mechanism, and the mean and variance of the climbing demand are output to capture the uncertainty under extreme weather, including:
[0043] An improved TimeXer prediction model is constructed, wherein the improved TimeXer prediction model is composed of an input layer, an attention mechanism, and an output layer;
[0044] The improved TimeXer prediction model is trained using historical climbing demand data and weather feature data to capture the long-term dependence of weather time series and fuse weather features through an attention mechanism;
[0045] The trained improved TimeXer prediction model is used to output the mean and variance of the climbing demand in combination with the current climbing demand data and weather feature data to capture the uncertainty under extreme weather.
[0046] In one embodiment, the input layer is composed of endogenous embedding and exogenous embedding, and the endogenous embedding takes historical climbing demand data as an endogenous variable, and the exogenous embedding takes weather features as an exogenous variable;
[0047] wherein the endogenous variable embedding formula is:
[0048] {s1,s2,...,s N}=Patchify(x)
[0049] P en = PatchEmbed(s1, s2, …, s N )
[0050] G en = Learnable(x)
[0051] The embedding formula of the exogenous variable is:
[0052] V ex,i = VariateEmbed(z (i) ), i∈{1, …, C}
[0053] where s N represents the Nth patch obtained by applying the Patchify function operation to the endogenous variable, Patchify(x) represents that the function divides the endogenous variable x 1:T into N non-overlapping patches, P en represents a D-dimensional time label vector, G en represents a learnable global label, PatchEmbed and Learnable represent different trainable linear projectors, V ex,i represents the i th embedded sequence-level variable, VariateEmbed represents a projector, z (i) represents the i th exogenous time series, and C represents the total number of exogenous variables.
[0054] In one embodiment, the attention mechanism is composed of an endogenous self-attention mechanism and an exogenous-to-endogenous cross-attention mechanism, which are used to fuse meteorological features and historical climbing demand data to improve prediction accuracy and uncertainty modeling capability.
[0055] wherein the endogenous self-attention captures the short-term dependencies between endogenous variables and the long-term patterns of the entire sequence, and the calculation process is:
[0056]
[0057] B l = Self-Attention(A l )
[0058]
[0059] The cross-attention integrates the information of the exogenous variable into the endogenous variable, and uses the learnable global label as the query to extract relevant information from the embedded sequence-level variable:
[0060]
[0061] wherein A ldenotes the vector and arranged by row, B l denotes A transformed by Self-Attention l , denotes P corresponding to the lth TimeXer block en , denotes G corresponding to the lth TimeXer block en Self-Attention denotes a self-attention mechanism, denotes the representation of the patch embedding of the endogenous variable in the lth TimeXer block after processing by the endogenous self-attention mechanism, denotes the representation of the learnable global endogenous label in the lth TimeXer block, LayerNorm denotes a layer normalization function, Cross-Attention denotes a cross-attention mechanism, V ex denotes the sequence-level variable embedded.
[0062] In one embodiment, the output layer generates the predicted mean and variance of the ramping demand by applying a linear projection to the final endogenous embedding.
[0063] According to a second aspect of an embodiment of the present application, a power system ramping demand prediction system is provided.
[0064] In one embodiment, the power system ramping demand prediction system comprises:
[0065] a key feature determination module configured to extract trend features of the up-ramp and down-ramp based on an adaptive trend judgment algorithm adjusted for volatility;
[0066] an extreme weather marking module configured to filter weather features related to ramping demand in meteorological data using a minimum redundancy maximum correlation feature selection method, determine an extreme value threshold of the weather features according to the distribution characteristics of historical meteorological data, and create a binary feature marking extreme weather for each time step;
[0067] a ramping demand prediction module configured to capture long-term dependencies of weather time series using an improved TimeXer prediction model, and fuse meteorological features through an attention mechanism to output the mean and variance of the ramping demand to capture the uncertainty under extreme weather.
[0068] In one embodiment, the key feature determination module dynamically adjusts the window size of the adaptive trend judgment algorithm according to the volatility of the climbing demand data when extracting the trend features of the up-climbing and down-climbing based on the adaptive trend judgment algorithm adjusted based on volatility, and introduces a trend strength evaluation mechanism and a retention strategy to improve the adaptive trend judgment algorithm; the trend features of the up-climbing and down-climbing are extracted by using the improved adaptive trend judgment algorithm;
[0069] wherein the dynamic adjustment of the window size of the adaptive trend judgment algorithm according to the volatility of the climbing demand data, and the introduction of the trend strength evaluation mechanism and the retention strategy, realize the improvement of the adaptive trend judgment algorithm, including:
[0070] The volatility rate factor is determined according to the data volatility in the current time window, the minimum volatility and the maximum volatility in the historical data, and the adaptive window of the adaptive trend judgment algorithm is obtained by dynamically adjusting the initial window by using the volatility rate factor; the dynamic adjustment formula of the adaptive window is:
[0071]
[0072] wherein, w a represents the adaptive window, w b represents the initial window, v represents the volatility rate factor, v c represents the data volatility in the current time window, v min represents the minimum volatility in the historical data, v max represents the maximum volatility in the historical data;
[0073] The trend slope is obtained by linear regression fitting of the trend line, and the trend strength is determined by combining the trend duration and the trend strength adjustment coefficient; the importance of the trend feature is quantified based on the trend strength, and the retention strategy is formulated by comparing the importance of the overlapping trends; the calculation formula of the trend strength is:
[0074]
[0075] c p =1-p value
[0076] wherein, I represents the trend strength, s represents the slope of the trend, t d represents the duration of the trend, c p represents the trend strength adjustment coefficient, p value represents the slope significance probability value obtained based on the linear regression t-test.
[0077] In one embodiment, the extreme weather marking module screens the weather features related to the climbing demand in the weather data by using the minimum redundancy maximum correlation feature selection method; determines the extreme value threshold of the weather feature according to the distribution characteristics of the historical weather data, and creates a binary feature to mark the extreme weather for each time step, obtains the weather data and performs discretization processing and normalization processing; calculates the mutual information between the weather feature and the climbing demand and the mutual information between the weather feature pairs; calculates the maximum correlation between the weather feature and the climbing demand according to the mutual information between the weather feature and the climbing demand, and calculates the minimum redundancy between the weather features based on the mutual information between the weather feature pairs; screens the key features related to the climbing demand in the weather data based on the maximum correlation between the weather feature and the climbing demand and the minimum redundancy between the weather features; determines the extreme threshold of the extreme weather according to the distribution characteristics of the historical weather data, and calculates the upper and lower limits of the historical threshold of each weather feature in the historical data; creates a binary feature to mark the extreme weather for each time step based on the historical threshold upper and lower limits;
[0078] The calculation formula of the mutual information between the weather feature and the climbing demand is:
[0079]
[0080] The calculation formula of the mutual information between the weather feature pairs is:
[0081]
[0082] The calculation formula of the maximum correlation between the weather feature and the climbing demand is:
[0083]
[0084] The calculation formula of the minimum redundancy between the weather features is:
[0085]
[0086] The objective function of the minimum redundancy maximum correlation is:
[0087] maxΦ(D,R),Φ=D-R
[0088] In the formula, I(f i ; c) represents the mutual information between the weather feature set f i and the climbing demand set c, f i represents the set of all weather feature data, c represents the set of all climbing demand data, p(x, y) represents the joint probability distribution of the weather feature x and the climbing demand y, p(x) represents the marginal probability distribution of the weather feature x, p(y) represents the marginal probability distribution of the climbing demand y, I(f i ; f j) represents the meteorological feature set f i and meteorological feature set f j The mutual information between them is max D(S,c), where D represents the maximum correlation between meteorological features and climbing requirements, D(S,c) represents the correlation distance between the selected feature subset S and the climbing requirement set c, minR(S) represents the minimum redundant information, R(S) represents the redundant information measurement, and Φ(D,R) represents the difference between correlation and redundancy.
[0089] In one embodiment, the ramp demand prediction module constructs an improved TimeXer prediction model while using the improved TimeXer prediction model to capture the long-term dependency of weather time series, and fuses meteorological features through an attention mechanism to output the mean and variance of the ramp demand to capture the uncertainty under extreme weather conditions; trains the improved TimeXer prediction model using historical ramp demand data and meteorological feature data to capture the long-term dependency of weather time series, and fuses meteorological features through an attention mechanism; uses the trained improved TimeXer prediction model in combination with current ramp demand data and meteorological feature data to output the mean and variance of the ramp demand to capture the uncertainty under extreme weather conditions;
[0090] Among them, the improved TimeXer prediction model consists of an input layer, an attention mechanism, and an output layer;
[0091] The input layer consists of endogenous embedding and exogenous embedding. The endogenous embedding uses historical ramp demand data as endogenous variables, while the exogenous embedding uses meteorological characteristics as exogenous variables.
[0092] The endogenous variable embedding formula is:
[0093] {s1,s2,...,s N}=Patchify(x)
[0094] P en =PatchEmbed(s1,s2,...,s N )
[0095] G en =Learnable(x)
[0096] The embedding formula of exogenous variables is:
[0097] V ex,i =VariateEmbed(z (i) ),i∈{1,...,C}
[0098] Where s Ndenotes the Nth patch obtained after applying the Patchify function operation on the endogenous variable, Patchify(x) denotes the function that projects the endogenous variable x 1:T partitioned into N non-overlapping patches, P en denotes the D-dimensional time token vector, G en denotes the learnable global token, PatchEmbed, Learnable respectively denote different trainable linear projectors, V ex,i denotes the i-th embedded sequence-level variable, VariateEmbed denotes the projector, z (i) denotes the i-th exogenous time series, C denotes the total number of exogenous variables;
[0099] The attention mechanism is composed of an endogenous self-attention mechanism and an exogenous-to-endogenous cross-attention mechanism, which are used to fuse meteorological features and historical climbing demand data to improve prediction accuracy and uncertainty modeling capability.
[0100] The endogenous self-attention captures the short-term dependencies between endogenous variables and the long-term patterns of the entire sequence, and the calculation process is as follows:
[0101]
[0102] B l = Self-Attention(A l )
[0103]
[0104] The cross-attention integrates the information of the exogenous variables into the endogenous variables, and uses the learnable global token as the query to extract relevant information from the embedded sequence-level variables:
[0105]
[0106] In the formula, A l denotes that the vectors and are arranged by rows, B l denotes A l , denotes the P en corresponding to the lth TimeXer block, denotes the G en corresponding to the lth TimeXer block, Self-Attention denotes the self-attention mechanism, denotes the representation of the patch embedding of the endogenous variable in the lth TimeXer block after being processed by the endogenous self-attention mechanism, represents the representation of the global intrinsic label learnable in the lth TimeXer block, LayerNorm represents the layer normalization function, Cross-Attention represents the cross-attention mechanism, V ex represents the embedded sequence-level variable;
[0107] The output layer generates the predicted mean and variance of the ramping demand by applying a linear projection on the final intrinsic embedding.
[0108] According to a third aspect of the embodiments of the present application, a computer device is provided.
[0109] In some embodiments, the computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0110] According to a fourth aspect of the embodiments of the present application, a computer readable storage medium is provided.
[0111] In one embodiment, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the above method.
[0112] The technical solutions provided by the embodiments of the present application can include the following beneficial effects:
[0113] The present application proposes an adaptive trend judgment algorithm to extract the trend characteristics of up-ramping and down-ramping. Then, through multi-dimensional correlation analysis, the correlation degree of net load characteristics, historical load prediction, weather forecast, and historical prediction error with net load ramping demand is determined. Then, the minimum redundancy maximum correlation method is used to compress the features of the input data, and an uncertain ramping demand prediction framework based on the TimeXer model is constructed. The model can effectively capture the long-term dependence relationship in time series data and fuse meteorological features through the attention mechanism, and output the confidence interval of uncertain ramping demand. To improve the performance of the model under extreme weather conditions, the present application also proposes a method for defining extreme weather indicators. The extreme value threshold is determined through the distribution of historical meteorological data, and a binary feature is created for each time step to mark extreme weather. At the same time, the output layer of the TimeXer model is modified to predict the mean and variance of the ramping demand simultaneously, in order to capture the uncertainty under extreme weather conditions. The negative log-likelihood loss function of the Gaussian distribution is used for training to optimize the performance of the model in uncertain prediction. The prediction method proposed in the present application improves the prediction accuracy by 18.4% under the consideration of meteorological features, and the interval coverage rate reaches 92.5%. Moreover, under the same confidence interval coverage rate, the bandwidth of the prediction interval is narrower, which better reflects the influence law of meteorological factors on ramping demand. Especially under extreme weather conditions, the model can more accurately predict the uncertainty of ramping demand.
[0114] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application, as claimed. BRIEF DESCRIPTION OF DRAWINGS
[0115] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and serve to explain the principles of the application, in which, like reference numerals designate corresponding parts throughout the several views.
[0116] Figure 1 is a flow chart of a power system ramping demand prediction method according to an exemplary embodiment;
[0117] Figure 2 is a structural block diagram of a power system ramping demand prediction system according to an exemplary embodiment;
[0118] Figure 3 is a flow chart of an adaptive trend judgment algorithm according to an exemplary embodiment;
[0119] Figure 4 is an example diagram of up-ramping feature extraction according to an exemplary embodiment;
[0120] Figure 5 is a curve diagram of Φ value change of an mRMR feature selection process according to an exemplary embodiment;
[0121] Figure 6 is a diagram of weather features screened by mRMR according to an exemplary embodiment;
[0122] Figure 7 is a diagram of the relationship between extreme weather and ramping demand according to an exemplary embodiment;
[0123] Figure 8 is an improved TimeXer architecture diagram according to an exemplary embodiment;
[0124] Figure 9 is a structural diagram of a computer device according to an exemplary embodiment. DETAILED DESCRIPTION
[0125] The following description and drawings are illustrative of specific embodiments thereof and are not intended to limit the scope of the embodiments. Parts and features of some embodiments can be included or substituted in or for parts and features of other embodiments. The scope of the embodiments encompassed herein includes the whole scope of the claims together with all available equivalents of the claims. In this document, the terms "first", "second", etc. are used merely to distinguish one element from another, and do not require or imply any actual relationship or order between the elements. In fact, the first element can be referred to as the second element, and vice versa. Also, the terms "comprises", "comprising", or any other variations thereof are intended to cover a non-exclusive inclusion, such that a structure, device, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such structure, device, or apparatus. Without further limitation, an element defined by an "includes a" statement does not exclude the presence of additional identical elements in the structure, device, or apparatus that includes the element. Various embodiments are described in progressive stages, each of which focuses on the differences from other embodiments, and the same or similar parts between various embodiments can be referred to each other.
[0126] The terms "longitudinal", "lateral", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like, as used herein, indicate relative positions or orientation relationships based on the positions or orientation relationships shown in the drawings, and are only used for the convenience of description herein and simplification of description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. In the description herein, unless otherwise specified and limited, the terms "mount", "connect", "connection" should be understood broadly, for example, it can be a mechanical connection or an electrical connection, it can be a communication between two elements inside, it can be a direct connection, or an indirect connection through an intermediate medium, and the specific meaning of the above terms can be understood by those skilled in the art according to the specific circumstances.
[0127] In this document, the term "multiple" means two or more, unless otherwise specified.
[0128] In this document, the character " / " represents an "or" relationship between the objects before and after it. For example, A / B means A or B.
[0129] In this document, the term "and / or" is a description of the relationship between the objects, which means that there can be three relationships. For example, A and / or B means that there are three relationships of A or B, or A and B.
[0130] It should be understood that although the steps in the flowchart are shown in a sequential order following the arrows, the steps are not necessarily executed in the order shown by the arrows. Unless otherwise explicitly stated herein, there is no strict order requirement for the execution of the steps, and the steps can be executed in other orders. Moreover, at least some of the steps in the figure can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the sub-steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or sub-steps or stages of other steps.
[0131] Each module in the device or system of the present application can be implemented wholly or partially by software, hardware, and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the above modules.
[0132] In the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0133] Figure 1 An embodiment of a power system ramping demand prediction method of the present application is shown.
[0134] In this optional embodiment, the power system ramping demand prediction method comprises:
[0135] Step S101, based on the fluctuation adjustment adaptive trend judgment algorithm, the trend characteristics of the up-ramping and down-ramping are extracted;
[0136] Step S102, using the minimum redundancy maximum correlation feature selection method, the weather features related to the ramping demand in the meteorological data are screened; the extreme value threshold of the weather features is determined according to the distribution characteristics of the historical meteorological data, and a binary feature label extreme weather is created for each time step;
[0137] Step S103, using the improved TimeXer prediction model, the long-term dependence relationship of the weather time series is captured, and the meteorological features are fused through the attention mechanism, and the mean and variance of the ramping demand are output to capture the uncertainty under extreme weather.
[0138] In this optional embodiment, the fluctuation adjustment adaptive trend judgment algorithm extracts the trend characteristics of the up-ramping and down-ramping, which comprises:
[0139] The window size of the adaptive trend judgment algorithm is dynamically adjusted according to the fluctuation of the ramping demand data, and a trend strength evaluation mechanism and a retention strategy are introduced to improve the adaptive trend judgment algorithm.
[0140] The improved adaptive trend judgment algorithm is used to extract the trend characteristics of the uphill and downhill.
[0141] In this optional embodiment, the window size of the adaptive trend judgment algorithm is adjusted according to the volatility of the climbing demand data, and a trend strength evaluation mechanism and a retention strategy are introduced to improve the adaptive trend judgment algorithm, which includes:
[0142] The volatility rate factor is determined according to the data volatility in the current time window, the minimum volatility and the maximum volatility in the historical data, and the initial window is dynamically adjusted using the volatility rate factor to obtain the adaptive window of the adaptive trend judgment algorithm;
[0143] The trend slope is obtained by linear regression fitting, and the trend strength is determined by combining the trend duration and the trend strength adjustment coefficient; the importance of the trend characteristics is quantified based on the trend strength, and the retention strategy is formulated by comparing the importance of the overlapping trends.
[0144] In this optional embodiment, the dynamic adjustment formula of the adaptive window is:
[0145]
[0146] The calculation formula of the trend strength is:
[0147]
[0148] c p =1-p value
[0149] In the formula, w a represents the adaptive window, w b represents the initial window, v represents the volatility rate factor, v c represents the data volatility in the current time window, v min represents the minimum volatility in the historical data, v max represents the maximum volatility in the historical data, I represents the trend strength, s represents the slope of the trend, t d represents the duration of the trend, c p represents the trend strength adjustment coefficient, p value represents the slope significance probability value obtained based on the linear regression t-test.
[0150] In this optional embodiment, the minimum redundancy maximum correlation feature selection method is used to screen the meteorological features related to the climbing demand in the meteorological data; the extreme value threshold of the meteorological features is determined according to the distribution characteristics of the historical meteorological data, and a binary feature is created for each time step to mark extreme weather, including:
[0151] obtain meteorological data and perform discretization and normalization processing; calculate mutual information between meteorological features and climbing demand and mutual information between pairs of meteorological features;
[0152] According to the mutual information between the meteorological features and the climbing demand, the maximum correlation between the meteorological features and the climbing demand is calculated, and based on the mutual information between the pairs of meteorological features, the minimum redundancy between the meteorological features is calculated;
[0153] Based on the maximum correlation between the meteorological features and the climbing demand and the minimum redundancy between the meteorological features, the key features related to the climbing demand in the meteorological data are screened out;
[0154] According to the distribution characteristics of the historical meteorological data, the extreme threshold of the extreme weather is determined, and the upper and lower limits of the historical threshold of each meteorological feature in the historical data are calculated; based on the historical threshold upper and lower limits, a binary feature is created for each time step to mark the extreme weather.
[0155] In this optional embodiment, the calculation formula of the mutual information between the meteorological features and the climbing demand is:
[0156]
[0157] The calculation formula of the mutual information between the pairs of meteorological features is:
[0158]
[0159] The calculation formula of the maximum correlation between the meteorological features and the climbing demand is:
[0160]
[0161] The calculation formula of the minimum redundancy between the meteorological features is:
[0162]
[0163] The objective function of the minimum redundancy maximum correlation is:
[0164] maxΦ(D,R),Φ=D-R
[0165] In the formula, I(f i ; c) represents the mutual information between the meteorological feature set f i and the climbing demand set c, f i represents the set of all meteorological feature data, c represents the set of all climbing demand data, p(x, y) represents the joint probability distribution of meteorological feature x and climbing demand y, p(x) represents the marginal probability distribution of meteorological feature x, p(y) represents the marginal probability distribution of climbing demand y, I(f i ; f j) represents the set of weather features f i The mutual information between the set of weather features f j , max D(S, c), D represents the maximum correlation of weather features and climbing demand, D(S, c) represents the correlation distance of the selected feature subset S and the set of climbing demand c, min R(S) represents the minimum redundancy information, R(S) represents the redundancy information measure, and Φ(D, R) represents the difference between correlation and redundancy.
[0166] In this optional embodiment, the improved TimeXer prediction model is used to capture the long-term dependence of weather time series, and the meteorological features are fused through the attention mechanism to output the mean and variance of the climbing demand, so as to capture the uncertainty under extreme weather, including:
[0167] An improved TimeXer prediction model is constructed, wherein the improved TimeXer prediction model is composed of an input layer, an attention mechanism and an output layer;
[0168] The improved TimeXer prediction model is trained by using historical climbing demand data and meteorological feature data, so as to capture the long-term dependence of weather time series and fuse meteorological features through the attention mechanism;
[0169] The trained improved TimeXer prediction model is used to output the mean and variance of the climbing demand in combination with the current climbing demand data and meteorological feature data, so as to capture the uncertainty under extreme weather.
[0170] In this optional embodiment, the input layer is composed of endogenous embedding and exogenous embedding, and the endogenous embedding takes the historical climbing demand data as an endogenous variable, and the exogenous embedding takes the meteorological feature as an exogenous variable;
[0171] The endogenous variable embedding formula is:
[0172] {s1,s2,...,s N}=Patchify(x)
[0173] P en =PatchEmbed(s1,s2,...,s N )
[0174] G en =Learnable(x)
[0175] The embedding formula of the exogenous variable is:
[0176] V ex,i =VariateEmbed(z (i) ),i∈{1,...,C}
[0177] where s N denotes the Nth patch obtained by applying the Patchify function operation to the endogenous variable, Patchify(x) denotes the function that splits the endogenous variable x 1:T into N non-overlapping patches, P en denotes the D-dimensional time label vector, G en denotes the learnable global label, PatchEmbed, Learnable denote different trainable linear projectors, V ex,i denotes the ith embedded sequence-level variable, VariateEmbed denotes the projector, z (i) denotes the ith exogenous time series, C denotes the total number of exogenous variables.
[0178] In this optional embodiment, the attention mechanism is composed of endogenous self-attention mechanism and exogenous-to-endogenous cross-attention mechanism, which is used to fuse meteorological features and historical climbing demand data to improve prediction accuracy and uncertainty modeling capability;
[0179] wherein the endogenous self-attention captures the short-term dependency between endogenous variables and the long-term pattern of the entire sequence, and the calculation process is:
[0180]
[0181] B l =Self-Attention(A l )
[0182]
[0183] The cross-attention integrates the information of the exogenous variable into the endogenous variable, and uses the learnable global label as the query to extract relevant information from the embedded sequence-level variable:
[0184]
[0185] wherein A l denotes that the vectors and are arranged by row, B l denotes A l after Self-Attention transformation,
[0186] denotes the P en corresponding to the lth TimeXer block, denotes the G en corresponding to the lth TimeXer block, and Self-Attention denotes the self-attention mechanism, represents the patch embedding of endogenous variables in the lth TimeXer block after being processed by the endogenous self-attention mechanism, represents the representation of the learnable global endogenous label in the lth TimeXer block, LayerNorm represents the layer normalization function, Cross-Attention represents the cross-attention mechanism, V ex represents the embedded sequence-level variable.
[0187] In this optional embodiment, the output layer generates the predicted mean and variance of the ramping demand by applying a linear projection to the final endogenous embedding.
[0188] Figure 2 An embodiment of a power system ramping demand prediction system of the present application is shown.
[0189] In this optional embodiment, the power system ramping demand prediction system comprises:
[0190] The key feature determination module 201 is configured to extract the trend features of the up-ramp and down-ramp based on the volatility-adjusted adaptive trend judgment algorithm.
[0191] The extreme weather marking module 202 is configured to screen the meteorological features related to the ramping demand in the meteorological data by using the minimum redundancy maximum correlation feature selection method, determine the extreme value threshold of the meteorological features according to the distribution characteristics of the historical meteorological data, and create a binary feature marking extreme weather for each time step.
[0192] The ramping demand prediction module 203 is configured to capture the long-term dependence relationship of the weather time series by using the improved TimeXer prediction model, and fuse the meteorological features through the attention mechanism to output the mean and variance of the ramping demand, so as to capture the uncertainty under the extreme weather.
[0193] In order to facilitate the understanding of the above technical solutions of the present application, the above technical solutions of the present application are further described from the aspects of architecture and principle as follows:
[0194] The application provides a power system climbing demand prediction method considering meteorological characteristics. First, an adaptive trend judgment algorithm is designed to extract the trend characteristics of up-climbing (positive steep increase) and down-climbing (reverse sudden drop). Second, the minimum redundancy maximum relevance (mRMR) feature selection method is used to select the features strongly related to climbing demand from meteorological data. To further improve the prediction performance of the model under extreme weather conditions, an extreme weather index definition method is proposed: based on the distribution characteristics of historical meteorological data, the extreme value threshold of each feature is determined, and a binary feature is generated for each time step to mark the extreme weather state. Finally, an improved attention fusion prediction framework based on TimeXer is constructed. The framework uses the original TimeXer attention mechanism to integrate the information of exogenous weather variables including extreme weather state into the global representation of endogenous variables, effectively capturing the long-term dependence of weather time series. The output layer of the TimeXer model is modified to predict the mean and variance of climbing demand simultaneously to capture the uncertainty under extreme weather. The negative log-likelihood loss function of Gaussian distribution is used for training to optimize the performance of the model in uncertainty prediction. The results show that the prediction accuracy and uncertainty quantification of the model considering meteorological characteristics and extreme weather are significantly better than those of the comparative model.
[0195] The climbing demand of the power grid system is mainly affected by renewable energy access and load characteristics. Under the condition of high proportion of new energy, the net load curve (defined as the difference between load and renewable energy generation) presents stronger volatility than the original load, forming the "duck curve" feature and increasing the demand for flexible adjustment of the system. The climbing demand can be defined as the change rate of net load per unit time, which is divided into upward and downward demands.
[0196] I. Adaptive trend judgment algorithm
[0197] The adaptive trend judgment algorithm aims to more accurately identify the trend changes of net load by dynamically adjusting the window size and evaluating the trend strength. Traditional trend judgment methods usually rely on fixed window size. This approach may lead to over-sensitive trend identification when data volatility is high, and may be slow when volatility is low, making it difficult to adapt to complex scenarios.
[0198] To address this issue, the present invention proposes an improved method that dynamically adjusts the window size by calculating the volatility of the data, thereby improving the adaptability of the algorithm. Specifically, when the data volatility is high, the algorithm uses a smaller window to capture rapidly changing trends; when the volatility is low, a larger window is used to smooth the noise and reduce misjudgments. In addition, the algorithm introduces a trend strength assessment mechanism to provide more valuable input for subsequent ramp-up demand forecasts by quantifying trend characteristics. At the same time, to address the problem of trend overlap, the algorithm formulates a retention strategy by comparing the importance of overlapping trends. These improvements significantly enhance the robustness and accuracy of the algorithm in complex scenarios. The core formula for dynamically adjusting the window size is as follows:
[0199] w a =w b ×(1+v)
[0200] Where w a represents the adaptive window, w b represents the initial window, which is usually preset according to the time resolution of the data and the analysis requirements, and v represents the volatility factor; the expression of v is:
[0201] v=v c -v min
[0202] v max -v min
[0203] Where, v c Indicates the data volatility within the current time window, usually expressed as standard deviation σ, v min Indicates the minimum volatility in historical data, v max Represents the maximum volatility in historical data. Through the above formula, the window size can be dynamically adjusted according to the volatility of the ramp demand data.
[0204] In order to quantify the importance of the trend, a trend strength I evaluation mechanism is also introduced. The calculation formula is:
[0205]
[0206] Where I represents the trend strength, s represents the slope of the trend, which is calculated by linear regression fitting trend line, and t d Indicates the duration of the trend, for t dThe square root is taken to balance the influence of trend duration on overall intensity, avoiding overemphasis on long trends; this processing makes the contribution of duration grow nonlinearly, i.e., as duration increases, its contribution to intensity will still grow, but the growth rate will gradually slow down; the square root is taken because the statistical reliability of a trend is usually proportional to the square root of the sample size, and it can better balance the weight relationship between slope and duration in intensity evaluation. Finally, c p = 1 - p value , c p represents the trend intensity adjustment coefficient, p value represents the slope significance probability value based on linear regression t-test, the closer to 0 indicates the more significant the trend, so that c p approaches 1, enhancing the overall trend intensity index;
[0207] In summary, the adaptive trend judgment algorithm not only can identify the existence of trends, but also provides a quantitative basis for their importance. When dealing with overlapping trends, the algorithm can compare the comprehensive indexes and retain the trends with higher importance. The specific process of the algorithm is shown in Figure 3 . Figure 4 The results of using the adaptive window algorithm to extract the load change trends of a typical day in a certain province are shown.
[0208] II. Meteorological feature selection and correlation analysis
[0209] 1. Multidimensional correlation analysis
[0210] The ramping demand of the power system is influenced by many factors, among which meteorological factors play a crucial role. Here, the Pearson correlation coefficient is used to analyze the correlation of weather variables. First, a multidimensional meteorological forecast dataset is collected, including: temperature and apparent temperature at different heights (such as 2 meters, 80 meters, 120 meters, and 180 meters); vapor pressure deficit indicating humidity; wind speed and direction covering multiple heights (10 meters to 180 meters) and pressure layers (1000 hPa to 925 hPa), including surface gust; total and instantaneous values of solar radiation (shortwave, direct, scattered, etc.) and ground radiation; cloud cover data covering low, medium, and high layers; rainfall, short-term rainfall, and snowfall data; and wind speed data at different pressure layers (such as 1000 hPa to 925 hPa). The formula for calculating the Pearson correlation coefficient is:
[0211]
[0212] where x i and y iObserved values of two variables respectively; x and y are the mean values of the corresponding variables; r ranges from -1 to 1, close to 1 indicates strong positive correlation, close to -1 indicates strong negative correlation, close to 0 indicates no obvious linear relationship; n represents the number of samples. By using the weather and climbing demand data of a certain province in 2024 to calculate the correlation coefficient of meteorological characteristics and climbing demand, the variables with high correlation degree are preliminarily screened out, see Table 1.
[0213] Table 1 Correlation of meteorological characteristics and climbing demand
[0214] Variable Correlation coefficient Variable Correlation coefficient 2 meter temperature 0.07 80 meter temperature 0.045 Apparent temperature 0.06 120 meter temperature 0.041 Rainfall -0.026 180 meter temperature 0.038 Shower -0.027 Shortwave radiation 0.178 Snowfall -0.027 Direct radiation 0.152 Low cloud cover -0.031 Scattered radiation 0.179 Medium cloud cover -0.067 Direct normal radiation 0.197 High cloud cover -0.051 Global tilt radiation 0.178 Evapotranspiration 0.148 Ground radiation 0.174 Vapor pressure difference 0.142 Instantaneous shortwave radiation 0.167 10 meter wind speed 0.015 Instantaneous direct radiation 0.139 80 meter wind speed 0.121 Instantaneous scattered radiation 0.176 120 meter wind speed 0.133 Instantaneous direct normal radiation 0.201 180 meter wind speed 0.136 Instantaneous global tilt radiation 0.165 10 meter wind direction -0.004 Instantaneous ground radiation 0.169 80 meter wind direction -0.003 1000 hPa wind speed 0.08 120 meter wind direction -0.006 975 hPa wind speed 0.12 180 meter wind direction 0.001 950 hPa wind speed 0.135 10 meter gust 0.004 925 hPa wind speed 0.133
[0215] Analysis found that among the given meteorological factors, the instantaneous direct normal radiation showed the strongest positive correlation with the climbing demand (correlation coefficient r = 0.20119), indicating that the increase in solar radiation may be related to the increase in power load, especially in the case of increased photovoltaic power output. While the medium cloud cover showed a negative correlation with the climbing demand (r = -0.06697), which may mean that the increase in cloud cover will reduce the transmittance of solar radiation, affecting the stability of photovoltaic power generation and the change of net load. However, these correlation coefficients are relatively small, indicating that the climbing demand may be influenced by multiple meteorological factors or there may be more complex nonlinear relationships. The correlation between wind speed and climbing demand is generally weak, with the highest correlation coefficient of 0.13641 (180 meters wind speed). The correlation changes with height and pressure layer: wind speed at higher altitudes (such as 180 meters) and lower pressure layers (such as 950 hPa) has stronger correlation with climbing demand, possibly because it better reflects the fluctuations in wind power output. Physically, wind speed indirectly affects climbing demand by affecting wind power output, but its direct impact is limited.
[0216] 2、mRMR feature selection method
[0217] Since the collected meteorological features have a dimension of dozens, directly inputting all features into the prediction model may cause dimension disaster and overfitting problem. Therefore, the Minimum Redundancy Maximum Relevance (mRMR) method is used for feature selection to obtain the most representative feature subset.
[0218] 2.1、mRMR method principle
[0219] The core idea of mRMR method is to meet two conditions at the same time:
[0220] 1) Maximum Relevance (Maximum Relevance): the selected features should have the maximum correlation with the target variable (climbing demand);
[0221]
[0222] 2) Minimum Redundancy: the selected features should have minimum redundancy among them;
[0223]
[0224] Combining the two criteria, the objective function of mRMR is:
[0225] max Φ(D, R), Φ = D - R
[0226] where I(f i ; c) denotes the mutual information between the set of weather features f i and the set of climbing demand c, f i denotes the set of all weather feature data, c denotes the set of all climbing demand data, p(x, y) denotes the joint probability distribution of weather feature x and climbing demand y, p(x) denotes the marginal probability distribution of weather feature x, p(y) denotes the marginal probability distribution of climbing demand y, I(f i ; f j ) denotes the mutual information between the set of weather features f i and the set of weather features f j , max D(S, c) denotes the maximum correlation of weather features and climbing demand, D(S, c) denotes the correlation distance of the selected feature subset S and the set of climbing demand c, min R(S) denotes the minimum redundancy information, R(S) denotes the redundancy information measure, and Φ(D, R) denotes the difference between correlation and redundancy.
[0227] 2.2, Implementation steps
[0228] The specific implementation steps of mRMR feature selection are as follows:
[0229] 1) Data preprocessing: discretize continuous features for ease of calculating mutual information; normalize all features to [0, 1] to ensure that features of different dimensions can be compared.
[0230] 2) Calculate the mutual information matrix: calculate the mutual information I(f i ; c) between each feature and the target variable; calculate the mutual information I(f i ; f j ) between pairs of features.
[0231] 3) Feature selection: first select the feature with the maximum mutual information with the target variable; select the features that satisfy the maximum Φ value in turn; for the selection of the m+1th feature:
[0232]
[0233] Where: S m is the set of m selected features, F is the set of all features, f j Represents a feature j, f i Represents a feature i.
[0234] 4) Determine the optimal number of features: Use the cross-validation method to evaluate the impact of different feature subset sizes on prediction performance, draw the feature number-performance curve, and find the inflection point.
[0235] 5) Evaluate the final feature subset: Use the selected feature subset to build a prediction model and compare the performance of the model using all features.
[0236] The changes in Φ values during the selection process were recorded, e.g. Figure 5 As shown in the figure, when the number of features reaches 11, the growth of Φ tends to slow down, indicating that further adding features may not bring significant performance improvements. By compressing the original 38 features to these 11 key features, the computational complexity of the model can be significantly reduced. Figure 6 Specific weather feature names are given.
[0237] 3. Extreme weather dualism
[0238] When analyzing the relationship between meteorological characteristics and power system ramping requirements, the impact of extreme weather events is particularly significant. Extreme weather can not only cause dramatic fluctuations in power load but also impact the stability of renewable energy generation, thereby exacerbating power system ramping requirements. Therefore, accurately identifying and quantifying the impact of extreme weather events on ramping requirements is crucial for improving the accuracy and robustness of forecasting models.
[0239] The definition of extreme weather is based on the historical distribution of meteorological characteristics. A threshold of 5% is used to screen out extreme behavior of each meteorological characteristic (such as temperature, wind speed, cloud cover change rate, etc.).
[0240] To incorporate the impact of extreme weather into the prediction model, we created a binary feature for each time step to mark whether an extreme weather event occurred at that time step. The specific steps are as follows:
[0241] 1) Select extreme thresholds: Select upper and lower 5% thresholds as the judgment criteria for extreme weather to capture more significant extreme events.
[0242] 2) Calculate historical thresholds: For each meteorological feature, calculate its 5% and 95% quantiles in historical data as the lower and upper thresholds.
[0243] 3) Labeling extreme events: At each time step, check all selected weather features (e.g., 11 key features selected by the mRMR method), and if the value of any of them exceeds its corresponding upper or lower 5% threshold, label the binary feature of that time step as 1; otherwise, label it as 0.
[0244] Figure 7 The relationship between extreme weather and the demand for climbing is shown.
[0245] III. Improved TimeXer prediction model
[0246] 1. Model introduction
[0247] TimeXer is a time series prediction model based on the Transformer architecture, designed specifically for handling prediction tasks with exogenous variables. In time series prediction, endogenous variables are the target sequences to be predicted, while exogenous variables are covariates that provide additional information to improve the predictability of endogenous variables, where T and T ex are the backtracking window lengths of endogenous and exogenous variables, respectively; is the i-th exogenous variable; C is the number of exogenous variables. The goal of TimeXer is to predict the future S time steps of endogenous values 1:T from historical observations x and exogenous variables Formally, it is represented as: where is the prediction model parameterized by θ.
[0248] The core advantage of TimeXer lies in its flexibility and efficiency:
[0249] 1) Flexible handling of exogenous variables: Supports exogenous variables with inconsistent backtracking lengths (i.e., T ex ≠ T), adapting to data heterogeneity in real-world scenarios.
[0250] 2) Dual dependency capture: Through self-attention and cross-attention mechanisms, TimeXer simultaneously models the dependency relationships in the time dimension (within endogenous variables) and the variable dimension (between endogenous and exogenous variables).
[0251] 3) Uncertainty modeling: Through fine-grained time patch representation and global label design, TimeXer can capture uncertainty in prediction, especially suitable for complex tasks such as demand prediction.
[0252] In uncertain climbing demand prediction, TimeXer can use historical demand data as endogenous variables and meteorological features and other external factors as exogenous variables, thereby improving prediction accuracy and robustness.
[0253] 2. Model Architecture
[0254] The architecture of TimeXer is based on Transformer, which contains three main parts: input layer, attention mechanism and output layer. The design focuses on the differential processing of endogenous and exogenous variables. The symbols of Self-Attention(.), Cross-Attention(.), Projection(.) and Feed-Forward(.) functions used in this paper are consistent with the corresponding formulas in the Transformer architecture. Among them:
[0255] 2.1. Input Layer
[0256] 1) Endogenous Embedding
[0257] Endogenous variables x 1:T are divided into non-overlapping patches, each patch has a length of P, and the number of patches is Each patch is mapped to a D-dimensional time token vector P en by linear projection, and a learnable global token G en is introduced to represent the overall characteristics of the sequence. The embedding process is as follows:
[0258] {s1,s2,…,s N}=Patchify(x)
[0259] P en =PatchEmbed(s1,s2,…,s N )
[0260] G en =Learnable(x)
[0261] In the formula, s N represents the Nth patch obtained by applying the Patchify function to the endogenous variable, and in the set {s1,s2,…,s N}, s N is the last patch, Patchify(x) represents the function that divides the endogenous variable x 1:T into N non-overlapping patches, and its output is the set of patches {s1,s2,…,s N}, P en represents the D-dimensional time token vector, and G en represents the learnable global token. PatchEmbed and Learnable represent different trainable linear projectors, which generate represents a set of rational numbers;
[0262] 2) Exogenous Embedding
[0263] each exogenous variable By the projector VariateEmbed: T ex → D is embedded as a sequence-level variable, denoted as V ex,i , the embedding formula is:
[0264] V ex,i = VariateEmbed(z (i) ), i ∈ {1,..., C}
[0265] where V ex,i represents the i-th embedded sequence-level variable, VariateEmbed represents the projector, z (i) represents the i-th exogenous time series, which has time steps from 1 to T ex , and C represents the total number of exogenous variables.
[0266] set This design avoids the fine-grained patch representation of exogenous variables, reduces computational complexity, and can overcome the problem of T ex ≠ T.
[0267] 2.2, Attention mechanism
[0268] TimeXer uses both endogenous self-attention mechanism and exogenous-to-endogenous cross-attention mechanism, where: endogenous self-attention is applied to P en and G en , capturing patch-level temporal dependencies; exogenous-to-endogenous cross-attention integrates the information of V ex into G en , achieving the integration of external information. Here, the attention mechanism of TimeXer is divided into two parts to fuse meteorological features (exogenous variables) and historical demand data (endogenous variables), improving the prediction accuracy and uncertainty modeling ability. The formal representation of the attention mechanism is as follows:
[0269] Endogenous self-attention. Endogenous self-attention captures short-term dependencies between endogenous variables and long-term patterns throughout the sequence, with the following calculation process:
[0270]
[0271] B l = Self-Attention(A l )
[0272]
[0273] In the formula, A ldenotes the vector and arranged by rows, B l denotes A transformed by Self-Attention l ,
[0274] denotes P corresponding to the l-th TimeXer block en , denotes G corresponding to the l-th TimeXer block en , Self-Attention denotes self-attention mechanism, denotes the representation of the patch embedding of endogenous variables in the l-th TimeXer block after processing by endogenous self-attention mechanism, which includes layer normalization (Layer Normalization), denotes the representation of the learnable global endogenous marker in the l-th TimeXer block, which is first processed by endogenous self-attention mechanism together with patch embedding, and then further updated by exogenous-to-endogenous cross-attention mechanism to incorporate the information of exogenous variables V ex . This process also includes layer normalization, LayerNorm denotes the layer normalization function, l∈{0,...,L-1} denotes the l-th TimeXer block, and Here, [·,·] denotes the concatenation of patch-level markers and global markers of endogenous variables along the sequence dimension, suitable for periodic and trend prediction in demand climbing requirements, Cross-Attention denotes cross-attention mechanism;
[0275] Cross-attention. Cross-attention incorporates the information of exogenous variables into endogenous variables, using G en as the query to extract relevant information from V ex
[0276]
[0277] Cross-Attention denotes the cross-attention mechanism; for example, when the exogenous variable is a meteorological feature (such as temperature), cross-attention can identify the causal relationship between temperature changes and demand fluctuations, thereby improving the interpretability and accuracy of the prediction. Finally, all time markers and learnable global markers will be transformed by a feedforward layer, expressed as follows:
[0278]
[0279] where l∈{1,...,L}, represents the endogenous variable patch embedding obtained by the lth TimeXer block The output after the feed-forward network transformation will be used as the input patch embedding for the l+1th TimeXer block. Represents the global endogenous mark obtained by the lth TimeXer block processing The output after the feedforward network transformation will be used as the input global label of the l+1th TimeXer block. Feed-Forward represents the feedforward network.
[0280] The combination of self-attention and cross-attention enables TimeXer to effectively integrate the temporal patterns of historical data with the external influence of meteorological characteristics. This design is particularly suitable for uncertain ramping demand forecasting because it captures the inherent fluctuations in demand while also quantifying sources of uncertainty using external variables.
[0281] 2.3. Output layer considering mean and variance
[0282] Here, in order to improve the prediction effect of the model in the uncertain climbing demand, the output layer of TimeXer is modified: by Apply linear projection to generate the predicted mean and variance See Figure 8 : Projection represents the linear projection layer. In order to ensure that the variance is non-negative, it is usually predicted Then pass This dual-head output structure allows the model to capture both the expected value and uncertainty of demand, which is particularly suitable for scenarios with high variability in demand under extreme weather conditions.
[0283] 3. Model training and optimization
[0284] TimeXer's training process includes data preprocessing, loss function definition, hyperparameter adjustment, and optimization strategy to ensure the model's performance in actual demand forecasting tasks.
[0285] 1) Data preprocessing
[0286] Endogenous variables: x 1:T Split into N patches, generating P en and G en ; Exogenous variables: for each Apply VariateEmbed projector to generate V ex .
[0287] 2) Model training
[0288] The negative log-likelihood loss function with Gaussian distribution is as follows:
[0289]
[0290] where, and are the mean and variance of the model output, s represents S steps in the future, represents the variance estimate of the ramping demand x at the T+i step, x T+i represents the actual value of the ramping demand at the T+i step, represents the mean estimate of x at the T+i step. This loss function encourages the model to optimize both the accuracy of the mean prediction and the variance, compared with the traditional mean square error (MSE), and is more suitable for processing the scenario of non-stationary data distribution during extreme weather, and ensures that the confidence interval width adapts to the actual variability.
[0291] In an embodiment, a computer device, which can be a server, has an internal structure diagram as shown in Figure 9 The computer device includes a processor, a memory and a network interface connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store static information and dynamic information data. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement the steps in the above method embodiments.
[0292] Those skilled in the art can understand that Figure 9 the structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. A specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0293] In addition, the present application also provides a computer device including a memory and a processor, the memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0294] In addition, the present application also provides a computer readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the steps in the above method embodiments.
[0295] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiments. Any reference to memory, storage, database or other medium used in each embodiment of the present 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 or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0296] The present application is not limited to the structures described above and shown in the drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present application is only limited by the appended claims.
Claims
1. A method for predicting ramp demand of a power system, characterized in that: include: An adaptive trend judgment algorithm based on volatility adjustment is used to extract the trend characteristics of upslope and downslope; The minimum redundancy maximum relevance feature selection method is used to screen meteorological features related to ramp requirements in meteorological data. The extreme value threshold of meteorological features is determined based on the distribution characteristics of historical meteorological data, and binary features are created for each time step to mark extreme weather. The improved TimeXer forecasting model is used to capture the long-term dependencies of weather time series, and the meteorological features are integrated through the attention mechanism to output the mean and variance of the ramp demand to capture the uncertainty under extreme weather conditions.
2. The method for predicting power system ramp demand according to claim 1, characterized in that: The adaptive trend judgment algorithm based on volatility adjustment extracts the trend features of upslope and downslope, including: The window size of the adaptive trend judgment algorithm is dynamically adjusted according to the volatility of the ramp demand data, and a trend strength evaluation mechanism and retention strategy are introduced to improve the adaptive trend judgment algorithm. The improved adaptive trend judgment algorithm is used to extract the trend features of upslope and downslope.
3. The method for predicting power system ramp demand according to claim 2, characterized in that: The method of dynamically adjusting the window size of the adaptive trend judgment algorithm according to the volatility of the ramp demand data and introducing a trend strength evaluation mechanism and a retention strategy to improve the adaptive trend judgment algorithm includes: The volatility factor is determined based on the data volatility in the current time window, the minimum volatility and the maximum volatility in the historical data, and the volatility factor is used to dynamically adjust the initial window to obtain the adaptive window of the adaptive trend judgment algorithm; The trend slope is obtained by fitting the trend line using linear regression, and the trend strength is determined by combining the trend duration and the trend strength adjustment coefficient. The importance of trend features is quantified based on the trend strength, and retention strategies are formulated by comparing the importance of overlapping trends.
4. The method for predicting ramp demand of a power system according to claim 3, characterized in that: The dynamic adjustment formula of the adaptive window is: w a =w b ×(1+v) The formula for calculating trend strength is: c p =1-p value Where w a represents the adaptive window, w b represents the initial window, v represents the volatility factor, v c Indicates the data volatility in the current time window, v min Indicates the minimum volatility in historical data, v max It represents the maximum volatility in historical data, I represents the trend strength, s represents the slope of the trend, and t d represents the duration of the trend, c p represents the trend strength adjustment coefficient, p value It represents the slope significance probability value obtained based on the linear regression t-test.
5. The method for predicting ramp demand of a power system according to claim 1, characterized in that: The method of using the minimum redundancy maximum correlation feature selection method to screen meteorological features related to the climbing requirement in the meteorological data; determining the extreme value threshold of the meteorological feature based on the distribution characteristics of the historical meteorological data, and creating a binary feature to mark extreme weather for each time step includes: Acquire meteorological data and perform discretization and normalization processing; calculate the mutual information between meteorological characteristics and climbing requirements, and the mutual information between pairs of meteorological characteristics; Based on the mutual information between meteorological features and ramp requirements, the maximum correlation between meteorological features and ramp requirements is calculated. Based on the mutual information between pairs of meteorological features, the minimum redundancy between meteorological features is calculated. Based on the maximum correlation between meteorological features and ramp requirements and the minimum redundancy between meteorological features, key features related to ramp requirements in meteorological data are screened; The extreme thresholds of extreme weather are determined based on the distribution characteristics of historical meteorological data, and the historical upper and lower limits of the thresholds for each meteorological feature in the historical data are calculated; based on the historical upper and lower limits, binary features are created for each time step to mark extreme weather.
6. The method for predicting ramp demand of a power system according to claim 5, characterized in that: The calculation formula of the mutual information between meteorological characteristics and climbing requirements is: The calculation formula for the mutual information between meteorological feature pairs is: The formula for calculating the maximum correlation between meteorological characteristics and climbing requirements is: The calculation formula for the minimum redundancy between meteorological features is: The objective function of minimum redundancy and maximum relevance is: maxΦ(D,R),Φ=DR Where, I(f i ; c) represents the meteorological feature set f i Mutual information between the climbing demand set c, f i represents the set of all meteorological feature data, c represents the set of all climbing demand data, p(x,y) represents the joint probability distribution of meteorological feature x and climbing demand y, p(x) represents the marginal probability distribution of meteorological feature x, p(y) represents the marginal probability distribution of climbing demand y, I(f i ;f j ) represents the meteorological feature set f i and meteorological feature set f j The mutual information between them is maxD(S,c), where D represents the maximum correlation between meteorological features and climbing requirements, D(S,c) represents the correlation distance between the selected feature subset S and the climbing requirement set c, minR(S) represents the minimum redundant information, R(S) represents the redundant information measurement, and Φ(D,R) represents the difference between correlation and redundancy.
7. The method for predicting ramp demand of a power system according to claim 1, characterized in that: The improved TimeXer forecasting model captures the long-term dependencies of weather time series and integrates meteorological features through an attention mechanism to output the mean and variance of ramp requirements to capture the uncertainty in extreme weather conditions. Build an improved TimeXer prediction model, where the improved TimeXer prediction model consists of an input layer, an attention mechanism, and an output layer; The improved TimeXer prediction model is trained using historical ramp demand data and meteorological feature data to capture the long-term dependencies of weather time series and integrate meteorological features through an attention mechanism; Using the trained improved TimeXer prediction model, combined with the current climbing demand data and meteorological characteristic data, the mean and variance of the climbing demand are output to capture the uncertainty in extreme weather conditions.
8. The method for predicting ramp demand of a power system according to claim 7, characterized in that: The input layer consists of endogenous embedding and exogenous embedding. The endogenous embedding uses historical ramp demand data as endogenous variables, while the exogenous embedding uses meteorological characteristics as exogenous variables. Among them, the endogenous variable embedding formula is: {s1,s2,...,s N }=Patchify(x) P en =PatchEmbed(s1,s2,…,s N ) G en =Learnable(x) The embedding formula of exogenous variables is: V ex,i =VariateEmbed(z (i) ),i∈{1,...,C} Where s N represents the Nth patch obtained by applying the Patchify function to the endogenous variable. Patchify(x) represents the function that applies the endogenous variable x to the endogenous variable x. 1:T Split into N non-overlapping patches, P en represents the D-dimensional time tag vector, G en represents a learnable global tag, PatchEmbed and Learnable represent different trainable linear projectors, and V ex,i represents the i-th embedded sequence-level variable, VariateEmbed represents the projector, z (i) This represents the i-th exogenous time series, and C represents the total number of exogenous variables.
9. The method for predicting ramp demand of a power system according to claim 7, characterized in that: The attention mechanism consists of an endogenous self-attention mechanism and an exogenous-to-endogenous cross-attention mechanism, which is used to integrate meteorological characteristics with historical ramp demand data to improve prediction accuracy and uncertainty modeling capabilities; Among them, endogenous self-attention captures the short-term dependencies between endogenous variables and the long-term patterns of the entire sequence. The calculation process is: B l =Self-Attention(A l ) Cross-attention incorporates information from exogenous variables into endogenous variables, using learnable global tags as queries to extract relevant information from the embedded sequence-level variables: Where A l Represents the vector and Arrange in rows, B l Represents A after Self-Attention transformation l , Indicates the P corresponding to the lth TimeXer block en , Indicates the G corresponding to the lth TimeXer block en , Self-Attention represents the self-attention mechanism, represents the patch embedding of the endogenous variable in the lth TimeXer block after being processed by the endogenous self-attention mechanism, represents the representation of the global endogenous tag that can be learned in the lth TimeXer block, LayerNorm represents the layer normalization function, Cross-Attention represents the cross attention mechanism, V ex Represents an embedded sequence-level variable.
10. The method for predicting ramp demand of a power system according to claim 7, characterized in that: The output layer generates the predicted mean and variance of the ramp demand by applying a linear projection to the final endogenous embedding.
11. A power system ramp demand forecasting system, characterized in that: include: Key feature determination module, used to extract up-slope and down-slope trend features based on the adaptive trend judgment algorithm adjusted by volatility; The extreme weather marking module is used to filter meteorological features related to ramp requirements in meteorological data using the minimum redundancy maximum relevance feature selection method; determine the extreme value threshold of meteorological features based on the distribution characteristics of historical meteorological data, and create binary features for each time step to mark extreme weather; The ramp demand forecasting module is used to use the improved TimeXer forecasting model to capture the long-term dependencies of weather time series, fuse meteorological features through the attention mechanism, and output the mean and variance of the ramp demand to capture the uncertainty under extreme weather conditions.
12. The power system ramp demand forecasting system according to claim 11, characterized in that: When extracting the trend features of up-climbing and down-climbing based on the volatility-adjusted adaptive trend judgment algorithm, the key feature determination module dynamically adjusts the window size of the adaptive trend judgment algorithm according to the volatility of the climbing demand data, and introduces a trend strength evaluation mechanism and a retention strategy to improve the adaptive trend judgment algorithm; the improved adaptive trend judgment algorithm is used to extract the trend features of up-climbing and down-climbing; Among them, the window size of the adaptive trend judgment algorithm is dynamically adjusted according to the volatility of the ramp demand data, and a trend strength evaluation mechanism and retention strategy are introduced to achieve improvements to the adaptive trend judgment algorithm, including: The volatility factor is determined based on the data volatility in the current time window, the minimum volatility, and the maximum volatility in the historical data. The volatility factor is used to dynamically adjust the initial window to obtain the adaptive window of the adaptive trend judgment algorithm. The dynamic adjustment formula of the adaptive window is: w a =w b ×(1+v) Where w a represents the adaptive window, w b represents the initial window, v represents the volatility factor, v c Indicates the data volatility in the current time window, v min Indicates the minimum volatility in historical data, v max Indicates the maximum volatility in historical data; The trend slope is obtained by fitting the trend line using linear regression, and the trend strength is determined by combining the trend duration and the trend strength adjustment coefficient. The importance of trend features is quantified based on the trend strength, and the retention strategy is formulated by comparing the importance of overlapping trends. The calculation formula for trend strength is: c p =1-p value Where I represents the trend strength, s represents the slope of the trend, and t d represents the duration of the trend, c p represents the trend strength adjustment coefficient, p value It represents the slope significance probability value obtained based on the linear regression t-test.
13. The power system ramp demand forecasting system according to claim 11, characterized in that: The extreme weather marking module uses the minimum redundancy maximum correlation feature selection method to screen meteorological features related to climbing requirements in meteorological data; determines the extreme value threshold of meteorological features according to the distribution characteristics of historical meteorological data, and creates binary features to mark extreme weather for each time step, obtains meteorological data and performs discretization and normalization processing; calculates the mutual information between meteorological features and climbing requirements and the mutual information between pairs of meteorological features; calculates the maximum correlation between meteorological features and climbing requirements based on the mutual information between meteorological features and climbing requirements, and calculates the minimum redundancy between meteorological features based on the mutual information between pairs of meteorological features; based on the maximum correlation between meteorological features and climbing requirements and the minimum redundancy information between meteorological features, screens key features related to climbing requirements in meteorological data; determines the extreme threshold of extreme weather according to the distribution characteristics of historical meteorological data, calculates the historical threshold upper and lower limits of each meteorological feature in historical data; creates binary features to mark extreme weather for each time step based on the historical threshold upper and lower limits; The calculation formula for the mutual information between meteorological characteristics and climbing requirements is: The calculation formula for the mutual information between meteorological feature pairs is: The formula for calculating the maximum correlation between meteorological characteristics and climbing requirements is: The calculation formula for the minimum redundancy between meteorological features is: The objective function of minimum redundancy and maximum relevance is: maxΦ(D,R),Φ=DR Where, I(f i ; c) represents the meteorological feature set f i Mutual information between the climbing demand set c, f i represents the set of all meteorological feature data, c represents the set of all climbing demand data, p(x,y) represents the joint probability distribution of meteorological feature x and climbing demand y, p(x) represents the marginal probability distribution of meteorological feature x, p(y) represents the marginal probability distribution of climbing demand y, I(f i ;f j ) represents the meteorological feature set f i and meteorological feature set f j The mutual information between them is maxD(S,c), where D represents the maximum correlation between meteorological features and climbing requirements, D(S,c) represents the correlation distance between the selected feature subset S and the climbing requirement set c, minR(S) represents the minimum redundant information, R(S) represents the redundant information measurement, and Φ(D,R) represents the difference between correlation and redundancy.
14. The power system ramp demand forecasting system according to claim 11, characterized in that: The ramp demand prediction module constructs an improved TimeXer prediction model by using the improved TimeXer prediction model to capture the long-term dependency of weather time series, and fuses meteorological features through an attention mechanism to output the mean and variance of the ramp demand to capture the uncertainty under extreme weather conditions; trains the improved TimeXer prediction model using historical ramp demand data and meteorological feature data to capture the long-term dependency of weather time series, and fuses meteorological features through an attention mechanism; and uses the trained improved TimeXer prediction model in combination with current ramp demand data and meteorological feature data to output the mean and variance of the ramp demand to capture the uncertainty under extreme weather conditions; Among them, the improved TimeXer prediction model consists of an input layer, an attention mechanism, and an output layer; The input layer consists of endogenous embedding and exogenous embedding. The endogenous embedding uses historical ramp demand data as endogenous variables, while the exogenous embedding uses meteorological characteristics as exogenous variables. The endogenous variable embedding formula is: {s1,s2,...,s N }=Patchify(x) P en =PatchEmbed(s1,s2,...,s N ) G en =Learnable(x) The embedding formula of exogenous variables is: V ex,i =VariateEmbed(z (i) ),i∈{1,...,C} Where s N represents the Nth patch obtained by applying the Patchify function to the endogenous variable. Patchify(x) represents the function that applies the endogenous variable x to the endogenous variable x. 1:T Split into N non-overlapping patches, P en represents the D-dimensional time tag vector, G en represents a learnable global tag, PatchEmbed and Learnable represent different trainable linear projectors, and V ex,i represents the i-th embedded sequence-level variable, VariateEmbed represents the projector, z (i) This represents the i-th exogenous time series, and C represents the total number of exogenous variables; The attention mechanism consists of an endogenous self-attention mechanism and an exogenous-to-endogenous cross-attention mechanism, which is used to integrate meteorological characteristics with historical ramp demand data to improve prediction accuracy and uncertainty modeling capabilities; Endogenous self-attention captures the short-term dependencies between endogenous variables and the long-term patterns of the entire sequence. The calculation process is: B l =Self-Attention(A l ) Cross-attention incorporates information from exogenous variables into endogenous variables, using learnable global tags as queries to extract relevant information from the embedded sequence-level variables: Where A l Represents the vector and Arrange in rows, B l Represents A after Self-Attention transformation l , Indicates the P corresponding to the lth TimeXer block en , Indicates the G corresponding to the lth TimeXer block en , Self-Attention represents the self-attention mechanism, represents the patch embedding of the endogenous variable in the lth TimeXer block after being processed by the endogenous self-attention mechanism, represents the representation of the global endogenous tag that can be learned in the lth TimeXer block, LayerNorm represents the layer normalization function, Cross-Attention represents the cross attention mechanism, V ex represents the embedded sequence-level variables; The output layer generates the predicted mean and variance of the ramp demand by applying a linear projection to the final endogenous embedding.
15. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.