A method, device and equipment for optimizing gas production in plunger gas wells based on federated learning
Through a federated learning method, the multi-branch deep neural network model and multi-objective optimization algorithm are used to solve the problem of low gas production prediction accuracy of gas wells, and the intelligent and refined management of gas well production is realized to ensure the normal lifting of the plunger gas well.
Patent Information
- Application Number
- CN202510702820.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-05-29
AI Technical Summary
In the prior art, gas production prediction accuracy of gas wells is limited, and the plunger working system lacks personalization and adaptability, making it difficult to cope with complex geological conditions and dynamic production environment.
Using a federated learning-based method, multi-stage cleaning and conversion are obtained by obtaining the plunger cycle data of the gas well, a multi-branch deep neural network model is constructed, and a multi-objective optimization algorithm is combined to generate and iterate the plunger working plan, and finally the optimal plunger working plan is obtained.
The accuracy of gas production prediction of gas wells has been improved, intelligent and refined management of gas well production has been realized, and the normal lifting of plunger gas wells has been ensured.
Smart Images

Figure CN120235080B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of plunger gas well gas production optimization, and in particular to a plunger gas well gas production optimization method, device and equipment based on federated learning. Background Art
[0002] Plunger gas lift is a technology that uses a plunger as a mechanical interface between gas and liquid. Within the formation and casing annulus, reservoir gas pushes the plunger to periodically expel liquid, effectively reducing gas upwelling and liquid backflow, minimizing the "slippage" effect.
[0003] Traditional gas well production prediction methods often rely on empirical models or simple statistical analysis with manual parameter adjustment, often failing to fully tap into the rich information available in big data, resulting in limited prediction accuracy. Furthermore, existing methods for recommending plunger operating schedules are typically based on fixed rules, lacking customization and adaptability, making them difficult to adapt to complex geological conditions and dynamic production environments. In light of this, the present invention provides a method for optimizing plunger gas well production based on federated learning. Summary of the Invention
[0004] The present invention solves the technical problem of limited prediction accuracy of gas production prediction in gas wells in the prior art by providing a method, device and equipment for optimizing gas production in plunger gas wells based on federated learning, and achieves the technical effect of intelligent gas well production.
[0005] In a first aspect, the present invention provides a method for optimizing gas production in a plunger gas well based on federated learning, the method comprising:
[0006] Obtain plunger cycle data for several gas wells, perform multi-stage cleaning and conversion on the plunger cycle data, and obtain sliding window combined plunger cycle gas production data for each gas well. Each gas well belongs to the same gas gathering station, and each gas well corresponds to several sliding window combined plunger cycle gas production data.
[0007] Based on a distributed federated learning framework, a multi-branch deep neural network model is trained using the sliding window of each gas well combined with the plunger cycle gas production data and pressure data to obtain a gas production prediction model.
[0008] Based on the multi-objective optimization algorithm, several plunger working schemes are generated. Based on the periodic gas production under each plunger working scheme output by the gas production prediction model, the plunger working schemes are iterated to finally obtain the optimal plunger working scheme.
[0009] Furthermore, the plunger cycle data is cleaned and transformed in multiple stages, including:
[0010] Obtaining the daily gas production of the gas well, and determining the periodic gas production of the gas well according to the well opening time and daily gas production of each period of the gas well on that day, wherein the plunger cycle data includes the well opening time and periodic gas production;
[0011] According to the frequency distribution of well opening time, the well opening time is screened;
[0012] According to the frequency distribution of periodic gas production, the periodic gas production is screened;
[0013] After the screening is completed, a preset number of plunger cycle data are combined based on the sliding window to obtain the sliding window combined plunger cycle gas production data.
[0014] Furthermore, based on the distributed federated learning framework, the multi-branch deep neural network model is trained by combining the plunger cycle gas production data and pressure data of each gas well with a sliding window to obtain a gas production prediction model, including:
[0015] A horizontal federated learning framework is built using multiple sliding windows and plunger cycle gas production data from each gas well in the same gas gathering station. The framework includes a central server and multiple local clients, with one local client corresponding to each gas well.
[0016] Aggregate in the central server to obtain the global model of the multi-branch deep neural network model;
[0017] A multi-branch deep neural network model is trained based on several sliding window combinations of plunger cycle gas production data and pressure data for each gas well, where the pressure data includes oil pressure, casing pressure, and external transmission pressure.
[0018] When the preset training requirements are met, the multi-branch deep neural network model is used as the gas production prediction model.
[0019] Furthermore, the global model includes:
[0020]
[0021] in, is the global model parameter, is the learning rate, is the number of local clients, For local clients The number of data samples, is the sum of the number of data samples of all local clients, For local clients The local loss function About Global Model Parameters gradient.
[0022] Furthermore, the loss training function of the multi-branch deep neural network model includes:
[0023]
[0024] in, is the loss training function of the multi-branch deep neural network model, is the total number of samples input into the multi-branch deep neural network model, For the The actual gas production of the samples, For the The predicted gas production of each sample.
[0025] Furthermore, several plunger working schemes are generated based on the multi-objective optimization algorithm, including:
[0026] According to the number of gas wells in the gas gathering station, the population size, crossover rate and mutation rate are determined, including:
[0027]
[0028] in, is the number of gas wells in the gas gathering station, is the population size, is the crossover rate, is the mutation rate;
[0029] After obtaining the population size, adjustments are made based on the preset time length to obtain 3N types of plunger working schemes.
[0030] Furthermore, based on the periodic gas production under each plunger working scheme output by the gas production prediction model, the plunger working scheme is iterated to finally obtain the optimal plunger working scheme, including:
[0031] S131, average pressure data corresponding to the gas production data of the piston cycle of each sliding window combination;
[0032] S132, after splicing the average pressure data with the plunger working plan, input them into the gas production prediction model to obtain the cycle gas production under each spliced plunger working plan;
[0033] S133, retaining the plunger working plan before the preset position, and re-performing cross-matching and mutation to obtain a new plunger working plan;
[0034] S134, repeating steps S132-S133, when the number of consecutive iterations reaches a preset number and the periodic gas production corresponding to the plunger working scheme does not increase, the optimal plunger working scheme is obtained.
[0035] Furthermore, when the optimal plunger working scheme is applied, the method further includes:
[0036] Calculate the load factor at the time of well opening;
[0037] If the load factor at the time of well opening is greater than or equal to the mean load factor, the well is opened; if it is less than, the well is shut in. The mean load factor includes:
[0038]
[0039] in, is the mean value of the load factor, is the number of cycles, For the Casing pressure per cycle, For the Oil pipe pressure per cycle, For the The line pressure for each cycle.
[0040] In a second aspect, the present invention provides a plunger gas well gas production optimization device based on federated learning, the device comprising:
[0041] The data acquisition module is used to obtain the plunger cycle data of several gas wells and perform multi-stage cleaning and conversion on the plunger cycle data to obtain the sliding window combined plunger cycle gas production data of each gas well. Each gas well belongs to the same gas gathering station and corresponds to several sliding window combined plunger cycle gas production data.
[0042] The model training module is used to train a multi-branch deep neural network model based on a distributed federated learning framework, combining plunger cycle gas production data and pressure data of each gas well with a sliding window to obtain a gas production prediction model;
[0043] The scheme generation module is used to generate several plunger working schemes based on the multi-objective optimization algorithm, and iterate the plunger working schemes based on the periodic gas production under each plunger working scheme output by the gas production prediction model, and finally obtain the optimal plunger working scheme.
[0044] In a third aspect, the present invention provides an electronic device, comprising:
[0045] processor;
[0046] a memory for storing processor-executable instructions;
[0047] The processor is configured to execute to implement a plunger gas well gas production optimization method based on federated learning provided in the first aspect.
[0048] One or more technical solutions provided in the present invention have at least the following technical effects or advantages:
[0049] The present invention cleans the data of each plunger gas well, uses the data of multiple gas wells to train a neural network model under federated learning to predict the periodic gas production of each gas well, and uses a multi-objective optimization algorithm combined with a neural network to screen the optimal plunger working plan that meets the conditions. The load coefficient is calculated in the actual process to ensure the normal lifting of the plunger gas well. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0051] Figure 1 A schematic flow chart of a method for optimizing gas production in a plunger gas well based on federated learning provided by the present invention;
[0052] Figure 2 A schematic flow chart of another method for optimizing gas production in a plunger gas well based on federated learning provided by the present invention;
[0053] Figure 3 A schematic diagram of a process for generating a plunger working scheme provided by the present invention;
[0054] Figure 4 This is a schematic diagram of the iterative predicted gas production provided by the present invention. DETAILED DESCRIPTION
[0055] The embodiment of the present invention solves the technical problem of limited prediction accuracy of gas production prediction of gas wells in the prior art by providing a plunger gas well gas production optimization method based on federated learning.
[0056] The technical solution of the present invention is to solve the above technical problems, and the overall idea is as follows:
[0057] A method for optimizing gas production from plunger gas wells based on federated learning is disclosed. The method comprises: obtaining plunger cycle data of several gas wells, and performing multi-stage cleaning and conversion on the plunger cycle data to obtain sliding window combined plunger cycle gas production data of each gas well, wherein each gas well belongs to the same gas gathering station and corresponds to several sliding window combined plunger cycle gas production data; based on a distributed federated learning framework, a multi-branch deep neural network model is trained using the sliding window combined plunger cycle gas production data and pressure data of each gas well to obtain a gas production prediction model; based on a multi-objective optimization algorithm, several plunger working schemes are generated, and based on the periodic gas production under each plunger working scheme output by the gas production prediction model, the plunger working schemes are iterated to ultimately obtain the optimal plunger working scheme.
[0058] In order to better understand the above technical solution, the above technical solution will be described in detail below with reference to the accompanying drawings and specific implementation methods.
[0059] First, the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the associated objects.
[0060] Plunger gas lift is a technology that uses a plunger as a mechanical interface between gas and liquid. Within the formation and casing annulus, reservoir gas pushes the plunger to periodically expel liquid, effectively reducing gas upwelling and liquid backflow, minimizing the "slippage" effect.
[0061] In the fields of mechanical and petroleum engineering, a plunger refers to a tightly fitting solid component that can slide in a pump or pipe to push fluid or isolate different types of fluids.
[0062] The present invention provides Figure 1 The method for optimizing gas production in a plunger gas well based on federated learning shown in FIG. 1 includes steps S11 to S13:
[0063] Step S11, obtaining the plunger cycle data of several gas wells, and performing multi-stage cleaning and conversion on the plunger cycle data to obtain the sliding window combined plunger cycle gas production data of each gas well, wherein each gas well belongs to the same gas gathering station, and each gas well corresponds to several sliding window combined plunger cycle gas production data.
[0064] The plunger cycle data is cleaned and converted in multiple stages, including: obtaining the daily gas production of the gas well, and determining the cycle gas production of the gas well in each cycle of the day based on the well opening time and daily gas production of the gas well, wherein the plunger cycle data includes the well opening time and the cycle gas production; screening the well opening time according to the frequency distribution of the well opening time; screening the cycle gas production according to the frequency distribution of the cycle gas production; after the screening is completed, combining a preset number of plunger cycle data based on the sliding window to obtain the sliding window combined plunger cycle gas production data.
[0065] Plunger cycle data refers to the data of relevant parameters in each working cycle (i.e., a complete up and down stroke) during the plunger gas lift oil and gas production process. Plunger cycle data includes well opening time, well closing time and cycle gas production.
[0066] Typically, a gas well is opened and shut down multiple times in a day, and gas can be produced while it's open. The combination of an open and shut-in period for a gas well can be recorded as a plunger cycle (the opening and shut-in periods for the same well are continuous and non-repeating).
[0067] Usually, the data only records the daily gas production and the gas production rate of the same well does not vary much. Therefore, the daily gas production can be converted into the periodic gas production of the period by calculating the proportion of the well opening time in each cycle to the total well opening time of the day as a weight.
[0068] For the selection of well opening duration, each gas well can be selected based on the frequency distribution of its well opening and closing duration, and those with abnormally long or short opening and closing durations can be excluded. This can be determined based on actual experience, or a threshold can be set to filter out. In addition, the well closing duration can also be selected.
[0069] For the selection of cyclic gas production, each gas well can determine the appropriate cyclic gas production interval based on the frequency distribution of its cyclic gas production, and can directly eliminate abnormally high gas production data generated by only one cycle per day.
[0070] Alternatively, the decision tree-based isolation forest method can be used to identify and remove isolated outliers whose feature distribution differs significantly from that of other periodic data by setting an anomaly score threshold and removing abnormal data. This method allows for the removal of no more than 5% of the total data. By constructing a random tree to assess the degree of anomaly in a data point, it can effectively capture data that deviates from normal patterns in the feature space.
[0071] The preset number can be three, and three consecutive plunger cycle data can be combined to obtain a sliding window combined plunger cycle gas production data. For example, if gas well A has 10 plunger cycle data, the combination method is 1.2.3, 2.3.4, 3.4.5...etc.
[0072] It should be noted that one gas well may correspond to several sliding window combined plunger cycle gas production data.
[0073] In step S12, based on the distributed federated learning framework, the plunger cycle gas production data and pressure data of each gas well are combined with the sliding window to train the multi-branch deep neural network model to obtain a gas production prediction model.
[0074] Specifically, it includes: building a horizontal federated learning framework based on the plunger cycle gas production data of several sliding windows of each gas well in the same gas gathering station, wherein the horizontal federated learning framework includes a central server and multiple local clients, and one gas well corresponds to one local client; performing aggregation in the central server to obtain a global model of the multi-branch deep neural network model; training the multi-branch deep neural network model based on the plunger cycle gas production data and pressure data of several sliding windows of each gas well, wherein the pressure data includes oil pressure, casing pressure and external transmission pressure; when the preset training requirements are met, the multi-branch deep neural network model is used as a gas production prediction model.
[0075] A horizontal federated learning framework is built using the sliding window combination plunger cycle gas production data within the same gas gathering station. The federated learning framework includes a central server and multiple local clients (each gas well represents a local client). Based on the federated learning framework, multi-well data can be effectively utilized to improve prediction accuracy and overcome the problem of insufficient data volume for a single well.
[0076] At the same gas gathering station, each sliding window is combined with the plunger cycle gas production data to set up a local client, train the local model, and aggregate the global model on the central server.
[0077] Global model update parameters Updated by the following formula, including:
[0078]
[0079] in, is the global model parameter, is the learning rate, is the number of local clients, For local clients The number of data samples, is the sum of the number of data samples of all local clients, For local clients The local loss function About Global Model Parameters gradient.
[0080] The main branch of the multi-branch deep neural network model uses a multi-layer perceptron (MLP), which can establish a nonlinear relationship between pressure data and gas production data. The auxiliary branch extracts local temporal features through a temporal convolutional network (TCN) and captures global correlation across cycles through a multi-head self-attention module.
[0081] The MLP includes multiple hidden layers and activation functions to enhance the model's expressiveness and prediction accuracy. The TCN incorporates dilated convolutions, residual connections, activation functions, and more, using a multi-head self-attention module to weightedly fuse the outputs of multiple branches. Pressure and gas production data are processed through forward propagation, and weights are optimized using a backpropagation algorithm.
[0082] The loss training function for the multi-branch deep neural network model includes:
[0083]
[0084] in, is the loss training function of the multi-branch deep neural network model, is the total number of samples input into the multi-branch deep neural network model, For the The actual gas production of the samples, For the The predicted gas production of each sample.
[0085] When the maximum number of training times or accuracy is reached, a multi-branch deep neural network model can be output to obtain a gas production prediction model.
[0086] In step S13, several plunger working schemes are generated based on a multi-objective optimization algorithm, and the plunger working schemes are iterated based on the periodic gas production under each plunger working scheme output by the gas production prediction model, so as to finally obtain the optimal plunger working scheme.
[0087] Figure 3 A flow chart for generating a plunger working plan, where the system is the plunger working plan.
[0088] Several plunger working schemes are generated based on a multi-objective optimization algorithm, including:
[0089] According to the number of gas wells in the gas gathering station, the population size, crossover rate and mutation rate are determined, including:
[0090]
[0091] in, is the number of gas wells in the gas gathering station, is the population size, is the crossover rate, is the mutation rate;
[0092] After obtaining the population size, adjustments are made based on the preset time length to obtain 3N types of plunger working schemes.
[0093] Among them, the population size increases linearly with the number of gas wells in the gas gathering station, and the crossover rate and mutation rate are dynamically adjusted based on the logarithmic function to ensure search efficiency in complex scenarios.
[0094] After generating N types of well opening and closing systems (plunger working plans), the plunger working plans are fine-tuned in terms of time based on the principle of multi-point detection. By increasing or decreasing the preset time length on the original basis (that is, the duration of opening and closing the well is increased by the preset time length at the same time, and decreased by the preset time length at the same time), a total of 3N different plunger working plans are finally obtained. The preset time length can be 5 minutes.
[0095] Based on the periodic gas production under each plunger working scheme output by the gas production prediction model, the plunger working scheme is iterated to finally obtain the optimal plunger working scheme, including:
[0096] S131, average pressure data corresponding to the gas production data of the piston cycle of each sliding window combination;
[0097] S132, combining the average pressure data with the plunger working plan and inputting them into the gas production prediction model to obtain the cycle gas production under each combined plunger working plan;
[0098] S133, retaining the plunger working plan before the preset position, and re-performing cross-matching and mutation to obtain a new plunger working plan;
[0099] S134, repeating steps S132-S133, when the number of consecutive iterations reaches a preset number and the periodic gas production corresponding to the plunger working scheme does not increase, the optimal plunger working scheme is obtained.
[0100] Without modifying the plunger system and without any anomalies, the pressure data for each cycle is relatively close. To ensure well opening safety, the average pressure data for the most recent n cycles can be determined. This average value will be used as part of the input to the gas production prediction model (i.e., the average oil pressure, average casing pressure, and average external pressure for n cycles).
[0101] The above 3N different plunger working schemes are paired with the corresponding average values of pressure data, and the paired data are input into the gas production prediction model for gas production prediction.
[0102] By screening, the plunger working schemes with gas production before the preset position are retained (for example, the top 20%).
[0103] Randomly select the remaining plunger working schemes for cross-matching to generate a new plunger switch well system. Perform mutation operation on the plunger switch well system data after cross-matching, and the mutation rate Keep it under 15% to increase diversity and explore more possible solutions.
[0104] In addition, in order to reduce the difference between the plunger work plan that has not been implemented and the plunger work plan that has been implemented, the time extreme value of the plunger work plan that has not been implemented can be determined by using the historical data mean of the opening and closing time of each cycle of each gas well plus or minus 3 times the variance.
[0105] By predicting gas production and executing iterative cycles of crossover and mutation, the optimal plunger recommendation solution is determined when the predicted gas production stops increasing after m consecutive iterations (for example, three). The convergence of the recommendation results is tested using a multi-point detection approach. Three results are output each round. After multiple iterations, the final results converge, improving the reliability and effectiveness of the solution. Figure 4 Schematic diagram of the predicted gas production after iteration.
[0106] To ensure the safety of the solution, when applying the optimal plunger working solution, the method further includes:
[0107] Calculate the load factor at the time of well opening;
[0108] If the load factor at the time of well opening is greater than or equal to the mean load factor, the well is opened; if it is less than, the well is shut in until the load factor at the time of well opening is greater than or equal to the mean load factor, where the mean load factor includes:
[0109]
[0110] in, is the mean value of the load factor, is the number of cycles, For the Casing pressure per cycle, For the Oil pipe pressure per cycle, For the The line pressure for each cycle.
[0111] Figure 2 Another method for optimizing gas production in a plunger gas well based on federated learning is provided by the present invention.
[0112] In summary, the present invention provides a method for optimizing gas production from a plunger gas well based on federated learning, the method comprising: obtaining plunger cycle data of several gas wells, and performing multi-stage cleaning and conversion on the plunger cycle data to obtain sliding window combined plunger cycle gas production data of each gas well, wherein each gas well belongs to the same gas gathering station, and each gas well corresponds to several sliding window combined plunger cycle gas production data; based on a distributed federated learning framework, a multi-branch deep neural network model is trained with the sliding window combined plunger cycle gas production data and pressure data of each gas well to obtain a gas production prediction model; based on a multi-objective optimization algorithm, several plunger working schemes are generated, and based on the periodic gas production under each plunger working scheme output by the gas production prediction model, the plunger working scheme is iterated to finally obtain the optimal plunger working scheme. The present invention performs data cleaning on the data of each plunger gas well, uses the multi-gas well data to train the neural network model under federated learning to predict the periodic gas production of each gas well, and uses the multi-objective optimization algorithm combined with the neural network to screen the optimal plunger working scheme that meets the conditions, and calculates the load coefficient in the actual process to ensure the normal lifting of the plunger gas well.
[0113] Based on the same inventive concept, the present invention provides a plunger gas well gas production optimization device based on federated learning, the device comprising:
[0114] The data acquisition module is used to obtain the plunger cycle data of several gas wells and perform multi-stage cleaning and conversion on the plunger cycle data to obtain the sliding window combined plunger cycle gas production data of each gas well. Each gas well belongs to the same gas gathering station and corresponds to several sliding window combined plunger cycle gas production data.
[0115] The model training module is used to train a multi-branch deep neural network model based on a distributed federated learning framework, combining plunger cycle gas production data and pressure data of each gas well with a sliding window to obtain a gas production prediction model;
[0116] The scheme generation module is used to generate several plunger working schemes based on the multi-objective optimization algorithm, and iterate the plunger working schemes based on the periodic gas production under each plunger working scheme output by the gas production prediction model, and finally obtain the optimal plunger working scheme.
[0117] Based on the same inventive concept, the present invention provides an electronic device, comprising:
[0118] processor;
[0119] a memory for storing processor-executable instructions;
[0120] The processor is configured to execute to implement a plunger gas well gas production optimization method based on federated learning.
[0121] Since the electronic device described in this embodiment is an electronic device used to implement the information processing method in the embodiment of the present invention, based on the information processing method described in the embodiment of the present invention, those skilled in the art will be able to understand the specific implementation of the electronic device of this embodiment and its various variations. Therefore, how the electronic device implements the method in the embodiment of the present invention will not be described in detail here. As long as the electronic device used by those skilled in the art to implement the information processing method in the embodiment of the present invention falls within the scope of protection of the present invention.
[0122] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take 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.) containing computer-usable program code.
[0123] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, 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 processes in the flowcharts and / or block diagrams. 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.
[0124] 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.
[0125] 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 1A step that specifies a function in one or more boxes.
[0126] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0127] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A method for optimizing gas production in plunger gas wells based on federated learning, characterized in that: The method comprises: Obtain plunger cycle data for several gas wells, perform multi-stage cleaning and conversion on the plunger cycle data, and obtain sliding window combined plunger cycle gas production data for each gas well. Each gas well belongs to the same gas gathering station, and each gas well corresponds to several sliding window combined plunger cycle gas production data. Based on a distributed federated learning framework, a multi-branch deep neural network model is trained using the sliding window of each gas well combined with the plunger cycle gas production data and pressure data to obtain a gas production prediction model. Based on the multi-objective optimization algorithm, several plunger working schemes are generated. Based on the periodic gas production under each plunger working scheme output by the gas production prediction model, the plunger working schemes are iterated to finally obtain the optimal plunger working scheme, including: According to the number of gas wells in the gas gathering station, the population size, crossover rate and mutation rate are determined, including: in, is the number of gas wells in the gas gathering station, is the population size, is the crossover rate, is the mutation rate; After obtaining the population size, adjustments are made based on the preset time length to obtain 3N types of plunger working schemes.
2. The method for optimizing gas production in a plunger gas well based on federated learning according to claim 1, characterized in that: Multi-stage cleaning and transformation of plunger cycle data, including: Obtaining the daily gas production of the gas well, and determining the periodic gas production of the gas well according to the well opening time and daily gas production of each period of the gas well on that day, wherein the plunger cycle data includes the well opening time and periodic gas production; According to the frequency distribution of well opening time, the well opening time is screened; According to the frequency distribution of periodic gas production, the periodic gas production is screened; After the screening is completed, a preset number of plunger cycle data are combined based on the sliding window to obtain the sliding window combined plunger cycle gas production data.
3. The method for optimizing gas production in a plunger gas well based on federated learning according to claim 1, characterized in that: Based on a distributed federated learning framework, a multi-branch deep neural network model is trained using a sliding window of each gas well, combining plunger cycle gas production data and pressure data, to obtain a gas production prediction model, including: A horizontal federated learning framework is built using multiple sliding windows and plunger cycle gas production data from each gas well in the same gas gathering station. The framework includes a central server and multiple local clients, with one local client corresponding to each gas well. Aggregate in the central server to obtain the global model of the multi-branch deep neural network model; A multi-branch deep neural network model is trained based on several sliding window combinations of plunger cycle gas production data and pressure data for each gas well, where the pressure data includes oil pressure, casing pressure, and external transmission pressure. When the preset training requirements are met, the multi-branch deep neural network model is used as the gas production prediction model.
4. The method for optimizing gas production in a plunger gas well based on federated learning according to claim 3, characterized in that: Global model, including: in, is the global model parameter, is the learning rate, is the number of local clients, For local clients The number of data samples, is the sum of the number of data samples of all local clients, For local clients The local loss function About Global Model Parameters gradient.
5. The method for optimizing gas production in a plunger gas well based on federated learning according to claim 3, characterized in that: The loss training function for the multi-branch deep neural network model includes: in, is the loss training function of the multi-branch deep neural network model, is the total number of samples input into the multi-branch deep neural network model, For the The actual gas production of the samples, For the The predicted gas production of each sample.
6. The method for optimizing gas production in a plunger gas well based on federated learning according to claim 1, characterized in that: Based on the periodic gas production under each plunger working scheme output by the gas production prediction model, the plunger working scheme is iterated to finally obtain the optimal plunger working scheme, including: S131, average pressure data corresponding to the gas production data of the piston cycle of each sliding window combination; S132, after splicing the average pressure data with the plunger working plan, input them into the gas production prediction model to obtain the periodic gas production under each spliced plunger working plan; S133, retaining the plunger working plan before the preset position, and re-performing cross-matching and mutation to obtain a new plunger working plan; S134, repeating steps S132-S133, when the number of consecutive iterations reaches a preset number and the periodic gas production corresponding to the plunger working scheme does not increase, the optimal plunger working scheme is obtained.
7. The method for optimizing gas production in a plunger gas well based on federated learning according to claim 6, characterized in that: When the optimal plunger operation scheme is applied, the method further comprises: Calculate the load factor at the time of well opening; If the load factor at the time of well opening is greater than or equal to the mean load factor, the well is opened; if it is less than, the well is shut in. The mean load factor includes: in, is the mean value of the load factor, is the number of cycles, For the Casing pressure per cycle, For the Oil pipe pressure per cycle, For the The line pressure for each cycle.
8. A plunger gas well gas production optimization device based on federated learning, characterized in that: A method for optimizing gas production in a plunger gas well based on federated learning, as applied to any one of claims 1 to 6, the device comprising: The data acquisition module is used to obtain the plunger cycle data of several gas wells and perform multi-stage cleaning and conversion on the plunger cycle data to obtain the sliding window combined plunger cycle gas production data of each gas well. Each gas well belongs to the same gas gathering station and corresponds to several sliding window combined plunger cycle gas production data. The model training module is used to train a multi-branch deep neural network model based on a distributed federated learning framework, combining plunger cycle gas production data and pressure data of each gas well with a sliding window to obtain a gas production prediction model; The scheme generation module is used to generate several plunger working schemes based on a multi-objective optimization algorithm, and iterate the plunger working schemes based on the periodic gas production under each plunger working scheme output by the gas production prediction model, and finally obtain the optimal plunger working scheme.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute to implement a plunger gas well gas production optimization method based on federated learning as described in any one of claims 1 to 7.