Discrete-based offshore wind power grid-connected system state probability prediction method and device
By preprocessing and discretizing the time series data of offshore wind farm output power, constructing state transition chain data, and using the causal self-attention module to construct a probabilistic prediction model, the problem of insufficient state representation in the offshore wind power grid-connected system is solved, system risk assessment and real-time early warning are realized, and the safe and reliable operation of the system is guaranteed.
Patent Information
- Application Number
- CN202411108319.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-08-13
AI Technical Summary
Existing technologies lack high-precision state characterization and fault prediction methods in offshore wind power grid-connected systems, making it difficult to cope with complex marine environments. This leads to accelerated equipment aging, system instability, and high maintenance costs.
By preprocessing and discretizing the time series continuous data of offshore wind farm output power, constructing state transition chain data, using the causal self-attention module to construct a probability prediction model, and optimizing the model parameters through the gradient descent method, the probabilistic prediction of the offshore wind power grid-connected system state is performed.
It realizes risk assessment and real-time early warning of offshore wind power systems, ensures the safe and reliable operation of the system, and reduces maintenance costs.
Smart Images

Figure CN118964892B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of power grids, and particularly relates to a state probability prediction method and device for an offshore wind power grid-connected system based on discretization. BACKGROUND
[0002] Offshore wind power grid-connected systems play an increasingly important role in the global renewable energy field, especially in ocean areas rich in wind resources. However, the operating environment of these systems has unique complexity, including extreme weather conditions and marine characteristics, which pose higher requirements for the stability and safe operation of the system. Offshore wind power grid-connected systems and their equipment must adapt to the continuously changing marine environment, such as high temperature, high humidity, strong salt spray corrosion, and continuous vibration and ocean current impact. In addition, the frequent occurrence of extreme weather events such as thunderstorms and typhoons increases the risk of system failure and damage. These factors not only accelerate equipment aging, but also can trigger complex failure chains, leading to instability of the entire system.
[0003] Due to the lower accessibility of offshore wind power equipment, the maintenance and fault repair costs are significantly higher than those of onshore wind power systems. Therefore, it is particularly important to develop a method that can accurately predict potential risks and performance changes of the grid-connected system. This prediction method needs to take into account the uncertainty and variability of the marine environment, and can assess risks in real time and provide reliable data support to optimize system operation and maintenance strategies. Current research mainly focuses on internal factors of equipment and failure mode analysis in onshore environments, and the understanding of equipment state and failure development mechanism in special marine environments is still limited. In addition, the fault diagnosis and remote monitoring technology of offshore wind power systems has not been fully developed, and there is a lack of high-precision state characterization and fault prediction methods for marine environments. SUMMARY
[0004] To overcome the deficiencies of the prior art, the present application provides a state probability prediction method and device for an offshore wind power grid-connected system based on discretization. The present application discretizes real-time operation data of offshore wind power and constructs it as state transition chain data, trains a probability prediction model for offshore wind power, predicts the system state and probability, and finally performs sampling analysis on the output results to determine the probability of any interval. This provides support for risk assessment and real-time early warning of offshore wind power systems, ensuring safe and reliable operation of offshore wind power grid-connected systems.
[0005] To achieve the above-mentioned purpose, the present application discloses the following technical solutions:
[0006] A state probability prediction method for an offshore wind power grid-connected system based on discretization, comprising the following steps:
[0007] S1: preprocessing the time series continuous data of offshore wind farm output power, discretizing, constructing state transition chain data, specifically including the following sub-steps:
[0008] S11: collecting the time series continuous data X of offshore wind farm output power t , preprocessing, replacing abnormal data with a first data symbol ERROR, and filling missing data with a second data symbol NONE;
[0009] S12: discretizing the time series continuous data, determining the discrete order N of the time series continuous data, and discretizing the time series continuous data X t into time series discrete data X d , the formula is:
[0010]
[0011] Wherein, x t is an element in the time series continuous data; x d is an element in the time series discrete data; x max is the maximum value of the time series continuous data; x min is the minimum value of the time series continuous data; is the floor operation; N is the discrete order of the time series continuous data; ∈ is the discretization parameter;
[0012] S13: encoding the first data symbol ERROR and the second data symbol NONE into the discrete order N and N+1 of the time series continuous data respectively, obtaining the state transition chain data X c ;
[0013] S2: superimposing the causal self-attention module to construct the offshore wind power grid system state probability prediction model, specifically including the following sub-steps:
[0014] S21: building a single causal self-attention module including a multi-head attention mechanism submodule and a layer normalization and residual connection submodule; the multi-head attention mechanism submodule is:
[0015]
[0016] Wherein, MuHe(Q,K,V) is the output of the multi-head attention mechanism submodule; Q is the query element; K is the key element; V is the value element; is the vector concatenation operation; W o is the parameter matrix needed for linear transformation after concatenation; n is the number of mapping subspaces; head i is the attention mechanism output result in the i-th semantic subspace, i∈1,2…n;
[0017] The layer normalization and residual connection submodule is:
[0018] out=LaNo(Add(Q+MuHe(Q,K,V)));
[0019] Wherein, out is the output of the layer normalization and residual connection sub-module; LaNo is the layer normalization function; Add is the residual connection function;
[0020] S22: Position encoding is performed on each causal self-attention module built in step S21 to maintain the time sequence information of the time sequence discrete data; the position encoding uses a combination of sine function and cosine function to generate a unique position encoding for each data in the time sequence discrete data, and the generation method is:
[0021]
[0022] Wherein, PE(pos,2j) is the odd position encoding of the time sequence discrete data; PE(pos,2j+1) is the even position encoding of the time sequence discrete data; pos is the extraction position of the time sequence discrete data; j is the dimension index of the offshore wind power grid-connected system state probability prediction model; d model is the dimension of the offshore wind power grid-connected system state probability prediction model;
[0023] S23: By stacking the single causal self-attention module in step S21, the offshore wind power grid-connected system state probability prediction model is constructed according to the length L c of the time sequence discrete data X max to be processed, and L max causal self-attention modules are stacked;
[0024] S3: The offshore wind power grid-connected system state probability prediction model obtained in step S2 is trained using the state transition chain data obtained in step S1, and the specific steps are as follows:
[0025] S31: Obtain the state transition chain data X c in step S1, construct state transition chain data samples, and divide them into training set data samples and validation set data samples;
[0026] S32: Train the offshore wind power grid-connected system state probability prediction model in batches, input the training set data samples, and use the gradient descent method to optimize the parameter matrix W o of the offshore wind power grid-connected system state probability prediction model in step S2; the mixed cross-entropy mean square error loss function used is:
[0027]
[0028] Wherein, Loss is the mixed cross-entropy mean square error loss function; λ is the weight coefficient; is a probability distribution corresponding to a state of the offshore wind power grid-connected system; y i is a true value of a training set data sample; is a probability distribution corresponding to a state of the offshore wind power grid-connected system; y i is a value after continuous processing; is a probability distribution after continuous processing; L is a probability distribution after continuous processing; L max is a time series discrete data X c is a length of a sequence of the time series discrete data X
[0029] S33: verifying a prediction accuracy of the offshore wind power grid-connected system state probability prediction model in step S2 using a verification set data sample, and predicting a state probability of the offshore wind power grid-connected system using a test set data sample to determine a probability distribution corresponding to a state of the offshore wind power grid-connected system;
[0030] S4: completing the state probability prediction according to the probability distribution corresponding to the state of the offshore wind power grid-connected system;
[0031] The probability distribution corresponding to the state of the offshore wind power grid-connected system in step S3 is The total number N of probability sampling values is s and the number n of target probability sampling values is s The probability of a target interval of the offshore wind power grid-connected system state is calculated as:
[0032]
[0033] wherein P is the probability of the target interval of the offshore wind power grid-connected system state; n s is the number of target probability sampling values; and N s is the total number of probability sampling values.
[0034] Preferably, the time series continuous data X t of the offshore wind farm output power collected in step S11 is preprocessed, specifically including the following sub-steps:
[0035] S111: collecting power output operation time series continuous data X t =[x1,x2,…,x t ] in real time through a monitoring system of the offshore wind farm;
[0036] S112: checking the collected time series continuous data, regarding data beyond a preset measurement range as abnormal data, and replacing the abnormal data with a first data symbol ERROR;
[0037] S113: checking the collected time series continuous data, locating missing data, and filling the missing data in the time series continuous data with a second data symbol NONE.
[0038] Preferably, the discrete degree N of the time series data is determined in step S12, specifically:
[0039] The collected time series data is statistically analyzed, a data distribution histogram is drawn, and the maximum value x max and the minimum value x min of the time series data are marked, and the discrete degree N of the time series data is determined as:
[0040]
[0041] Wherein, N is the discrete degree of the time series data; δ is the width of each discrete interval, which is not more than a given precision; x max is the maximum value of the time series data; x min is the minimum value of the time series data.
[0042] Preferably, the multi-head attention mechanism in step S21 needs to construct a mapping subspace, specifically:
[0043] The three basic calculation elements in the multi-head attention mechanism are query element Q, key element K and value element V, and the semantic subspace mapped to is:
[0044]
[0045] Wherein, W i Q is the parameter matrix used by the query element Q to map to the i-th semantic subspace; W i K is the parameter matrix used by the key element K to map to the i-th semantic subspace; W i V is the parameter matrix used by the value element V to map to the i-th semantic subspace; Q i is the i-th semantic subspace of the query element Q; K i is the i-th semantic subspace of the key element K; V i is the i-th semantic subspace of the value element V;
[0046] The attention mechanism in each semantic subspace is:
[0047]
[0048] Wherein, head i is the output result of the attention mechanism in the i-th semantic subspace; mask is the causal time parameter; Attention is the attention mechanism function; Softmax is the normalization exponential function; d k is the dimension of the semantic subspace K i vector; T is the transpose operation.
[0049] Preferably, the position coding in step S22 can make the coding of each attention module unique, and the adjacent positions have continuous coding, so that the offshore wind power grid-connected system state probability prediction model can capture the relative relationship between positions.
[0050] Preferably, in step S31, the state transition chain data sample is constructed, specifically:
[0051] In the state transition chain data X c , data subsequences with a length of L max are sequentially and continuously extracted, for each subsequence; L max -1 data points are set as input data samples Input; and L max data points are set as target data samples Target; the input data samples Input and the target data samples Target constitute the state transition chain data sample.
[0052] Preferably, in step S4, the number N s of probability sampling values and the number n s of target probability sampling values are counted, specifically including the following substeps:
[0053] S41: According to the output probability of the offshore wind power grid-connected system state probability prediction model, the probability sampling value number N is counted, wherein represents the probability of falling into the first discretization interval.
[0054] S42: Inside the discretization interval, uniform distribution sampling is used to obtain the discretization interval sampling parameter as:
[0055]
[0056] wherein, is the discretization interval sampling parameter; a i is the upper limit of the i-th interval after discretization; b i is the lower limit of the i-th interval after discretization; and rand() is a random number generated between 0 and 1 using uniform distribution.
[0057] S43: Steps S41 and S42 are repeated to obtain the number N s of discretization interval sampling parameters , and the number n s of target probability sampling values falling into the set target interval [c, d] is counted.
[0058] The second aspect of the present application provides a prediction device based on the discretization of the offshore wind power grid-connected system state probability prediction method, which comprises a data acquisition module, a preprocessing module and a model prediction module.
[0059] The data acquisition module is used to collect real-time continuous data of the offshore wind power grid-connected system.
[0060] The preprocessing module is used to clean the real-time continuous data, replace abnormal data, fill in missing data, and apply a discretization method to construct the state transition chain data from the real-time continuous data.
[0061] The model prediction module is used to input the state transition chain data into the pre-trained offshore wind power grid-connected system state probability prediction model to obtain the operating state and probability of the offshore wind power grid-connected system at the next time.
[0062] The third aspect of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program controls the device where the computer readable storage medium is located to execute the offshore wind power grid-connected system state probability prediction method based on discretization when running.
[0063] Compared with the prior art, the present application has the following beneficial effects:
[0064] (1) The present application preprocesses the collected time series continuous data of the offshore wind farm output power, and performs discretization to discretize the time series continuous data into time series discrete data; and replaces and supplements abnormal and missing data to obtain real and reliable data that can reflect the operation of the offshore wind power grid-connected system.
[0065] (2) The present application builds a single causal self-attention module through a multi-head attention mechanism module and a layer normalization and residual connection module, uses a combination of sine and cosine functions to generate a unique position encoding for each data in the time series discrete data to maintain the time series information of the time series discrete data, and finally stacks the single causal self-attention module to construct the offshore wind power grid-connected system state probability prediction model.
[0066] (3) The present application uses state transition chain data to train the offshore wind power grid-connected system state probability prediction model, uses gradient descent method to optimize the parameter matrix of the offshore wind power grid-connected system state probability prediction model, and completes the probability distribution output of the offshore wind power grid-connected system state; according to the probability distribution corresponding to the offshore wind power grid-connected system state, the offshore wind power grid-connected system state probability prediction is completed; the risk of the offshore wind power system is evaluated, and real-time warning is performed to ensure the safe and reliable operation of the offshore wind power grid-connected system.
[0067] (4) The present invention can accurately extract probability information from the collected time-series continuous data of the offshore wind power grid-connected system and give the confidence level of any interval; while the traditional method based on continuous values uses the mean square error loss function and cannot directly learn the probability information of the data. When faced with data with strong randomness, it is impossible to obtain the probability result; the interval prediction method can only give an interval with a specified confidence level and cannot estimate the confidence level of any interval. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 This is a control block diagram of the offshore wind power grid-connected system state probability prediction method based on discretization of the present invention;
[0069] Figure 2 A line graph of the collected raw sea breeze data of the present invention;
[0070] Figure 3 This is a local comparison diagram of the discretized sea breeze data of the present invention;
[0071] Figure 4 This is a comparison chart of the effects of applying the loss function of the present invention. DETAILED DESCRIPTION
[0072] 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 indicated.
[0073] The present invention provides a method for predicting the state probability of offshore wind power grid-connected system based on discretization, such as Figure 1 As shown, the time series continuous data of the offshore wind farm output power is preprocessed and discretized to construct state transition chain data; a causal self-attention module is superimposed to construct a state probability prediction model for the offshore wind power grid-connected system; the state transition chain data is used to train the state probability prediction model for the offshore wind power grid-connected system; and state probability prediction is completed based on the probability distribution corresponding to the state of the offshore wind power grid-connected system. This includes:
[0074] Step S1: Preprocess the time series continuous data of the offshore wind farm output power, discretize it, and construct state transition chain data.
[0075] like Figure 2 The figure shows a line graph of the collected sea breeze raw data of the present invention, which is the actual raw data of a wind farm collected for one year according to an embodiment of the present invention, with a sampling frequency of one power point every 15 minutes.
[0076] Step S11: collect the time series continuous data X of the output power of the offshore wind farm t Perform preprocessing, which includes the following sub-steps:
[0077] Step S111: Collecting power output runtime sequential data X in real time through the monitoring system of the offshore wind farm t . t .
[0078] Step S112: Checking the collected sequential data, regarding the data exceeding the preset measurement range as abnormal data, and replacing it with the first data symbol ERROR.
[0079] Step S113: Checking the collected sequential data, locating the missing data, and filling the sequential data with the second data symbol NONE.
[0080] The embodiment of the present application can train the abnormal data and missing data in the collected sequential data of the offshore wind power grid-connected system together with the normal data after simple identification and marking, without further filling. Meanwhile, the probability prediction model can provide a pre-training model for more tasks.
[0081] Step S12: Discretizing the sequential data, determining the discrete number N of the sequential data; statistically analyzing the collected sequential data, drawing a data distribution histogram, and marking the maximum value x max and the minimum value x min of the sequential data to determine the discrete number N of the sequential data as:
[0082]
[0083] Wherein, N is the discrete number of the sequential data; δ is the width of each discrete interval, which is not more than a given accuracy; x max is the maximum value of the sequential data; x min is the minimum value of the sequential data.
[0084] Discretizing the sequential data X t into the sequential discrete data X d is:
[0085]
[0086] Wherein, x t is an element in the sequential data; x d is an element in the sequential discrete data; x max is the maximum value of the sequential data; x min is the minimum value of the sequential data; is the floor operation; N is the discrete number of the sequential data; ∈ is the discretization parameter.
[0087] AsFigure 3 The sea wind data discretization local contrast chart of the application is shown, which shows that there is a small error after the data discretization is re-continuous, and the part of the error has little effect on the overall data accuracy.
[0088] Step S13: encode the first data symbol ERROR and the second data symbol NONE into discrete series N and N+1 of time-continuous data respectively, to obtain state transition chain data X c .
[0089] Step S2: superimpose the causal self-attention module to construct a state probability prediction model of the offshore wind power grid-connected system.
[0090] Step S21: build a single causal self-attention module, including: a multi-head attention mechanism and two sub-modules of layer normalization and residual connection; the multi-head attention mechanism needs to construct a mapping subspace, specifically:
[0091] The three basic calculation elements in the multi-head attention mechanism are query element Q, key element K and value element V, and the semantic subspace mapped to is:
[0092]
[0093] Wherein, W i Q is the parameter matrix used by the query element Q to map to the i-th semantic subspace; W i K is the parameter matrix used by the key element K to map to the i-th semantic subspace; W i V is the parameter matrix used by the value element V to map to the i-th semantic subspace; Q i is the i-th semantic subspace of the query element Q; K i is the i-th semantic subspace of the key element K; V i is the i-th semantic subspace of the value element V.
[0094] The attention mechanism in each semantic subspace is:
[0095]
[0096] Wherein, head i is the output result of the attention mechanism in the i-th semantic subspace; mask is the causal time parameter; Attention is the attention mechanism function; Softmax is the normalization exponential function; d k is the dimension of the semantic subspace K i vector; T is the transpose operation.
[0097] The outputs of the plurality of subspaces are then spliced to obtain a multi-head attention mechanism submodule:
[0098]
[0099] wherein MuHe(Q, K, V) is the output of the multi-head attention mechanism submodule; Q is a query element; K is a key element; and V is a value element; is a vector splicing operation; W o is a parameter matrix required for linear transformation after splicing; n is the number of mapping subspaces; head i is the attention mechanism output result in the i-th semantic subspace, i∈1, 2…n.
[0100] The layer normalization and residual connection submodule is:
[0101] out=LaNo(Add(Q+MuHe(Q,K,V)));
[0102] wherein out is the output of the layer normalization and residual connection submodule; LaNo is a layer normalization function; and Add is a residual connection function.
[0103] Step S22: Position encoding is performed on each attention module built in step S21 to maintain the time sequence information of the time sequence discrete data, and also to enable the encoding of each attention module to be unique, and the adjacent positions to have continuous encoding, so that the offshore wind power grid-connected system state probability prediction model can capture the relative relationship between positions.
[0104] The position encoding uses a combination of sine and cosine functions to generate unique position encoding for each data in the time sequence discrete data, and the generation method is:
[0105]
[0106] wherein PE(pos, 2j) is the odd position encoding of the time sequence discrete data; PE(pos, 2j+1) is the even position encoding of the time sequence discrete data; pos is the extraction position of the time sequence discrete data; j is the dimension index of the offshore wind power grid-connected system state probability prediction model; d model is the dimension of the offshore wind power grid-connected system state probability prediction model.
[0107] Step S23: By stacking the single causal self-attention module in step S21, the learning ability of the offshore wind power grid-connected system state probability prediction model to complex data dynamics is enhanced, complex information can be processed, and deeper data features can be extracted, thereby improving the performance and stability of the offshore wind power grid-connected system state probability prediction model.
[0108] According to the time sequence discrete data Xc The length of the sequence L max , stack L max A causal self-attention module is used to construct a probability prediction model for the offshore wind power grid-connected system state.
[0109] Step S3: Use the state transition chain data to train the offshore wind power grid-connected system state probability prediction model.
[0110] Step S31: Obtain the state transfer chain data X in step S1 c , construct the state transfer chain data sample, and then divide it into training set data sample and validation set data sample according to 8:2; the construction process of the state transfer chain data sample is: in the state transfer chain data X c , successively extract the length L max For each subsequence, set L max -1 data point as input data sample Input; set L max The data points are used as target data samples Target; the input data samples Input and the target data samples Target constitute the state transfer chain data samples.
[0111] Step S32: Train the offshore wind power grid-connected system state probability prediction model in batches, input the training set data samples, and use the gradient descent method to optimize the parameter matrix W of the offshore wind power grid-connected system state probability prediction model in step S2. o ; The hybrid cross entropy mean square error loss function used is:
[0112]
[0113] Among them, Loss is the mixed cross entropy mean square error loss function; λ is the weight coefficient; is the probability distribution corresponding to the offshore wind power grid-connected system state; y i is the true value of the training set data sample; y i The value after serialization; for The probability distribution after continuous processing; L max is the discrete time series data X c The length of the sequence.
[0114] like Figure 4 The figure shows the effect comparison of the application loss function of the present invention. It can be seen that after using the hybrid loss function, the convergence speed of the data is significantly accelerated; in the above formula and y i They are all one-hot encoded; the specific probability distribution formula after serialization is:
[0115]
[0116] where argmax() is the index of the maximum value of the matrix;
[0117] Step S33: Verify the prediction accuracy of the offshore wind power grid-connected system state probability prediction model in step S2 using the verification set data samples, and use the test set data samples to predict the state probability of the offshore wind power grid-connected system to determine the probability distribution corresponding to the state of the offshore wind power grid-connected system.
[0118] Step S4: Complete the state probability prediction according to the probability distribution corresponding to the state of the offshore wind power grid-connected system.
[0119] The probability distribution corresponding to the state of the offshore wind power grid-connected system in step S3 is The total number of probability sampling values N s and the number of target probability sampling values n s , specifically including the following sub-steps:
[0120] Step S41: According to the output probability of the offshore wind power grid-connected system state probability prediction model Sample each discretization interval, where represents the output corresponding to the i-th position, and the probability of falling in the first discretization interval.
[0121] Step S42: Inside the discretization interval, use uniform distribution sampling to obtain the discretization interval sampling parameters as:
[0122]
[0123] where, is the discretization interval sampling parameter; a i is the upper limit of the i-th interval after discretization; b i is the lower limit of the i-th interval after discretization; rand() is a random number generated between [0, 1) using uniform distribution.
[0124] Step S43: Repeat steps S41 and S42 to obtain the number of probability sampling values N s discretization interval sampling parameters The number of target probability sampling values n s falling in the set target interval [c, d].
[0125] The probability of the target interval of the offshore wind power grid-connected system state is calculated as:
[0126]
[0127] Wherein, P is the probability of the offshore wind power grid-connected system state target interval; n s is the target probability sampling value number; N s is the total number of probability sampling values.
[0128] As shown in Table 1, the table shows the predicted network probability output of the embodiment of the present application, indicating the Tok-5 predicted value and its probability of an output site, which can prove that the method is accurate in predicting the offshore wind power grid-connected system state probability, and can meet the actual demand.
[0129] Table 1 Top 5 tokens and their probability output results
[0130] Encoding value Value Probability / % 24 44.2318 19.14 25 46.2527 19.1216 27 50.2943 13.7265 26 48.2735 9.1949 28 52.3151 9.0475
[0131] The second aspect of the embodiment of the present application proposes a prediction device of the offshore wind power grid-connected system state probability prediction method based on discretization, which comprises a data acquisition module, a preprocessing module and a model prediction module.
[0132] The data acquisition module is used to acquire real-time continuous data of the offshore wind power grid-connected system.
[0133] The preprocessing module is used to clean the real-time continuous data, replace abnormal data, fill in missing data, and apply a discretization method to construct the real-time continuous data into state transition chain data.
[0134] The model prediction module is used to input the state transition chain data into the pre-trained offshore wind power grid-connected system state probability prediction model to obtain the running state and probability of the offshore wind power grid-connected system at the next time.
[0135] The third aspect of the embodiment of the present application proposes a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program controls the device where the computer readable storage medium is located to execute the offshore wind power grid-connected system state probability prediction method when running.
[0136] The embodiments of the present application also provide a computer device. The computer device comprises a processor, a memory, and a computer program stored in the memory and running on the processor. The processor implements the foregoing method in the embodiments when executing the computer program, and thus the details are not described herein. Alternatively, the computer program is executed by the processor to implement the functions of each model / unit in the apparatus in the embodiments, and thus the details are not described herein. The computer device is a desktop computer, a notebook, a palm computer, a server, and a cloud server. The computer device comprises, but is not limited to, a processor and a memory. Those skilled in the art understand that the computer device comprises more or less components than the diagram, or combines certain components, or comprises different components, for example, the computer device further comprises an input / output device, a network access device, and a bus. The processor is a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor is a microprocessor, or the processor can also be any conventional processor. The memory is an internal storage unit of the computer device, for example, a hard disk or a memory of the computer device. The memory can also be an external storage device of the computer device, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, and a flash card. Further, the memory comprises an internal storage unit and an external storage device of the computer device. The memory is used to store the computer program and other programs and data required by the computer device. The memory can also be used to temporarily store data that has been output or will be output.
[0137] The application has the following beneficial effects: the embodiment of the application pre-processes and discretizes the time-series continuous data of the collected offshore wind farm output power, and obtains data reflecting the real operation of the offshore wind power grid-connected system; the state probability prediction model of the offshore wind power grid-connected system is constructed by stacking single causal self-attention modules, and the state probability prediction model of the offshore wind power grid-connected system is trained using state transition chain data, the parameter matrix of the state probability prediction model of the offshore wind power grid-connected system is optimized, the probability distribution output of the state of the offshore wind power grid-connected system is obtained, and the state probability prediction of the offshore wind power grid-connected system is completed; the risk assessment and real-time early warning of the offshore wind power system are realized, and the embodiment analysis can prove that the application can guarantee the safe and reliable operation of the offshore wind power grid-connected system.
[0138] The above-described embodiments are only used to describe the preferred embodiments of the application, and do not limit the scope of the application. Without departing from the design spirit of the application, various modifications and improvements to the technical solutions of the application made by those skilled in the art shall fall within the protection scope of the claims of the application.
Claims
1. A method for predicting the state probability of offshore wind power grid-connected system based on discretization, characterized by , which includes the following steps: S1: Preprocess the time series continuous data of offshore wind farm output power, discretize it, and construct state transition chain data. The specific steps include the following: S11: The collected time series data of offshore wind farm output power X t Perform preprocessing, use the first data symbol ERROR to replace abnormal data, and use the second data symbol NONE to fill missing data; S12: Discretize the time series continuous data, determine the discrete level N of the time series continuous data, and convert the time series continuous data X t Discretize into discrete time series data X d The formula is: Among them, x t is an element in the time series continuous data; x d is an element in the time series discrete data; x max is the maximum value of time series continuous data; x min is the minimum value of time series continuous data; is the rounding operation; N is the discrete series of time series continuous data; ∈ is the discretization parameter; S13: Encode the first data symbol ERROR and the second data symbol NONE into discrete series N and N+1 of time-series continuous data respectively to obtain state transition chain data X c ; S2: Superimpose the causal self-attention module to construct the offshore wind power grid-connected system state probability prediction model, which specifically includes the following sub-steps: S21: Build a single causal self-attention module including a multi-head attention mechanism submodule and a layer normalization and residual connection submodule; the multi-head attention mechanism submodule is: Among them, MuHe(Q,K,V) is the output of the multi-head attention mechanism submodule; Q is the query element; K is the key element; V is the value element; is the vector concatenation operation; W o is the parameter matrix required for linear transformation after splicing; n is the number of mapping subspaces; head i Output result of the attention mechanism in the i-th semantic subspace, i∈1,2…n; The layer normalization and residual connection submodules are: out=LaNo(Add(Q+MuHe(Q,K,V))); Among them, out is the output of the layer normalization and residual connection submodule; LaNo is the layer normalization function; Add is the residual connection function; S22: Position encoding is performed on each causal self-attention module constructed in step S21 to maintain the temporal information of the discrete time series data. The position encoding uses a combination of sine and cosine functions to generate a unique position code for each data in the discrete time series data. The generation method is: Among them, PE(pos,2j) is the odd position encoding of time series discrete data; PE(pos,2j+1) is the even position encoding of time series discrete data; pos is the extraction position of time series discrete data; j is the dimension index of the offshore wind power grid-connected system state probability prediction model; d model The dimensions of the offshore wind power grid-connected system state probability prediction model; S23: By stacking the single causal self-attention module in step S21, according to the time series discrete data X to be processed c The length of the sequence L max , stack L max A causal self-attention module is used to construct a probability prediction model for the offshore wind power grid-connected system state; S3: Using the state transition chain data obtained in step S1 to train the offshore wind power grid-connected system state probability prediction model obtained in step S2, specifically including the following sub-steps: S31: Get the state transfer chain data X in step S1 c , construct state transfer chain data samples and divide them into training set data samples and validation set data samples; S32: Train the offshore wind power grid-connected system state probability prediction model in batches, input the training set data samples, and use the gradient descent method to optimize the parameter matrix W of the offshore wind power grid-connected system state probability prediction model in step S2 o ; The hybrid cross entropy mean square error loss function used is: Among them, Loss is the mixed cross entropy mean square error loss function; λ is the weight coefficient; is the probability distribution corresponding to the offshore wind power grid-connected system state; y i is the true value of the training set data sample; y i The value after serialization; for The probability distribution after continuous processing; L max is the discrete time series data X c The length of the sequence; S33: using the validation set data samples to verify the prediction accuracy of the offshore wind power grid-connected system state probability prediction model in step S2, and using the test set data samples to predict the state probability of the offshore wind power grid-connected system, and determine the probability distribution corresponding to the offshore wind power grid-connected system state; S4: Complete the state probability prediction based on the probability distribution corresponding to the offshore wind power grid-connected system state; The probability distribution corresponding to the offshore wind power grid-connected system state in step S3 is obtained as follows: The total number of statistical probability sampling values N s and the number of target probability sampling values n s , the probability of calculating the target interval of the offshore wind power grid-connected system state is: Where P is the probability of the target interval of the offshore wind power grid-connected system state; n s is the number of target probability sampling values; N s is the total number of probability sampling values.
2. The method for predicting offshore wind power grid-connected system state probability based on discretization according to claim 1 is characterized by: In step S11, the collected time series continuous data X of the output power of the offshore wind farm is collected. t Perform preprocessing, which includes the following sub-steps: S111: Through the monitoring system of offshore wind farms, real-time collection of continuous data on power output operation sequence X t =[x1,x2,…,x t ]; S112: Check the collected time series continuous data, and treat the data that exceeds the preset quantitative measurement range as abnormal data, and replace it with the first data symbol ERROR; S113: Check the collected time-series continuous data, locate missing data, and use the second data symbol NONE to fill the time-series continuous data.
3. The method for predicting offshore wind power grid-connected system state probability based on discretization according to claim 1 is characterized by: In step S12, the discrete level N of the time series continuous data is determined, specifically: Perform statistical analysis on the collected time series continuous data, draw a data distribution histogram, and mark the maximum value x of the time series continuous data max and the minimum value x min , determine the discrete series N of time series continuous data as: Where N is the discrete series of continuous time series data; δ is the width of each discrete interval that does not exceed a given precision; x max is the maximum value of time series continuous data; x min The minimum value of continuous time series data.
4. The method for predicting offshore wind power grid-connected system state probability based on discretization according to claim 1 is characterized by: The multi-head attention mechanism in step S21 requires the construction of a mapping subspace, specifically: The three basic computational elements in the multi-head attention mechanism are the query element Q, the key element K, and the value element V, which are mapped to the semantic subspace as follows: Among them, W i Q The parameter matrix used to map the query element Q to the i-th semantic subspace; W i K W is the parameter matrix used to map the key element K to the i-th semantic subspace; i V Q is the parameter matrix used to map the value element V to the i-th semantic subspace; i is the i-th semantic subspace of the query element Q; K i is the i-th semantic subspace of key element K; V i is the i-th semantic subspace of the value element V; The attention mechanism in each semantic subspace is: Among them, head i is the output result of the attention mechanism in the i-th semantic subspace; mask is the causal time parameter; Attention is the attention mechanism function; Softmax is the normalized exponential function; d k is the semantic subspace K i The dimension of the vector; T is the transpose operation.
5. The method for predicting offshore wind power grid-connected system state probability based on discretization according to claim 1 is characterized by: In step S31, a state transition chain data sample is constructed, specifically: In the state transfer chain data X c , successively extract the length L max For each subsequence, set L max -1 data point as input data sample Input; set L max The data points are used as target data samples Target; the input data samples Input and the target data samples Target constitute the state transfer chain data samples.
6. The method for predicting offshore wind power grid-connected system state probability based on discretization according to claim 1, characterized in that: The number N of statistical probability sampling values in step S4 s and the number of target probability sampling values n s , specifically including the following sub-steps: S41: Output probability of offshore wind power grid-connected system state probability prediction model Sampling each discretization interval, where Represents the probability that the output corresponding to the i-th position falls in the first discretization interval; S42: Within the discretization interval, uniform distribution sampling is used to obtain the discretization interval sampling parameters: in, is the discretization interval sampling parameter; a i is the upper limit of the i-th interval after discretization; b i is the lower limit of the i-th interval after discretization; rand() is a random number generated between [0,1) using uniform distribution; S43: Repeat steps S41 and S42 to obtain the number N of probability sampling values s Discretized interval sampling parameters Count the number of target probability sampling values n that fall within the set target interval [c, d] s .
7. A prediction device according to any one of claims 1 to 6, characterized in that: It includes: Data acquisition module, preprocessing module and model prediction module; The data acquisition module is used to collect real-time continuous data of the offshore wind power grid-connected system; The preprocessing module is used to clean the real-time continuous data, replace abnormal data, fill missing data, and construct the real-time continuous data into state transition chain data using a discretization method; The model prediction module is used to input the state transfer chain data into a pre-trained offshore wind power grid-connected system state probability prediction model to obtain the operating state and probability of the offshore wind power grid-connected system at the next moment.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when running, controls the device where the computer-readable storage medium is located to execute the offshore wind power grid-connected system state probability prediction method based on discretization according to any one of claims 1 to 6.
Citation Information
Patent Citations
Multi-head self-attention offshore wind power ultra-short time power prediction method of integrated lifting mode
CN116050621A
Generative adversarial multi-head attention neural network self-learning method for aero-engine data reconstruction
WO2024087129A1