Multi-step prediction and early warning method and device for abnormal working conditions in gas storage injection-production process
Through multi-model fusion and dynamic weight adjustment methods, the accuracy and early warning problems of abnormal working conditions prediction during gas storage injection and procurement are solved, the prediction accuracy and early warning efficiency are improved, and accidents are reduced.
Patent Information
- Application Number
- CN202411103465.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-12-31
AI Technical Summary
The prior art is difficult to accurately predict abnormal working conditions during underground gas storage injection and procurement, resulting in frequent accidents and economic losses. The cumulative error of the multi-step prediction model is large and there is a lack of an effective early warning mechanism.
The multi-model fusion method is adopted to obtain historical actual data and historical prediction data of two preset models, dynamically adjust the model weights, update the prediction results in real time, improve the prediction accuracy, and provide early warning for abnormal working conditions.
It effectively reduces the probability of accidents, improves the accuracy of prediction of parameter parameters of the injection and procurement process, enhances the early warning ability for abnormal working conditions, and reduces economic losses.
Smart Images

Figure CN119226972A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of prediction and early warning of abnormal operating conditions, and in particular to a multi-step prediction and early warning method and device for abnormal operating conditions in the injection and production process of a gas storage reservoir. Background Art
[0002] As an important part of the storage and distribution system in the natural gas industry, underground gas storage has the advantages of large reserves, good stability and strong peak-shaving capability. However, its injection and production operations show the characteristics of "frequent changes between high and low production, drastic changes between high and low pressures, and long-term use of cyclic injection and production". In addition, the downhole environment is complex, and the injection and production tubing and casing are long-term affected by strong alternating loads, which makes casing leakage and annulus pressure accidents prone to occur, resulting in peak-shaving failure and even the scrapping of the gas storage.
[0003] Predicting abnormal conditions in the injection and production process of a gas storage reservoir and foreseeing abnormal conditions by predicting parameter change trends are of great significance for mitigating the consequences of accidents and reducing economic losses. Therefore, accurately predicting the changing trends of gas storage reservoir injection and production process parameters in the future time period and issuing early warnings for abnormal conditions are issues that need to be urgently addressed. Summary of the invention
[0004] The present application provides a multi-step prediction and early warning method, device, equipment and storage medium for abnormal operating conditions in the injection and production process of a gas storage reservoir, which are used to accurately predict the abnormal injection and production conditions of monitoring parameters in a future time period and provide early warning information.
[0005] On the one hand, the present application provides a multi-step prediction and early warning method for abnormal conditions in an injection-production process, the method comprising:
[0006] Acquire historical actual data, historical predicted data of the first model, and historical predicted data of the second model; wherein the historical actual data is the injection and production process data actually collected within a preset historical time period, the first model and the second model are preset algorithm models, both of which are used to predict wellhead pressure data, and the historical predicted data represents the wellhead pressure data predicted within a preset historical time period;
[0007] Determine the prediction weight of the first model and the prediction weight of the second model according to the historical actual data, the historical prediction data of the first model, and the historical prediction data of the second model; wherein the prediction weight represents the importance of the prediction result obtained by the model, and the prediction result represents the data output by the model;
[0008] Determine the prediction results of the first model and the prediction results of the second model based on historical actual data;
[0009] According to the prediction results of the first model, the prediction results of the second model, the prediction weight of the first model, and the prediction weight of the second model, the target injection and production data is determined; wherein the target injection and production data is the wellhead pressure data to be predicted, which is used to warn of abnormal working conditions. Optionally, the preset historical time period includes multiple time points; according to the historical actual data, the historical prediction data of the first model, and the historical prediction data of the second model, the prediction weight of the first model and the prediction weight of the second model are determined, including:
[0010] Determine the residual data of the first model at the time point according to the historical actual data at each time point and the historical predicted data of the first model at each time point; wherein the residual data represents the difference between the historical actual data and the historical predicted data;
[0011] Determine the residual data of the second model at a time point based on the historical actual data at each time point and the historical predicted data of the second model at each time point;
[0012] The prediction weight of the first model and the prediction weight of the second model are determined according to the residual data of the first model at each time point and the residual data of the second model at each time point.
[0013] Optionally, determining the prediction weight of the first model and the prediction weight of the second model according to the residual data of the first model at each time point and the residual data of the second model at each time point includes:
[0014] Determine the historical weight of the first model at a time point and the historical weight of the second model at a time point according to the residual data of the first model at each time point and the residual data of the second model at each time point;
[0015] Determine the prediction weight of the first model and the prediction weight of the second model based on the historical weight of the first model at each time point and the historical weight of the second model at each time point
[0016] Optionally, the historical weight of the first model at a time point and the historical weight of the second model at a time point can be expressed as:
[0017]
[0018] Among them, x1 represents the historical weight of the first model at a point in time, x2 represents the historical weight of the second model at a point in time, y1 represents the residual data of the first model at a point in time, y2 represents the residual data of the second model at a point in time, and min represents the determination The minimum value of .
[0019] Optionally, obtain historical actual data, including:
[0020] Acquire the initial injection and production data within a preset historical time period collected by the data acquisition device; wherein the data acquisition device is used to collect data on the gas storage reservoir, and the initial injection and production data includes injection and production time, gas production pressure, gas production temperature, gas injection pressure and gas injection temperature;
[0021] Determine sine and cosine characteristics according to the time data; wherein the sine and cosine characteristics represent the periodicity of the injection and production process;
[0022] Normalizing the initial injection and production data to obtain normalized data;
[0023] Based on the normalized data, determine the historical actual data.
[0024] Optionally, it also includes:
[0025] Obtaining a preset first initial model and a preset second initial model;
[0026] Determine the preset hyperparameters of the first initial model and the preset hyperparameters of the second initial model according to the historical injection and production data; wherein the hyperparameters are indicators that affect the performance of the model;
[0027] The first model is determined according to the preset hyperparameters of the first initial model, and the second model is determined according to the preset hyperparameters of the second initial model.
[0028] Optionally, according to historical injection and production data, the hyper parameters of the preset first initial model are determined, including:
[0029] Get the preset hyperparameter range;
[0030] According to the preset hyperparameter range and historical injection and production data, the preset hyperparameters of the first initial model are obtained.
[0031] In a second aspect, the present application provides a multi-step prediction and early warning device for abnormal conditions in the injection and production process of a gas storage reservoir, comprising:
[0032] An acquisition module is used to acquire historical actual data, historical prediction data of the first model, and historical prediction data of the second model; wherein the historical actual data is the injection and production process data actually collected within a preset historical time period, the first model and the second model are preset algorithm models, both of which are used to predict wellhead pressure data, and the historical prediction data represents the wellhead pressure data predicted within the preset historical time period; a first determination module is used to determine the prediction weight of the first model and the prediction weight of the second model according to the historical actual data, the historical prediction data of the first model, and the historical prediction data of the second model; wherein the prediction weight represents the importance of the prediction result obtained by the model, and the prediction result represents the data output by the model;
[0033] A second determination module is used to determine the prediction result of the first model and the prediction result of the second model according to the historical actual data;
[0034] The third determination module is used to determine the target injection and production data according to the prediction results of the first model, the prediction results of the second model, the prediction weight of the first model, and the prediction weight of the second model; wherein the target injection and production data is the wellhead pressure data to be predicted, which is used to warn of abnormal working conditions.
[0035] In a third aspect, the present application provides an electronic device, including:
[0036] Processor and memory;
[0037] Memory stores computer-executable instructions;
[0038] The processor executes the computer execution instructions stored in the memory, so that the electronic device executes any one of the multi-step prediction and early warning methods for abnormal operating conditions in the injection and production process of a gas storage reservoir in the first aspect.
[0039] In a fourth aspect, the present application provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are executed by a processor, they are used to implement a multi-step prediction and early warning method for abnormal operating conditions in the injection and production process of a gas storage reservoir as described in any one of the first aspects.
[0040] The present application provides a multi-step prediction and early warning method, device, equipment and storage medium for abnormal operating conditions in the injection and production process of a gas storage reservoir. By updating and adjusting the prediction weight of a first model and the prediction weight of a second model, the accuracy of the prediction results for each time period can be improved. The prediction weight of the first model and the prediction weight of the second model can be adjusted in real time by acquiring historical actual data, historical prediction data of the first model, and historical prediction data of the second model in real time. The prediction weight of the first model and the prediction weight of the second model can be reasonably and flexibly adjusted according to the values of the models in each time period, so that the prediction results are more accurate, and early warnings are issued for abnormal operating conditions, thereby reducing the occurrence of related accidents. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] Figure 1 A flow chart of a multi-step prediction and early warning method for abnormal conditions in the injection and production process of a gas storage provided in an embodiment of the present application;
[0043] Figure 2 A flow chart of another multi-step prediction and early warning method for abnormal conditions in the injection and production process of a gas storage provided in an embodiment of the present application;
[0044] Figure 3 The abnormal working condition of the injection and production process provided in the embodiment of the present application is multi-step predict Warning diagram;
[0045] Figure 4 A schematic diagram of the structure of a multi-step prediction and early warning device for abnormal conditions in the injection and production process of a gas storage provided in an embodiment of the present application;
[0046] Figure 5 An electronic device provided in an embodiment of the present application.
[0047] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0048] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0049] First, the terms involved in this application are explained:
[0050] Multi-step prediction refers to the use of models to predict the values of multiple future time points in time series analysis or machine learning, rather than just the value of the next time point. In this application, the prediction results of the first prediction model are the wellhead pressure data at multiple future time points, and the prediction results of the second prediction model are the wellhead pressure data at multiple future time points. The corresponding target injection and production data are also the wellhead pressure data to be predicted at multiple future time points.
[0051] Gas storage injection and production refers to the process of injecting and producing natural gas in underground gas storage.
[0052] Injection and production process data generally refers to various data collected during water injection (or gas injection) and oil production (or gas production) operations during oil and gas extraction. These data are essential for optimizing production, improving recovery, monitoring oil and gas reservoir status, and ensuring safe production.
[0053] In the existing technology, in the injection and production operation, due to individual knowledge, experience and other reasons, on-site personnel cannot timely predict the abnormal injection and production conditions in the future based on the trend of monitoring parameters. However, based on machine learning prediction technology, there are few prediction and early warning schemes for abnormal conditions in the injection and production process (mainly referring to annular pressure caused by oil / casing leakage, cementing failure, and thermal expansion). The prediction and early warning of gas storage injection and production process parameters is essentially a multi-step prediction problem of time series. XGBoost (eXtremeGradient Boosting, extreme gradient boosting algorithm), LSTM (Long Short-Term Memory, long short-term memory network) and other methods are widely used in time series multi-step prediction, but most multi-step prediction models are single-point rolling single prediction models or use fixed weighting methods such as equal weighting and Lagrangian weighting to merge models for rolling prediction, ignoring the weight changes of each model in the future time period, and the error accumulation problem is prominent. Therefore, directly using XGBoost and LSTM to predict the parameters of the gas storage injection and production process has a large error problem.
[0054] The present application provides a multi-step prediction and early warning method, device, equipment and storage medium for abnormal working conditions in the injection and production process of a gas storage reservoir, which obtains historical actual data, historical prediction data of a first model, and historical prediction data of a second model; wherein the historical actual data is the injection and production process data actually collected within a preset historical time period, the first model and the second model are preset algorithm models, both of which are used to predict wellhead pressure data, and the historical prediction data represents the wellhead pressure data predicted within the preset historical time period; according to the historical actual data, the historical prediction data of the first model, and the historical prediction data of the second model, the prediction weight of the first model and the prediction weight of the second model are determined; wherein the prediction weight represents the importance of the prediction result obtained by the model, and the prediction result represents the data output by the model; by updating and adjusting the prediction weight of the first model and the prediction weight of the second model, the accuracy of the prediction result of each time period can be improved; according to the historical actual data, the prediction result of the first model and the prediction result of the second model are determined; according to the prediction result of the first model, the prediction result of the second model, the prediction weight of the first model, and the prediction weight of the second model, the target injection and production data are determined; wherein the target injection and production data is the wellhead pressure data to be predicted, which is used to warn of abnormal working conditions. The prediction weight of the first model and the prediction weight of the second model are adjusted in real time by acquiring the historical actual data, the historical prediction data of the first model, and the historical prediction data of the second model in real time. The prediction weight of the first model and the prediction weight of the second model are adjusted reasonably and flexibly according to the values of the models in each time period, thereby reducing the cumulative error of multi-step predictions and making the prediction results more accurate.
[0055] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0056] Figure 1 A multi-step prediction and early warning method for abnormal conditions in the injection and production process of a gas storage reservoir is provided in an embodiment of the present application. Figure 1 As shown, the method body can be a server or other servers, and this embodiment is not particularly limited here. Figure 1 As shown, the method includes:
[0057] S101. Acquire historical actual data, historical predicted data of the first model, and historical predicted data of the second model; wherein the historical actual data are injection and production process data actually collected within a preset historical time period, the first model and the second model are preset algorithm models, both of which are used to predict wellhead pressure data, and the historical predicted data represent the wellhead pressure data predicted within a preset historical time period.
[0058] The historical time period is a period of time in the past preset by the user. If a small time interval represents an hour, the historical time period can be the past 10 hours. The historical actual data is the actual injection-production related data for each hour in the past 10 hours.
[0059] Both the first model and the second model can be used to obtain predicted values of injection and production data based on historical actual data.
[0060] The first model and the second model can be different models or multiple different models. For example, the first model can be two models, and the second model can be one model, so the first model and the second model represent three different models. The first model and the second model can be neural networks or tree models. For example, CNN-BiLSTM-Attention model, XGBoost model, decision tree model, neural model, support vector machine model, AdaBoost model, GBDT model, LightGEB model, CatBoost model, etc.
[0061] The historical prediction data refers to the injection and production process data predicted by the model at that time within a preset historical time period, that is, the historical prediction data of the first model and the historical prediction data of the second model can be directly obtained. For example, the prediction results output by the first model in the previous hour can be obtained.
[0062] In this embodiment, obtaining historical actual data includes:
[0063] Acquire the initial injection and production data within a preset historical time period collected by the data acquisition device; wherein the data acquisition device is used to collect data on the gas storage reservoir, and the initial injection and production data includes injection and production time, gas production pressure, gas production temperature, gas injection pressure and gas injection temperature;
[0064] Determine sine and cosine characteristics according to the time data; wherein the sine and cosine characteristics represent the periodicity of the injection and production process;
[0065] Normalizing the initial injection and production data to obtain normalized data;
[0066] Based on the normalized data, determine the historical actual data.
[0067] Among them, the acquisition equipment is a device that can collect injection and production process data in real time. The acquisition equipment includes sensors that can collect the corresponding casing pressure during injection / production, and also includes sensors that can collect the corresponding casing temperature data. The injection pressure includes the wellhead injection pressure, and the gas production pressure includes the wellhead gas production pressure. During injection / production, the oil pressure and casing pressure are pressure data obtained from different pipes, which can be collectively referred to as the wellhead pressure.
[0068] The injection and production time is collected in the form of "%Y-%M-%D%h:%m:%s" time series, where Y represents the year, M represents the month, D represents the date, h represents the hour, m represents the second, and % represents the specific value. The single variable feature extraction method is used to extract the month information and season information from the time series, and the seasonal information is assigned labels of 1, 2, 3, and 4 respectively. For example: March, April, and May are spring, with a label of 1; June, July, and August are summer, with a label of 2; September, October, and November are autumn, with a label of 3; December, January, and February are winter, with a label of 4.
[0069] The monthly characteristics are input into the sine function and cosine function to construct new time series features (i.e., sine and cosine features) to reflect the nature of the injection-production cycle, increase the input feature dimension, and enhance the nonlinear relationship between the learning features of the prediction model and the monitoring parameters. The nonlinear relationship represents the existence of interaction, and this interaction makes the whole no longer simply equal to the sum of its parts.
[0070] The preset sine function can be:
[0071] Month_sin=sin(2×π×x / 12);
[0072] The preset cosine function can be:
[0073] Month_cos=cos(2×π×x / 12); for example: taking the time data of 2022-03-02 12:00:00 as an example, extract month 3 from it; according to the seasonal division principle, the seasonal feature data at this time is 1; at the same time, the month data 3 is respectively substituted into the sine function and cosine function to calculate the corresponding sine and cosine features. At this time, the sine feature is sin(2×π×3 / 12)=1, and the cosine feature is cos(2×π×3 / 12)=0.
[0074] Normalization processing is used to convert data of different dimensions and ranges into a unified scale. The injection and production process data can be mapped to the interval [0, 1]. The conversion formula can be:
[0075]
[0076] Among them, x i (k) is the initial injection and production data; x i,min is the maximum and minimum value of feature i; x' i (k) is a normalized value, i.e., normalized data, i=1, 2, ..., n; k=1, 2, ..., m, feature i can be any one of gas production pressure, gas production temperature, gas injection pressure, gas injection temperature, and sine and cosine features, and n represents the number of features. For example, in the present application, the initial injection and production data include sine and cosine features, gas production pressure, gas production temperature, gas injection pressure, and gas injection temperature, so n is 5. m represents how many data each feature has. For example, if there are twenty data for gas production pressure, then m for gas production pressure is 20, and the number of all features is the same (i.e., if there are 20 data for gas injection pressure, then there are 20 data for gas production pressure, gas production temperature, gas injection pressure, and sine and cosine features).
[0077] The advantage of this setting is that by determining the sine and cosine characteristics, the periodic changes in the injection and production process of the gas storage can be effectively analyzed. This is very helpful for understanding the operating laws of the gas storage and optimizing the injection and production strategy; normalization processing can eliminate the differences between different data magnitudes, which helps to improve the accuracy and consistency of data analysis and improve the utilization and value of data.
[0078] In this embodiment, it also includes:
[0079] Obtaining a preset first initial model and a preset second initial model;
[0080] Determine the preset hyperparameters of the first initial model and the preset hyperparameters of the second initial model according to the historical injection and production data; wherein the hyperparameters are indicators that affect the performance of the model;
[0081] The first model is determined according to the preset hyperparameters of the first initial model, and the second model is determined according to the preset hyperparameters of the second initial model.
[0082] Among them, hyperparameters refer to the parameters that need to be set before model training in machine learning algorithms. These parameters remain unchanged during the training process, which is different from the parameters learned by the model through training data (such as weights in neural networks). The choice of hyperparameters has a significant impact on the performance of the model, so they need to be tuned. Common hyperparameters include: Learning Rate: Controls the step size of the model weight update. Batch Size: The number of training samples used in each iteration. Epochs: The number of times the entire training data set is used. Regularization Parameter: Parameters to prevent overfitting, such as L1 or L2 regularization coefficients. Hidden Layers and Neurons: The number of hidden layers in a neural network and the number of neurons in each layer. Activation Function: Such as ReLU (Rectified Linear Unit, linear rectification function) function, Sigmoid function, Tanh (hyperbolic tangent) function, etc., used to introduce nonlinear characteristics. Optimizer: Such as SGD (Stochastic Gradient Descent), Adam (Adaptive Moment Estimation), RMSprop (Root mean square prop), etc., which are algorithms used to update model weights.
[0083] Hyperparameter tuning is usually performed through grid search, random search, or Bayesian optimization, so that the difference between the final model's predicted value and the true value is small, and the predicted value and the true value have the same change trend.
[0084] The benefit of this setting is that the performance and generalization ability of the model can be significantly improved by choosing appropriate hyperparameters.
[0085] In this embodiment, the hyperparameters of the preset first initial model are determined based on the historical injection and production data, including:
[0086] Get the preset hyperparameter range;
[0087] According to the preset hyperparameter range and historical injection and production data, the preset hyperparameters of the first initial model are obtained.
[0088] When performing hyperparameter tuning, presetting the hyperparameter range is an important step. Reasonable range settings can improve tuning efficiency and help find the optimal hyperparameter combination.
[0089] When the preset first initial model is the CNN_BiLSTM (Convolution-Bidirectional Long Short-Term Memory) model, the data is converted into the (number of samples, time step, number of features) format; the converted data sets are respectively input into CNN_BiLSTM (output_dim is the prediction time step h), and the search interval of the number of hidden layers of BiLSTM (Bidirectional Long Short-Term Memory, BiLSTM, bidirectional long short-term memory network) is set to [4, 20]. When the grid search method is used to select the smallest error (i.e., the difference between the predicted value and the true value is the smallest), the number of hidden layers of CNN_BiLSTM is confirmed as the hyperparameter of the preset first initial model.
[0090] When the preset second initial model is the XGBoost multi-step prediction model, the data is converted into the format of (number of samples, time steps × number of features); the search interval for the number of trees of XGBoost is set to [10, 100], the learning rate search interval is set to [0.01, 0.3], and the tree depth search interval is set to [3, 10]. The greedy algorithm is used to optimize the hyperparameters such as the number of trees, learning rate, and tree depth of the XGBoost prediction model and establish a corresponding model as the hyperparameters of the preset second initial model, so as to minimize the difference between the predicted value and the true value.
[0091] The benefit of this setting is that by specifying a range, appropriate hyperparameters can be selected faster and better, which can significantly improve the performance and generalization ability of the model.
[0092] S102. Determine the prediction weight of the first model and the prediction weight of the second model based on historical actual data, historical prediction data of the first model, and historical prediction data of the second model; wherein the prediction weight represents the importance of the prediction result obtained by the model, and the prediction result represents the data output by the model.
[0093] Among them, the historical actual data, the historical prediction data of the first model, and the historical prediction data of the second model are data of the same time period. For example, the historical actual data includes the actual data of each hour in the past 10 hours. Then, the historical prediction data of the first model includes: the prediction data of the first model for each hour in the past 10 hours, and the historical prediction data of the second model includes: the prediction data of the second model for each hour in the past 10 hours. The prediction weight of the first model can be the prediction weight for the next hour, then there is only one corresponding prediction weight. It can also be the prediction weight for the next three hours, then there are three corresponding prediction weights. Similarly, the number of prediction weights of the first model and the number of prediction weights of the second model need to be consistent.
[0094] The prediction weight of the first model for the next 3 hours and the prediction weight of the second model for the next 3 hours can be determined based on the actual data of each hour in the past 10 hours, the predicted data of the first model for each hour in the past 10 hours, and the predicted number of the second model for each hour in the past 10 hours.
[0095] In this embodiment, the preset historical time period includes multiple time points; according to the historical actual data, the historical prediction data of the first model, and the historical prediction data of the second model, the prediction weight of the first model and the prediction weight of the second model are determined, including:
[0096] Determine the residual data of the first model at the time point according to the historical actual data at each time point and the historical predicted data of the first model at each time point; wherein the residual data represents the difference between the historical actual data and the historical predicted data;
[0097] Determine the residual data of the second model at a time point based on the historical actual data at each time point and the historical predicted data of the second model at each time point;
[0098] The prediction weight of the first model and the prediction weight of the second model are determined according to the residual data of the first model at each time point and the residual data of the second model at each time point.
[0099] Among them, a time point can be an hour or a day. When the preset historical point interval represents the past ten hours, then a time point represents any hour in the ten hours. For example, the preset historical time period is 1 o'clock, 2 o'clock..., 10 o'clock, then a time point can be 1 o'clock, 2 o'clock... or 10 o'clock. Obtain the difference between the actual data at 1 o'clock and the predicted data of the first model at 1 o'clock, and you can get the residual data e11 of the first model at 1 o'clock. And so on, get the residual data of the first model for each hour in the past ten hours, recorded as e11, e12, e13,..., e110. Similarly, get the difference between the actual data at 1 o'clock and the predicted data of the second model at 1 o'clock, and you can get the residual data e21 of the second model at 1 o'clock. And thereby get the residual data of the second model for each hour in the past ten hours, recorded as e21, e22, e23,..., e210. According to (e11, e12, e13, ..., e110) and (e21, e22, e23, ..., e210), the prediction weight E11 of the first model and the prediction weight E21 of the second model are obtained.
[0100] The advantage of this setting is that the prediction weights are updated in real time based on the residual data, avoiding the accumulation of cumulative errors and thus improving the accuracy of the prediction.
[0101] In this embodiment, the prediction weight of the first model and the prediction weight of the second model are determined according to the residual data of the first model at each time point and the residual data of the second model at each time point, including:
[0102] Determine the historical weight of the first model at a time point and the historical weight of the second model at a time point according to the residual data of the first model at each time point and the residual data of the second model at each time point;
[0103] The prediction weight of the first model and the prediction weight of the second model are determined according to the historical weight of the first model at each time point and the historical weight of the second model at each time point.
[0104] The prediction weight of the first model can be obtained by obtaining the historical weight of the first model at each time point and the historical weight of the second model at each time point, and then calculating the average value of the historical weight of the first model at each time point. The prediction weight of the second model can be obtained by obtaining the historical weight of the second model at each time point and then calculating the average value of the historical weight of the second model at each time point.
[0105] If the residual data of the first model in the past ten hours are e11, e12, e13, ..., e110, and the residual data of the second model in each hour in the past ten hours are e21, e22, e23, ..., e210. e11 represents the residual of the first model at time 1, and e21 represents the residual of the second model at time 1. Then, according to e11 and e21, the weight w11 of the first model at time 1 and the weight w21 of the second model at time 1 can be obtained. e12 represents the residual of the first model at time 2, and e22 represents the residual of the second model at time 2. Then, according to e12 and e22, the weight w12 of the first model at time 2 and the weight w22 of the second model at time 2 can be obtained. By analogy, the weights of the first model in the past ten hours are w11, w12, w13, ... w110, and the weights of the second model in the past ten hours are w21, w22, w23, ... w210. According to the weights of the first model in the past ten hours (i.e., w11, w12, w13, ... w110), the prediction weight E1 of the first model can be obtained. According to the weights of the second model in the past ten hours (i.e., w21, w22, w23, ... w210), the prediction weight of the second model can be obtained. It can be E11 = (w11 + w12 + w13 + ... + w110) / 10, E21 = (w21, w22, w23, ... w210) / 10; at the same time, the prediction weight E12 = (E11 + w12 + w13 + ... + w110) / 10 of the first model at the next time point, and the prediction weight E22 = (E21, w22, w23, ... w210) / 10 of the second model at the next time point can be obtained.
[0106] The advantage of this setting is that the prediction weights are dynamically adjusted according to the historical weights, so that the model can adapt to changes in data and improve the flexibility and adaptability of the model; the method of determining the model prediction weights based on residual data can significantly improve the accuracy and reliability of the prediction by dynamically adjusting and optimizing the model weights, which has important practical application value.
[0107] In this embodiment, the historical weight of the first model at a point in time and the historical weight of the second model at a point in time can be expressed as:
[0108]
[0109] Among them, x1 represents the historical weight of the first model at a point in time, x2 represents the historical weight of the second model at a point in time, y1 represents the residual data of the first model at a point in time, y2 represents the residual data of the second model at a point in time, and min represents the determination The minimum value of .
[0110] Among them, the residual data of the first model at the time point and the residual data of the second model at the time point are both known data, and the historical weight of the first model at the time point and the historical weight of the second model at the time point add up to 1; the historical weight of the first model at the time point and the historical weight of the second model at the time point can be obtained according to the least squares principle; the fitting model parameters (i.e., weight data) are found by minimizing the sum of squares of the error (i.e., residual data) between the observed data and the model prediction value.
[0111] The sum of the historical weights of the first model at a point in time and the historical weights of the second model at a point in time is 1; and the sum of the square of the historical weight of the first model at a point in time multiplied by the square of the residual of the first model at a point in time, and the square of the historical weight of the first model at a point in time multiplied by the square of the residual of the first model at a point in time needs to be a minimum value, so as to determine the historical weight of the fitted first model at a point in time, and the historical weight of the second model at a point in time.
[0112] When there are a first model, a second model, and a third model, the historical weight of the first model at a point in time, the historical weight of the second model at a point in time, and the historical weight of the third model at a point in time can be expressed as:
[0113]
[0114] Among them, x1 represents the historical weight of the first model at a point in time, x2 represents the historical weight of the second model at a point in time, x3 represents the historical weight of the third model at a point in time, y1 represents the residual data of the first model at a point in time, y2 represents the residual data of the second model at a point in time, y3 represents the residual data of the third model at a point in time, and min represents the determination The minimum value of , can be deduced in the same way as the number of models increases.
[0115] The advantage of this setting is that it finds the minimum sum of squares to determine the historical weight of each model at a certain point in time, making the prediction more accurate.
[0116] S103: Determine the prediction result of the first model and the prediction result of the second model according to the historical actual data.
[0117] The historical actual data is input into the first model to obtain the prediction result of the first model; the historical actual data is input into the second model to obtain the prediction result of the second model.
[0118] S104. Determine target injection and production data according to the prediction results of the first model, the prediction results of the second model, the prediction weight of the first model, and the prediction weight of the second model; wherein the target injection and production data is the wellhead pressure data to be predicted, which is used to warn of abnormal working conditions.
[0119] When there are only two models, the first model and the second model, the target injection-production data may be: the prediction result of the first model×the prediction weight of the first model+the prediction weight of the second model×the prediction weight of the second model.
[0120] When there are three models, namely the first model, the second model and the third model, the target injection and production data can be: the prediction result of the first model × the prediction weight of the first model + the prediction weight of the second model × the prediction weight of the second model + the prediction weight of the third model × the prediction weight of the third model, and so on as the number of models increases.
[0121] Abnormal operating conditions may refer to: the wellhead pressure data exceeds the set threshold, and there is a potential risk. Wellhead pressure includes oil pressure and casing pressure. Early warning of abnormal operating conditions means that the wellhead pressure data exceeds the set threshold (mainly referring to the casing pressure data), and an early warning of the situation is required. For example: the first threshold is set to 14MPa, and the second threshold is set to 21MPa. The first threshold and the second threshold represent different degrees of risk, so different early warning levels are given. In this patent, when the casing pressure value in the predicted wellhead pressure exceeds 14MPa, a first-level early warning is given to alert the operator to the occurrence of potential risks (such as casing leakage); when the casing pressure value in the predicted wellhead pressure exceeds 21MPa, a second-level early warning is given to remind the operator to take necessary control measures (such as shutting in the well) to ensure safe production of injection and production.
[0122] The present application provides a multi-step prediction and early warning method for abnormal operating conditions in the injection and production process of a gas storage reservoir. The method dynamically adjusts the prediction weights of the first model and the second model through historical prediction data of the first model and the historical prediction data of the second model, thereby avoiding the cumulative error caused by the multi-step prediction model and making the prediction more accurate.
[0123] Figure 2 Another multi-step prediction and early warning method for abnormal conditions in the injection and production process of a gas storage reservoir is provided in an embodiment of the present application. Figure 2 As shown, the method body can be a server or other servers, and this embodiment is not particularly limited here. Figure 2 As shown, the method includes:
[0124] S201. Process the initial injection and production historical process data to obtain historical injection and production process data.
[0125] The method for processing the initial injection and production historical process data to obtain the historical injection and production process data is as follows:
[0126] The initial historical injection and production process data is obtained, where the initial historical injection and production process data includes casing pressure data, oil pressure data, wellhead temperature, oil / technical suite pressure, and time data. The casing pressure data is obtained from the casing, and the oil pressure data is obtained from the oil pressure pipe. The casing pressure data and the oil pressure data represent the wellhead pressure during gas production / injection, reflecting the abnormal injection and production situation. The time data is a time series in the form of "%Y-%M-%D%h:%m:%s".
[0127] According to the monthly information, the sine function, and the cosine function, the monthly sine characteristics and the cosine characteristics are obtained to reflect the properties of the injection-production cycle.
[0128] The initial historical injection and production process data is normalized to obtain normalized initial injection and production data. It is worth noting that the initial historical injection and production process data at this time includes: casing pressure data, oil pressure data, wellhead temperature, oil / technical suite pressure, seasonal information, monthly information, monthly sine characteristics, and monthly cosine characteristics.
[0129] The grey correlation coefficient was calculated based on the normalized initial injection and production data.
[0130] The grey correlation coefficient is obtained as:
[0131]
[0132] in, Take the double minimum and maximum value for the absolute difference, that is, first take the minimum (largest) value among all samples of feature i, and then take the minimum (largest) value among all features; Δ i (k)=|x' ot (k)-x' i (k)| is the absolute value of the difference between the corresponding elements of the sub-feature sequence and the target sequence; ρ is the resolution coefficient, which is usually taken as 0.5.
[0133] Calculate the grey relational degree:
[0134]
[0135] in, is information entropy. The larger the entropy value, the more information it contains. i (k) = x' i (k) / x' i (k) is the ratio of the kth normalized value in feature i to the sum of all normalized values of the feature. The correlation between the sub-feature sequence and the target feature sequence is obtained, and the key features with a correlation greater than 0.5 (medium and strong correlation) are selected and used as the input features of the prediction model.
[0136] S202. Obtain a single prediction model based on historical injection and production process data.
[0137] Based on the historical injection and production process data, the model method for obtaining a single prediction is:
[0138] The historical injection and production process data are divided into 8:2 to obtain the training set and the test set respectively.
[0139] The single prediction model can be a CNN_BiLSTM model or an XGBoost multi-step prediction model.
[0140] For the BiLSTM dataset, the data is converted into the (number of samples, time steps, number of features) format; for the XGBoost dataset, the data is converted into the (number of samples, time steps × number of features) format.
[0141] The converted data sets are respectively input into the CNN_BiLSTM and XGBoost multi-step prediction models (output_dim is the prediction time step h), and the search interval of the number of BiLSTM hidden layers is set to [4, 20]. The grid search method is used to select the number of hidden layers of CNN_BiLSTM when the error is minimized, and the corresponding prediction model is established; the search interval of the number of trees of XGBoost is set to [10, 100], the learning rate search interval is set to [0.01, 0.3], and the tree depth search interval is set to [3, 10]. The greedy algorithm is used to optimize the hyperparameters such as the number of trees, learning rate, and tree depth of the XGBoost prediction model and establish the corresponding model.
[0142] After grid search for parameter optimization, the CNN-BiLSTM prediction model has the following convolution kernels: filters = 16, kernel size kernel_size = 3, pooling size pool_size = 2; hidden layer dimension hidden_dim = 16, regularization term dropout_out = 0.1, batch size batch_size = 24, and optimizer Adam. After the hyperparameter optimization of XGBoost using the greedy algorithm, the prediction model has the following tree number n_estimator = 90, maximum tree depth max_depth = 4, learning rate learning_rate = 0.1, and gamma = 0.2.
[0143] S203, inputting the historical injection-production process data of the past k moments into each single prediction model, thereby obtaining the predicted injection-production process data of each single prediction model at the next h moments.
[0144] S204. Obtain the historical weights of each single prediction model at the past k moments according to the historical injection and production process data at the past k moments and the prediction values of each single prediction model at the past k moments.
[0145] The historical weight of a single forecast model is represented as:
[0146]
[0147] in, represents the fitting residual of the i-th model at time t, y it Represents the true value of the historical injection and production process data at time t, Represents the predicted value of a single prediction model at time t; ω itrepresents the weight of the i-th model at time t; n represents the number of single prediction models; at time t, the number of single prediction models is the number of ω it e it term; p represents the number of measured sample points, time t is any moment in the past k moments, minJ t Represents the smallest sum.
[0148] The formula is solved based on the least squares principle. Let R = [1, 1, ..., 1], then the residual matrix E = [(e it ) n×1 ][(e it ) n×1 ] T (i=1, 2...n), where n represents the number of models, T is an n×1 column vector; P is the optimal weight vector formed by the optimal weights obtained at each sample point, then the formula can be rewritten as:
[0149]
[0150] By setting the partial derivative to 0, we can get the optimal weight vector of each model at each sample point:
[0151] p=(ω it ,ω jt )=(E -1 R) / (R T E -1 R);
[0152] S205. Obtain the prediction weights of each single prediction model at h moments in the future based on the historical weights of each single prediction model at k moments in the past.
[0153] In the actual multi-step prediction of abnormal injection and production conditions, since the actual value at the prediction time is unknown and the error cannot be calculated, directly using the weights of all historical training data may have the risk of information leakage. Considering that the prediction data of each single model in the next h steps depends on the historical injection and production data of the previous k steps, in order to achieve the purpose of multi-step prediction, the weight value ω of each moment in the historical tk time period is calculated it Then, the weight ω of the next t+h steps is introduced i,m+h (i=1,2,3……n;m=1,2,……), m represents the current time, h represents the number of prediction steps. The weight of the next t+h steps is:
[0154]
[0155] Because it is a multi-step prediction, the weights obtained are in matrix form. The shape of the weight matrix for each sample is [h, i], where i represents the number of prediction models.
[0156] For the above process, there is
[0157] S206. Obtain the final prediction results for the next h moments according to the prediction weights of each single prediction model for the next h moments and the predicted injection-production process data of each single prediction model for the next h moments.
[0158] The final prediction result can be expressed as:
[0159]
[0160] Among them, ω i,k+1 represents the prediction weight of the i-th model at time k+1, y i,k+1 represents the predicted injection-production process data of the i-th model at time k+1, Y k+1 represents the final prediction result at time k+1, where k+1 represents any time from the current time to the future time h.
[0161] S207. Based on the final prediction result, an abnormal operating condition warning is issued during the injection and production process.
[0162] in, Figure 3 This is a schematic diagram of the abnormal working condition warning during the injection and production process. Figure 3 As shown, casing pressure and oil pressure belong to wellhead pressure, and the first-level warning threshold of casing pressure is set to 14MPa. The oil pressure values and casing pressure values in the past 10 moments (i.e., 0-9 on the horizontal axis) are historical values, and the casing pressure does not exceed 14MPa, which is a normal working condition. The next three moments (i.e., 10-12 on the horizontal axis) are the final prediction results. It can be seen that the casing pressure data exceeds the threshold at 10-12, and exceeds the oil pressure at the corresponding moment, which is an abnormal working condition, so an early warning is required to enable the staff to take corresponding measures.
[0163] Another multi-step prediction and early warning method for abnormal conditions in the injection and production process of a gas storage reservoir provided by the present application utilizes sine and cosine functions to reflect the periodicity of data changes, thereby avoiding the traditional time series prediction method of constructing features using time-frequency domain indicators and differential indicators while ignoring the importance of timestamp features on the prediction target; secondly, a direct multi-output strategy is adopted to improve the traditional model based on the use of all data to infer the weights of h time steps, and the weights of future h time steps are inferred based on the historical k-step errors of the model, thereby realizing adaptive updating of combined weights, overcoming the limitations of fixed weighting and single-point rolling prediction, and improving the calculation speed and the accuracy of prediction and early warning.
[0164] Figure 4 This is a schematic diagram of the structure of a multi-step prediction and early warning device for abnormal conditions in the injection and production process of a gas storage reservoir provided in an embodiment of the present application. The device of this embodiment can be in the form of software and / or hardware. Figure 4As shown, a multi-step prediction and early warning device 400 for abnormal operating conditions in the injection and production process of a gas storage reservoir provided in an embodiment of the present application includes: an acquisition module 401, a first determination module 402, a second determination module 403, and a third determination module 404.
[0165] The acquisition module 401 is used to acquire historical actual data, historical prediction data of the first model, and historical prediction data of the second model; wherein the historical actual data is the injection and production process data actually collected within a preset historical time period, the first model and the second model are preset algorithm models, both of which are used to predict wellhead pressure data, and the historical prediction data represents the wellhead pressure data predicted within a preset historical time period;
[0166] A first determination module 402 is used to determine the prediction weight of the first model and the prediction weight of the second model according to the historical actual data, the historical prediction data of the first model, and the historical prediction data of the second model; wherein the prediction weight represents the importance of the prediction result obtained by the model, and the prediction result represents the data output by the model;
[0167] A second determination module 403 is used to determine the prediction result of the first model and the prediction result of the second model according to the historical actual data;
[0168] The third determination module 404 is used to determine the target injection and production data according to the prediction results of the first model, the prediction results of the second model, the prediction weight of the first model, and the prediction weight of the second model; wherein the target injection and production data is the wellhead pressure data to be predicted, which is used to warn of abnormal working conditions.
[0169] In one example, the first determining module 402 includes:
[0170] A first determining unit is used to determine residual data of the first model at a time point according to historical actual data at each time point and historical predicted data of the first model at each time point; wherein the residual data represents the difference between the historical actual data and the historical predicted data;
[0171] A second determining unit is used to determine the residual data of the second model at a time point according to the historical actual data at each time point and the historical predicted data of the second model at each time point;
[0172] The third determination unit is used to determine the prediction weight of the first model and the prediction weight of the second model according to the residual data of the first model at each time point and the residual data of the second model at each time point.
[0173] In one example, the third determining unit is specifically configured to:
[0174] Determine the historical weight of the first model at a time point and the historical weight of the second model at a time point according to the residual data of the first model at each time point and the residual data of the second model at each time point;
[0175] The prediction weight of the first model and the prediction weight of the second model are determined according to the historical weight of the first model at each time point and the historical weight of the second model at each time point.
[0176] In one example, the third determining unit is specifically configured to:
[0177]
[0178] Among them, x1 represents the historical weight of the first model at a point in time, x2 represents the historical weight of the second model at a point in time, y1 represents the residual data of the first model at a point in time, and y2 represents the residual data of the second model at a point in time.
[0179] In one example, the acquisition module 401 includes:
[0180] The first acquisition unit is used to acquire the initial injection and production data within a preset historical time period collected by the data acquisition device; wherein the data acquisition device is used to collect data on the gas storage reservoir, and the initial injection and production data includes injection and production time, gas production pressure, gas production temperature, gas injection pressure and gas injection temperature;
[0181] A fourth determination unit is used to determine the sine and cosine characteristics according to the time data; wherein the sine and cosine characteristics represent the periodicity of the injection and production process;
[0182] A obtaining unit is used to perform normalization processing on the initial injection and production data to obtain normalized data;
[0183] The fifth determining unit is used to determine the historical actual data according to the normalized data.
[0184] In one example, the acquisition module 401 includes:
[0185] A second acquisition unit, used to acquire a preset first initial model and a preset second initial model;
[0186] A sixth determination unit, used to determine the hyperparameters of the preset first initial model and the hyperparameters of the preset second initial model according to the historical injection and production data; wherein the hyperparameters are indicators that affect the performance of the model;
[0187] The seventh determination unit is used to determine the first model according to the preset hyperparameters of the first initial model, and to determine the second model according to the preset hyperparameters of the second initial model.
[0188] In a possible implementation manner, the sixth determining unit is specifically configured to:
[0189] Get the preset hyperparameter range;
[0190] According to the preset hyperparameter range and historical injection and production data, the preset hyperparameters of the first initial model are obtained.
[0191] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 50 includes:
[0192] The electronic device 50 may include a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, a communication component 503 and other components. The processor 501 , the memory 502 and the communication component 503 are connected via a bus 504 .
[0193] In the specific implementation process, at least one processor 501 executes the computer execution instructions stored in the memory 502, so that at least one processor 501 executes the above-mentioned method for multi-step prediction and early warning of abnormal operating conditions in the injection and production process of a gas storage reservoir.
[0194] In the above Figure 5 In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0195] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0196] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0197] In some embodiments, a computer program product is also proposed, including a computer program or instructions, which, when executed by a processor, implements the steps in any of the above-mentioned methods for multi-step prediction and early warning of abnormal operating conditions in the injection and production process of a gas storage reservoir.
[0198] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0199] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0200] To this end, an embodiment of the present application provides a computer-readable storage medium, which stores multiple instructions, which can be loaded by a processor to execute the steps of any one of the methods for multi-step prediction and early warning of abnormal conditions in the injection and production process of a gas storage facility provided in the embodiments of the present application.
[0201] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0202] According to one aspect of the present application, a computer program product or a computer program is provided. The computer program product or the computer program comprises computer instructions stored in a computer-readable storage medium.
[0203] Since the instructions stored in the storage medium can execute the steps of a method for multi-step prediction and early warning of abnormal conditions in the injection and production process of a gas storage reservoir provided in an embodiment of the present application, the beneficial effects that can be achieved by any method for multi-step prediction and early warning of abnormal conditions in the injection and production process of a gas storage reservoir provided in the embodiments of the present application can be achieved. For details, please refer to the previous embodiments and will not be repeated here.
[0204] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0205] It should be further noted that, although the various steps in the flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flow chart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0206] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0207] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0208] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not specifically stated, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.
[0209] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0210] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0211] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0212] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A multi-step prediction and early warning method for abnormal conditions in the injection and production process of a gas storage reservoir, characterized in that: include: Acquire historical actual data, historical predicted data of the first model, and historical predicted data of the second model; wherein the historical actual data is the injection and production process data actually collected within a preset historical time period, the first model and the second model are preset algorithm models, both of which are used to predict wellhead pressure data, and the historical predicted data represents the wellhead pressure data predicted within the preset historical time period; Determine the prediction weight of the first model and the prediction weight of the second model according to the historical actual data, the historical prediction data of the first model, and the historical prediction data of the second model; wherein the prediction weight represents the importance of the prediction result obtained by the model, and the prediction result represents the data output by the model; Determining the prediction result of the first model and the prediction result of the second model according to the historical actual data; The target injection and production data is determined according to the prediction results of the first model, the prediction results of the second model, the prediction weight of the first model, and the prediction weight of the second model; wherein the target injection and production data is the wellhead pressure data to be predicted, which is used to warn of abnormal working conditions.
2. The method according to claim 1, characterized in that The preset historical time period includes multiple time points; determining the prediction weight of the first model and the prediction weight of the second model according to the historical actual data, the historical prediction data of the first model, and the historical prediction data of the second model, includes: Determine the residual data of the first model at each time point according to the historical actual data at each time point and the historical predicted data of the first model at each time point; wherein the residual data represents the difference between the historical actual data and the historical predicted data; Determine the residual data of the second model at each time point according to the historical actual data at each time point and the historical prediction data of the second model at each time point; Determine the prediction weight of the first model and the prediction weight of the second model based on the residual data of the first model at each time point and the residual data of the second model at each time point.
3. The method according to claim 2, characterized in that The determining, according to the residual data of the first model at each time point and the residual data of the second model at each time point, the prediction weight of the first model and the prediction weight of the second model, comprises: Determine, according to the residual data of the first model at each time point and the residual data of the second model at each time point, the historical weight of the first model at the time point and the historical weight of the second model at the time point; The prediction weight of the first model and the prediction weight of the second model are determined according to the historical weight of the first model at each time point and the historical weight of the second model at each time point.
4. The method according to claim 3, characterized in that: The historical weight of the first model at the time point and the historical weight of the second model at the time point can be expressed as: Among them, x1 represents the historical weight of the first model at the time point, x2 represents the historical weight of the second model at the time point, y1 represents the residual data of the first model at the time point, y2 represents the residual data of the second model at the time point, min represents the determination The minimum value of .
5. The method according to claim 1, characterized in that The obtaining of historical actual data includes: Acquire initial injection and production data within a preset historical time period collected by a data acquisition device; wherein the data acquisition device is used to collect data on the gas storage reservoir, and the initial injection and production data includes injection and production time, gas production pressure, gas production temperature, gas injection pressure and gas injection temperature; Determine sine and cosine characteristics according to the time data; wherein the sine and cosine characteristics represent the periodicity of the injection and production process; Normalizing the initial injection-production data to obtain normalized data; The historical actual data is determined based on the normalized data.
6. The method according to claim 1, characterized in that Also includes: Obtaining a preset first initial model and a preset second initial model; Determining, according to the historical injection and production data, the hyperparameters of the preset first initial model and the hyperparameters of the preset second initial model; wherein the hyperparameters are indicators that affect model performance; The first model is determined according to the preset hyperparameters of the first initial model, and the second model is determined according to the preset hyperparameters of the second initial model.
7. The method according to claim 6, characterized in that Determining the hyper parameters of the preset first initial model according to the historical injection and production data includes: Get the preset hyperparameter range; The preset hyperparameters of the first initial model are obtained according to the preset hyperparameter range and the historical injection and production data.
8. A multi-step prediction and early warning device for abnormal conditions in the injection and production process of a gas storage reservoir, characterized in that: include: An acquisition module, used to acquire historical actual data, historical predicted data of the first model, and historical predicted data of the second model; wherein the historical actual data is the injection and production process data actually collected within a preset historical time period, the first model and the second model are preset algorithm models, both of which are used to predict wellhead pressure data, and the historical predicted data represents the wellhead pressure data predicted within a preset historical time period; A first determination module, configured to determine a prediction weight of the first model and a prediction weight of the second model according to the historical actual data, the historical prediction data of the first model, and the historical prediction data of the second model; wherein the prediction weight represents the importance of the prediction result obtained by the model, and the prediction result represents the data output by the model; A second determination module, used to determine the prediction result of the first model and the prediction result of the second model according to the historical actual data; The third determination module is used to determine the target injection and production data according to the prediction results of the first model, the prediction results of the second model, the prediction weight of the first model, and the prediction weight of the second model; wherein the target injection and production data is the wellhead pressure data to be predicted, which is used to warn of abnormal operating conditions.
9. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the electronic device executes a multi-step prediction and early warning method for abnormal operating conditions in the injection and production process of a gas storage reservoir as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement a multi-step prediction and early warning method for abnormal operating conditions in the injection and production process of a gas storage facility as described in any one of claims 1 to 7.