A bubble drainage optimization method and system based on production data
Patent Information
- Application Number
- CN202611218520.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-09-11
AI Technical Summary
具体解决在多口气井存在泡排处置需求且泡排执行资源受限的条件下,泡排任务安排难以与各气井携液状态变化及泡排作业状态迁移过程相协调,导致多井泡排作业排程整体等待时间较长的问题
[0069] 1. Based on further analysis and research of existing technical problems, this invention recognizes that the scheduling of multi-well bubble drainage operations is not only limited by the bubble drainage execution resource time period, but also jointly affected by the changes in the liquid-carrying state of each gas well and the state migration process of bubble drainage operations. By using the gas well bubble drainage operation state machine to process the gas well production sequence, a well-level bubble drainage disposal window chain is generated according to the entry time of the bubble drainage pending execution state, the state residence boundary, and the state migration duration of adjacent states. Then, the execution time period of the pending disposal window is matched with the bubble drainage execution resource time period according to different matching orders to construct multiple multi-well bubble drainage candidate operation schedules. The bubble drainage task is used as a migration trigger input to the gas well bubble drainage operation state machine. The disposal window is updated according to the simulated state migration results, and the sum of the residence duration of each gas well in the bubble drainage pending execution state is evaluated. This makes the generation of bubble drainage tasks, the changes in the gas well bubble drainage operation state, and the evaluation of multi-well bubble drainage operation schedules correlated, which helps to improve the coordination between the bubble drainage task arrangement and the changes in the liquid-carrying state of each gas well and the state migration process of bubble drainage operations, and shortens the overall waiting time of multi-well bubble drainage operation scheduling.
Smart Images

Figure CN122736282A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data analysis technology, specifically to a bubble drainage optimization method and system based on production data. Background Technology
[0002] During gas well production, liquid accumulation within the wellbore can affect gas lift and transport, altering the well's gas production, pressure, and liquid production states. Foam drainage gas production is an operational method used to improve the liquid-carrying condition of gas wells. By implementing foam drainage operations, the impact of liquid accumulation in the wellbore on gas well production is reduced. In production areas with a large number of gas wells, foam drainage tasks typically need to be planned in a coordinated manner, taking into account the production status of each well, foam drainage needs, and the availability of foam drainage work teams, injection equipment, and reagents.
[0003] Existing methods for managing well drainage operations typically determine whether a well requires drainage based on production parameters such as gas production, tubing pressure, casing pressure, or fluid production. Drainage tasks are then scheduled according to the well's priority, available operating time, or the availability of drainage resources. Some methods also utilize historical production data to determine well status trends or generate multi-well operation plans based on the duration of drainage tasks and resource time intervals to reduce time conflicts between drainage tasks.
[0004] However, the liquid-carrying state of gas wells and the demand for bubble drainage treatment continuously change with the production process. After the bubble drainage task is executed, it undergoes a process from operation triggering to response, response duration, and response decay. Existing technologies, when determining bubble drainage tasks, typically focus on matching the current production status, treatment priority, or available resource time, but do not adequately consider the correlation between the changes in gas well status caused by the bubble drainage task and subsequent bubble drainage treatment arrangements. Therefore, the treatment period determined in the early stages may no longer be applicable to the actual state of the gas well after the bubble drainage task is executed. Candidate operation plans are also difficult to update and compare based on the state changes caused by different task arrangements. This easily leads to problems such as inconsistencies between the timing of bubble drainage treatment and the evolution of the gas well status, duplication or failure of subsequent treatment arrangements, and unreasonable resource allocation for multi-well bubble drainage execution, thus affecting the overall scheduling effectiveness of bubble drainage tasks for multiple gas wells. Summary of the Invention
[0005] The purpose of this invention is to provide a foam drainage optimization method and system based on production data to solve the problems mentioned in the background art. Specifically, it addresses the problem that, under conditions where multiple gas wells have foam drainage needs and foam drainage execution resources are limited, the scheduling of foam drainage tasks is difficult to coordinate with the changes in the liquid-carrying state of each gas well and the transition process of the foam drainage operation state, resulting in a long overall waiting time for multi-well foam drainage operation scheduling.
[0006] To achieve the above objectives, one of the objectives of this invention is to provide a bubble displacement optimization method based on production data, comprising the following method steps:
[0007] S1. Obtain the production time sequence and bubble drainage execution time period of each gas well. The production time sequence of the gas well represents the change in the liquid-carrying state of the gas well.
[0008] The process of obtaining gas well production timelines specifically includes:
[0009] The production data of each gas well within the planning area is read from the gas well production data record. The production data includes sampling time, tubing pressure, casing pressure, instantaneous gas production and instantaneous liquid production.
[0010] The production data is aligned with the sampling time according to the sampling period. Missing data is processed according to the number of consecutive missing sampling points and the missing proportion of production parameters. When an incomplete production time sequence flag is generated, the corresponding gas well is removed from the set of gas wells participating in the bubble drainage optimization process.
[0011] The rate of decrease in gas production is determined based on the median of instantaneous gas production in the previous time interval and the most recent time interval, the increment of casing-oil pressure difference is determined based on the median of casing-oil pressure difference in the previous time interval and the most recent time interval, and the fluctuation coefficient of instantaneous liquid production is determined based on the standard deviation and arithmetic mean of instantaneous liquid production.
[0012] The gas well production time sequence is composed of tubing pressure, casing pressure, instantaneous gas production, instantaneous fluid production, gas production decline rate, casing-oil pressure differential increment, and instantaneous fluid production fluctuation coefficient arranged according to the sampling time, and stored according to the gas well identifier and sampling time.
[0013] The process of acquiring resource time periods for bubble sorting specifically includes:
[0014] Read the status of the foaming and drainage operation team, refueling equipment, and chemical preparation within the planning period from the foaming and drainage operation plan record;
[0015] The continuous time interval in which the same bubble drainage operation team and the corresponding refueling equipment are simultaneously available is determined as the initial resource period. The unavailable time intervals corresponding to equipment maintenance, team handover, insufficient reagents and safety control are deleted, and the overlapping time intervals corresponding to the same bubble drainage operation team are merged into a continuous time interval.
[0016] When the bubble drainage operation team and the filling equipment can execute multiple bubble drainage tasks in parallel, the corresponding continuous time interval is divided into bubble drainage execution resource periods with different resource identifiers according to the number of parallel executions;
[0017] The duration of each gas well's task is determined based on the time required for reagent preparation, injection operation, and on-site confirmation. Bubble drainage execution resource periods with a duration shorter than the minimum task duration among all gas wells to be processed are removed.
[0018] Step S1 obtains the production time sequence of each gas well and the resource time period for bubble drainage execution. It then unifies and organizes the production data representing the changes in the liquid-carrying state of the gas well with the resource time boundary that can execute the bubble drainage task. This provides a data foundation for subsequent identification of bubble drainage disposal needs, generation of disposal windows, and scheduling of bubble drainage tasks under the condition of limited bubble drainage execution resources.
[0019] S2. The gas well production time sequence is processed using a gas well bubble drainage operation state machine that includes bubble drainage pending execution state, bubble drainage response state, and response decay state. Based on the entry time of the bubble drainage pending execution state, the state dwell boundary, and the state transition duration of adjacent states, a well-level bubble drainage disposal window chain is generated. The well-level bubble drainage disposal window chain consists of disposal windows arranged in the state transition order. Each disposal window includes an execution period and a response occupation period.
[0020] The process of determining the state machine for gas well bubble drainage operations specifically includes:
[0021] A gas well bubble drainage operation state machine is established for each gas well, including stable production state, bubble drainage pending execution state, bubble drainage response state, and response decay state. The stable production state is an auxiliary state that does not participate in the generation of the well-level bubble drainage treatment window chain.
[0022] The criteria for entering the bubble drainage pending execution state are set based on the gas production decline rate, the increase in the casing oil pressure difference, and the instantaneous fluid production fluctuation coefficient. When multiple criteria for entering the bubble drainage pending execution state are met and the corresponding relationship is maintained continuously, the gas well bubble drainage operation state machine is made to enter the bubble drainage pending execution state from the stable production state or the response decay state, and the entry time of the bubble drainage pending execution state is determined.
[0023] Successful bubble drainage operations are determined based on the instantaneous gas production growth rate or the decrease in the casing oil pressure difference after the bubble drainage task is completed, as well as the continuous maintenance of the corresponding changes. Calibration samples are formed based on the bubble drainage pending execution state entry time, bubble drainage response state entry time, and response decay state entry time corresponding to historical bubble drainage operations.
[0024] Based on the calibration samples, determine the state dwell boundary, the state transition time from the bubble sort pending state to the bubble sort response state, the state transition time from the bubble sort response state to the response decay state, and the state transition time from the response decay state to the next bubble sort pending state.
[0025] The generation process of the well-level bubble drainage treatment window chain specifically includes:
[0026] The time when the gas well production sequence meets the conditions for entering the bubble drainage pending execution state is determined as the predicted time when the bubble drainage pending execution state enters the first disposal window.
[0027] Based on the predicted entry time of the bubble drainage pending state, the state dwell boundary, and the state transition time from the bubble drainage pending state to the bubble drainage response state, the end time of the execution period of the processing window is determined, and the time interval between the predicted entry time of the bubble drainage pending state and the end time of the execution period is determined as the execution period.
[0028] The midpoint of the execution period is determined as the start time of the prediction task, and the response period is determined based on the start time of the prediction task, the state transition time from the bubble sort pending execution state to the bubble sort response state, and the state transition time from the bubble sort response state to the response decay state.
[0029] Based on the predicted start time of the current processing window and the state transition time of adjacent states, determine the predicted entry time of the bubble sort pending state corresponding to the next processing window, and continue to generate the next processing window if the predicted entry time of the bubble sort pending state corresponding to the next processing window is earlier than the end time of the planning cycle.
[0030] The processing windows arranged in the order of state transition are formed into a well-level bubble drainage processing window chain. The processing window corresponding to the current bubble drainage pending execution state is determined as the pending processing window, and the remaining processing windows are determined as the waiting-to-be-called state.
[0031] Step S2 uses the gas well bubble drainage operation state machine to convert the changes in the liquid-carrying state of the gas well in the gas well production sequence into a state transition process between the bubble drainage pending execution state, the bubble drainage response state, and the response decay state. Based on this, a well-level bubble drainage disposal window chain containing the execution period and the response occupation period is generated, so that the bubble drainage disposal timing of each gas well can correspond to its bubble drainage operation state transition process.
[0032] S3. The disposal window corresponding to the current pending bubble drainage status is determined as the pending disposal window. The execution time period of the pending disposal window is matched with the bubble drainage execution resource time period according to different matching orders to generate bubble drainage tasks containing the corresponding gas wells and task execution time periods, and multiple multi-well bubble drainage candidate operation schedules are constructed. The matching process specifically includes:
[0033] Read the well-level bubble drainage treatment window chain corresponding to each gas well, and determine the treatment window corresponding to the current bubble drainage pending execution status as the pending drainage treatment window;
[0034] All pending processing windows are arranged in different matching orders according to the end time of the execution period of the pending processing window from early to late, the dwell time between the start time of the planning cycle and the time when the bubble drainage pending execution status enters from long to short, and the end time of the response occupation period from late to early.
[0035] For each matching order, the time intersection between the execution time of the pending processing window and the execution resource time of the bubble sort arranged according to the resource start time is calculated sequentially;
[0036] When the duration of the time intersection is not less than the duration of the corresponding gas well task, and the time intersection is not occupied by other bubble drainage tasks corresponding to the same resource identifier, the task execution period is determined according to the start time of the time intersection and the duration of the task. A bubble drainage task including gas well identifier, pending drainage window identifier, resource identifier and task execution period is generated, and the corresponding task execution period is marked as occupied.
[0037] If no bubble drainage execution resource period can be matched with the current pending drainage window, no bubble drainage task will be generated for the corresponding gas well, and the corresponding drainage window will remain as the pending drainage window.
[0038] The process of constructing a multi-well bubble drainage candidate operation schedule specifically includes:
[0039] All bubble drainage tasks generated under each matching order are arranged from early to late according to the task start time to form the corresponding multi-well bubble drainage candidate operation schedule. The matching order identifier, bubble drainage task and unfinished matching pending disposal window are retained in the multi-well bubble drainage candidate operation schedule.
[0040] In the same multi-well bubble drainage candidate operation schedule, when the task execution time periods of bubble drainage tasks corresponding to the same resource identifier overlap, a resource conflict flag is generated, and the bubble drainage task with the later sorting position is deleted.
[0041] When the execution periods of bubble drainage tasks corresponding to the same gas well overlap, a gas well task conflict flag is generated, and the bubble drainage task with the earlier start time is retained.
[0042] If no bubble drainage task is generated in a multi-well bubble drainage candidate job schedule, retain the multi-well bubble drainage candidate job schedule and record all pending disposal windows as incomplete matching.
[0043] If no bubble drainage task is generated in any of the candidate multi-well bubble drainage operation schedules, the simulation state transition and the determination of the multi-well bubble drainage operation schedule will be stopped.
[0044] Step S3 matches the execution time of the pending disposal window with the bubble drainage execution resource time according to different matching orders, generates bubble drainage tasks and constructs multiple multi-well bubble drainage candidate operation schedules, so that the limited bubble drainage execution resources can form multiple comparable allocation results among the disposal time requirements of each gas well, and reduces the possibility of unreasonable scheduling caused by using only one matching order.
[0045] S4. The bubble drainage task is used as the migration trigger input to the gas well bubble drainage operation state machine. When the corresponding gas well enters the bubble drainage response state, the corresponding pending drainage handling window is updated to the executed state, and subsequent handling windows are closed during the response occupation period. When the corresponding gas well enters the response decay state, the next handling window is determined as the pending drainage handling window. The handling window update process specifically includes:
[0046] For each multi-well bubble drainage candidate operation schedule, the gas well bubble drainage operation state machine and well-level bubble drainage treatment window chain corresponding to each gas well are copied to form independent processing copies.
[0047] Read the bubble drainage tasks in the multi-well bubble drainage candidate operation schedule from morning to night according to the task start time. Use the bubble drainage task as the migration trigger input to the gas well bubble drainage operation state machine of the corresponding gas well. Determine the bubble drainage response state entry time according to the task start time and the state transition time from the bubble drainage pending execution state to the bubble drainage response state.
[0048] When the corresponding gas well enters the bubble drainage response state, the corresponding pending treatment window is updated to the executed state, and the corrected response occupation period is determined based on the entry time of the bubble drainage response state and the state transition time from the bubble drainage response state to the response decay state.
[0049] The original follow-up processing windows that overlap with the revised response period will be updated to closed, and the remaining original follow-up processing windows that are after the executed processing windows and do not overlap with the revised response period will be updated to invalid.
[0050] When the corresponding gas well enters the response decay state, the simulated entry time of the next bubble discharge state is determined based on the entry time of the bubble discharge response state, the state transition time from the bubble discharge response state to the response decay state, and the state transition time from the response decay state to the next bubble discharge state to be executed. The next disposal window and subsequent disposal windows are regenerated based on the simulated entry time, and the regenerated next disposal window is determined as the disposal window to be discharged.
[0051] If there is no corresponding bubble drainage task in the current pending drainage window, the corresponding gas well will remain in the current pending bubble drainage state, and the dwell time of the current pending bubble drainage state will continue until the end of the planned cycle.
[0052] Step S4 takes the bubble drainage task in each multi-well bubble drainage candidate operation schedule as the migration trigger input gas well bubble drainage operation state machine, updates the well-level bubble drainage disposal window chain according to the bubble drainage response state and response decay state caused by the bubble drainage task, closes or invalidates the original subsequent disposal window that is no longer compatible with the time period occupied by the corrected response, and regenerates the next disposal window, so that the candidate operation schedule can reflect the change of gas well bubble drainage operation status after the bubble drainage task is executed.
[0053] S5. The multi-well bubble drainage candidate operation schedule with the smallest sum of the dwell times of all gas wells in the bubble drainage pending execution state is determined as the multi-well bubble drainage operation schedule; specifically including:
[0054] Read the state transition results of the gas well bubble drainage operation state machine simulation and the update results of the well-level bubble drainage treatment window chain corresponding to each multi-well bubble drainage candidate operation schedule;
[0055] For each gas well, starting from the simulated entry time of each bubble drainage pending execution state, the dwell time of the corresponding gas well in the bubble drainage pending execution state is accumulated until the corresponding dwell time ends. Where the simulated entry time of the bubble drainage pending execution state is earlier than the start time of the planning cycle, the dwell time generated before the start of the planning cycle is included. Where the dwell time ends later than the end time of the planning cycle, the dwell time is accumulated until the end time of the planning cycle.
[0056] The processing window corresponding to the waiting call state, closed state, and invalid state is not included in the dwell time of the bubble drainage pending execution state. Gas wells that have not completed the matching of bubble drainage execution resource time periods continue to accumulate the dwell time of the current bubble drainage pending execution state.
[0057] The dwell time of each gas well in the bubble drainage waiting state is summed to obtain the sum of the dwell time of each gas well in the bubble drainage waiting state corresponding to each multi-well bubble drainage candidate operation schedule;
[0058] The multi-well bubble drainage candidate operation schedule with the smallest sum of the dwell time of each gas well in the bubble drainage pending execution state is determined as the multi-well bubble drainage operation schedule.
[0059] When the sum of the dwell time of each gas well in the bubble drainage pending execution state corresponding to multiple multi-well bubble drainage candidate operation schedules is the same, the multi-well bubble drainage candidate operation schedule with more bubble drainage tasks is determined as the multi-well bubble drainage operation schedule; when the number of bubble drainage tasks is still the same, the multi-well bubble drainage candidate operation schedule with the earlier end time of the last bubble drainage task is determined as the multi-well bubble drainage operation schedule; when the end time of the last bubble drainage task is still the same, the multi-well bubble drainage candidate operation schedule with the smaller matching sequence number is determined as the multi-well bubble drainage operation schedule.
[0060] Write the gas well identifier, task execution period, resource identifier, corresponding pending disposal window, and the sum of the dwell time of each gas well in the pending bubble drainage operation schedule into the bubble drainage scheduling record.
[0061] Step S5 calculates the sum of the dwell time of each gas well in the bubble drainage waiting state based on the simulation state transition results and well-level bubble drainage disposal window chain update results corresponding to the candidate bubble drainage operation schedules for each multi-well, and determines the multi-well bubble drainage operation schedule accordingly. This makes the bubble drainage task arrangement take into account the changes in the liquid-carrying state of each gas well, the bubble drainage operation state transition process, and the bubble drainage execution resource constraints, which helps to shorten the overall waiting time of the multi-well bubble drainage operation schedule.
[0062] The second objective of this invention is to provide a bubble drainage optimization system based on production data, including a production timeline and execution resource acquisition module, a well-level bubble drainage treatment window chain generation module, a candidate operation schedule construction module, a treatment window status update module, and a multi-well bubble drainage operation schedule determination module; wherein:
[0063] The production sequence and execution resource acquisition module acquires the production sequence of each gas well and the execution resource period for bubble drainage. The production sequence of the gas well represents the change in the liquid-carrying state of the gas well.
[0064] The well-level bubble drainage disposal window chain generation module uses the gas well bubble drainage operation state machine, which includes bubble drainage pending execution state, bubble drainage response state, and response decay state, to process the gas well production time sequence. Based on the entry time of the bubble drainage pending execution state, the state dwell boundary, and the state transition duration of adjacent states, it generates a well-level bubble drainage disposal window chain. The well-level bubble drainage disposal window chain consists of disposal windows arranged in the state transition order. Each disposal window includes an execution period and a response occupation period.
[0065] The candidate job scheduling construction module determines the disposal window corresponding to the current bubble drainage pending execution status as the pending disposal window, matches the execution time period of the pending disposal window with the bubble drainage execution resource time period according to different matching orders, generates bubble drainage tasks containing the corresponding gas well and task execution time period, and constructs multiple multi-well bubble drainage candidate job schedules;
[0066] The disposal window status update module takes the bubble drainage task as the migration trigger input gas well bubble drainage operation state machine. When the corresponding gas well enters the bubble drainage response state, it updates the corresponding pending disposal window to the executed state and closes the subsequent disposal window during the response occupation period. When the corresponding gas well enters the response decay state, the next disposal window is determined as the pending disposal window.
[0067] The multi-well bubble drainage operation scheduling determination module determines the multi-well bubble drainage candidate operation schedule with the smallest sum of the residence time of each gas well in the bubble drainage pending execution state as the multi-well bubble drainage operation schedule.
[0068] Compared with the prior art, the beneficial effects of the present invention are:
[0069] 1. Based on further analysis and research of existing technical problems, this invention recognizes that the scheduling of multi-well bubble drainage operations is not only limited by the bubble drainage execution resource time period, but also jointly affected by the changes in the liquid-carrying state of each gas well and the state migration process of bubble drainage operations. By using the gas well bubble drainage operation state machine to process the gas well production sequence, a well-level bubble drainage disposal window chain is generated according to the entry time of the bubble drainage pending execution state, the state residence boundary, and the state migration duration of adjacent states. Then, the execution time period of the pending disposal window is matched with the bubble drainage execution resource time period according to different matching orders to construct multiple multi-well bubble drainage candidate operation schedules. The bubble drainage task is used as a migration trigger input to the gas well bubble drainage operation state machine. The disposal window is updated according to the simulated state migration results, and the sum of the residence duration of each gas well in the bubble drainage pending execution state is evaluated. This makes the generation of bubble drainage tasks, the changes in the gas well bubble drainage operation state, and the evaluation of multi-well bubble drainage operation schedules correlated, which helps to improve the coordination between the bubble drainage task arrangement and the changes in the liquid-carrying state of each gas well and the state migration process of bubble drainage operations, and shortens the overall waiting time of multi-well bubble drainage operation scheduling.
[0070] 2. This invention updates the corresponding pending disposal window to the executed state when the corresponding gas well enters the bubble drainage response state. It determines the corrected response occupation period based on the task start time of the bubble drainage task, updates the original subsequent disposal windows that overlap with the corrected response occupation period to the closed state, updates the remaining original subsequent disposal windows to the invalid state, and then regenerates the next disposal window based on the simulated entry time of the next bubble drainage pending execution state. This allows the well-level bubble drainage disposal window chain to be updated as the gas well bubble drainage operation state changes due to the bubble drainage task. This helps to reduce the situation where subsequent disposal windows that are no longer suitable for the current gas well state continue to participate in bubble drainage task matching, and improves the rationality of the multi-well bubble drainage candidate operation scheduling evaluation results. Attached Figure Description
[0071] Figure 1 This is a schematic diagram of the core process of the overall method steps of the present invention;
[0072] Figure 2 This is a schematic diagram of the core process of obtaining the gas well production time sequence in step S1 of the present invention;
[0073] Figure 3 This is a schematic diagram of the core process of obtaining the resource time period in step S1 of the present invention;
[0074] Figure 4 This is a schematic diagram of the core process of determining the gas well foam drainage operation state machine and generating the well-level foam drainage treatment window chain in step S2 of the present invention.
[0075] Figure 5This is a schematic diagram of the core process of bubble drainage task matching and multi-well bubble drainage candidate operation scheduling in step S3 of the present invention;
[0076] Figure 6 This is a schematic diagram of the core process of simulating state transition and updating the handling window in step S4 of the present invention;
[0077] Figure 7 This is a schematic diagram of the core process of evaluating the candidate scheduling of multi-well bubble drainage and determining the scheduling of multi-well bubble drainage in step S5 of the present invention.
[0078] Figure 8 This is a schematic diagram of the overall module structure of the present invention.
[0079] In the diagram: 100, Production Sequence and Execution Resource Acquisition Module; 200, Well-Level Bubble Drainage Disposal Window Chain Generation Module; 300, Candidate Operation Schedule Construction Module; 400, Disposal Window Status Update Module; 500, Multi-Well Bubble Drainage Operation Schedule Determination Module. Detailed Implementation
[0080] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0081] Next, please refer to Figure 1 One of the objectives of this embodiment is to provide a foam drainage optimization method based on production data. This method is used when multiple gas wells have foam drainage requirements and foam drainage execution resources are limited. It determines the changes in the liquid-carrying state and the foam drainage operation status of each gas well based on the gas well production sequence, generates a well-level foam drainage disposal window chain corresponding to the foam drainage operation status migration process, and matches the execution time period in the well-level foam drainage disposal window chain with the foam drainage execution resource time period according to different matching orders to construct multiple multi-well foam drainage candidate operation schedules. Furthermore, it uses the foam drainage tasks in each multi-well foam drainage candidate operation schedule as migration triggers to input the gas well foam drainage operation state machine, updates the disposal window based on the simulated state migration results, and determines the multi-well foam drainage operation schedule based on the sum of the dwell times of each gas well in the foam drainage pending execution state.
[0082] The bubble displacement optimization method based on production data includes S1 to S5, wherein:
[0083] S1. Obtain the gas well production time sequence and foam drainage execution resource period for each gas well, where the gas well production time sequence characterizes the changes in the liquid-carrying state of the gas well;
[0084] S2. The gas well production time sequence is processed using the gas well bubble drainage operation state machine, which includes the bubble drainage pending execution state, bubble drainage response state, and response decay state. Based on the entry time of the bubble drainage pending execution state, the state dwell boundary, and the state transition duration of adjacent states, a well-level bubble drainage disposal window chain is generated. The well-level bubble drainage disposal window chain consists of disposal windows arranged in the state transition order. Each disposal window includes an execution period and a response occupation period.
[0085] S3. Determine the disposal window corresponding to the current bubble drainage pending execution status as the pending disposal window, match the execution time period of the pending disposal window with the bubble drainage execution resource time period according to different matching order, generate a bubble drainage task containing the corresponding gas well and task execution time period, and construct multiple multi-well bubble drainage candidate operation schedules.
[0086] S4. Use the bubble drainage task as a migration trigger input to the bubble drainage operation state machine of the gas well. When the corresponding gas well enters the bubble drainage response state, update the corresponding pending disposal window to the executed state, and close the subsequent disposal window during the response occupation period. When the corresponding gas well enters the response decay state, determine the next disposal window as the pending disposal window.
[0087] S5. The multi-well bubble drainage candidate operation schedule with the smallest sum of the dwell time of each gas well in the bubble drainage pending execution state is determined as the multi-well bubble drainage operation schedule.
[0088] Specifically, the methods and steps are as follows:
[0089] Please see Figure 2-3 S1. Obtain the gas well production time sequence and bubble drainage execution resource time period for each gas well, specifically including the process of obtaining the gas well production time sequence and the process of obtaining the bubble drainage execution resource time period.
[0090] The process of obtaining gas well production timelines specifically includes:
[0091] Retrieves production data from each gas well within the planned area from the gas well production data records; This indicates the number of gas wells participating in the bubble drainage optimization treatment. Integers greater than or equal to 2; Indicates the gas well number. The value ranges from 1 to Production data for each gas well includes sampling time, tubing pressure, casing pressure, instantaneous gas production, and instantaneous fluid production. The units for tubing pressure and casing pressure are megapascals, the unit for instantaneous gas production is 10,000 cubic meters per day, and the unit for instantaneous fluid production is cubic meters per day.
[0092] Using a 5-minute sampling period, production data from the 24 hours prior to the start of the planning period are aligned with the sampling time. If the number of consecutively missing sampling points for the same production parameter is no more than 3, linear interpolation is performed based on the valid production data before and after the missing sampling points. If the number of consecutively missing sampling points is greater than 3, or the missing proportion of any production parameter within 24 hours is greater than 10%, an incomplete production timeline flag is generated, and the corresponding gas well is removed from the gas well set for this bubble drainage optimization process, and this is recorded in the manual review record. After deletion, the number of gas wells participating in the bubble drainage optimization process is re-determined. If the number of deleted gas wells is less than 2, an insufficient number of gas wells flag is generated, and the construction of multi-well bubble drainage candidate operation schedule is stopped; if the number of deleted gas wells is not less than 2, the remaining gas wells are processed.
[0093] by Indicate the sampling time; calculate the first time respectively. At the sampling time of the gas well The median instantaneous gas production over the previous 60-minute to 30-minute interval, and the sampling time. The median instantaneous gas production over the previous 30-minute interval; This represents the median instantaneous gas production within the previous 30-minute interval, expressed as... This represents the median of instantaneous gas production over the most recent 30-minute interval; This represents the smoothing parameter for gas production. Take 0.01 million cubic meters per day; Indicates the first At the sampling time of the gas well The corresponding rate of decrease in gas production, the rate of decrease in gas production Calculate according to the following formula:
[0094] Among them, the rate of decline in gas production Dimensionless value; rate of decrease in gas production A value greater than 0 indicates that the instantaneous gas production in the most recent 30-minute interval is lower than the instantaneous gas production in the previous 30-minute interval.
[0095] Calculate the sampling time separately The median of the differential oil pressure between 60 and 30 minutes prior, and the sampling time. The median of the casing-oil pressure differential within the previous 30-minute interval; the casing-oil pressure differential is obtained by subtracting the tubing pressure from the casing pressure; subtract the previous median from the next median to obtain the increment of the casing-oil pressure differential, and the unit of the increment of the casing-oil pressure differential is megapascals;
[0096] Calculate sampling time The standard deviation and arithmetic mean of the instantaneous fluid production over the previous 60 minutes are used to calculate the instantaneous fluid production fluctuation coefficient by dividing the standard deviation by the arithmetic mean. When the arithmetic mean of the instantaneous fluid production is 0, 0.01 cubic meters per day is used as the denominator. The instantaneous fluid production fluctuation coefficient is a dimensionless value.
[0097] The data, arranged according to sampling time, including tubing pressure, casing pressure, instantaneous gas production, instantaneous fluid production, gas production decrease rate, casing-oil pressure differential increment, and instantaneous fluid production fluctuation coefficient, constitute the first... The gas well production sequence is stored according to the gas well identifier and sampling time, and is used to characterize the production sequence of the gas wells. Changes in the liquid-carrying state of a gas well;
[0098] The process of acquiring the production timeline of the gas well completes the reading of production data of each gas well, the alignment of sampling time, the processing of missing data, and the calculation of the gas well liquid-carrying state change index, so as to obtain the gas well production timeline corresponding to each gas well, and provide input for the gas well bubble drainage operation state machine to determine the bubble drainage pending execution state, bubble drainage response state, and response decay state.
[0099] The process of acquiring resource time periods for bubble sorting specifically includes:
[0100] Retrieve the status of the foaming and drainage operation teams, refueling equipment, and reagent preparation within the planning period from the foaming and drainage operation plan record; Indicates the start time of the planning period, in order to This indicates the end time of the planning period; the duration of the planning period is 8 to 24 hours. In this specific embodiment, the planning period is set to 9:00 to 18:00 on the same day.
[0101] The continuous time interval in which the same bubble drainage operation team and the corresponding refueling equipment are simultaneously available is defined as the initial resource period; the unavailable time intervals corresponding to equipment maintenance, team handover, insufficient reagents, and safety management are deleted; when two initial resource periods corresponding to the same bubble drainage operation team overlap, the two overlapping time intervals are merged into one continuous time interval.
[0102] by Indicates the number of resource time periods for bubble sorting; This indicates the sequence number of the resource time period for bubble sorting. The value ranges from 1 to ; will the first Each bubble drainage execution resource time period is recorded as Each bubble flush execution resource period This includes the resource start time, resource end time, and resource identifier; when the bubble drainage operation team and the filling equipment can execute multiple bubble drainage tasks in parallel, the corresponding continuous time interval is divided into multiple bubble drainage execution resource periods with different resource identifiers according to the number of parallel executions;
[0103] by Indicates the first The duration of a single bubble drainage operation required for a gas well, in minutes; duration of the operation. The time required for reagent preparation, injection operation, and on-site confirmation is determined, with a range of 20 to 60 minutes. In this embodiment, the task duration for each gas well is set to 30 minutes. If the duration of the bubble drainage execution resource period is less than the minimum task duration among all gas wells to be processed, the corresponding bubble drainage execution resource period is deleted.
[0104] The execution period, response period, and bubble sort execution resource period all adopt left-closed and right-open time intervals; when the end time of the previous time interval is equal to the start time of the next time interval, the two time intervals do not overlap; before executing each time calculation formula, the state dwell boundary, state transition duration, and task duration are uniformly converted into minutes, and added or subtracted based on the absolute time under the same date base.
[0105] The process of obtaining the bubble drainage execution resource time slots involves aligning the time of the bubble drainage work team, the filling equipment and the preparation status of the reagents, deleting unavailable time intervals, merging overlapping time intervals and splitting parallel resources, so as to obtain the bubble drainage execution resource time slots that can be used for bubble drainage task matching within the planning period.
[0106] Step S1 completes the acquisition of gas well production time sequence and foam drainage execution resource time period for each gas well, obtaining production time sequence data characterizing the changes in the liquid-carrying state of the gas well and the resource time boundary that can execute foam drainage tasks within the planning cycle, providing input for step S2 to generate well-level foam drainage disposal window chain and step S3 to perform execution time period matching.
[0107] Please see Figure 4 S2. The gas well production timeline is processed using a gas well bubble drainage operation state machine that includes bubble drainage pending execution state, bubble drainage response state, and response decay state. Based on the entry time of the bubble drainage pending execution state, the state dwell boundary, and the state transition duration of adjacent states, a well-level bubble drainage disposal window chain is generated. The well-level bubble drainage disposal window chain consists of disposal windows arranged in the state transition order. Each disposal window includes an execution period and a response occupation period. Specifically, it includes the determination process of the gas well bubble drainage operation state machine and the generation process of the well-level bubble drainage disposal window chain.
[0108] The process of determining the state machine for gas well bubble drainage operations specifically includes:
[0109] A gas well bubble drainage operation state machine is established for each gas well; the gas well bubble drainage operation state machine includes a bubble drainage pending execution state, a bubble drainage response state, and a response decay state, and includes a stable production state to indicate that the gas well production sequence has not yet met the entry conditions for the bubble drainage pending execution state; the stable production state is an auxiliary state and does not participate in the generation of the well-level bubble drainage treatment window chain;
[0110] The bubble drainage pending execution state indicates that the gas well production sequence has shown changes in the liquid-carrying state of the gas well but has not yet entered the bubble drainage response state through the bubble drainage task; the bubble drainage response state indicates that the bubble drainage task has been used as a migration trigger input to the gas well bubble drainage operation state machine, and the corresponding gas well is in the response stage generated by the bubble drainage action; the response decay state indicates that the bubble drainage response state continues until the state transition time of the adjacent state, after which the bubble drainage action enters the decay stage.
[0111] Regarding the first Three criteria are set for the gas well to enter the pending execution state; the first criterion is the rate of decrease in gas production. The first criterion is that the pressure difference between the casing and oil pressurization points is greater than or equal to 0.08; the second criterion is that the pressure difference between the casing and oil pressurization points is greater than or equal to 0.03 MPa; the third criterion is that the instantaneous production fluctuation coefficient is greater than or equal to 0.25; when two or three of the three criteria for entering the bubble drainage pending execution state are met, and the corresponding relationship is maintained continuously for 30 minutes, the gas well bubble drainage operation state machine enters the bubble drainage pending execution state from the stable production state or the response decay state; the starting time of the continuous 30-minute period is determined as the entry time of the bubble drainage pending execution state;
[0112] A successful bubble drainage operation is defined as a bubble drainage operation in which, within 60 minutes after the completion of the bubble drainage task, the instantaneous gas production rate increases by more than 10% relative to the median of the 30 minutes before the task begins, or the casing-oil pressure difference decreases by more than 0.05 MPa relative to the median of the 30 minutes before the task begins, and the corresponding change is maintained continuously for 15 minutes. The starting time of maintaining this continuous 15-minute change is determined as the bubble drainage response state entry time corresponding to the historical bubble drainage operation. When the bubble drainage task record, gas well production time sequence, and state time are all complete, the calibration sample of the entry state residence boundary and state transition duration of the corresponding bubble drainage operation record is used.
[0113] Starting from the moment when the bubble drainage response state begins, the median instantaneous gas production and the median differential pressure of the casing oil in the 30 minutes before the start of the task are used as the benchmark. When the instantaneous gas production growth rate is continuously lower than 3% and the decrease in differential pressure of the casing oil is continuously lower than 0.02 MPa, and this relationship is maintained for 30 minutes, the starting moment when this relationship is maintained for 30 minutes is determined as the moment when the response decay state corresponding to the historical bubble drainage operation begins.
[0114] by Indicates the first The state residence boundary of a gas well, in hours; state residence boundary Indicates the first The maximum allowed duration for a gas well to remain in the bubble drainage pending execution state after entering the state is determined. When the number of valid successful bubble drainage operation records is 20 or more, the 20 most recent records are used. When the number of valid successful bubble drainage operation records is 5 to 19, all valid records are used. The 75th percentile of the dwell time between the entry time of the bubble drainage pending execution state and the entry time of the bubble drainage response state in the records is determined as the state dwell boundary. When the number of valid and successful bubble drainage operation records is less than 5, the state will remain at the boundary. Set to 4 hours; if the calculation result is less than 2 hours, set the state dwell boundary. The time limit is adjusted to 2 hours; if the calculation result exceeds 8 hours, the state dwell boundary will be adjusted. Revised to 8 hours;
[0115] by Indicates the first The state transition time of a gas well from the pending bubble drainage state to the bubble drainage response state is measured in minutes. When there are 20 or more valid successful bubble drainage operation records, the 20 most recent records are used. When the number of valid successful bubble drainage operation records is between 5 and 19, all valid records are used. The median of the time between the start time of the bubble drainage task and the start time of the bubble drainage response state in the used records is determined as the state transition time. When the number of valid and successful bubble drainage operation records is less than 5, the state transition time will be extended. Set to 30 minutes; correct to 10 minutes if the calculation result is less than 10 minutes; correct to 60 minutes if the calculation result is greater than 60 minutes.
[0116] by Indicates the first The state transition time of a gas well from the bubble drainage response state to the response decay state is measured in hours. When there are more than 20 valid successful bubble drainage operation records, the 20 most recent records are used. When the number of valid successful bubble drainage operation records is between 5 and 19, all valid records are used. The median of the time between the entry time of the bubble drainage response state and the entry time of the response decay state in the used records is determined as the state transition time. When the number of valid and successful bubble drainage operation records is less than 5, the state transition time will be extended. Set to 2 hours; correct to 1 hour if the calculation result is less than 1 hour; correct to 6 hours if the calculation result is greater than 6 hours.
[0117] by Indicates the first The state transition time of a gas well from the response decay state to the next bubble drainage pending execution state is measured in hours. When there are more than 20 valid successful bubble drainage operation records, the 20 most recent records are used. When the number of valid successful bubble drainage operation records is between 5 and 19, all valid records are used. The median of the time between the entry time of the response decay state and the entry time of the next bubble drainage pending execution state in the used records is determined as the state transition time. When the number of valid and successful bubble drainage operation records is less than 5, the state transition time will be extended. Set to 1 hour; correct to 0.5 hours if the calculation result is less than 0.5 hours; correct to 6 hours if the calculation result is greater than 6 hours.
[0118] Steps S2 and S4 are based on the state transition duration , and The state transition of the state machine for simulating gas well bubble drainage operation; the bubble drainage response state entry time, response decay state entry time, and next bubble drainage pending execution state entry time in step S4 are all simulated state entry times used in the multi-well bubble drainage candidate operation scheduling evaluation process.
[0119] The process of determining the gas well bubble drainage operation state machine completes the determination of the state meaning, state entry conditions, state residence boundaries, and state transition duration of the stable production state, bubble drainage pending execution state, bubble drainage response state, and response decay state. This results in a gas well bubble drainage operation state machine that can process gas well production timelines and receive bubble drainage tasks as transition triggers, providing a state processing basis for the generation of well-level bubble drainage disposal window chains and the disposal window update in step S4.
[0120] The generation process of the well-level bubble drainage treatment window chain specifically includes:
[0121] by Indicates the processing window number. Starting from 1 and increasing; Indicates the first Well No. Predicted entry time of bubble sorting pending execution status for each processing window; predicted entry time of bubble sorting pending execution status for the first processing window. The time when the gas well production sequence meets the conditions for entering the bubble discharge pending execution state is determined.
[0122] by Indicates the first Well No. The end time of the execution period for each processing window; to ensure that the bubble drainage task triggers the corresponding gas well to enter the bubble drainage response state before the state dwell boundary is reached, the end time of the execution period is calculated according to the following formula. ,Right now: ;
[0123] Predict the entry time of the bubble arrangement pending execution state. Until the end of the execution period The time interval between left-closed and right-open is determined as the first... Well No. The execution period for each processing window; the end time of the execution period. Earlier than or equal to the predicted entry time of the bubble sorting pending execution state When an execution period exception flag is generated, the duration of the execution period is less than the duration of the task. When an abnormal execution period or insufficient processing window duration is detected, the generation of well-level bubble drainage processing window chains for the corresponding gas well is stopped, and the corresponding gas well is written into the manual review record.
[0124] by Indicates the first Well No. The start time of the predicted task corresponds to each processing window; before the matching of bubble sort execution resource time periods is completed, the midpoint of the execution time period is determined as the start time of the predicted task. Calculate according to the following formula: ;
[0125] by Indicates the first Well No. The response time occupied by each processing window; based on the predicted task start time. State transition duration and state transition duration The response time period is determined according to the following formula. ,Right now: ;
[0126] Response time period The prediction period is formed based on the start time of the prediction task; after step S3 determines the task execution period of the bubble sorting task, step S4 recalculates the response time period based on the start time of the bubble sorting task.
[0127] by Indicates the first The predicted entry time of the bubble drainage pending state corresponding to the next treatment window of the gas well is calculated as follows: Based on the predicted task start time of the current treatment window, the state transition time from the bubble drainage pending state to the bubble drainage response state, the state transition time from the bubble drainage response state to the response decay state, and the state transition time from the response decay state to the next bubble drainage pending state, the predicted entry time of the bubble drainage pending state corresponding to the next treatment window is calculated according to the following formula. ,Right now: ;
[0128] Predict the entry time of the bubble arrangement pending execution state. Substitute the formula for the end time of the execution period back into the formula to calculate the end time of the execution period of the next processing window; then, based on the bubble sorting pending execution status of the next processing window, predict the entry time and the end time of the execution period, and continue to determine the predicted task start time and response time period of the next processing window.
[0129] Predicted entry time for the bubble drainage pending execution status corresponding to the next processing window Earlier than the end of the planning period At that time, the next processing window will be generated; the predicted entry time for the bubble sorting pending execution status corresponding to the next processing window will be... Later than or equal to the end of the planning period At that time, stop generating subsequent processing windows;
[0130] The processing windows are arranged according to the state transition order; each processing window includes the execution period, the response time period, and the window status; the first processing window corresponding to the current bubble sort pending execution state is directly determined as the pending processing window; the remaining processing windows are in the waiting-to-be-called state;
[0131] The processing windows arranged in the order of state transitions will form the first... The well-level bubble drainage treatment window chain of the gas well; when the well-level bubble drainage treatment window chain does not contain a treatment window, an empty treatment window chain flag is generated, and the corresponding gas well is prohibited from entering step S3;
[0132] The generation process of this well-level bubble drainage disposal window chain uses the output of the previous formula as the input of the next formula, and sequentially completes the determination of the bubble drainage pending execution state prediction entry time, execution period end time, prediction task start time, response occupation period, and bubble drainage pending execution state prediction entry time corresponding to the next disposal window, resulting in a well-level bubble drainage disposal window chain composed of disposal windows arranged in the state transition order, providing input for step S3 to determine the pending disposal window and perform bubble drainage execution resource period matching.
[0133] Step S2 completes the determination of the gas well bubble drainage operation state machine and the generation of the well-level bubble drainage disposal window chain, resulting in a well-level bubble drainage disposal window chain that can carry the execution time period, response occupation time period and state transition order of each gas well. This provides a bridging object for step S3 to construct multiple multi-well bubble drainage candidate operation schedules and step S4 to update the execution disposal window.
[0134] Please see Figure 5S3. Determine the disposal window corresponding to the current bubble drainage pending execution status as the pending disposal window. Match the execution time period of the pending disposal window with the bubble drainage execution resource time period according to different matching orders to generate a bubble drainage task containing the corresponding gas well and task execution time period, and construct multiple multi-well bubble drainage candidate operation schedules. Specifically, this includes the matching process in step S3 and the construction process of the multi-well bubble drainage candidate operation schedule.
[0135] The matching process in step S3 specifically includes:
[0136] Read the well-level bubble drainage treatment window chain corresponding to each gas well; determine the treatment window corresponding to the current bubble drainage pending execution state as the pending treatment window; when there are two pending treatment windows for the same gas well, retain the treatment window with the earlier start time of the execution period, and restore the other treatment window to the waiting call state;
[0137] Three matching orders are generated for all pending processing windows; the first matching order is arranged from earliest to latest according to the end time of the execution period of the pending processing window; the second matching order is arranged according to the start time of the planning cycle. The dwell time between the entry time of the bubble drainage pending execution state is arranged from longest to shortest; the third matching order is arranged from latest to earliest according to the end time of the response occupation period of the pending disposal window; when the same sorting value appears in the same matching order, it is arranged from smallest to largest according to the gas well number;
[0138] For a given matching order, each pending processing window is read sequentially; the bubble sort execution resource time period is read from morning to evening according to the resource start time. ; Calculate the execution time period of the current pending disposal window and the bubble drainage execution resource time period. The time intersection; the start time of the time intersection is the later of the start times of the two time periods, and the end time of the time intersection is the earlier of the end times of the two time periods;
[0139] The duration of the time intersection is greater than or equal to the mission duration of the corresponding gas well. If the time intersection is not occupied by other bubble sorting tasks in the current matching order, the start time of the time intersection is determined as the task start time of the bubble sorting task; the task start time and task duration are then compared. The sum of these two times is determined as the task end time; the task execution period consists of the task start time and the task end time.
[0140] The bubble drainage task includes the gas well identifier of the corresponding gas well, the identifier of the window to be drained, the resource identifier, and the task execution time period; after the bubble drainage task is generated, the corresponding task execution time period in the bubble drainage execution resource time period is marked as occupied, and the next window to be drained in the current matching order is read.
[0141] The duration of the time overlap is less than the duration of the task. If the next bubble drainage execution resource time period cannot be matched with the current pending disposal window, the corresponding bubble drainage task will not be generated, the corresponding disposal window will remain as the pending disposal window, and a resource matching failure flag will be generated.
[0142] In step S3, the matching process matches the execution time period of the pending disposal window with the bubble drainage execution resource time period according to different matching orders, and obtains bubble drainage tasks that include the corresponding gas wells and task execution time periods, providing task input for the construction of multi-well bubble drainage candidate operation scheduling.
[0143] The process of constructing a multi-well bubble drainage candidate operation schedule specifically includes:
[0144] by Indicates the number of matching sequences; with Indicates the matching sequence number. The value ranges from 1 to In this embodiment The value is 3; the number is 3. All bubble sorting tasks generated under this matching order are arranged from earliest to latest according to their start time, forming the first... Multiple wells can be scheduled for operation. ;
[0145] Each multi-well bubble drainage candidate operation schedule All retain the corresponding matching order identifier, bubble drainage task, and pending disposal window for incomplete matching; when the bubble drainage tasks generated by different matching orders are the same, the corresponding results are still retained as different multi-well bubble drainage candidate operation schedules, so that step S4 can be executed separately to simulate state transition;
[0146] In the scheduling of candidate bubble drainage operations for the same multi-well, when the task execution time periods of two bubble drainage tasks corresponding to the same resource identifier overlap, a resource conflict flag is generated and the bubble drainage task with the later sorting position is deleted; when the task execution time periods of two bubble drainage tasks corresponding to the same gas well overlap, a gas well task conflict flag is generated and the bubble drainage task with the earlier task start time is retained.
[0147] If a multi-well bubble drainage candidate job schedule does not generate any bubble drainage tasks, the multi-well bubble drainage candidate job schedule is retained, and all pending processing windows are recorded as incomplete matching; if no bubble drainage tasks are generated in any of the multi-well bubble drainage candidate job schedules, a flag indicating no feasible bubble drainage tasks is generated, steps S4 and S5 are stopped, and a prompt to supplement bubble drainage execution resource time period is output.
[0148] The process of constructing the multi-well bubble drainage candidate operation schedule completes the combination, time arrangement and conflict verification of bubble drainage tasks under different matching orders, and obtains multiple multi-well bubble drainage candidate operation schedules that can be input into the gas well bubble drainage operation state machine to perform simulated state transitions, providing input for the disposal window update in step S4.
[0149] Step S3 completes the determination of the pending disposal window, the matching of the execution time period with the bubble drainage execution resource time period, the generation of bubble drainage tasks, and the construction of multiple multi-well bubble drainage candidate operation schedules, obtaining bubble drainage task combinations with different matching orders, which provides input for step S4 to compare the impact of different bubble drainage task combinations on the gas well bubble drainage operation status and well-level bubble drainage disposal window chain.
[0150] Please see Figure 6 S4. The bubble drainage task is used as the migration trigger input to the gas well bubble drainage operation state machine. When the corresponding gas well enters the bubble drainage response state, the corresponding pending disposal window is updated to the executed state, and subsequent disposal windows are closed during the response occupation period. When the corresponding gas well enters the response decay state, the next disposal window is determined as the pending disposal window. Specifically, this includes:
[0151] Scheduling for each multi-well bubble drainage candidate operation Each gas well's bubble drainage operation state machine and well-level bubble drainage disposal window chain are copied to form independent processing copies. The simulation state transition and disposal window update corresponding to a multi-well bubble drainage candidate operation schedule do not change the processing copies corresponding to other multi-well bubble drainage candidate operation schedules.
[0152] Read the candidate operation schedule for multi-well bubble drainage from morning to night according to the task start time. The bubble extraction task in the middle; Indicates the first In the multi-well bubble drainage candidate operation scheduling, the first Well No. Each processing window corresponds to the start time of the bubble drainage task;
[0153] by Indicates the first Under the multi-well bubble drainage candidate operation scheduling, the first Well No. The simulated entry time of the second bubble sort pending execution state; the simulated entry time of the first bubble sort pending execution state satisfies... = ;
[0154] by Indicates the first Under the multi-well bubble drainage candidate operation scheduling, the first Well No. The termination time of the dwell time corresponding to the pending execution state of the next bubble sorting; when the first... Well No. When a corresponding bubble drainage task exists at a processing window, the dwell timer terminates at that time. Calculate according to the following formula: ;
[0155] When the Well No. If no corresponding bubble drainage task is available in a given processing window, the end time of the planning cycle will be [not specified]. Determined as the end time of stay ;
[0156] When a corresponding bubble drainage task exists, the bubble drainage task is used as the transition trigger input to the gas well bubble drainage operation state machine; the gas well bubble drainage operation state machine transitions from the start time of the bubble drainage task for a specified period of time. Afterwards, the simulated gas well enters the bubble discharge response state; the dwell time ends at the specified time. Simultaneously, to simulate the moment when the bubble drainage response state enters, the corresponding pending drainage processing window is updated to the executed state;
[0157] by Indicates the first In the scheduling of multiple well drainage candidate operations, the response time period is adjusted based on the task start time of the drainage task; the response time period It is determined by the following formula: ;
[0158] Read the original subsequent processing windows in the well-level bubble drainage processing window chain that are located after the already executed processing windows; the execution time and response time occupied by the original subsequent processing windows. When time overlap occurs, the corresponding original subsequent processing window will be updated to the closed state; the remaining original subsequent processing windows that are located after the already executed processing window and do not overlap with the response time period will be updated to the invalid state; the processing windows corresponding to the closed state and the invalid state will no longer participate in subsequent matching and dwell time calculation.
[0159] Response time period At the end, the simulated gas well enters a response decay state; with Indicates the first Under the multi-well bubble drainage candidate operation scheduling, the first The simulated entry time for the next gas well's gas flow execution state is calculated using the following formula. ,Right now: ;
[0160] When the corresponding gas well enters the response decay state, the simulated entry time of the next gas well to be executed is used as the basis. Regenerate the next processing window and designate the regenerated next processing window as the pending processing window; the execution period of the next processing window starts from the simulation entry time. Start; from response decay state entry time to simulation entry time The duration between these periods is not included in the dwell time of the bubble sort pending execution state;
[0161] Simulate the entry time Substitute the well-level bubble drainage treatment window chain generation process into the process of generating the next treatment window and subsequent treatment windows in sequence; the newly generated treatment windows replace the original subsequent treatment windows that have been updated to a closed or invalid state;
[0162] No. Well No. When there is no corresponding bubble drainage task for a given processing window, the corresponding gas well remains in the current bubble drainage pending execution state. Processing windows following the current pending processing window in the well-level bubble drainage processing window chain remain in a waiting-to-be-called state and are not included in the bubble drainage pending execution state dwell time calculation. The dwell time for the current bubble drainage pending execution state continues until the end of the planning cycle. ;
[0163] The disposal window update process in step S4 is triggered by the bubble drainage task generated in step S3. Based on the task start time and the state transition duration of adjacent states, the dwell time termination time, the corrected response occupation period, and the simulated entry time of the next bubble drainage pending state are determined. This completes the update of the executed state of the pending disposal window, the closure of subsequent disposal windows during the response occupation period, the handling of the failure of the original subsequent disposal windows, and the regeneration of the next disposal window. The simulated state transition results and disposal window update results corresponding to each multi-well bubble drainage candidate operation schedule are obtained, providing input for step S5 to calculate the dwell time of each gas well in the bubble drainage pending state.
[0164] Step S4 completes the independent simulation state transition of multiple multi-well bubble drainage candidate operation schedules, so that the task execution period of the bubble drainage task directly changes the state of the gas well bubble drainage operation state machine and the executed state, closed state, failed state and next disposal window in the well-level bubble drainage disposal window chain, providing state basis for step S5 to evaluate different multi-well bubble drainage candidate operation schedules.
[0165] Please see Figure 7 S5. The multi-well bubble drainage candidate operation schedule with the smallest sum of the dwell times of all gas wells in the bubble drainage pending execution state is determined as the multi-well bubble drainage operation schedule, specifically including:
[0166] Read the state transition results of the gas well bubble drainage operation state machine simulation and the well-level bubble drainage treatment window chain update results for each multi-well bubble drainage candidate operation schedule obtained in step S4;
[0167] by Indicates the first Under the multi-well bubble drainage candidate operation scheduling, the first The number of times a gas well is actually activated as the current bubble drainage pending execution state; the disposal windows corresponding to the waiting call state, closed state, and failed state are not counted in the number of activations of the bubble drainage pending execution state;
[0168] by Indicates the first Under the multi-well bubble drainage candidate operation scheduling, the first The residence time of a gas well, measured in hours, is accumulated from the start time of each simulated bubble drainage execution state to the end time of the corresponding residence time; the start time of the simulated bubble drainage execution state is earlier than the start time of the planning cycle. In this case, the dwell time already incurred before the start of the planning period shall be included; the dwell time ending time shall be later than the end time of the planning period. At that time, the accumulation will only continue until the end of the planning period. ; Duration of bubble sorting pending execution status Calculate according to the following formula: ;
[0169] When a corresponding bubble sorting task exists, the dwell timer ends. The start time and state transition duration of the bubble sorting task The sum; when there is no corresponding bubble sorting task, the dwell timer ends. The end of the planning period Therefore, gas wells that have not completed the matching of bubble drainage execution resources will continue to accumulate the dwell time of the current bubble drainage pending execution state, but the dwell time of the subsequent processing window corresponding to the waiting call state will not be accumulated repeatedly.
[0170] by Indicates the first The sum of the dwell time of each gas well in the bubble drainage waiting state corresponding to the multi-well bubble drainage candidate operation schedule, in hours; Calculate according to the following formula: ;
[0171] Calculate the corresponding multi-well bubble drainage candidate operation schedules in sequence. ;Will The smallest candidate operation schedule for multi-well bubble drainage was determined to be the multi-well bubble drainage operation schedule.
[0172] Two multi-well bubble drainage candidate operation schedules corresponding to When the number of bubble drainage tasks is the same, the multi-well bubble drainage candidate operation schedule with more bubble drainage tasks is determined as the multi-well bubble drainage operation schedule; when the number of bubble drainage tasks is still the same, the multi-well bubble drainage candidate operation schedule with the earlier end time of the last bubble drainage task is determined as the multi-well bubble drainage operation schedule; when the end time of the last bubble drainage task is still the same, the multi-well bubble drainage candidate operation schedule with the smaller matching sequence number is determined as the multi-well bubble drainage operation schedule.
[0173] Write the gas well identifier, task execution period, resource identifier, corresponding pending disposal window, and the sum of the dwell time of each gas well in the pending bubble drainage operation schedule into the bubble drainage schedule record.
[0174] The process of determining the multi-well bubble drainage operation schedule involves calculating the dwell time of each gas well in the bubble drainage pending execution state under each multi-well bubble drainage candidate operation schedule and summing the dwell time across wells to obtain the multi-well bubble drainage operation schedule with the minimum sum of the dwell times of each gas well in the bubble drainage pending execution state.
[0175] Step S5 completes the evaluation of the state dwell time of multiple multi-well bubble drainage candidate operation scheduling and the final selection of the best one. The bubble drainage task generated in step S3 enters the scheduling evaluation process after the simulated state transition and disposal window update in step S4, and finally obtains the multi-well bubble drainage operation schedule.
[0176] The parameters and thresholds in this embodiment are determined based on historical gas well production data, historical gas well fluid-carrying events, and records of successful foam drainage operations; wherein:
[0177] Gas production smoothing parameters The sampling rate is 0.01 million cubic meters per day, the sampling period is 5 minutes, the gas well production timeline is 24 hours, the maximum number of consecutive missing sampling points is 3, and the maximum proportion of missing production parameters is 10%.
[0178] The threshold values for gas production decline rate, casing oil pressure difference increment, instantaneous fluid production fluctuation coefficient, and continuous holding time are set to 0.08, 0.03 MPa, 0.25, and 30 minutes, respectively, and are verified based on the principle of minimizing the sum of the number of false identifications and the number of false identifications of historical gas well fluid-carrying events.
[0179] Successful bubble drainage operation is determined by an instantaneous gas production growth rate of 10%, a decrease in casing oil pressure difference of 0.05 MPa, and a continuous holding time of 15 minutes. The response decay state is determined by an instantaneous gas production growth rate of less than 3%, a decrease in casing oil pressure difference of less than 0.02 MPa, and a continuous holding time of 30 minutes.
[0180] State dwell boundary The state transition time is determined using the 75th percentile of the dwell time of the pending state during a successful bubble drainage operation at a corresponding gas well. , and The median of the corresponding state transition duration is used to determine this.
[0181] When changes occur in gas well production practices, wellhead equipment, foaming agent type, or production data acquisition methods, the aforementioned parameters and thresholds should be recalculated and verified before being used for subsequent foaming optimization.
[0182] To further illustrate the working process of this embodiment, a specific operation process is given below:
[0183] Starting time of the planning period 9:00 AM on a certain production day, the end time of the planning cycle Taking the optimization process of three gas wells at 18:00 on the same day as an example; the three gas wells are referred to as the first gas well, the second gas well, and the third gas well, with the gas well numbers 1, 2, and 3 respectively; the task duration for each of the three gas wells is 30 minutes;
[0184] In step S1, the production sequence of the three gas wells was verified for production data integrity. The median instantaneous gas production of the first gas well in the previous 30-minute interval was 10,000 cubic meters per day, and the median instantaneous gas production in the most recent 30-minute interval was 8,900 cubic meters per day. The gas production decline rate of the first gas well was calculated to be 0.11 according to the gas production decline rate formula. The increase in casing pressure difference of the first gas well was 0.04 MPa, and the instantaneous production fluctuation coefficient was 0.18.
[0185] The second gas well had a gas production decline rate of 0.09, an increase in casing-oil pressure differential of 0.035 MPa, and an instantaneous fluid production fluctuation coefficient of 0.29; the third gas well had a gas production decline rate of 0.085, an increase in casing-oil pressure differential of 0.025 MPa, and an instantaneous fluid production fluctuation coefficient of 0.31.
[0186] The first gas well meets the criteria for the rate of decrease in gas production and the criteria for the increase in the differential pressure between casing and oil; the second gas well meets the criteria for the rate of decrease in gas production, the criteria for the increase in the differential pressure between casing and oil, and the criteria for the fluctuation coefficient of instantaneous production volume; the third gas well meets the criteria for the rate of decrease in gas production and the criteria for the fluctuation coefficient of instantaneous production volume; the criteria for the three gas wells have been maintained continuously for 30 minutes, therefore the three gas wells have entered the bubble drainage pending execution state;
[0187] The entry times for the bubble drainage pending execution state of the first, second, and third gas wells are 7:00, 8:00, and 8:30, respectively; the corresponding state dwell boundaries are 4 hours, 2.5 hours, and 4.5 hours, respectively; the state transition time from the bubble drainage pending execution state to the bubble drainage response state for all three gas wells is 30 minutes; the state transition time from the bubble drainage response state to the response decay state for the first and second gas wells is 2 hours, and the corresponding state transition time for the third gas well is 3 hours; the state transition times from the response decay state to the next bubble drainage pending execution state for the first, second, and third gas wells are 1 hour, 0.5 hours, and 1 hour, respectively.
[0188] For the first gas well, the predicted start time for the bubble drainage pending execution status of the first treatment window is 7:00; the execution period ends at 10:30, and the execution period is from 7:00 to 10:30; the predicted start time for the task is 8:45; the response occupation period is from 9:15 to 11:15; the predicted start time for the bubble drainage pending execution status of the next treatment window is 12:15.
[0189] For the second gas well, the predicted start time for the bubble drainage pending execution status of the first treatment window is 8:00; the execution period ends at 10:00, and the execution period is from 8:00 to 10:00; the predicted start time for the task is 9:00; the response occupation period is from 9:30 to 11:30; the predicted start time for the bubble drainage pending execution status of the next treatment window is 12:00.
[0190] For the third gas well, the predicted start time for the bubble drainage pending execution status of the first treatment window is 8:30; the execution period ends at 12:30, and the execution period is from 8:30 to 12:30; the predicted start time for the task is 10:30; the response occupation period is from 11:00 to 14:00; the predicted start time for the bubble drainage pending execution status of the next treatment window is 15:00.
[0191] Step S1 obtains three bubble sort execution resource periods: the first bubble sort execution resource period is from 9:30 to 10:00; the second bubble sort execution resource period is from 10:00 to 10:30; and the third bubble sort execution resource period is from 12:00 to 12:30.
[0192] The first matching order is arranged from morning to night according to the end time of the execution period of the pending disposal window. The arrangement results are the second gas well, the first gas well, and the third gas well. The second gas well is matched with the first bubble drainage execution resource period, the first gas well is matched with the second bubble drainage execution resource period, and the third gas well is matched with the third bubble drainage execution resource period, forming the first multi-well bubble drainage candidate operation schedule.
[0193] The second matching order is based on the start time of the planning cycle. The dwell time between the well and the entry time of the bubble drainage pending execution state is arranged from longest to shortest, and the result is the first gas well, the second gas well, and the third gas well. The first gas well matches the resource period of the first bubble drainage execution. The execution period of the second gas well ends at 10:00, and the resource period of the second bubble drainage execution begins at 10:00. Since there is no continuous 30-minute time overlap, no bubble drainage task is generated for the second gas well. The third gas well matches the resource period of the second bubble drainage execution, forming the second multi-well bubble drainage candidate operation schedule.
[0194] The third matching order is arranged from late to early according to the end time of the response occupation period of the pending disposal window. The arrangement result is the third gas well, the second gas well, and the first gas well. The third gas well is matched with the first bubble drainage execution resource period. The second gas well cannot form a time intersection with the second bubble drainage execution resource period for a continuous 30 minutes, so the second gas well did not generate a bubble drainage task. The first gas well is matched with the second bubble drainage execution resource period, forming the third multi-well bubble drainage candidate operation schedule.
[0195] For the first multi-well bubble drainage candidate operation scheduling, the bubble drainage task for the second gas well starts at 9:30 AM. The second gas well simulates entering the bubble drainage response state at 10:00 AM, with the corrected response period from 10:00 AM to 12:00 PM. The second gas well simulates entering the response decay state at 12:00 PM, and the simulated start time for the next bubble drainage pending execution state is 12:30 PM. Similarly, the bubble drainage task for the first gas well starts at 10:00 AM, and the first gas well simulates entering the bubble drainage response state at 10:30 AM, with the corrected response period from 10:00 AM to 12:00 PM. From 12:30 to 12:30, the first gas well simulated entering the response decay state at 12:30, and the simulated entry time for the next bubble drainage pending execution state was 13:30; the bubble drainage task of the third gas well started at 12:00, and the third gas well simulated entering the bubble drainage response state at 12:30. The corrected response occupation period was from 12:30 to 15:30, and the third gas well simulated entering the response decay state at 15:30. The simulated entry time for the next bubble drainage pending execution state was 16:30.
[0196] In the first multi-well drainage candidate operation scheduling, the dwell time for the first drainage of the first gas well is from 7:00 to 10:30, a total of 3.5 hours; the dwell time for the second drainage is from 13:30 to 18:00, a total of 4.5 hours, for a total dwell time of 8 hours. Similarly, the dwell time for the second drainage of the first gas well is from 8:00 to 10:00, a total of 2 hours; the dwell time for the second drainage is 1 hour. From 2:30 AM to 6:00 PM, a total of 5.5 hours, the dwell time of the second gas well is 7.5 hours; the dwell time of the third gas well in the first bubble drainage pending execution state is from 8:30 AM to 12:30 PM, a total of 4 hours; the dwell time of the second bubble drainage pending execution state is from 4:30 PM to 6:00 PM, a total of 1.5 hours, and the dwell time of the third gas well is 5.5 hours; the sum of the dwell times corresponding to the first multi-well bubble drainage candidate operation scheduling is 21 hours;
[0197] In the second multi-well bubble drainage candidate operation scheduling, the bubble drainage task of the first gas well started at 9:30 AM. The first gas well simulated entering the bubble drainage response state at 10:00 AM, and the simulated entry time for the next bubble drainage pending execution state was 1:00 PM. The dwell time of the first gas well was 8 hours. The bubble drainage task of the third gas well started at 10:00 AM. The third gas well simulated entering the bubble drainage response state at 10:30 AM, and the simulated entry time for the next bubble drainage pending execution state was 2:30 PM. The dwell time of the third gas well was 5.5 hours. The second gas well did not generate a bubble drainage task. The second gas well remained in the current bubble drainage pending execution state from 8:00 AM to 6:00 PM, with a dwell time of 10 hours. The sum of the dwell times corresponding to the second multi-well bubble drainage candidate operation scheduling is 23.5 hours.
[0198] In the third multi-well bubble drainage candidate operation scheduling, the bubble drainage task of the third gas well starts at 9:30 AM, the third gas well simulates entering the bubble drainage response state at 10:00 AM, the simulated entry time for the next bubble drainage pending execution state is 2:00 PM, and the dwell time of the third gas well is 5.5 hours; the bubble drainage task of the first gas well starts at 10:00 AM, the first gas well simulates entering the bubble drainage response state at 10:30 AM, the simulated entry time for the next bubble drainage pending execution state is 1:30 PM, and the dwell time of the first gas well is 8 hours; the second gas well did not generate a bubble drainage task, and the dwell time is 10 hours; the sum of the dwell times corresponding to the third multi-well bubble drainage candidate operation scheduling is 23.5 hours;
[0199] The sum of the dwell times of all gas wells in the bubble drainage pending execution state corresponding to the first multi-well bubble drainage candidate operation schedule is 21 hours, which is less than the 23.5 hours corresponding to the second and third multi-well bubble drainage candidate operation schedules. Therefore, the first multi-well bubble drainage candidate operation schedule is determined as the multi-well bubble drainage operation schedule. The final determined multi-well bubble drainage operation schedule includes the bubble drainage task of the second gas well from 9:30 to 10:00, the bubble drainage task of the first gas well from 10:00 to 10:30, and the bubble drainage task of the third gas well from 12:00 to 12:30.
[0200] The specific operation process completes the acquisition of gas well production time sequence, acquisition of bubble drainage execution resource time period, determination of gas well bubble drainage operation state machine, generation of well-level bubble drainage disposal window chain, matching of pending disposal window with bubble drainage execution resource time period, construction of multiple multi-well bubble drainage candidate operation schedule, updating of disposal window and determination of multi-well bubble drainage operation schedule, and finally obtains a multi-well bubble drainage operation schedule with a total residence time of 21 hours for each gas well in the bubble drainage pending execution state.
[0201] As can be seen from the above description, the bubble drainage optimization method based on production data provided in this embodiment has the following technical effects:
[0202] The gas well bubble drainage operation state machine is used to process the gas well production time sequence. Based on the entry time of the bubble drainage pending execution state, the state dwell boundary and the state transition time of adjacent states, a well-level bubble drainage disposal window chain is generated. The execution time of the pending disposal window is matched with the bubble drainage execution resource time according to different matching orders to construct multiple multi-well bubble drainage candidate operation schedules.
[0203] Furthermore, the bubble drainage task is used as a migration trigger input to the gas well bubble drainage operation state machine. Based on the simulated state migration results, the corresponding pending disposal window is updated to the executed state, the corrected response time period is determined, the original subsequent disposal window is updated to the closed or invalid state, and the next disposal window is regenerated based on the simulated entry time of the next bubble drainage pending execution state. Then, the multi-well bubble drainage operation schedule is determined based on the sum of the residence time of each gas well in the bubble drainage pending execution state. This makes the generation of bubble drainage tasks, the migration of gas well bubble drainage operation state, the updating of disposal windows, and the evaluation of multi-well bubble drainage operation schedules interconnected. This helps to improve the coordination between the bubble drainage task arrangement and the changes in the liquid-carrying state of each gas well and the bubble drainage operation state migration process, reduces the situation where the original subsequent disposal window that is no longer suitable for the current gas well state continues to participate in bubble drainage task matching, and shortens the overall waiting time of multi-well bubble drainage operation scheduling.
[0204] Please see Figure 8The second objective of this embodiment is to provide a bubble drainage optimization system based on production data, including a production timing and execution resource acquisition module 100, a well-level bubble drainage disposal window chain generation module 200, a candidate operation scheduling construction module 300, a disposal window status update module 400, and a multi-well bubble drainage operation scheduling determination module 500.
[0205] The production sequence and execution resource acquisition module 100 acquires the production sequence of each gas well and the execution resource period of the bubble discharge. The production sequence of the gas well represents the change in the liquid-carrying state of the gas well.
[0206] The well-level bubble drainage disposal window chain generation module 200 uses a gas well bubble drainage operation state machine, which includes bubble drainage pending execution state, bubble drainage response state, and response decay state, to process the gas well production time sequence. Based on the entry time of the bubble drainage pending execution state, the state dwell boundary, and the state transition duration of adjacent states, it generates a well-level bubble drainage disposal window chain. The well-level bubble drainage disposal window chain consists of disposal windows arranged in the state transition order. Each disposal window includes an execution time period and a response occupation time period.
[0207] The candidate job scheduling construction module 300 determines the disposal window corresponding to the current bubble drainage pending execution status as the pending disposal window, matches the execution time period of the pending disposal window with the bubble drainage execution resource time period according to different matching orders, generates a bubble drainage task containing the corresponding gas well and task execution time period, and constructs multiple multi-well bubble drainage candidate job schedules;
[0208] The disposal window status update module 400 takes the bubble drainage task as the migration trigger input gas well bubble drainage operation state machine. When the corresponding gas well enters the bubble drainage response state, it updates the corresponding pending disposal window to the executed state and closes the subsequent disposal window during the response occupation period. When the corresponding gas well enters the response decay state, the next disposal window is determined as the pending disposal window.
[0209] The multi-well bubble drainage operation scheduling determination module 500 determines the multi-well bubble drainage candidate operation schedule with the smallest sum of the residence time of each gas well in the bubble drainage pending execution state as the multi-well bubble drainage operation schedule.
[0210] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A bubble displacement optimization method based on production data, characterized in that, The methods and steps include the following: S1. Obtain the gas well production time sequence and foam drainage execution resource period for each gas well, wherein the gas well production time sequence characterizes the changes in the liquid-carrying state of the gas well; S2. The gas well production sequence is processed using a gas well bubble drainage operation state machine that includes bubble drainage pending execution state, bubble drainage response state, and response decay state. Based on the entry time of the bubble drainage pending execution state, the state dwell boundary, and the state transition duration of adjacent states, a well-level bubble drainage disposal window chain is generated. The well-level bubble drainage disposal window chain consists of disposal windows arranged in the state transition order. Each disposal window includes an execution period and a response occupation period. S3. Determine the disposal window corresponding to the current bubble drainage pending execution status as the pending disposal window, match the execution time period of the pending disposal window with the bubble drainage execution resource time period according to different matching orders, generate a bubble drainage task containing the corresponding gas well and task execution time period, and construct multiple multi-well bubble drainage candidate operation schedules. S4. The bubble drainage task is used as a migration trigger input to the gas well bubble drainage operation state machine. When the corresponding gas well enters the bubble drainage response state, the corresponding pending disposal window is updated to the executed state. During the response occupation period, the subsequent disposal window is closed. When the corresponding gas well enters the response decay state, the next disposal window is determined as the pending disposal window. S5. The multi-well bubble drainage candidate operation schedule with the smallest sum of the dwell time of each gas well in the bubble drainage pending execution state is determined as the multi-well bubble drainage operation schedule.
2. The bubble drainage optimization method based on production data according to claim 1, characterized in that, The process of obtaining the gas well production timeline specifically includes: The production data of each gas well within the planning range is read from the gas well production data record. The production data includes sampling time, tubing pressure, casing pressure, instantaneous gas production and instantaneous liquid production. The production data is aligned with the sampling time according to the sampling period. Missing data is processed according to the number of consecutive missing sampling points and the missing ratio of production parameters. When an incomplete production time sequence flag is generated, the corresponding gas well is removed from the set of gas wells participating in the bubble drainage optimization process. The rate of decrease in gas production is determined based on the median of instantaneous gas production in the previous time interval and the most recent time interval, the increment of casing-oil pressure difference is determined based on the median of casing-oil pressure difference in the previous time interval and the most recent time interval, and the fluctuation coefficient of instantaneous liquid production is determined based on the standard deviation and arithmetic mean of instantaneous liquid production. The production sequence of the gas well is composed of tubing pressure, casing pressure, instantaneous gas production, instantaneous fluid production, gas production decline rate, casing-oil pressure differential increment, and instantaneous fluid production fluctuation coefficient arranged according to the sampling time, and stored according to the gas well identifier and sampling time.
3. The bubble drainage optimization method based on production data according to claim 1, characterized in that, The process of acquiring the bubble extraction execution resource time period specifically includes: Read the status of the foaming and drainage operation team, refueling equipment, and chemical preparation within the planning period from the foaming and drainage operation plan record; The continuous time interval in which the same bubble drainage operation team and the corresponding refueling equipment are simultaneously available is determined as the initial resource period. The unavailable time intervals corresponding to equipment maintenance, team handover, insufficient reagents and safety control are deleted, and the overlapping time intervals corresponding to the same bubble drainage operation team are merged into a continuous time interval. When the bubble drainage operation team and the filling equipment can execute multiple bubble drainage tasks in parallel, the corresponding continuous time interval is divided into bubble drainage execution resource periods with different resource identifiers according to the number of parallel executions; The duration of each gas well's task is determined based on the time required for reagent preparation, injection operation, and on-site confirmation. Bubble drainage execution resource periods with a duration shorter than the minimum task duration among all gas wells to be processed are removed.
4. The bubble drainage optimization method based on production data according to claim 1, characterized in that, The process of determining the state machine for gas well foam drainage operations specifically includes: A gas well foam drainage operation state machine is established for each gas well, including a stable production state, a foam drainage pending execution state, a foam drainage response state, and a response decay state. The stable production state is an auxiliary state that does not participate in the generation of the well-level foam drainage treatment window chain. The criteria for entering the bubble drainage pending execution state are set according to the gas production decline rate, the increase of the casing oil pressure difference and the instantaneous fluid production fluctuation coefficient. When multiple criteria for entering the bubble drainage pending execution state are met and the corresponding relationship is maintained continuously, the gas well bubble drainage operation state machine is made to enter the bubble drainage pending execution state from the stable production state or the response decay state, and the entry time of the bubble drainage pending execution state is determined. Successful bubble drainage operations are determined based on the instantaneous gas production growth rate or the decrease in the casing oil pressure difference after the bubble drainage task is completed, as well as the continuous maintenance of the corresponding changes. Calibration samples are formed based on the bubble drainage pending execution state entry time, bubble drainage response state entry time, and response decay state entry time corresponding to historical bubble drainage operations. The state dwell boundary, the state transition time from the bubble sorting pending state to the bubble sorting response state, the state transition time from the bubble sorting response state to the response decay state, and the state transition time from the response decay state to the next bubble sorting pending state are determined based on the calibration sample.
5. The bubble drainage optimization method based on production data according to claim 4, characterized in that, The generation process of the well-level bubble drainage treatment window chain specifically includes: The time when the gas well production sequence meets the conditions for entering the bubble drainage pending execution state is determined as the predicted time when the bubble drainage pending execution state enters the first disposal window. Based on the predicted entry time of the bubble drainage pending state, the state dwell boundary, and the state transition duration from the bubble drainage pending state to the bubble drainage response state, the end time of the execution period of the processing window is determined, and the time interval between the predicted entry time of the bubble drainage pending state and the end time of the execution period is determined as the execution period. The midpoint of the execution period is determined as the start time of the prediction task, and the response period is determined based on the start time of the prediction task, the state transition time from the bubble sorting pending state to the bubble sorting response state, and the state transition time from the bubble sorting response state to the response decay state. Based on the predicted start time of the current processing window and the state transition time of adjacent states, the predicted entry time of the bubble sorting pending state corresponding to the next processing window is determined, and if the predicted entry time of the bubble sorting pending state corresponding to the next processing window is earlier than the end time of the planning cycle, the next processing window is generated. The processing windows arranged in the order of state transition are formed into a well-level bubble drainage processing window chain. The processing window corresponding to the current bubble drainage pending execution state is determined as the pending processing window, and the remaining processing windows are determined as the waiting-to-be-called state.
6. The bubble drainage optimization method based on production data according to claim 5, characterized in that, The matching process in S3 specifically includes: Read the well-level bubble drainage treatment window chain corresponding to each gas well, and determine the treatment window corresponding to the current bubble drainage pending execution status as the pending drainage treatment window; All pending processing windows are arranged in different matching orders according to the end time of the execution period of the pending processing window from early to late, the dwell time between the start time of the planning cycle and the time when the bubble drainage pending execution status enters from long to short, and the end time of the response occupation period from late to early. For each matching order, the time intersection between the execution time of the pending processing window and the execution resource time of the bubble sort arranged according to the resource start time is calculated sequentially; When the duration of the time intersection is not less than the duration of the corresponding gas well task, and the time intersection is not occupied by other bubble drainage tasks corresponding to the same resource identifier, the task execution period is determined according to the start time of the time intersection and the duration of the task, and a bubble drainage task including gas well identifier, pending drainage window identifier, resource identifier and task execution period is generated, and the corresponding task execution period is marked as occupied. If no bubble drainage execution resource period can be matched with the current pending drainage window, no bubble drainage task will be generated for the corresponding gas well, and the corresponding drainage window will remain as the pending drainage window.
7. The bubble drainage optimization method based on production data according to claim 6, characterized in that, The process of constructing the multi-well bubble drainage candidate operation schedule specifically includes: All bubble drainage tasks generated under each matching order are arranged from early to late according to the task start time to form the corresponding multi-well bubble drainage candidate operation schedule. The matching order identifier, bubble drainage task and unfinished matching pending disposal window are retained in the multi-well bubble drainage candidate operation schedule. In the same multi-well bubble drainage candidate operation schedule, when the task execution time periods of bubble drainage tasks corresponding to the same resource identifier overlap, a resource conflict flag is generated, and the bubble drainage task with the later sorting position is deleted. When the execution periods of bubble drainage tasks corresponding to the same gas well overlap, a gas well task conflict flag is generated, and the bubble drainage task with the earlier start time is retained. When no bubble drainage task is generated in a multi-well bubble drainage candidate job schedule, the multi-well bubble drainage candidate job schedule is retained, and all pending disposal windows are recorded as incomplete matching. If no bubble drainage task is generated in any of the candidate multi-well bubble drainage operation schedules, the simulation state transition and the determination of the multi-well bubble drainage operation schedule will be stopped.
8. The bubble drainage optimization method based on production data according to claim 7, characterized in that, The processing window update process in S4 specifically includes: For each multi-well bubble drainage candidate operation schedule, the gas well bubble drainage operation state machine and well-level bubble drainage treatment window chain corresponding to each gas well are copied to form independent processing copies. Read the bubble drainage tasks in the multi-well bubble drainage candidate operation schedule from morning to night according to the task start time, use the bubble drainage task as the migration trigger input to the gas well bubble drainage operation state machine of the corresponding gas well, and determine the bubble drainage response state entry time according to the task start time and the state transition time from the bubble drainage pending execution state to the bubble drainage response state. When the corresponding gas well enters the bubble drainage response state, the corresponding pending drainage treatment window is updated to the executed state, and the corrected response occupation period is determined according to the entry time of the bubble drainage response state and the state transition time from the bubble drainage response state to the response decay state. The original subsequent processing windows that overlap with the modified response period are updated to closed, and the remaining original subsequent processing windows that are after the executed processing windows and do not overlap with the modified response period are updated to invalid. When the corresponding gas well enters the response decay state, the simulated entry time of the next bubble discharge state is determined based on the entry time of the bubble discharge response state, the state transition time from the bubble discharge response state to the response decay state, and the state transition time from the response decay state to the next bubble discharge pending state. The next disposal window and subsequent disposal windows are regenerated based on the simulated entry time, and the regenerated next disposal window is determined as the disposal window to be discharged. If there is no corresponding bubble drainage task in the current pending drainage window, the corresponding gas well will remain in the current pending bubble drainage state, and the dwell time of the current pending bubble drainage state will continue until the end of the planned cycle.
9. The bubble drainage optimization method based on production data according to claim 8, characterized in that, The process of determining the multi-well bubble drainage operation schedule specifically includes: Read the state transition results of the gas well bubble drainage operation state machine simulation and the update results of the well-level bubble drainage treatment window chain corresponding to each multi-well bubble drainage candidate operation schedule; For each gas well, starting from the simulated entry time of each bubble drainage pending execution state, the dwell time of the corresponding gas well in the bubble drainage pending execution state is accumulated until the corresponding dwell time ends. Where the simulated entry time of the bubble drainage pending execution state is earlier than the start time of the planning cycle, the dwell time generated before the start of the planning cycle is included. Where the dwell time ends later than the end time of the planning cycle, the dwell time is accumulated until the end time of the planning cycle. The processing window corresponding to the waiting call state, closed state, and invalid state is not included in the dwell time of the bubble drainage pending execution state. Gas wells that have not completed the matching of bubble drainage execution resource time periods continue to accumulate the dwell time of the current bubble drainage pending execution state. The dwell time of each gas well in the bubble drainage waiting state is summed to obtain the sum of the dwell time of each gas well in the bubble drainage waiting state corresponding to each multi-well bubble drainage candidate operation schedule; The multi-well bubble drainage candidate operation schedule with the smallest sum of the dwell time of each gas well in the bubble drainage pending execution state is determined as the multi-well bubble drainage operation schedule. When the sum of the dwell time of each gas well in the bubble drainage pending execution state corresponding to multiple multi-well bubble drainage candidate operation schedules is the same, the multi-well bubble drainage candidate operation schedule with more bubble drainage tasks is determined as the multi-well bubble drainage operation schedule; when the number of bubble drainage tasks is still the same, the multi-well bubble drainage candidate operation schedule with the earlier end time of the last bubble drainage task is determined as the multi-well bubble drainage operation schedule; when the end time of the last bubble drainage task is still the same, the multi-well bubble drainage candidate operation schedule with the smaller matching sequence number is determined as the multi-well bubble drainage operation schedule. The gas well identifier, task execution period, resource identifier, corresponding pending disposal window, and the sum of the dwell time of each gas well in the pending bubble drainage operation schedule are written into the bubble drainage scheduling record.
10. A bubble drainage optimization system based on production data, used to implement the bubble drainage optimization method based on production data as described in any one of claims 1-9, characterized in that, This includes modules for production timing and execution resource acquisition, well-level bubble drainage treatment window chain generation, candidate job scheduling construction, treatment window status update, and multi-well bubble drainage operation scheduling determination, among which: The production timing and execution resource acquisition module acquires the gas well production timing and foam drainage execution resource time period for each gas well. The gas well production timing characterizes the changes in the liquid-carrying state of the gas well. The well-level bubble drainage disposal window chain generation module uses a gas well bubble drainage operation state machine, which includes a bubble drainage pending execution state, a bubble drainage response state, and a response decay state, to process the gas well production sequence. Based on the entry time of the bubble drainage pending execution state, the state dwell boundary, and the state transition duration of adjacent states, it generates a well-level bubble drainage disposal window chain. The well-level bubble drainage disposal window chain consists of disposal windows arranged in the state transition order. Each disposal window includes an execution period and a response occupation period. The candidate job scheduling construction module determines the disposal window corresponding to the current bubble drainage pending execution status as the pending disposal window, matches the execution time period of the pending disposal window with the bubble drainage execution resource time period according to different matching orders, generates a bubble drainage task containing the corresponding gas well and task execution time period, and constructs multiple multi-well bubble drainage candidate job schedules. The disposal window status update module takes the bubble drainage task as a migration trigger input to the gas well bubble drainage operation state machine. When the corresponding gas well enters the bubble drainage response state, it updates the corresponding pending disposal window to the executed state and closes the subsequent disposal window during the response occupation period. When the corresponding gas well enters the response decay state, the next disposal window is determined as the pending disposal window. The multi-well bubble drainage operation scheduling determination module determines the multi-well bubble drainage candidate operation schedule with the smallest sum of the residence time of each gas well in the bubble drainage pending execution state as the multi-well bubble drainage operation schedule.