Offshore wind power operation prediction method and early warning system based on generative model
By adopting a symbolic sequence prediction method based on a generative model in the field of offshore wind power, normal weather data are fused with extreme weather data, solving the problem of low prediction accuracy in extreme weather, and achieving high-precision wind power power prediction and risk assessment.
Patent Information
- Application Number
- CN202510081306.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-05-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to provide high-precision prediction under extreme weather conditions, and traditional probability prediction methods lack effective extreme weather data support, resulting in reduced prediction accuracy.
The offshore wind power power operation prediction method based on the generative model is adopted, and the normal weather data is used as a supplement to extreme weather data to realize data sharing and information transmission. The generative model adopts an autoregressive structure, and generates symbol sequences and numerical prediction results through the multi-head self-attention mechanism and multi-loss function optimization.
It significantly improves the prediction accuracy in extreme weather, ensures the consistency and accuracy of symbol sequence and numerical predictions, and provides more reliable technical means to enhance the system's ability to respond to extreme weather risks.
Smart Images

Figure CN119990438A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of offshore wind power system operation, and in particular relates to an offshore wind power operation prediction method and an early warning system based on a generative model. Background Art
[0002] As the frequency and intensity of extreme weather events continue to increase due to climate change, key areas such as power systems, transportation, and meteorological warnings are facing severe challenges. The uncertainty and risks brought by extreme weather make it crucial to accurately predict its impact on the system. However, the scarcity of extreme weather data has become a major challenge facing prediction models. Traditional probabilistic prediction methods usually rely on normal weather data for training, and often lack effective data support for special cases of extreme weather, resulting in reduced prediction accuracy and difficulty in dealing with complex extreme climate conditions.
[0003] In order to enhance the prediction ability under extreme weather conditions, some generative models and data augmentation techniques have been gradually introduced in recent years to improve the prediction accuracy under extreme conditions. However, these methods mostly use independent data sets or model architectures, and do not share normal and extreme weather data within a unified framework, resulting in low prediction efficiency and difficulty in adapting to actual needs. Current prediction methods often fail to provide sufficient accuracy and robustness when facing extreme weather, thus limiting their application value in risk assessment and emergency management.
[0004] In order to solve this problem, the present invention proposes a method for predicting the operation of offshore wind power based on a generative model. By constructing a symbol sequence model, normal weather data is used as a supplement to extreme weather data to achieve data sharing and information transmission. The generative model adopts an autoregressive structure, which can simultaneously generate the probability distribution of the symbol sequence and the corresponding numerical prediction results, thereby improving the prediction accuracy under extreme weather. The present invention can be widely used in the fields of power systems, traffic management, meteorological disaster warning, etc., providing a more reliable technical means for high-precision prediction of extreme weather, thereby enhancing the system's ability to cope with risks. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention provides an offshore wind power operation prediction method and early warning system based on a generative model. Through extreme weather and normal weather historical data, a symbol sequence is constructed and continuous numerical values are discretized; a symbol system is introduced to represent different weather conditions, and sequence data is generated for model training; a generative prediction model is constructed, and a multi-head self-attention mechanism is used to realize the joint generation of symbol sequence and numerical output; the cross entropy loss of the symbol sequence, the mean square error loss of the numerical output, and the symbol-numerical matching loss are set, and the model is optimized through multiple loss functions; finally, the symbol sequence and numerical prediction results are gradually outputted through an autoregressive generation process, so as to realize the probability prediction of wind power under extreme weather conditions.
[0006] To achieve the above object, the present invention discloses the following technical solution:
[0007] A method for predicting offshore wind power operation based on a generative model, comprising:
[0008] S1: Obtain historical weather data, convert it into a weather symbol sequence, perform numerical discretization, and complete the embedding of the weather symbol sequence and its discrete numerical values;
[0009] S11: Use the set symbols to represent the weather conditions, collect historical weather data, convert them into a weather symbol sequence, and construct {sym1,sym2,…,sym n}; Discretize the measured weather continuous numerical data to obtain a weather output discrete numerical sequence;
[0010] S12: embed the weather symbol sequence and its discrete numerical sequence into high-dimensional vector space respectively;
[0011] S13: Mark the input position by position encoding to obtain a high-dimensional representation EinpGy of the weather symbol input sequence;
[0012] S2: Build a weather symbol sequence generation model, decode it, and output the weather symbol sequence;
[0013] S21: Generate weather symbol sequence through multi-head self-attention mechanism, splice multi-head self-attention output results, and output projection matrix W O , mapped back to the original dimension, and the multi-head self-attention output MultiHead is obtained;
[0014] S22: The decoder is constructed by stacking layers, each of which contains multi-head self-attention, feedforward network and residual connection to build an autoregressive model;
[0015] S23: According to the autoregressive model, the high-dimensional representation EinpGy of the weather symbol input sequence is input, and the weather symbol sequence is generated and output, specifically:
[0016]
[0017] in, Generate a weather symbol sequence for time y; Decoder is an autoregressive model; EinpGy is a high-dimensional representation of the weather symbol input sequence; y is a time parameter;
[0018] S3: Establish a wind power prediction loss function model, perform training, and adjust and optimize model parameters; the wind power prediction loss function model is established as:
[0019] lm total =L CE +α·L MSE +β·L match ;
[0020] Among them, L total is the output of the wind power prediction loss function model; L MSE is the mean square error loss function of the numerical output of the weather symbol sequence; L match is the consistency matching loss function; L CE is the cross entropy loss function of the weather symbol sequence; α is the weight coefficient of the mean square error loss function; β is the optimization weight coefficient of the consistency matching loss function; min is the minimization objective function;
[0021] S4: Train the wind power prediction loss function model to obtain the optimal weight coefficient and complete the wind power operation prediction;
[0022] By minimizing the total loss function L total Achieve consistent optimization of symbol sequence classification, numerical output prediction and symbol-value matching; adjust the weight coefficient α of the mean square error loss function and the optimized weight coefficient β of the consistency matching loss function to accurately predict wind power and judge the operating risks of offshore wind power.
[0023] Preferably, step S11 discretizes the measured weather continuous numerical data, specifically:
[0024]
[0025] Among them, χ d Output a discrete numerical sequence for weather; x c Enter continuous values for weather; x min Enter the minimum value of the continuous numerical range for weather; x max is the maximum value of the continuous numerical range of weather input; ∈ is the correction parameter; N is the level parameter for discretization of weather data.
[0026] Preferably, in step S12, the weather symbol sequence and its discrete numerical sequence are respectively embedded into the high-dimensional vector space, specifically:
[0027] The weather symbol sequence {sym1,sym2,…,sym n} is mapped into weather symbol sequence embedding vector through the symbol embedding layer, specifically:
[0028] Esym(sym i )=Embedding(sym i );
[0029] Among them, Esym(sym i ) is the weather symbol sequence sym i Embedding vector; Embedding is the embedding function; sym i is the value of the ith weather symbol sequence; i is the weather symbol sequence number;
[0030] Enter the weather as a continuous value {x c1 ,x c2 ,…,x cn} is mapped into a continuous data embedding vector through the embedding layer, specifically:
[0031] Ec(χ ci )=Embedding(χ ci );
[0032] Among them, Ec(χ ci ) is the continuous value input for weather x ci Embedding vector; χ ci is the i-th continuous data value;
[0033] Output the weather as a discrete numerical sequence {x d1 ,x d2 ,…,x dn}, mapped into discrete numerical embedding vectors through the embedding layer, specifically:
[0034] Ed(x di )=Embedding(x di );
[0035] Among them, Ed(x di ) is the weather output discrete numerical sequence x di Embedding vector; x di Output a discrete numerical sequence for the i-th weather.
[0036] Preferably, the high-dimensional representation EinpGy of the weather symbol input sequence in step S13 is:
[0037] EinpGy=Concat(Esym+P,Ec+Ed+P);
[0038] Among them, EinpGy is the high-dimensional representation of the weather symbol input sequence; P is the input embedding position code; Esym is the weather symbol sequence embedding vector; Ec is the weather input continuous numerical embedding vector; Ed is the weather output discrete numerical sequence embedding vector; Concat is the multi-head self-attention concatenation function.
[0039] Preferably, in step S21, a weather symbol sequence is generated by a multi-head self-attention mechanism, the multi-head self-attention output results are spliced, and the projection matrix W is output. O , mapped back to the original dimension, and the multi-head self-attention output is obtained, specifically:
[0040] MultiHead(Q,K,V)=Concat(Attention1,…,Attention h )W O ;
[0041] Among them, MultiHead(Q,K,V) is the multi-head self-attention output; Concat is the multi-head self-attention concatenation function; Attention1 is the first weather symbol sequence; Attention h is the hth weather symbol sequence; W O is the output projection matrix; Q is the first dimension parameter of the multi-head self-attention mechanism; K is the second dimension parameter of the multi-head self-attention mechanism; V is the third dimension parameter of the multi-head self-attention mechanism;
[0042] The calculation formula of the multi-head self-attention mechanism is:
[0043]
[0044] Among them, d k is the scaling factor; softmax is the normalization function; T is the matrix transpose symbol.
[0045] Preferably, in step S22, an autoregressive model is constructed to obtain the l-th layer output of the decoder as:
[0046] H (l) =LayerNorm(FFN(MultiHead(H (l-1) ))+H (l-1) );
[0047] Among them, H (l) is the output of the first layer of the decoder; LayerNorm is the layer normalization model; FFN is the feedforward neural network model; MultiHead (H (l-1)) is the output of the l-1th layer of multi-head self-attention; H (l-1) is the l-1th layer output of the decoder.
[0048] Preferably, the cross entropy loss function L of the weather symbol sequence in step S3 is CE The weather symbol sequence obtained in step S23 Output classification optimization, specifically:
[0049]
[0050] Among them, L CE is the output of the cross entropy loss function; y i is the true probability distribution of the i-th weather symbol label; is the probability distribution of the i-th weather symbol predicted by the autoregressive model.
[0051] Similarly, the cross entropy loss function L of the weather symbol sequence is CE It can also be used for the weather output discrete numerical sequence x in step S1 d Optimize classification.
[0052] Preferably, the mean square error loss function L of the weather symbol sequence numerical output in step S3 is MSE The regression optimization for the continuous numerical output in step S1 is as follows:
[0053]
[0054] Among them, L MSE is the output of the mean square error loss function; Enter a continuous value for the i-th weather; Enter a continuous value for the i-th weather forecast by the model.
[0055] Preferably, the consistency matching loss function L in step S3 is match Convert continuous numerical values into symbol categories and calculate their cross entropy loss to implement the consistency matching loss function between the weather symbol sequence and the numerical output, specifically:
[0056]
[0057] Among them, L match Output of the consistency matching loss function; is the symbol category converted from the numerical output; is the true label of the weather symbol sequence.
[0058] The second aspect of the present invention proposes an early warning system for an offshore wind power operation prediction method based on a generative model, which includes: a data preprocessing module, a model building module and an optimization reasoning module;
[0059] The data preprocessing module is used to obtain historical weather data, construct a weather symbol sequence, and discretize continuous values to generate data samples that meet the input requirements of the weather symbol sequence;
[0060] The model building module is used to input the processed weather symbol sequence and numerical data into the generative model to build an autoregressive prediction model; through the construction of a multi-head self-attention mechanism and an embedding layer, the joint generation of the weather symbol sequence and the numerical output is realized, and the cross entropy loss of the weather symbol sequence, the mean square error loss of the numerical output, and the consistency matching loss function of the weather symbol sequence are optimized to ensure the prediction accuracy of the model under extreme weather conditions;
[0061] The optimization reasoning module is used to input test data for prediction after the wind power prediction loss function model training is completed, output the probability distribution of weather symbol sequence and numerical prediction results, and gradually output the optimal weather symbol sequence and numerical results through the autoregressive prediction model to realize wind power prediction.
[0062] Compared with the prior art, the present invention has the following beneficial effects:
[0063] (1) The present invention integrates extreme weather and normal weather data into the same prediction framework by constructing a unified symbolic sequence model, which significantly improves the efficiency of data sharing and information transmission.
[0064] (2) The present invention uses a generative model for autoregressive prediction, effectively capturing the scarcity and particularity of extreme weather. At the same time, it ensures the consistency and accuracy of symbolic sequences and numerical predictions through joint optimization of multiple loss functions.
[0065] (3) The present invention adopts a method that combines continuous numerical prediction with discrete interval prediction, which not only maintains a high prediction accuracy, but also provides rich probability information; it can effectively quantify the risk uncertainty of the prediction results, and provide a scientific basis for risk assessment and decision-making of extreme weather; through the dual prediction mechanism, it can more comprehensively grasp the trend of weather changes, help decision makers formulate more reasonable response measures, and reduce the potential risks brought by extreme weather. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 It is a flow chart of the offshore wind power operation prediction method based on the generative model of the present invention;
[0067] Figure 2This is a structural diagram of an early warning system of an offshore wind power operation prediction method based on a generative model of the present invention;
[0068] Figure 3 It is a schematic diagram of the output and input of the weather symbol sequence generative autoregressive model of the present invention;
[0069] Figure 4 The output probability data display diagram of the weather symbol sequence generative autoregressive model of the present invention;
[0070] Figure 5 It is a curve chart showing the accuracy change of discrete data of the weather symbol sequence generative autoregressive model validation set of the present invention;
[0071] Figure 6 This is a curve chart showing the mean square error variation of continuous data of the weather symbol sequence generative autoregressive model validation set of the present invention.
[0072] Main reference numerals:
[0073] 201, data preprocessing module; 202, model building module; 203, optimization reasoning module. DETAILED DESCRIPTION
[0074] The exemplary embodiments, features and aspects of the present invention will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0075] The present invention provides a method for predicting offshore wind power operation based on a generative model, such as Figure 1 As shown, historical weather data is obtained, converted into a weather symbol sequence, numerically discretized, and the weather symbol sequence and its discrete numerical embedding are completed; a generative model of the weather symbol sequence is constructed, decoded, and the weather symbol sequence is output; a wind power prediction loss function model is established, and training is performed to adjust and optimize the model parameters; the wind power prediction loss function model is trained to obtain the optimal weight coefficient and complete the wind power operation prediction; it includes:
[0076] Step S1: Obtain historical weather data, convert it into a weather symbol sequence, perform numerical discretization, and complete the embedding of the weather symbol sequence and its discrete numerical values.
[0077] Step S11: Use the set symbol to represent the weather conditions, collect historical weather data, convert it into a weather symbol sequence, and construct {sym1,sym2,…,sym n}, for example, the sequence of normal, typhoon warning, and typhoon warning; the measured weather data (including electrical data, wind power data, etc.) and other continuous numerical data are discretized to obtain the weather output discrete numerical sequence:
[0078]
[0079] Among them, x d Output a discrete numerical sequence for weather; x c Enter continuous values for weather; x min Enter the minimum value of the continuous numerical range for weather; x max is the maximum value of the continuous numerical range of weather input; ∈ is a correction parameter, which is specifically 0.0001 in the embodiment; and N is a level parameter for discretization of weather data.
[0080] Step S12: embedding the weather symbol sequence and its discrete numerical sequence into the high-dimensional vector space respectively, specifically:
[0081] The weather symbol sequence {sym1,sym2,…,sym n} is mapped into weather symbol sequence embedding vector through the symbol embedding layer, specifically:
[0082] Esym(sym i )=Embedding(sym i );
[0083] Among them, Esym(sym i ) is the weather symbol sequence sym i Embedding is the embedding function; sym i is the numerical value of the i-th weather symbol sequence.
[0084] Enter the weather as a continuous value {x c1 ,x c2 ,…,x cn} is mapped into a continuous data embedding vector through the embedding layer, specifically:
[0085] Ec(x ci )=Embedding(x ci );
[0086] Among them, Ec(x ci ) Input continuous value x for weather ci Embedding vector; x ci is the i-th continuous data value.
[0087] Output the weather as a discrete numerical sequence {x d1 ,x d2 ,…,x dn}, mapped into discrete numerical embedding vectors through the embedding layer, specifically:
[0088] Ed(x di)=Embedding(x di );
[0089] Among them, Ed(x di ) is the weather output discrete numerical sequence x di Embedding vector; x di Output a discrete numerical sequence for the i-th weather.
[0090] Step S13: Mark the input position by position coding, and obtain the high-dimensional representation of the weather symbol input sequence as follows:
[0091] EinpGy=Concat(Esym+P,Ec+Ed+P);
[0092] Among them, EinpGy is the high-dimensional representation of the weather symbol input sequence; P is the input embedding position code; Esym is the weather symbol sequence embedding vector; Ec is the weather input continuous numerical embedding vector; Ed is the weather output discrete numerical sequence embedding vector.
[0093] Step S2: construct a weather symbol sequence generative model, decode it, and output the weather symbol sequence.
[0094] Step S21: Generate a weather symbol sequence through a multi-head self-attention mechanism, splice the multi-head self-attention output results, and output the projection matrix W O , mapped back to the original dimension, the multi-head self-attention output is:
[0095] MultiHead(Q,K,V)=Concat(Attention1,…,Attention h )W O ;
[0096] Among them, MultiHead(Q,K,V) is the multi-head self-attention output; Concat is the multi-head self-attention concatenation function; Attention1 is the first weather symbol sequence; Attention h is the hth weather symbol sequence; W O is the output projection matrix; Q is the first dimension parameter of the multi-head self-attention mechanism; K is the second dimension parameter of the multi-head self-attention mechanism; V is the third dimension parameter of the multi-head self-attention mechanism.
[0097] The calculation formula of the multi-head self-attention mechanism is:
[0098]
[0099] Among them, d k is the scaling factor; softmax is the normalization function; T is the matrix transpose symbol.
[0100] Step S22: The decoder is constructed by stacking layers, each layer contains multi-head self-attention, feedforward network and residual connection, and an autoregressive model is constructed to obtain the output of the lth layer of the decoder:
[0101] H (l) =LayerNorm(FFN(MultiHead(H (l-1) ))+H (l-1) );
[0102] Among them, H (l) is the output of the first layer of the decoder; LayerNorm is the layer normalization model; FFN is the feedforward neural network model; MultiHead (H (l-1) ) is the output of the l-1th layer of multi-head self-attention; H (l-1) is the l-1th layer output of the decoder.
[0103] Step S23: According to the autoregressive model obtained in step S22, the high-dimensional representation EinpGy of the weather symbol input sequence in step S1 is input, and a weather symbol sequence is generated and output, specifically:
[0104]
[0105] in, Generate a weather symbol sequence for time y; Decoder is an autoregressive model; y is the time parameter.
[0106] Step S3: Establish a wind power prediction loss function model, perform training, and adjust and optimize model parameters.
[0107] Establish the cross entropy loss function L for the weather symbol sequence CE , the mean square error loss function L of the numerical output of the weather symbol sequence MSE And the consistency matching loss function L match .like Figure 3 The figure shows the output and input schematic diagram of the weather symbol sequence generative autoregressive model of the present invention, which realizes the prediction of extreme weather, weather data, power, etc. through autoregressive neural network and mean square loss, cross entropy loss, and matching loss.
[0108] Cross entropy loss function L for weather symbol sequence CE The weather symbol sequence obtained in step S23 Output classification optimization, specifically:
[0109]
[0110] Among them, L CE is the output of the cross entropy loss function; y iis the true probability distribution of the i-th weather symbol label; is the probability distribution of the i-th weather symbol predicted by the autoregressive model.
[0111] Similarly, the cross entropy loss function L of the weather symbol sequence is CE It can also be used for the weather output discrete numerical sequence x in step S1 d Optimize classification.
[0112] The mean square error loss function L of the numerical output of the weather symbol sequence MSE The regression optimization for the continuous numerical output in step S1 is as follows:
[0113]
[0114] Among them, L MSE is the output of the mean square error loss function; Enter a continuous value for the i-th weather; Enter a continuous value for the i-th weather forecast by the model.
[0115] Consistency matching loss function L match Convert continuous numerical values into symbol categories and calculate their cross entropy loss to implement the consistency matching loss function between the weather symbol sequence and the numerical output, specifically:
[0116]
[0117] Among them, L match Output of the consistency matching loss function; is the symbol category converted from the numerical output; is the true label of the weather symbol sequence.
[0118] The wind power prediction loss function model is constructed as follows:
[0119] lm total =L CE +α·L MSE +β·L match ;
[0120] Among them, L total is the output of the wind power prediction loss function model; L MSE is the mean square error loss function of the numerical output of the weather symbol sequence; L match is the consistency matching loss function; L CE is the cross entropy loss function of the weather symbol sequence; α is the weight coefficient of the mean square error loss function; β is the optimization weight coefficient of the consistency matching loss function; min is the minimization objective function.
[0121] like Figure 4 The figure shows the output probability data display diagram of the weather symbol sequence generative autoregressive model of the present invention, which predicts the probability of normal, typhoon, thunderstorm and other weather conditions.
[0122] Step S4: training the wind power prediction loss function model, obtaining the optimal weight coefficient, and completing the wind power operation prediction.
[0123] During the training process, by minimizing the total loss function L total To adjust the model parameters, achieve consistent optimization of symbol sequence classification, numerical output prediction and symbol-value matching; adjust the weight coefficient α of the mean square error loss function and the optimized weight coefficient β of the consistency matching loss function to accurately predict wind power and judge the operation risk of offshore wind power.
[0124] like Figure 5 The figure shows the curve of the discrete data accuracy change of the weather symbol sequence generative autoregressive model verification set of the present invention, indicating that the discrete accuracy increases with the number of iterations, the accuracy of the prediction results meets the actual needs, and the application effect is good.
[0125] like Figure 6 The figure shows the mean square error variation curve of the continuous data of the weather symbol sequence generative autoregressive model validation set of the present invention, which proves that the mean square error of the present method gradually decreases with the number of iterations, and the actual application effect is good.
[0126] The second aspect of the present invention proposes an early warning system for offshore wind power operation prediction method based on a generative model, such as Figure 2 As shown, it includes: a data preprocessing module, a model building module and an optimization reasoning module.
[0127] The data preprocessing module 201 is used to obtain historical weather data, construct a weather symbol sequence, and discretize continuous numerical values to generate data samples that meet the input requirements of the weather symbol sequence, including extreme weather symbols, normal weather symbols, and sequence start and end symbols.
[0128] The model building module 202 is used to input the processed weather symbol sequence and numerical data into the generative model to build an autoregressive prediction model; through the construction of a multi-head self-attention mechanism and an embedding layer, the joint generation of the weather symbol sequence and the numerical output is realized, and the cross entropy loss of the weather symbol sequence, the mean square error loss of the numerical output and the consistency matching loss function of the weather symbol sequence are optimized to ensure the prediction accuracy of the model under extreme weather conditions.
[0129] The optimization reasoning module 203 is used to input test data for prediction after the wind power prediction loss function model training is completed, output the probability distribution of the weather symbol sequence and the numerical prediction results, and gradually output the optimal weather symbol sequence and numerical results through the autoregressive prediction model to realize the wind power prediction.
[0130] The beneficial effects of the present invention are as follows: the present invention provides an offshore wind power operation prediction method and early warning system based on a generative model. By constructing a unified symbolic sequence model, extreme weather and normal weather data are integrated into the same prediction framework, which significantly improves the efficiency of data sharing and information transmission; the generative model is used for autoregressive prediction to effectively capture the scarcity and particularity of extreme weather, and at the same time, multiple loss functions are jointly optimized to ensure the consistency and accuracy of symbolic sequences and numerical predictions. The embodiment of the present invention not only ensures a high prediction accuracy by combining continuous numerical prediction and discrete interval prediction, but also can provide rich probabilistic information; with the help of this dual prediction mechanism, the trend of weather changes can be fully captured, helping decision makers to formulate more accurate response measures, thereby reducing the potential risks brought by extreme weather. In extreme weather scenarios, it provides a more scientific basis for risk assessment and decision-making, and also provides more valuable data support for the operation and management of the wind power industry, thereby improving the utilization efficiency and safety of wind power resources.
[0131] The embodiments described above are only descriptions of the preferred implementation modes of the present invention, and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A method for predicting offshore wind power operation based on a generative model, characterized in that: It includes: S1: Obtain historical weather data, convert it into a weather symbol sequence, perform numerical discretization, and complete the embedding of the weather symbol sequence and its discrete numerical values; S11: Use the set symbols to represent the weather conditions, collect historical weather data, convert them into a weather symbol sequence, and construct {sym1,sym2,…,sym n }; Discretize the measured weather continuous numerical data to obtain a weather output discrete numerical sequence; S12: embed the weather symbol sequence and its discrete numerical sequence into high-dimensional vector space respectively; S13: Mark the input position by position encoding to obtain a high-dimensional representation EinpGy of the weather symbol input sequence; S2: Build a weather symbol sequence generation model, decode it, and output the weather symbol sequence; S21: Generate weather symbol sequence through multi-head self-attention mechanism, splice multi-head self-attention output results, and output projection matrix W O , mapped back to the original dimension, and the multi-head self-attention output MultiHead is obtained; S22: The decoder is constructed by stacking layers, each of which contains multi-head self-attention, feedforward network and residual connection to build an autoregressive model; S23: According to the autoregressive model, the high-dimensional representation EinpGy of the weather symbol input sequence is input, and the weather symbol sequence is generated and output, specifically: in, Generate a weather symbol sequence for time y; Decoder is an autoregressive model; EinpGy is a high-dimensional representation of the weather symbol input sequence; y is a time parameter; S3: Establish a wind power prediction loss function model, perform training, and adjust and optimize model parameters; the wind power prediction loss function model is established as follows: minL total =L CE +α·L MSE +β·L match ; Among them, L total is the output of the wind power prediction loss function model; L MSE is the mean square error loss function of the numerical output of the weather symbol sequence; L match is the consistency matching loss function; L CE is the cross entropy loss function of the weather symbol sequence; α is the weight coefficient of the mean square error loss function; β is the optimization weight coefficient of the consistency matching loss function; min is the minimization objective function; S4: Train the wind power prediction loss function model to obtain the optimal weight coefficient and complete the wind power operation prediction; By minimizing the total loss function L total Achieve consistent optimization of symbol sequence classification, numerical output prediction and symbol-value matching; adjust the weight coefficient α of the mean square error loss function and the optimized weight coefficient β of the consistency matching loss function to accurately predict wind power and judge the operating risks of offshore wind power.
2. The offshore wind power operation prediction method based on a generative model according to claim 1 is characterized in that: Step S11 discretizes the measured weather continuous numerical data, specifically: Among them, χ d Output a discrete numerical sequence for weather; χ c Enter continuous values for weather; χ min Enter the minimum value of the continuous numerical range for weather; max is the maximum value of the continuous numerical range of weather input; ∈ is the correction parameter; N is the level parameter for discretization of weather data.
3. The offshore wind power operation prediction method based on a generative model according to claim 1 is characterized in that: In step S12, the weather symbol sequence and its discrete numerical sequence are respectively embedded into the high-dimensional vector space, specifically: The weather symbol sequence {sym1,sym2,…,sym n } is mapped into weather symbol sequence embedding vector through the symbol embedding layer, specifically: Esym(sym i )=Embedding(sym i ); Among them, Esym(sym i ) is the weather symbol sequence sym i Embedding is the embedding function; sym i is the value of the ith weather symbol sequence; i is the weather symbol sequence number; Enter the weather as a continuous value {x c1 ,x c2 ,…,x cn } is mapped into a continuous data embedding vector through the embedding layer, specifically: Ec(χ ci )=Embedding(χ ci ); Among them, Ec(χ ci ) is the continuous value input for weather x ci Embedding vector; χ ci is the i-th continuous data value; Output the weather as a discrete numerical sequence {x d1 ,x d2 ,…,x dn }, mapped into discrete numerical embedding vectors through the embedding layer, specifically: Ed(x di )=Embedding(x di ); Among them, Ed(x di ) is the weather output discrete numerical sequence x di Embedding vector; x di Output a discrete numerical sequence for the i-th weather.
4. The offshore wind power operation prediction method based on a generative model according to claim 1 is characterized in that: The high-dimensional representation EinpGy of the weather symbol input sequence in step S13 is: EinpGy=Concat(Esym+P,Ec+Ed+P); Among them, EinpGy is the high-dimensional representation of the weather symbol input sequence; P is the input embedding position code; Esym is the weather symbol sequence embedding vector; Ec is the weather input continuous numerical embedding vector; Ed is the weather output discrete numerical sequence embedding vector; Concat is the multi-head self-attention concatenation function.
5. The offshore wind power operation prediction method based on a generative model according to claim 1 is characterized in that: In step S21, a weather symbol sequence is generated through a multi-head self-attention mechanism, the multi-head self-attention output results are spliced, and the output projection matrix W is used O , mapped back to the original dimension, and the multi-head self-attention output is obtained, specifically: MultiHead(Q,K,V)=Concat(Attention1,…,Attention h )W O ; Among them, MultiHead(Q,K,V) is the multi-head self-attention output; Concat is the multi-head self-attention concatenation function; Attention1 is the first weather symbol sequence; Attention h is the hth weather symbol sequence; W O is the output projection matrix; Q is the first dimension parameter of the multi-head self-attention mechanism; K is the second dimension parameter of the multi-head self-attention mechanism; V is the third dimension parameter of the multi-head self-attention mechanism; The calculation formula of the multi-head self-attention mechanism is: Among them, d k is the scaling factor; softmax is the normalization function; T is the matrix transpose symbol.
6. The offshore wind power operation prediction method based on a generative model according to claim 1 is characterized in that: In step S22, an autoregressive model is constructed to obtain the output of the first layer of the decoder as: H (l) =LayerNorm(FFN(MultiHead(H (l-1) ))+H (l-1) ); Among them, H (l) is the output of the first layer of the decoder; LayerNorm is the layer normalization model; FFN is the feedforward neural network model; MultiHead (H (l-1) ) is the output of the l-1th layer of multi-head self-attention; H (l-1) is the l-1th layer output of the decoder.
7. The offshore wind power operation prediction method based on a generative model according to claim 1 is characterized in that: The cross entropy loss function L of the weather symbol sequence in step S3 CE The weather symbol sequence obtained in step S23 Output classification optimization, specifically: Among them, L CE is the output of the cross entropy loss function; y i is the true probability distribution of the i-th weather symbol label; is the probability distribution of the i-th weather symbol predicted by the autoregressive model; Similarly, the cross entropy loss function L of the weather symbol sequence is CE It can also be used for the weather output discrete numerical sequence x in step S1 d Optimize classification.
8. The offshore wind power operation prediction method based on a generative model according to claim 1, characterized in that: The mean square error loss function L of the weather symbol sequence numerical output in step S3 MSE The regression optimization for the continuous numerical output in step S1 is as follows: Among them, L MSE is the output of the mean square error loss function; Enter a continuous value for the i-th weather; Enter a continuous value for the i-th weather forecast by the model.
9. The offshore wind power operation prediction method based on a generative model according to claim 1, characterized in that: The consistency matching loss function L in step S3 match Convert continuous numerical values into symbol categories and calculate their cross entropy loss to implement the consistency matching loss function between the weather symbol sequence and the numerical output, specifically: Among them, L match Output of the consistency matching loss function; is the symbol category converted from the numerical output; is the true label of the weather symbol sequence.
10. An early warning system for the offshore wind power operation prediction method based on a generative model according to claim 1, characterized in that: It includes: Data preprocessing module, model building module and optimization reasoning module; The data preprocessing module is used to obtain historical weather data, construct a weather symbol sequence, and discretize continuous values to generate data samples that meet the weather symbol sequence input requirements; The model building module is used to input the processed weather symbol sequence and numerical data into the generative model to build an autoregressive prediction model; through the construction of a multi-head self-attention mechanism and an embedding layer, the joint generation of the weather symbol sequence and the numerical output is realized, and the cross entropy loss of the weather symbol sequence, the mean square error loss of the numerical output and the consistency matching loss function of the weather symbol sequence are optimized to ensure the prediction accuracy of the model under extreme weather conditions; The optimization reasoning module is used to input test data for prediction after the wind power prediction loss function model training is completed, output the probability distribution of weather symbol sequence and numerical prediction results, and gradually output the optimal weather symbol sequence and numerical results through the autoregressive prediction model to realize wind power prediction.