Gas well foam drainage system optimization method and device based on genetic algorithm and time sequence model

By combining genetic algorithms with time-series models, the optimal bubble-drainage date is predicted using the Prophet bubble-drainage time-series model, and the optimal bubble-drainage regime is obtained. This solves the problems of empiricism and strict data selection requirements in traditional methods, and achieves accurate and efficient optimization of gas well bubble-drainage regime, reducing costs and improving gas production efficiency.

CN120822643APending Publication Date: 2025-10-21PETROCHINA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410433861.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-11
Publication Date
2025-10-21

AI Technical Summary

Technical Problem

Traditional gas well bubble drainage system optimization methods have problems such as empiricism, cumbersome implementation process, and strict data selection requirements, which result in the inability to accurately and efficiently solve the bubble drainage system optimization problem.

Method used

A method based on genetic algorithm and time series model is adopted. The optimal bubble discharge date is predicted by Prophet bubble discharge time series model, and the optimal bubble discharge regime is obtained by using genetic algorithm. Combined with gas well production data and regime data, accurate and efficient bubble discharge regime optimization is achieved.

Benefits of technology

It enables accurate and efficient optimization of the bubble drainage system at low cost, reducing time and labor costs and improving gas extraction efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120822643A_ABST
    Figure CN120822643A_ABST
Patent Text Reader

Abstract

The invention discloses a gas well foam drainage system optimization method and device based on a genetic algorithm and a time sequence model, and the method comprises the steps: obtaining historical production data and historical system data of a gas well, and carrying out the preprocessing of the historical production data and the historical system data, and obtaining the data which are subjected to foam drainage and the data which are not subjected to foam drainage; performing prediction by adopting a Prophet-based foam scrubbing time sequence model according to the foam scrubbing data to obtain an optimal foam scrubbing date; according to the constraint conditions of the parameters needing to be optimized, the genetic algorithm is adopted, the maximum water yield serves as the target, and the optimal foam drainage system is obtained through optimization; and calculating other related parameters according to a result obtained by optimization to obtain a final optimal foam drainage system result. According to the method, a Prophet-based foam drainage time sequence model prediction method is adopted, so that a result more conforming to a historical well condition can be better predicted, and the actual condition is more conformed; and the optimal foam drainage system is found by adopting a genetic algorithm optimization method, so that the foam drainage system optimization problem can be accurately and efficiently solved at low cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of gas well foam drainage and gas production technology, and in particular to a gas well foam drainage system optimization method and device based on a genetic algorithm and a time series model. Background Art

[0002] Foam drainage gas recovery involves adding a foaming agent to a gas well. A certain amount of foaming agent is injected into the well. When the accumulated water at the bottom of the well contacts the foaming agent, the natural gas flow stirs it, generating a large amount of low-density, aqueous foam. This foam is carried from the bottom of the well to the surface by the airflow, effectively removing the accumulated liquid. However, the proper injection system for the foaming agent directly affects the efficiency of the gas recovery process. If the foaming agent injection concentration is too low, the gas-water two-phase flow pattern in the wellbore will not be improved. If the injection concentration is too high, the wellbore pressure drop will increase, making surface defoaming difficult and generating high back pressure in the separator.

[0003] There are currently several methods for optimizing the bubble drainage system in gas wells: (1) Directly determine the adjustment of the bubble drainage system based on experience. (2) First, use a conventional time series model to predict the water production of the gas well, and then adjust the bubble drainage system based on the prediction results to keep the concentration of the bubble drainage agent constant. (3) Use wellhead temperature, transient curves, and field sampling to explore the bubble return time of the gas well, and then use flow pressure testing to understand the water production pattern of the gas well, so as to optimize the timing of drug addition and improve the bubble drainage efficiency.

[0004] However, these existing methods have several problems. First, the first method, relying solely on experience, can lead to incorrect decisions. Second, for gas wells with large fluctuations in water production, the second method requires very high data selection. Finally, the third method is relatively cumbersome in actual implementation and also suffers from the problem of empiricism. Consequently, these existing methods cannot accurately and efficiently solve the problem of optimizing the bubble drainage system. Summary of the Invention

[0005] The technical problem to be solved by the present invention is that the traditional gas well bubble drainage system optimization method has the problems of empiricism, cumbersome implementation process, and strict data selection requirements, which makes it impossible to accurately and efficiently solve the bubble drainage system optimization problem. The purpose of the present invention is to provide a gas well bubble drainage system optimization method and device based on genetic algorithm and time series model, and adopt time series prediction and genetic optimization methods to accurately and efficiently predict the optimal bubble drainage system for a certain time period. Specifically, the bubble drainage time series model prediction method based on Prophet can better predict results that are more in line with historical well conditions and more in line with actual conditions. The subsequent use of genetic algorithm optimization method to find the optimal bubble drainage system can accurately, efficiently and at low cost solve the bubble drainage system optimization problem, and ultimately achieve the purpose of reducing costs and increasing efficiency.

[0006] The present invention is achieved through the following technical solutions:

[0007] In a first aspect, the present invention provides a method for optimizing a gas well bubble drainage system based on a genetic algorithm and a time series model, the method comprising:

[0008] Obtaining historical production data and historical system data of the gas well, and preprocessing the historical production data and historical system data to obtain bubbled and non-bubbled data;

[0009] According to the data of the existing drainage, the drainage time series model based on Prophet is used to predict and obtain the optimal drainage date;

[0010] According to the constraints of the parameters to be optimized, the genetic algorithm is used to optimize the optimal bubble drainage system with the goal of maximizing water production.

[0011] Based on the optimization results, other relevant parameters are calculated to obtain the final optimal bubble drainage system result.

[0012] Furthermore, historical production data includes date, casing pressure, oil pressure, daily gas production and daily water production;

[0013] The historical system data include time, amount of treatment agent added, dilution ratio of treatment agent to aqueous solution, pumping speed of diluted agent and circulation time.

[0014] Furthermore, the historical production data and historical system data are pre-processed to obtain the pre-soaked data and the un-soaked data, including:

[0015] Preprocess the historical production data: use linear filling to process the empty values ​​in the historical production data to obtain the preprocessed historical production data;

[0016] Preprocess the historical system data, specifically:

[0017] Find the system data corresponding to each well from the original table, and find the earliest date in the system data corresponding to each well, that is, the date when the drainage starts;

[0018] The pre-processed historical production data is divided into soaked data and unsoaked data according to the soaking start date, and the unsoaked data is discarded;

[0019] Using the date as the index, the system data of each well for the period of time that is missing is copied downward using the data of the last system adjustment to obtain the complete system data after bubble drainage.

[0020] Furthermore, the expression of the Prophet-based bubble row timing model is:

[0021] y(t)=g(t)+s(t)+h(t)+∈ (t)

[0022] Where g(t) represents the trend term, which represents the non-periodic variation trend of casing pressure, oil pressure, gas production, and water production indexed by time series of the flushed data.

[0023] s(t) represents the periodic term, or seasonal term, which is generally expressed in weeks or years. It represents the weekly, monthly, and annual trends of the four components of the pumped data: casing pressure, oil pressure, gas production, and water production (the period used in this invention is 30 days).

[0024] h(t) represents the holiday term, which indicates the impact of holidays with non-fixed periods on the predicted value in the time period of the data.

[0025] ∈ (t) It represents the error term or residual term, which represents the fluctuation that the model has not predicted on the row data, and it follows a Gaussian distribution;

[0026] The Prophet-based bubble-price time series model fits the trend term, cycle term, holiday term and error term, and accumulates them to obtain the predicted value of the time series, that is, the optimal bubble-price date.

[0027] Furthermore, the parameters that need to be optimized include circulation time, per-well usage, configuration ratio and actual pump displacement.

[0028] Furthermore, according to the constraints of the parameters to be optimized, a genetic algorithm is used to optimize the optimal bubble drainage system with the goal of maximizing water production. The specific optimization steps are as follows:

[0029] Population initialization: A solution is generated randomly based on the constraints, using the cycle time, per-well dosage, configuration ratio, and actual pump displacement as a solution. A chromosome is encoded as a genotype in binary, which is then converted to a decimal phenotype.

[0030] Calculate individual fitness: take the maximum water production as the objective function, and use the objective function value directly as the individual fitness;

[0031] Selection: First, individuals that do not meet the conditions are screened out and removed from the population; then, individuals with high fitness are selected using a roulette wheel method. The roulette wheel method uses a probability proportional to fitness to determine the number of genes each individual inherits into the next generation.

[0032] Crossover: First, a random crossover point is generated, and then a crossover probability is used to determine whether to perform a crossover. If a crossover is performed, the genes in the two chromosomes are exchanged to produce a new individual.

[0033] Mutation: A certain probability is used to determine whether to perform a mutation. If a mutation occurs, the binary gene bit of the randomly generated mutation point is reversed.

[0034] Termination judgment: If the number of iterations is reached, the algorithm is terminated, otherwise it returns to the step of calculating individual fitness.

[0035] Furthermore, with the goal of maximizing water production, the objective function is a function fitted by random forest using the previously processed foamed drainage data and the cycle time, per-well usage, configuration ratio, and actual pump displacement in the system as x and water production as y.

[0036] Furthermore, the calculation formulas for other relevant parameters are:

[0037] Total foaming agent usage = the sum of daily treatment agent usage per well on a platform;

[0038] Injection volume of a single well = (configuration ratio + 1) * dosage per well;

[0039] Total fluid volume injected = the sum of the injection volumes of each well on a platform;

[0040] Calculate pump displacement = total liquid volume injected / 24;

[0041] Filling time = (injection volume / ((24*60) / total circulation time)) / actual pump displacement of a single well)*60;

[0042] Total filling time = the sum of filling time for each well on a platform;

[0043] Stop filling time = cycle time - total filling time.

[0044] In a second aspect, the present invention further provides a gas well bubble discharge system optimization device based on a genetic algorithm and a time series model, the device using the above-mentioned gas well bubble discharge system optimization method based on a genetic algorithm and a time series model; the device comprises:

[0045] An acquisition unit is used to acquire historical production data and historical system data of the gas well, and pre-process the historical production data and historical system data to obtain bubbled and non-bubbled data;

[0046] The Prophet prediction unit is used to predict the optimal date of the row according to the row data using the Prophet-based row time series model;

[0047] The genetic optimization unit is used to optimize the optimal bubble drainage system based on the constraints of the parameters to be optimized and the maximum water production as the goal;

[0048] The result calculation unit is used to calculate other relevant parameters according to the result obtained by optimization, and obtain the final optimal bubble discharge system result.

[0049] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for optimizing the gas well bubble drainage system based on the genetic algorithm and the timing model is implemented.

[0050] In a fourth aspect, the present invention further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned gas well bubble drainage system optimization method based on genetic algorithm and timing model.

[0051] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0052] 1. The present invention utilizes a genetic algorithm and time series model-based method and device for optimizing gas well bubble drainage systems. This method fully utilizes gas well production and system data, employing time series prediction and genetic optimization methods to accurately and efficiently predict the optimal bubble drainage system for a specific time period. Specifically, the Prophet-based bubble drainage time series model prediction method can better predict results that are more consistent with historical well conditions and more realistic. Subsequent genetic algorithm optimization is used to find the optimal bubble drainage system, enabling accurate, efficient, and cost-effective solutions to bubble drainage system optimization.

[0053] 2. Compared with the traditional method of optimizing the bubble drainage system, the method of the present invention does not rely on experience to determine the system, but uses genetic algorithms and Prophet models to accurately and efficiently predict which bubble drainage system will be the best on a certain day within a period of time.

[0054] 3. The method of the present invention has strong data compatibility, has better data processing capabilities for various problems of original data, is more suitable for actual production conditions, can greatly reduce time costs and labor costs, and achieve the goal of reducing costs and increasing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:

[0056] Figure 1 The process of the gas well bubble drainage system optimization method based on genetic algorithm and time series model of the present invention Figure 1 ;

[0057] Figure 2 The process of the gas well bubble drainage system optimization method based on genetic algorithm and time series model of the present invention Figure 2 ;

[0058] Figure 3It is the genetic algorithm flow chart of the present invention;

[0059] Figure 4 This is a structural block diagram of the gas well bubble discharge system optimization device based on genetic algorithm and timing model of the present invention. DETAILED DESCRIPTION

[0060] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with examples and drawings. The exemplary embodiments of the present invention and their descriptions are only used to explain the present invention and are not intended to limit the present invention.

[0061] Traditional gas well bubble drainage system optimization methods have problems such as empiricism, cumbersome implementation process, and strict data selection requirements, which make it impossible to accurately and efficiently solve the bubble drainage system optimization problem.

[0062] The present invention designs a method and device for optimizing the bubble drainage system of a gas well based on a genetic algorithm and a time series model. It uses time series prediction and genetic optimization methods to accurately and efficiently predict the optimal bubble drainage system for a certain time period. The present invention uses a Prophet-based bubble drainage time series model prediction method to better predict results that are more consistent with historical well conditions and more in line with actual conditions. The subsequent use of a genetic algorithm optimization method to find the optimal bubble drainage system can accurately, efficiently, and cost-effectively solve the bubble drainage system optimization problem, ultimately achieving the goal of reducing costs and increasing efficiency. The method and device of the present invention can accurately, efficiently, and cost-effectively predict the optimal bubble drainage system based on the production data and system data of the gas well.

[0063] Example 1

[0064] like Figure 1 and Figure 2 As shown, the present invention is based on a genetic algorithm and a time series model to optimize the gas well bubble drainage system. The method includes:

[0065] Step 1: Obtain historical production data and historical system data of the gas well, and pre-process the historical production data and historical system data to obtain bubbled and non-bubbled data;

[0066] In this embodiment, the historical production data includes date, casing pressure, oil pressure, daily gas production and daily water production;

[0067] The historical system data include time, amount of treatment agent added, dilution ratio of treatment agent to aqueous solution, pumping speed of diluted agent and circulation time.

[0068] During the specific implementation, some historical production data of three wells on a certain platform are shown in Tables 1 to 3; the historical system data of three wells on a certain platform are shown in Table 4.

[0069] Table 1 Part of the historical production data of a well on a certain platform

[0070]

[0071]

[0072] Table 2 Partial historical production data of Well 2 on a certain platform

[0073]

[0074]

[0075] Table 3 Partial historical production data of Well 3 on a certain platform

[0076]

[0077] Table 4 Historical system data of three wells on a certain platform

[0078]

[0079]

[0080] In this embodiment, historical production data and historical system data are pre-processed to obtain pre-sorted data and un-pre-sorted data, including:

[0081] Preprocess the historical production data: use linear filling to process the empty values ​​in the historical production data to obtain the preprocessed historical production data;

[0082] Preprocess the historical system data, specifically:

[0083] Find the system data corresponding to each well from the original table, and find the earliest date in the system data corresponding to each well, that is, the date when the drainage starts;

[0084] The pre-processed historical production data is divided into soaked data and unsoaked data according to the soaking start date, and the unsoaked data is discarded;

[0085] Since the system is adjusted once in a period of time, the system data of each well with the missing period is copied downward using the data of the last system adjustment with the date as the index to obtain the complete system data after bubble drainage, in preparation for the objective function used in the subsequent genetic algorithm optimization.

[0086] It should be noted that the unsoaked data does not have institutional data and cannot be used to fit the objective function because the soaking has not yet begun. Furthermore, since the time series forecast results must be consistent with or even better than the current situation, and the unsoaked data is relatively old and of little reference value, it is discarded and only the soaked data will be used for subsequent forecasts.

[0087] Step 2: Based on the existing soaking data, a Prophet-based soaking time series model is used to predict and obtain the optimal soaking date;

[0088] In this embodiment, the data of the past month in the production data is taken (that is, the data of the most recent month that has been soaked, and the predicted results are more in line with the current situation), and the soaking time series model based on Prophet is used for prediction to obtain the optimal soaking date, which serves as the basis for obtaining the optimal soaking result later.

[0089] Specifically, Prophet is an open-source time series forecasting algorithm developed by Facebook. It can effectively process holiday information and fit the changing trends of time series data by week, month, and year. Prophet works well for historical data with strong cyclical characteristics. It can handle outliers in time series and also handle cases with missing values.

[0090] The expression of the Prophet-based bubble row timing model of the present invention is:

[0091] y(t)=g(t)+s(t)+h(t)+∈ (t)

[0092] Where g(t) represents the trend term, which represents the non-periodic variation trend of casing pressure, oil pressure, gas production, and water production indexed by time series of the flushed data.

[0093] s(t) represents the periodic term, or seasonal term, which is generally expressed in weeks or years. It represents the weekly, monthly, and annual trends of the four components of the pumped data: casing pressure, oil pressure, gas production, and water production (the period used in this invention is 30 days).

[0094] h(t) represents the holiday term, which indicates the impact of holidays with non-fixed periods on the predicted value in the time period of the data.

[0095] ∈ (t) It represents the error term or residual term, which represents the fluctuation that the model has not predicted on the row data, and it follows a Gaussian distribution;

[0096] The Prophet-based bubble-price time series model fits the trend term, cycle term, holiday term and error term, and accumulates them to obtain the predicted value of the time series, that is, the optimal bubble-price date.

[0097] There are two important functions in the Prophet-based bubble sequence model:

[0098] 1. The "make_future_dataframe" function is used to create a DataFrame object for a future time point or date range. Its function is to generate a time series index for future predictions. Here it is used to fit the pre-sorted data and generate the corresponding data frame.

[0099] 2. The "predict" function is a method used to predict future data. It has functions such as generating future prediction values, providing uncertainty ranges, and batch prediction. Here, the "predict" function is used to obtain the production data prediction result data frame, and finally the predicted value of the production data can be obtained.

[0100] Step 3: Based on the constraints of the parameters to be optimized, a genetic algorithm is used to optimize the optimal bubble drainage system with the goal of maximizing water production.

[0101] In this embodiment, the parameters to be optimized include cycle time, usage per well, configuration ratio, and actual pump displacement.

[0102] In this embodiment, the constraints include:

[0103] (1) 90 min < cycle time < 180 min, and the cycle time is divisible by 24 h * 60 min;

[0104] (2) 1*average daily water production < per-well water consumption < 3*average daily water production, where the average daily water production refers to the data for the most recent month after drainage;

[0105] (3) 0< configuration ratio < 40;

[0106] (4) 15<actual pump displacement<30;

[0107] (5) 48 < minimum usage per well * (configuration ratio + 1) < 360.

[0108] In this embodiment, the goal is to maximize water production. The objective function uses the previously processed foaming data and the cycle time, per-well usage, configuration ratio, and actual pump displacement in the system as x, and water production as y, and uses a random forest fitting function.

[0109] Specifically, the genetic algorithm starts from the initial population and adopts the natural law of survival of the fittest to select individuals, and then produces a new generation of populations through hybridization and mutation, and evolves generation by generation until the goal is met. The basic concepts of the genetic algorithm include:

[0110] Individual (chromosome): A chromosome represents the solution to a problem and contains several genes;

[0111] Gene: A gene represents a decision variable in the solution of the problem;

[0112] Population: Multiple individuals constitute a population, that is, multiple sets of solutions to a problem constitute a population of solutions;

[0113] Fitness function: The fitness function is a function used to measure the environmental adaptability of each individual in a population, that is, "survival of the fittest", which is the main basis for genetic algorithms to achieve survival of the fittest;

[0114] Genetic operations: mainly refer to operations that generate new populations, including selection, crossover, and mutation.

[0115] In this embodiment, according to the constraints of the parameters to be optimized, a genetic algorithm is used to maximize the water production to find the optimal bubble drainage system, such as Figure 3 , the specific optimization steps using genetic algorithm are:

[0116] a) Population initialization: A solution is generated randomly based on the constraints, using the cycle time, per-well dosage, configuration ratio, and actual pump displacement as a solution. A chromosome is encoded as a genotype in binary, which is then converted to a decimal phenotype.

[0117] b) Calculate individual fitness: Take the maximum water production as the objective function, and use the objective function value directly as the individual fitness;

[0118] c) Selection: First, individuals that do not meet the conditions are screened out and removed from the population. Then, individuals with high fitness are selected using a roulette wheel method. The roulette wheel method determines the number of genes each individual inherits into the next generation of the population based on a probability proportional to fitness.

[0119] d) Crossover: Crossover is the main way for a population to produce new individuals. First, a random crossover point is generated, and then a crossover probability is used to decide whether to perform a crossover. If a crossover is performed, the genes in the two chromosomes involved in the crossover are exchanged to produce a new individual.

[0120] e) Mutation: Mutation is also a way for a population to generate new individuals. Mutation is determined by a certain probability. If a mutation occurs, the binary gene bit of the randomly generated mutation point is reversed.

[0121] f) Termination judgment: If the number of iterations is reached, the algorithm is terminated, otherwise return to step b).

[0122] Step 4: Calculate other relevant parameters (including total foaming agent dosage, single well injection fluid volume, total injection fluid volume, calculated pump displacement, injection time, total injection time, and injection stop time) based on the optimization results. Finally, the parameters obtained from the optimization and the other calculated relevant parameters are used to form the final optimal foaming and drainage system results for each well.

[0123] Specifically, the calculation formulas for other relevant parameters are:

[0124] Total foaming agent usage = the sum of daily treatment agent usage per well on a platform;

[0125] Injection volume of a single well = (configuration ratio + 1) * dosage per well;

[0126] Total fluid volume injected = the sum of the injection volumes of each well on a platform;

[0127] Calculate pump displacement = total liquid volume injected / 24;

[0128] Filling time = (injection volume / ((24*60) / total circulation time)) / actual pump displacement of a single well)*60;

[0129] Total filling time = the sum of filling time for each well on a platform;

[0130] Stop filling time = cycle time - total filling time.

[0131] The above technical solutions provide an optimization result table for a certain platform, that is, the final optimal bubble discharge system result is shown in Table 5.

[0132] Table 5 Optimization results

[0133]

[0134] The present invention has the following beneficial effects:

[0135] (1) Compared with the traditional method of optimizing the bubble drainage system, the method of the present invention does not rely on experience to determine the system, but uses genetic algorithms and Prophet models to accurately and efficiently predict which bubble drainage system will be the best on a certain day within a period of time.

[0136] (2) The method of the present invention has strong data compatibility and good data processing capabilities for various problems of original data. It is more suitable for actual production conditions and can greatly reduce time and labor costs, thereby achieving the goal of reducing costs and increasing efficiency.

[0137] Example 2

[0138] like Figure 4 As shown, the difference between this embodiment and embodiment 1 is that this embodiment provides a gas well bubble discharge system optimization device based on a genetic algorithm and a time series model. The device uses the gas well bubble discharge system optimization method based on a genetic algorithm and a time series model in embodiment 1; the device includes:

[0139] An acquisition unit is used to acquire historical production data and historical system data of the gas well, and pre-process the historical production data and historical system data to obtain bubbled and non-bubbled data;

[0140] The Prophet prediction unit is used to predict the optimal date of the row according to the row data using the Prophet-based row time series model;

[0141] The genetic optimization unit is used to optimize the optimal bubble drainage system based on the constraints of the parameters to be optimized and the maximum water production as the goal;

[0142] The result calculation unit is used to calculate other relevant parameters according to the result obtained by optimization, and obtain the final optimal bubble discharge system result.

[0143] The execution process of each unit can be performed according to the process steps of the gas well bubble removal system optimization method based on genetic algorithm and timing model in Example 1, and will not be described in detail in this embodiment.

[0144] At the same time, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the above-mentioned gas well bubble drainage system optimization method based on genetic algorithm and timing model is implemented.

[0145] At the same time, the present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned gas well bubble drainage system optimization method based on genetic algorithm and timing model.

[0146] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0147] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0148] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0149] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0150] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A gas well bubble drainage system optimization method based on genetic algorithm and time series model, characterized in that: The method includes: Acquiring historical production data and historical system data of the gas well, and preprocessing the historical production data and historical system data to obtain bubbled and unbubbled data; According to the already-prepared data, a prediction is made using a Prophet-based preparatory time series model to obtain the optimal preparatory date; According to the constraints of the parameters to be optimized, the genetic algorithm is used to optimize the optimal bubble drainage system with the goal of maximizing water production. Based on the optimization results, other relevant parameters are calculated to obtain the final optimal bubble drainage system result.

2. The method for optimizing the gas well bubble discharge system based on genetic algorithm and time series model according to claim 1, characterized in that: The historical production data includes date, casing pressure, oil pressure, daily gas production and daily water production; The historical system data include time, amount of treatment agent added, dilution ratio of treatment agent to aqueous solution, pumping speed of diluted agent and circulation time.

3. The method for optimizing the gas well bubble discharge system based on genetic algorithm and time series model according to claim 1, characterized in that: Preprocessing the historical production data and historical system data to obtain pre-processed data and unpre-processed data includes: Preprocessing the historical production data: processing the null values ​​in the historical production data by linear filling to obtain preprocessed historical production data; The historical system data is preprocessed as follows: Find the system data corresponding to each well from the original table, and find the earliest date in the system data corresponding to each well, that is, the date when the drainage starts; dividing the pre-processed historical production data into soaked data and unsoaked data according to the soaking start date, and discarding the unsoaked data; Using the date as the index, the system data of each well for the period of time that is missing is copied downward using the data of the last system adjustment to obtain the complete system data after bubble drainage.

4. The method for optimizing the gas well bubble discharge system based on genetic algorithm and time series model according to claim 1, characterized in that: The expression of the Prophet-based bubble row timing model is: y(t)=g(t)+s(t)+h(t)+∈ (t) Where g(t) represents the trend term, which represents the non-periodic variation trend of casing pressure, oil pressure, gas production, and water production indexed by time series of the flushed data. s(t) represents the periodic term, which indicates the changing trend of the casing pressure, oil pressure, gas production and water production of the drainage data in weeks, months and years; h(t) represents the holiday term, which indicates the impact of holidays with non-fixed periods on the predicted value in the time period of the data. ∈ (t) represents the error term, which represents the fluctuation that the model did not predict on the row data, and it follows a Gaussian distribution; The Prophet-based bubble-price time series model fits the trend term, cycle term, holiday term and error term, and accumulates them to obtain the predicted value of the time series, that is, the optimal bubble-price date.

5. The method for optimizing the gas well bubble discharge system based on genetic algorithm and time series model according to claim 1, characterized in that: The parameters that need to be optimized include circulation time, per-well usage, configuration ratio and actual pump displacement.

6. The method for optimizing the gas well bubble discharge system based on genetic algorithm and time series model according to claim 5, characterized in that: According to the constraints of the parameters to be optimized, a genetic algorithm is used to maximize water production to find the optimal bubble drainage system. The specific optimization steps are as follows: Population initialization: A solution is generated randomly based on the constraints, using the cycle time, per-well dosage, configuration ratio, and actual pump displacement as a solution. A chromosome is encoded as a genotype in binary, which is then converted to a decimal phenotype. Calculate individual fitness: take the maximum water production as the objective function, and use the objective function value directly as the individual fitness; Selection: First, individuals that do not meet the conditions are screened out and removed from the population; then individuals with high fitness are selected using a roulette wheel method, where the probability proportional to fitness determines the number of genes each individual inherits into the next generation. Crossover: First, a random crossover point is generated, and then a crossover is determined based on the preset crossover probability. If a crossover is performed, the genes in the two chromosomes are swapped to produce a new individual. Mutation: The preset probability is used to determine whether to perform mutation. If mutation occurs, the binary gene bit of the randomly generated mutation point is reversed; Termination judgment: If the number of iterations is reached, the algorithm is terminated, otherwise it returns to the step of calculating individual fitness.

7. The method for optimizing the gas well bubble discharge system based on genetic algorithm and time series model according to claim 1, characterized in that: The calculation formulas for other relevant parameters are: Total foaming agent usage = the sum of daily treatment agent usage per well on a platform; Injection volume of a single well = (configuration ratio + 1) * dosage per well; Total fluid volume injected = the sum of the injection volumes of each well on a platform; Calculate pump displacement = total liquid volume injected / 24; Filling time = (injection volume / ((24*60) / total circulation time)) / actual pump displacement of a single well)*60; Total filling time = the sum of filling time for each well on a platform; Stop filling time = cycle time - total filling time.

8. A gas well bubble discharge system optimization device based on genetic algorithm and time series model, characterized in that: The device uses the gas well bubble drainage system optimization method based on genetic algorithm and time series model as described in any one of claims 1 to 7; the device includes: An acquisition unit is used to acquire historical production data and historical system data of the gas well, and pre-process the historical production data and historical system data to obtain bubbled and unbubbled data; A Prophet prediction unit is used to predict the optimal date of the withdrawal according to the withdrawal data using a Prophet-based withdrawal time series model; The genetic optimization unit is used to optimize the optimal bubble drainage system based on the constraints of the parameters to be optimized and the maximum water production as the goal; The result calculation unit is used to calculate other relevant parameters according to the result obtained by optimization, and obtain the final optimal bubble discharge system result.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the gas well bubble drainage system optimization method based on genetic algorithm and timing model is implemented as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the gas well bubble drainage system optimization method based on genetic algorithm and timing model is implemented as described in any one of claims 1 to 7.