An agent method for constructing a numerical simulation example of a gas reservoir

By integrating and intelligently verifying data through a multi-agent collaborative mechanism and the MCP protocol interface layer, the problem of integrating multi-source data in gas reservoir numerical simulation examples was solved, achieving automated standardization of data and efficient model construction, thereby improving the accuracy and automation of modeling.

CN122433486APending Publication Date: 2026-07-21LUYI COUNTY YULONG COMMERCE & TRADE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LUYI COUNTY YULONG COMMERCE & TRADE CO LTD
Filing Date
2026-04-16
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In the construction of numerical simulation examples for gas reservoirs, the difficulty in integrating multi-source data, the low efficiency of manual operation, and the insufficient accuracy of verification lead to the inability to guarantee the accuracy and completeness of the initial data.

Method used

Employing a multi-agent collaborative mechanism and MCP protocol interface layer, the system achieves automatic standardized access and integration of multi-source data. It uses a collaborative architecture of main agent and segmented agents for modular division and parameter matching, and combines an unstructured vector knowledge base with a gas reservoir engineering mechanism model for intelligent verification and optimization.

Benefits of technology

It achieves efficient and automated integration of multi-source data, ensuring data accuracy and integrity, improving the automation level and quality of modeling, and providing a scientific and accurate model foundation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122433486A_ABST
    Figure CN122433486A_ABST
Patent Text Reader

Abstract

The application relates to the cross field of oil and gas field development engineering and artificial intelligence, and discloses a gas reservoir numerical simulation example construction agent method. First, the method carries out unified collection and standardization processing on multi-source heterogeneous data to form a structured data pool and an unstructured vector knowledge base; the standardization access and integration of various data are realized through an MCP protocol interface layer; collaborative modeling is carried out with the system including a main agent, a segmented agent and a keyword sub-agent as the core; the segmented agent is modularly divided according to the chapter structure of an example file of a target numerical simulation software to automatically generate an initial numerical simulation example file; finally, the generated example file is intelligently checked and optimized in combination with the vector knowledge base and a gas reservoir engineering mechanism model to form an example file. The application improves the reliability of numerical simulation work, shortens the modeling cycle and provides a more scientific and accurate model basis for gas reservoir development decision-making.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the intersection of oil and gas field development engineering and artificial intelligence, specifically a method for constructing intelligent agents from gas reservoir numerical simulation examples. Background Technology

[0002] By integrating multi-agent collaborative mechanisms, retrieval-enhanced generation technology, and standardized protocol interfaces, this method addresses the challenges of integrating multi-source data, low efficiency of manual operations, and insufficient verification accuracy in the construction of numerical simulation examples for gas reservoirs. It is applied to numerical simulation modeling of conventional, tight, and unconventional gas reservoirs, providing core technical support for optimizing oil and gas field development plans, analyzing production dynamics, and making intelligent decisions.

[0003] Currently, when constructing numerical simulation examples for gas reservoirs, due to the numerous and heterogeneous data sources, it is impossible to achieve automatic standardized access and unified management of geological, dynamic, and document-based data when integrating and processing multi-source data. When there are deviations or omissions in the data foundation, it will cause source errors in subsequent modeling inputs, making it impossible to guarantee the accuracy and completeness of the initial data.

[0004] Therefore, a method for constructing intelligent agents using numerical simulation examples of gas reservoirs is proposed to solve the above problems. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a method for constructing intelligent agents for gas reservoir numerical simulation examples. This method solves the problems mentioned in the background technology, such as the inability to achieve automatic standardized access and unified management of geological, dynamic, and document-based data, as well as the inability to guarantee the accuracy and completeness of initial data.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for constructing an intelligent agent for a gas reservoir numerical simulation example, the method comprising the following steps: S1. Collect and manage multi-source heterogeneous data to generate a structured data pool and an unstructured vector knowledge base; S2. Through the MCP protocol interface layer, the data in the structured data pool and the unstructured vector knowledge base are standardized for access and integration to generate standardized multi-source data; S3. Based on the standardized multi-source data, the modeling of gas reservoir numerical simulation examples is carried out through multi-agent collaboration of the intelligent agent layer to generate initial numerical simulation example files. The intelligent agent layer adopts an architecture of collaboration between the main intelligent agent and the sub-intelligent agents. The sub-intelligent agents are modularly divided according to the chapter structure of the example file of the target numerical simulation software. S4. Based on the initial numerical simulation example file, intelligent verification and optimization processing are performed in conjunction with the unstructured vector knowledge base and the gas reservoir engineering mechanism model to generate a verified numerical simulation example file. S5. Output the verified numerical simulation example file.

[0007] Preferably, the collection and management of multi-source heterogeneous data in step S1 to generate a structured data pool and an unstructured vector knowledge base includes the following steps: S11. Collect multi-source data of the target gas reservoir, including basic geological data, dynamic production data and unstructured knowledge data; Basic geological data includes drilling data, well logging data, seismic interpretation data, and 3D geological modeling results; Dynamic production data includes daily gas production data, pressure change data, and liquid accumulation data of the gas reservoir; Unstructured knowledge data includes detailed gas reservoir description reports, adjacent well case study files, and expert experience documents; S12. Perform data cleaning, format standardization, unit unification, and outlier removal on the structured data in the various types of source data to generate the structured data pool; Outlier removal employs a composite criterion based on data distribution and business rules, for sequence data. , its first Data points To be considered an outlier, the following conditions must be met simultaneously: ; in, and Sequences The global mean and standard deviation, for The median of the data within the local time window. The interquartile range of the data in this window. and This is a threshold coefficient preset based on gas reservoir engineering experience; S13. Vectorize the unstructured knowledge data in the various types of source data, and construct a retrieval-enhanced vector knowledge base to generate the unstructured vector knowledge base.

[0008] Preferably, in step S2, the standardized access and integration of data from the structured data pool and the unstructured vector knowledge base, generated through the MCP protocol interface layer, includes the following steps: S21. Construct a standardized interface layer based on a multi-agent communication protocol, and define a unified data transmission format and communication specifications; S22. Through the standardized interface layer, access the geological modeling software, production data platform and document parsing tool, and call the document parsing tool to parse the unstructured knowledge data in the unstructured vector knowledge base; S23. Through the standardized interface layer, receive grid data from the geological modeling software, dynamic production data from the production data platform, and structured parsing results from the document parsing tool, and integrate them to generate the standardized multi-source data.

[0009] Preferably, in step S3, based on the standardized multi-source data, the modeling of gas reservoir numerical simulation examples is performed through multi-agent collaboration at the agent layer to generate initial numerical simulation example files. The agent layer adopts an architecture of collaboration between a master agent and segmented agents. The segmented agents are modularly divided according to the chapter structure of the example files of the target numerical simulation software, including the following steps: S31. The main intelligent agent receives the computational instance construction task, and decomposes and schedules the task, allocating the sub-tasks to the corresponding segment intelligent agents. S32. Multiple segmented intelligent agents work in parallel, and based on the standardized multi-source data, perform parameter matching and example fragment generation within the chapter of their respective example files. The segmented intelligent agents include geological grid intelligent agents, fluid PVT intelligent agents, relative permeability intelligent agents, rock property intelligent agents, well production system intelligent agents, water body intelligent agents, and digital model initialization intelligent agents. S33. Each segmented intelligent agent submits its generated computational fragment to the main intelligent agent; S34. The main intelligent agent fuses, sorts, and assembles all received example fragments to generate the initial numerical simulation example file that conforms to the format requirements of the target numerical simulation software.

[0010] Preferably, the parameter matching and example fragment generation process of the geological grid agent in S32 includes the following steps: S321a. The geological grid agent extracts geological model data from the standardized multi-source data; S322a. The geological grid agent calls the corresponding keyword sub-agent to generate grid definition parameters according to the type of the geological model data. The keyword sub-agent includes the DIMENS keyword sub-agent for defining grid dimensions, the ACTNUM keyword sub-agent for defining effective grids, the COORD and ZCORN keyword sub-agents for defining corner grid coordinates, the DX, DY, and DZ keyword sub-agents for defining Cartesian grid dimensions, and the TOPS keyword sub-agent for defining top surface depth. S323a. The geological grid intelligent body calls the corresponding keyword sub-intelligent body to generate rock physical property parameter distribution data. The keyword sub-intelligent body includes the PORO keyword sub-intelligent body that defines porosity, the PERMX keyword sub-intelligent body that defines X-direction permeability, the PERMY keyword sub-intelligent body that defines Y-direction permeability, the PERMZ keyword sub-intelligent body that defines Z-direction permeability, and the NTG keyword sub-intelligent body that defines net-to-gross ratio. S324a. The geological grid agent combines the grid definition parameters with the rock physical property parameter distribution data to generate a geological grid chapter example fragment.

[0011] Preferably, the parameter matching and example fragment generation process of the fluid PVT agent in S32 includes the following steps: S321b, The fluid PVT agent extracts reservoir fluid type definitions from the standardized multi-source data; S322b. The fluid PVT agent, according to the fluid type definition, calls the corresponding keyword sub-agent to generate fluid components and characteristic parameters. When it is a black oil model, the called keyword sub-agents include PVDO and PVTO keyword sub-agents that define oil phase PVT properties, PVDG and PVTG keyword sub-agents that define gas phase PVT properties, and PVTW keyword sub-agents that define water phase PVT properties. When it is a component model, the called keyword sub-agent includes GRAVITY keyword sub-agent that defines critical parameters of the components. S323b, The fluid PVT agent calls the DENSITY keyword sub-agent that defines the fluid density to generate fluid density data; S324b, The fluid PVT agent combines the fluid components with the characteristic parameters and the fluid density data to generate a fluid PVT chapter example segment.

[0012] Preferably, the parameter matching and example fragment generation process performed by the phase-permeable agent in S32 includes the following steps: S321c, The phase permeability intelligent agent extracts experimental and empirical data on gas-water, oil-gas, and oil-gas-water phase permeability curves from the standardized multi-source data; S322c. The phase permeability agent, according to the phase permeability curve representation format, calls the corresponding keyword sub-agent to generate standardized phase permeability curve table data. The keyword sub-agent includes the SWOF keyword sub-agent that defines the oil-water phase permeability curve, the SGOF keyword sub-agent that defines the oil-gas phase permeability curve, and the SGFN and SWFN keyword sub-agents that define the gas-water phase permeability curve. S323c, The relative permeability agent calls the SATNUM keyword sub-agent that defines the relative permeability curve partition number to associate the standardized relative permeability curve table data with the grid region; S324c, The interpenetrating agent combines the associated interpenetrating curve data to generate an interpenetrating chapter example segment.

[0013] Preferably, the parameter matching and example fragment generation process of the well production system intelligent agent in S32 includes the following steps: S321d, The well production system intelligent agent extracts the target gas reservoir's basic well information, well trajectory data, well completion data, and production dynamic data from the standardized multi-source data; S322d, The well production system intelligent agent calls the WELSPECS keyword sub-intelligent agent that defines the well location and basic attributes to generate well location data; S323d, The well production system intelligent agent calls the COMPDAT keyword sub-intelligent agent that defines the well completion segment to generate well completion data; S324d. The well production system intelligent agent calls the corresponding keyword sub-intelligent agent to generate production system data according to the production stage. The keyword sub-intelligent agent includes the WCONHIST keyword sub-intelligent agent that defines historical production constraints, the WCONPROD keyword intelligent agent that defines predictive period production constraints, and the WCONINJE keyword intelligent agent that defines injection well constraints. S325d, The well production system intelligent agent combines the well location data, the well completion data, and the production system data in a time sequence to generate a well production system chapter example segment.

[0014] Preferably, in step S4, based on the initial numerical simulation example file, and combining the unstructured vector knowledge base and the gas reservoir engineering mechanism model, intelligent verification and optimization are performed to generate a verified numerical simulation example file, which includes the following steps: S41. Perform syntax verification on the initial numerical simulation example file: Read the initial numerical simulation example file, call the execution program of the target numerical simulation software to parse it, and when the parsing error occurs, automatically extract the error lines and keywords in the error log. Based on the error lines and keywords, search the preset keyword syntax rule library to generate syntax error location information and correction suggestions. S42. Perform semantic and logical verification on the example files that have passed the syntax check: analyze the logical dependencies and mutual exclusion relationships between different keywords in the example files, compare them with the pre-set knowledge graph of logical relationships of gas reservoir parameters, and generate logical consistency verification results. Among these measures, the severity of logical conflicts in key parameters is quantitatively assessed, with a conflict index. The calculation formula is: ; in, This represents the total number of parameter logic rules involved in this round of verification. The first example file actually used Parameter values, For the first defined in the knowledge graph The reasonable values ​​and ranges specified in the rules. For indicator functions, when violation The value is 1 if it is true, and 0 otherwise. To pre-set the importance of the rules The weighting coefficient of each rule; S43. Perform physical rationality verification on the example files that have passed semantic and logical verification: extract the key physical property parameters from the example files, combine them with the unstructured vector knowledge base, retrieve the historical experience parameter range of similar gas reservoirs through retrieval enhancement generation technology, and cross-verify them with the theoretical rationality range calculated by the gas reservoir engineering mechanism model to generate parameter rationality evaluation results. S44. Based on the syntax error location information and correction suggestions, the logical consistency verification results and the parameter rationality evaluation results, the initial numerical simulation case file is automatically corrected and optimized iteratively to generate the verified numerical simulation case file.

[0015] Preferably, S44 includes the following steps: S441. When the syntax error location information and correction suggestions exist, directly modify the parameters and format of the corresponding keyword line according to the correction suggestions; S442. When the logical consistency verification result indicates that there is a logical conflict, the parameter values ​​of the relevant keywords are automatically adjusted to reduce the conflict based on the preset conflict resolution rule priority. S443. When the parameter rationality assessment result indicates that the parameter exceeds the reasonable range, the intersection of the median of the historical empirical parameters of the similar gas reservoir and the reasonable range of the mechanism model theory is used as a reference, and the parameter is automatically adjusted to the reference range. S444. Resubmit the corrected and optimized example file for verification processing from S41 to S43 to form a closed-loop optimization process until all verifications pass and the maximum number of iterations is reached, and output the final verified numerical simulation example file.

[0016] Compared with existing technologies, this invention provides a method for constructing intelligent agents in numerical simulation examples of gas reservoirs, which has the following beneficial effects: 1. In this invention, by constructing a standardized data processing flow based on the MCP protocol interface layer, the automatic standardized access and unified integration of multi-source heterogeneous data from geological modeling software, production data platforms, and documents are realized. This solves the problems of inconsistent multi-source data formats and errors that are easy to occur during manual integration, ensuring the accuracy and integrity of input data, providing a high-quality structured data pool for subsequent automated modeling, and improving the reliability of numerical simulation work.

[0017] 2. In this invention, by adopting a collaborative architecture of main agent and segmented agents, and by modularizing the segmented agents according to the chapter structure of the example file of the target numerical simulation software, the invention achieves automated parsing and arrangement of complex keyword syntax and logical dependencies between parameters, replacing the traditional manual writing mode that relies on engineer experience. This avoids chapter omissions, keyword errors and logical contradictions, improves the automation level and first-time success rate of example construction, and shortens the modeling cycle.

[0018] 3. In this invention, by integrating an unstructured vector knowledge base with a gas reservoir engineering mechanism model, a triple intelligent verification and closed-loop optimization process covering syntactic, semantic, and physical rationality is constructed. This process can automatically discover and correct various potential errors in the initial numerical simulation example files, solving the problems of limited coverage and reliance on subjective experience in traditional manual verification. This ensures the model quality and physical reliability of the final constructed numerical simulation examples, providing a more scientific and accurate model foundation for gas reservoir development decisions. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating the steps of constructing an intelligent agent for a gas reservoir numerical simulation example according to the present invention. Detailed Implementation

[0020] The technical solutions of 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.

[0021] Please see Figure 1 The specific implementation of a method for constructing an intelligent agent in a gas reservoir numerical simulation example is as follows, and the method includes the following steps: S1. Collect and manage multi-source heterogeneous data to generate a structured data pool and an unstructured vector knowledge base; S2. Through the MCP protocol interface layer, the data in the structured data pool and the unstructured vector knowledge base are standardized for access and integration to generate standardized multi-source data. S3. Based on standardized multi-source data, the modeling of gas reservoir numerical simulation examples is carried out through multi-agent collaboration in the intelligent agent layer to generate initial numerical simulation example files. The intelligent agent layer adopts an architecture of collaboration between the main intelligent agent and the sub-intelligent agents. The sub-intelligent agents are modularly divided according to the chapter structure of the example file of the target numerical simulation software. S4. Based on the initial numerical simulation example file, intelligent verification and optimization are performed by combining the unstructured vector knowledge base and the gas reservoir engineering mechanism model to generate a verified numerical simulation example file. S5. Output the verified numerical simulation example file.

[0022] The process of collecting and managing multi-source heterogeneous data in S1 to generate a structured data pool and an unstructured vector knowledge base includes the following steps: S11. Collect multi-source data of the target gas reservoir, including basic geological data, dynamic production data and unstructured knowledge data; Basic geological data includes drilling data, well logging data, seismic interpretation data, and 3D geological modeling results; Dynamic production data includes daily gas production data, pressure change data, and liquid accumulation data of the gas reservoir; Unstructured knowledge data includes detailed gas reservoir description reports, adjacent well case study files, and expert experience documents; S12. Perform data cleaning, format standardization, unit unification, and outlier removal on structured data from various types of source data to generate a structured data pool. Outlier removal employs a composite criterion based on data distribution and business rules, for sequence data. , its first Data points To be considered an outlier, the following conditions must be met simultaneously: ; in, and Sequences The global mean and standard deviation, for The median of the data within the local time window. The interquartile range of the data in this window. and This is a threshold coefficient preset based on gas reservoir engineering experience; S13. Vectorize unstructured knowledge data from various types of source data and construct a retrieval-enhanced vector knowledge base to generate an unstructured vector knowledge base. Specifically, the vectorization process uses a pre-trained language model to convert unstructured texts such as gas reservoir detailed description reports and expert experience documents into high-dimensional vectors. The retrieval enhancement generates a vector knowledge base by associating the above vectors with source text fragments and storing them in a vector database, supporting approximate nearest neighbor retrieval based on cosine similarity.

[0023] In S2, the MCP protocol interface layer is used to standardize and integrate data from the structured data pool and the unstructured vector knowledge base to generate standardized multi-source data. This includes the following steps: S21. Construct a standardized interface layer based on a multi-agent communication protocol, and define a unified data transmission format and communication specifications; Specifically, the MCP protocol interface layer is implemented based on the HTTP and gRPC framework, defining standard message formats for requesting and transmitting data. Its core includes DataSchema messages that define data types, GridDataRequest messages that request geological grid data, and ProductionDataPacket messages that encapsulate production dynamic data. This interface layer achieves standardized access by developing dedicated adapters for different backend systems. The adapters are responsible for converting the native data format into standard MCP messages and vice versa. S22. Through a standardized interface layer, connect to geological modeling software, production data platform and document parsing tool, and call the document parsing tool to parse unstructured knowledge data in unstructured vector knowledge base; S23. Through the standardized interface layer, receive grid data from geological modeling software, dynamic production data from the production data platform, and structured parsing results from document parsing tools, and integrate them to generate standardized multi-source data. The overall quality of the integrated data is evaluated, and its comprehensive quality score is determined. It can be calculated using the following formula: ; in, For the completeness rate of key data items, To score the consistency between cross-source data, The percentage of null values ​​in the cleaned data. , , These are weighting coefficients set according to the importance of the business, and ; Specifically, completeness rate The calculation method is as follows: ,in This is the total number of required parameters pre-defined based on the target gas reservoir type and numerical simulation scheme. Consistency score is calculated based on the number of required non-nullable parameter items obtained in the integrated data. The calculation method is as follows: for different data sources describing the same geological entity and physical parameters, their values ​​are compared. ,in For the cross-validable logarithm of parameters, and For the first The values ​​of each parameter in different sources, the null value rate ,in To consolidate the total number of fields in the dataset, Number of null fields, weighting coefficient , , The setting principle is =0.5, =0.3, =0.2, and when Below the preset threshold When the default value is 0.7, a data quality alarm is triggered and a mark is set that requires manual review.

[0024] In S3, based on standardized multi-source data, the modeling of gas reservoir numerical simulation examples is performed through multi-agent collaboration at the agent layer, generating initial numerical simulation example files. The agent layer adopts an architecture of collaboration between the main agent and segment agents. The segment agents are modularly divided according to the chapter structure of the example files of the target numerical simulation software, including the following steps: S31. The main intelligent agent receives the computational example construction task, decomposes the task and schedules resources, and assigns the sub-tasks to the corresponding segment intelligent agents. Specifically, the main intelligent agent, segment intelligent agents, and key sub-intelligent agents are software agents that follow hierarchical decision-making logic. The main intelligent agent acts as a coordinator and uses a bidding and tendering mechanism based on the contract network protocol to decompose and schedule tasks. Each segment intelligent agent receives tasks, exchanges statuses, and submits results through a message bus with a publish and subscribe pattern. The task allocation strategy is based on an assessment of the real-time load and historical data processing capabilities of each segment agent, and assigns subtask weights to the i-th segment agent from the master agent. Calculated dynamically by the following formula: ; in, This represents the total number of segmented agents involved in the tasks to be assigned. For the first The historical average efficiency score of each segmented agent in handling similar tasks. Its current real-time load rate; Specifically, historical average efficiency score The calculation method is as follows: ,in The average time taken for this segmented agent to complete similar historical subtasks. This serves as the standard reference time for this type of subtask. Rate the accuracy of its historical task outputs. This is the weighting factor, with a default value of 0.6; Real-time load rate The calculation method is as follows: ,in This represents the number of tasks currently being processed by the segmented agent. Set the maximum number of concurrent processing tasks for it; S32. Multiple segmented intelligent agents work in parallel. Based on standardized multi-source data, they perform parameter matching and example segment generation within the chapter of their respective example files. The segmented intelligent agents include geological grid intelligent agents, fluid PVT intelligent agents, relative permeability intelligent agents, rock property intelligent agents, well production system intelligent agents, water body intelligent agents, and digital model initialization intelligent agents. S33. Each segment agent submits its generated computational example fragments to the main agent. S34. The main intelligent agent fuses, sorts, and assembles all received example fragments to generate an initial numerical simulation example file that meets the format requirements of the target numerical simulation software.

[0025] The parameter matching and example fragment generation process for the S32 geological grid intelligent agent includes the following steps: S321a. Geological grid intelligent agents extract geological model data from standardized multi-source data; S322a. The geological grid agent calls the corresponding keyword sub-agents to generate grid definition parameters according to the type of geological model data. The keyword sub-agents include the DIMENS keyword sub-agent for defining grid dimensions, the ACTNUM keyword sub-agent for defining effective grids, the COORD and ZCORN keyword sub-agents for defining corner grid coordinates, the DX, DY, and DZ keyword sub-agents for defining Cartesian grid dimensions, and the TOPS keyword sub-agent for defining top surface depth. S323a. The geological grid intelligent body calls the corresponding keyword sub-intelligent body to generate rock physical property parameter distribution data. The keyword sub-intelligent bodies include the PORO keyword sub-intelligent body that defines porosity, the PERMX keyword sub-intelligent body that defines X-direction permeability, the PERMY keyword sub-intelligent body that defines Y-direction permeability, the PERMZ keyword sub-intelligent body that defines Z-direction permeability, and the NTG keyword sub-intelligent body that defines net-to-gross ratio. The generated mesh undergoes a quality pre-evaluation, including mesh distortion. The calculation formula is: ; in, The total number of cells in the grid. For the first The area of ​​any face of a grid cell. The average surface area of ​​all grid cells in this layer, when When the preset threshold is exceeded, the grid smoothing process is triggered; Specifically, area For the first The area of ​​the face with the largest deviation from the average area among the six faces of a grid cell, and the average area. This is the average area of ​​all faces of all mesh cells within the current computational layer, when the calculated... Greater than the preset threshold When the default value is 0.25, a mesh smoothing process is triggered. This process uses the Laplace smoothing algorithm to iteratively adjust the mesh node coordinates until... And reach the maximum number of iterations; S324a. The geological grid intelligent agent combines grid definition parameters with rock physical property parameter distribution data to generate geological grid chapter example fragments.

[0026] The parameter matching and example fragment generation process for the fluid PVT agent in S32 includes the following steps: S321b, Fluid PVT agents extract reservoir fluid type definitions from standardized multi-source data; S322b: The fluid PVT agent, based on the fluid type definition, calls the corresponding keyword sub-agent to generate fluid components and characteristic parameters. When it is a black oil model, the keyword sub-agents called include the PVDO and PVTO keyword sub-agents that define the PVT properties of the oil phase, the PVDG and PVTG keyword sub-agents that define the PVT properties of the gas phase, and the PVTW keyword sub-agent that defines the PVT properties of the water phase. When it is a component model, the keyword sub-agent called includes the GRAVITY keyword sub-agent that defines the critical parameters of the components. S323b: The fluid PVT agent calls the DENSITY keyword sub-agent that defines the fluid density to generate fluid density data; During the parameter generation process, PVT parameters from different data sources are consistently fused, and the fused parameter values ​​are... The calculation is as follows: ; in, To provide the total number of data sources for this parameter, For from the Parameter values ​​from each data source. Provide the historical standard deviation of such parameters for this data source. To prevent division by zero for a very small positive value, To assign weights to the data source based on its historical reliability; Specifically, historical error standard deviation This is achieved by maintaining a data source error record table in the system knowledge base, recording each data source error. The error between the provided values ​​of various PVT parameters and the benchmark values ​​of those parameters after subsequent verification through authoritative experiments and historical fitting is calculated, and the standard deviation of this type of error is used as the basis for the determination. For newly connected data sources and data sources with no historical records, assign them a larger default value. Value, retrieves all data sources with records. Twice the average, minimum positive value Take 1×10 −8 To prevent division by zero errors; S324b, the fluid PVT agent combines fluid components with characteristic parameters and fluid density data to generate a fragment of the fluid PVT chapter example.

[0027] The parameter matching and example fragment generation process of the phase-permeable agent in S32 includes the following steps: S321c, the phase permeability intelligent agent extracts experimental and empirical data on gas-water, oil-gas, and oil-gas-water phase permeability curves from standardized multi-source data; S322c: The phase permeability agent calls the corresponding keyword sub-agent to generate standardized phase permeability curve table data according to the phase permeability curve representation format. The keyword sub-agents include the SWOF keyword sub-agent that defines the oil-water phase permeability curve, the SGOF keyword sub-agent that defines the oil-gas phase permeability curve, and the SGFN and SWFN keyword sub-agents that define the gas-water phase permeability curve. When generating curve data, the smoothness and physical plausibility of the curves are verified, and their monotonicity evaluation index is used. Calculated using the following formula: ; in, This represents the total number of data points for the relative permeability curve. This represents the number of data point pairs in the curve that violate the monotonic relationship between saturation and relative permeability of the relative permeability curve. Specifically, the number of data point pairs that violate monotonic relationships The method for determining this is: iterate through each data point starting from the second point. Check its relative permeability value Compared to the previous point The relationship between the relative permeability of the oil phase and the oil phase. It should be adjusted according to the water saturation level. Increasing and monotonically decreasing, when This is counted as one violation point pair, for the relative permeability of the water phase. , should follow Increasing and monotonically increasing, when This is counted as one violation point pair. Below the preset threshold When the default value is 0.9, the curve smoothing correction process is triggered, and the original data points are resampled using cubic spline interpolation to ensure monotonicity. S323c, the relative permeability agent calls the SATNUM keyword sub-agent that defines the relative permeability curve partition number to associate the standardized relative permeability curve table data with the grid region; S324c and the phase permeation agent combine the associated phase permeation curve data to generate phase permeation chapter example segments.

[0028] The S32 well production system intelligent agent performs parameter matching and example fragment generation processing, which includes the following steps: S321d, the well production system intelligent agent extracts the target gas reservoir's basic well information, well trajectory data, well completion data, and production dynamic data from standardized multi-source data; S322d, the well production system intelligent agent calls the WELSPECS keyword sub-intelligent agent that defines the well location and basic attributes to generate well location data; S323d, the well production system intelligent agent calls the COMPDAT keyword sub-intelligent agent that defines the completion segment to generate completion data; S324d, the well production system intelligent agent calls the corresponding keyword sub-intelligent agent to generate production system data according to the production stage. The keyword sub-intelligent agents include the WCONHIST keyword sub-intelligent agent that defines historical production constraints, the WCONPROD keyword intelligent agent that defines predictive period production constraints, and the WCONINJE keyword intelligent agent that defines injection well constraints. S325d, the well production system intelligent agent combines well location data, well completion data and production system data in time sequence to generate well production system chapter example segments.

[0029] In S4, based on the initial numerical simulation example file, intelligent verification and optimization are performed using an unstructured vector knowledge base and a gas reservoir engineering mechanism model to generate a verified numerical simulation example file. The steps include: S41. Perform syntax verification on the initial numerical simulation example file: Read the initial numerical simulation example file, call the execution program of the target numerical simulation software to parse it, and when the parsing error occurs, automatically extract the error lines and keywords in the error log. Based on the error lines and keywords, search the preset keyword syntax rule library to generate syntax error location information and correction suggestions. S42. Perform semantic and logical verification on the example files that have passed the syntax check: analyze the logical dependencies and mutual exclusion relationships between different keywords in the example files, compare them with the pre-set knowledge graph of logical relationships of gas reservoir parameters, and generate logical consistency verification results. Specifically, the knowledge graph of logical relationships of gas reservoir parameters stores rules in the form of triples, with weight coefficients. Based on the rule type preset: the weight of basic syntax and integrity rules is 1.0, the weight of physical logic rules is 0.7, and the weight of engineering experience constraint rules is 0.5; Among these measures, the severity of logical conflicts in key parameters is quantitatively assessed, with a conflict index. The calculation formula is: ; in, This represents the total number of parameter logic rules involved in this round of verification. The first example file actually used Parameter values, For the first defined in the knowledge graph The reasonable values ​​and ranges specified in the rules. For indicator functions, when violation The value is 1 if it is true, and 0 otherwise. To pre-set the importance of the rules The weighting coefficient of each rule; S43. Perform physical rationality verification on the example files that have passed semantic and logical verification: extract the key physical property parameters in the example files, combine them with the unstructured vector knowledge base, retrieve the historical experience parameter range of similar gas reservoirs through retrieval enhancement generation technology, and cross-validate them with the theoretical rationality range calculated by the gas reservoir engineering mechanism model to generate parameter rationality evaluation results. Specifically, the operation process of the retrieval enhancement generation technology is as follows: First, the extracted key physical property parameters and their context are constructed into a natural language query. The query is then performed in an unstructured vector knowledge base to retrieve the Top-K most similar known gas reservoir cases and experience paragraphs. Subsequently, the retrieved relevant knowledge is combined with the original query to form prompt words, which are then input into a large language model to generate structured parameter rationality assessment results. The gas reservoir engineering mechanism model includes a material balance equation for assessing the reasonable range of formation pressure, Darcy's formula for assessing the reasonable range of single-well productivity, and phase equation for assessing the reasonable range of fluid PVT parameters. The theoretical range calculated and output by the model is cross-validated with the empirical range obtained from the retrieval. S44. Based on the syntax error location information and correction suggestions, the logical consistency verification results and the parameter rationality evaluation results, the initial numerical simulation case file is automatically corrected and optimized iteratively to generate a verified numerical simulation case file.

[0030] S44 includes the following steps: S441. When there is syntax error location information and correction suggestions, directly modify the parameters and format of the corresponding keyword line according to the correction suggestions; S442. When the logical consistency check result indicates that there is a logical conflict, the parameter values ​​of the relevant keywords are automatically adjusted to reduce the conflict based on the priority of the preset conflict resolution rules. S443. When the parameter rationality assessment results indicate that the parameter exceeds the reasonable range, the intersection of the median value of the historical empirical parameters of similar gas reservoirs and the reasonable range of the mechanism model theory shall be used as a reference to automatically adjust the parameter to the reference range. S444. Resubmit the corrected and optimized example file for verification processing from S41 to S43 to form a closed-loop optimization process until all verifications pass and the maximum number of iterations is reached, and output the final verified numerical simulation example file.

[0031] The steps of a method for constructing an intelligent agent in a gas reservoir numerical simulation example are as follows: Step 1: Collection and Management of Multi-Source Heterogeneous Data This method first initiates a multi-source data governance process, led by data engineers, to systematically collect various types of data from the target gas reservoir. This includes basic geological data such as drilling, logging, and 3D geological modeling results; dynamic production data such as daily gas production and pressure changes; and unstructured knowledge data such as reservoir description reports and expert experience documents. Subsequently, the structured data undergoes data cleaning, format standardization, unit unification, and outlier removal to form a high-quality structured data pool. Simultaneously, the unstructured knowledge data is vectorized to construct an unstructured vector knowledge base with retrieval and enhanced generation capabilities, providing knowledge support for intelligent decision-making.

[0032] Step 2: Standard data integration based on the MCP protocol: To break down data silos, this method constructs an MCP protocol interface layer to achieve standardized data access and integration. This interface layer defines a unified data transmission format and communication specifications, enabling seamless integration with various external systems such as geological modeling software, production data platforms, and document parsing tools. The document parsing tool uses this interface to intelligently parse documents in the unstructured vector knowledge base, extracting key parameters. Ultimately, grid data, dynamic production data, and structured parsing results from various sources are integrated into a standardized multi-source data set through the MCP protocol interface layer, providing unified and standardized data input for subsequent modeling.

[0033] Step 3: Automated modeling of multi-agent collaborative examples: This step is the core of the method and is executed by the agent layer. After receiving the case construction task, the main agent makes global decisions and schedules the process, breaking down the task and dynamically allocating it to the corresponding sub-agents. The sub-agents are modularized according to the chapter structure of the case file of the target numerical simulation software, including at least a geological grid agent, a fluid PVT agent, a relative permeability agent, a rock property agent, a well production system agent, a water body agent, and a numerical simulation initialization agent. Each sub-agent calls multiple keyword sub-agents under its jurisdiction, working in parallel based on standardized multi-source data, and completing parameter matching and case fragment generation within their respective sections. Finally, the main agent merges, sorts, and assembles the case fragments submitted by all sub-agents to generate an initial numerical simulation case file that meets the software format requirements.

[0034] Step 4: Intelligent verification and optimization by integrating knowledge base and mechanism model: To ensure the quality of the numerical simulation examples, this method performs intelligent verification on the initial numerical simulation example files. The verification is divided into three levels: First, syntax verification is performed by calling the simulator to parse and retrieve the pre-set syntax rule library to automatically locate and correct format errors. Second, semantic and logical verification is performed by analyzing the dependency and mutual exclusion relationships between keywords based on the knowledge graph of the logical relationship between gas reservoir parameters to ensure logical consistency. Finally, physical rationality verification is performed by extracting key physical property parameters, retrieving similar gas reservoir experience from the unstructured vector knowledge base, and cross-validating with the theoretical range calculated by the gas reservoir engineering mechanism model. Based on the results of the above three verifications, the system automatically corrects and performs closed-loop optimization on the example files. After multiple rounds of iteration, a high-quality verified numerical simulation example file is finally output.

[0035] Step 5: Output and application of example files: The validated numerical simulation example file serves as the final result of this method. It is output, visualized, and delivered through the application layer. This file is directly called by mainstream numerical simulation mechanism model software for historical fitting and production prediction, providing a decision-making basis for the development and adjustment of old gas reservoirs. At the same time, this file also serves as a high-quality training sample, which is input into the intelligent agent model for gas reservoir development, supporting the construction and application of its intelligent scenarios and workflows.

[0036] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0037] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for constructing an intelligent agent in a numerical simulation example of a gas reservoir, characterized in that, The method includes the following steps: S1. Collect and manage multi-source heterogeneous data to generate a structured data pool and an unstructured vector knowledge base; S2. Through the MCP protocol interface layer, the data in the structured data pool and the unstructured vector knowledge base are standardized for access and integration to generate standardized multi-source data; S3. Based on the standardized multi-source data, the modeling of gas reservoir numerical simulation examples is carried out through multi-agent collaboration of the intelligent agent layer to generate initial numerical simulation example files. The intelligent agent layer adopts an architecture of collaboration between the main intelligent agent and the sub-intelligent agents. The sub-intelligent agents are modularly divided according to the chapter structure of the example file of the target numerical simulation software. S4. Based on the initial numerical simulation example file, intelligent verification and optimization processing are performed in conjunction with the unstructured vector knowledge base and the gas reservoir engineering mechanism model to generate a verified numerical simulation example file. S5. Output the verified numerical simulation example file.

2. The method for constructing an intelligent agent for a gas reservoir numerical simulation example according to claim 1, characterized in that, The steps in S1 for collecting and managing multi-source heterogeneous data to generate a structured data pool and an unstructured vector knowledge base include: S11. Collect multi-source data of the target gas reservoir, including basic geological data, dynamic production data and unstructured knowledge data; Basic geological data includes drilling data, well logging data, seismic interpretation data, and 3D geological modeling results; Dynamic production data includes daily gas production data, pressure change data, and liquid accumulation data of the gas reservoir; Unstructured knowledge data includes detailed gas reservoir description reports, adjacent well case study files, and expert experience documents; S12. Perform data cleaning, format standardization, unit unification, and outlier removal on the structured data in the various types of source data to generate the structured data pool; Outlier removal employs a composite criterion based on data distribution and business rules, for sequence data. , its first Data points To be considered an outlier, the following conditions must be met simultaneously: ; in, and Sequences The global mean and standard deviation, for The median of the data within the local time window. The interquartile range of the data in this window. and This is a threshold coefficient preset based on gas reservoir engineering experience; S13. Vectorize the unstructured knowledge data in the various types of source data, and construct a retrieval-enhanced vector knowledge base to generate the unstructured vector knowledge base.

3. The method for constructing an intelligent agent for a gas reservoir numerical simulation example according to claim 1, characterized in that, In step S2, the standardized access and integration of data from the structured data pool and the unstructured vector knowledge base are performed through the MCP protocol interface layer to generate standardized multi-source data, including the following steps: S21. Construct a standardized interface layer based on a multi-agent communication protocol, and define a unified data transmission format and communication specifications; S22. Through the standardized interface layer, access the geological modeling software, production data platform and document parsing tool, and call the document parsing tool to parse the unstructured knowledge data in the unstructured vector knowledge base; S23. Through the standardized interface layer, receive grid data from the geological modeling software, dynamic production data from the production data platform, and structured parsing results from the document parsing tool, and integrate them to generate the standardized multi-source data.

4. The method for constructing an intelligent agent for a gas reservoir numerical simulation example according to claim 1, characterized in that, In step S3, based on the standardized multi-source data, the modeling of gas reservoir numerical simulation examples is performed through multi-agent collaboration at the agent layer, generating initial numerical simulation example files. The agent layer adopts an architecture of collaboration between a master agent and segmented agents. The segmented agents are modularly divided according to the chapter structure of the example files of the target numerical simulation software, including the following steps: S31. The main intelligent agent receives the computational instance construction task, and decomposes and schedules the task, allocating the sub-tasks to the corresponding segment intelligent agents. S32. Multiple segmented intelligent agents work in parallel, and based on the standardized multi-source data, perform parameter matching and example fragment generation within the chapter of their respective example files. The segmented intelligent agents include geological grid intelligent agents, fluid PVT intelligent agents, relative permeability intelligent agents, rock property intelligent agents, well production system intelligent agents, water body intelligent agents, and digital model initialization intelligent agents. S33. Each segmented intelligent agent submits its generated computational fragment to the main intelligent agent; S34. The main intelligent agent fuses, sorts, and assembles all received example fragments to generate the initial numerical simulation example file that conforms to the format requirements of the target numerical simulation software.

5. The method for constructing an intelligent agent for a gas reservoir numerical simulation example according to claim 4, characterized in that, The parameter matching and example fragment generation process of the geological grid agent in S32 includes the following steps: S321a. The geological grid agent extracts geological model data from the standardized multi-source data; S322a. The geological grid agent calls the corresponding keyword sub-agent to generate grid definition parameters according to the type of the geological model data. The keyword sub-agent includes the DIMENS keyword sub-agent for defining grid dimensions, the ACTNUM keyword sub-agent for defining effective grids, the COORD and ZCORN keyword sub-agents for defining corner grid coordinates, the DX, DY, and DZ keyword sub-agents for defining Cartesian grid dimensions, and the TOPS keyword sub-agent for defining top surface depth. S323a. The geological grid intelligent body calls the corresponding keyword sub-intelligent body to generate rock physical property parameter distribution data. The keyword sub-intelligent body includes the PORO keyword sub-intelligent body that defines porosity, the PERMX keyword sub-intelligent body that defines X-direction permeability, the PERMY keyword sub-intelligent body that defines Y-direction permeability, the PERMZ keyword sub-intelligent body that defines Z-direction permeability, and the NTG keyword sub-intelligent body that defines net-to-gross ratio. S324a. The geological grid agent combines the grid definition parameters with the rock physical property parameter distribution data to generate a geological grid chapter example fragment.

6. The method for constructing an intelligent agent for a gas reservoir numerical simulation example according to claim 4, characterized in that, The parameter matching and example fragment generation process of the fluid PVT agent in S32 includes the following steps: S321b, The fluid PVT agent extracts reservoir fluid type definitions from the standardized multi-source data; S322b. The fluid PVT agent, according to the fluid type definition, calls the corresponding keyword sub-agent to generate fluid components and characteristic parameters. When it is a black oil model, the called keyword sub-agents include PVDO and PVTO keyword sub-agents that define oil phase PVT properties, PVDG and PVTG keyword sub-agents that define gas phase PVT properties, and PVTW keyword sub-agents that define water phase PVT properties. When it is a component model, the called keyword sub-agent includes GRAVITY keyword sub-agent that defines critical parameters of the components. S323b, The fluid PVT agent calls the DENSITY keyword sub-agent that defines the fluid density to generate fluid density data; S324b, The fluid PVT agent combines the fluid components with the characteristic parameters and the fluid density data to generate a fluid PVT chapter example segment.

7. The method for constructing an intelligent agent for a gas reservoir numerical simulation example according to claim 4, characterized in that, The parameter matching and example fragment generation process of the phase-permeable agent in S32 includes the following steps: S321c, The phase permeability intelligent agent extracts experimental and empirical data on gas-water, oil-gas, and oil-gas-water phase permeability curves from the standardized multi-source data; S322c. The phase permeability agent, according to the phase permeability curve representation format, calls the corresponding keyword sub-agent to generate standardized phase permeability curve table data. The keyword sub-agent includes the SWOF keyword sub-agent that defines the oil-water phase permeability curve, the SGOF keyword sub-agent that defines the oil-gas phase permeability curve, and the SGFN and SWFN keyword sub-agents that define the gas-water phase permeability curve. S323c, The relative permeability agent calls the SATNUM keyword sub-agent that defines the relative permeability curve partition number to associate the standardized relative permeability curve table data with the grid region; S324c, The interpenetrating agent combines the associated interpenetrating curve data to generate an interpenetrating chapter example segment.

8. The method for constructing an intelligent agent for a gas reservoir numerical simulation example according to claim 4, characterized in that, The parameter matching and example fragment generation process of the S32 well production system intelligent agent includes the following steps: S321d, The well production system intelligent agent extracts the target gas reservoir's basic well information, well trajectory data, well completion data, and production dynamic data from the standardized multi-source data; S322d, The well production system intelligent agent calls the WELSPECS keyword sub-intelligent agent that defines the well location and basic attributes to generate well location data; S323d, The well production system intelligent agent calls the COMPDAT keyword sub-intelligent agent that defines the well completion segment to generate well completion data; S324d. The well production system intelligent agent calls the corresponding keyword sub-intelligent agent to generate production system data according to the production stage. The keyword sub-intelligent agent includes the WCONHIST keyword sub-intelligent agent that defines historical production constraints, the WCONPROD keyword intelligent agent that defines predictive period production constraints, and the WCONINJE keyword intelligent agent that defines injection well constraints. S325d, The well production system intelligent agent combines the well location data, the well completion data and the production system data in a time sequence to generate a well production system chapter example segment.

9. The method for constructing an intelligent agent for a gas reservoir numerical simulation example according to claim 1, characterized in that, The steps in S4, which involve intelligent verification and optimization based on the initial numerical simulation example file and the unstructured vector knowledge base and gas reservoir engineering mechanism model, to generate a verified numerical simulation example file, include the following: S41. Perform syntax verification on the initial numerical simulation example file: Read the initial numerical simulation example file, call the execution program of the target numerical simulation software to parse it, and when the parsing error occurs, automatically extract the error lines and keywords in the error log. Based on the error lines and keywords, search the preset keyword syntax rule library to generate syntax error location information and correction suggestions. S42. Perform semantic and logical verification on the example files that have passed the syntax check: analyze the logical dependencies and mutual exclusion relationships between different keywords in the example files, compare them with the pre-set knowledge graph of logical relationships of gas reservoir parameters, and generate logical consistency verification results. Among these measures, the severity of logical conflicts in key parameters is quantitatively assessed, with a conflict index. The calculation formula is: ; in, This represents the total number of parameter logic rules involved in this round of verification. The first example file actually used Parameter values, For the first defined in the knowledge graph The reasonable values ​​and ranges specified in the rules. For indicator functions, when violation The value is 1 if the condition is met, and 0 otherwise. To pre-set the importance of the rules The weighting coefficient of each rule; S43. Perform physical rationality verification on the example files that have passed semantic and logical verification: extract the key physical property parameters from the example files, combine them with the unstructured vector knowledge base, retrieve the historical experience parameter range of similar gas reservoirs through retrieval enhancement generation technology, and cross-verify them with the theoretical rationality range calculated by the gas reservoir engineering mechanism model to generate parameter rationality evaluation results. S44. Based on the syntax error location information and correction suggestions, the logical consistency verification results and the parameter rationality evaluation results, the initial numerical simulation case file is automatically corrected and optimized iteratively to generate the verified numerical simulation case file.

10. The method for constructing an intelligent agent for a gas reservoir numerical simulation example according to claim 9, characterized in that, S44 includes the following steps: S441. When the syntax error location information and correction suggestions exist, directly modify the parameters and format of the corresponding keyword line according to the correction suggestions; S442. When the logical consistency verification result indicates that there is a logical conflict, the parameter values ​​of the relevant keywords are automatically adjusted to reduce the conflict based on the preset conflict resolution rule priority. S443. When the parameter rationality assessment result indicates that the parameter exceeds the reasonable range, the intersection of the median of the historical empirical parameters of the similar gas reservoir and the reasonable range of the mechanism model theory is used as a reference, and the parameter is automatically adjusted to the reference range. S444. Resubmit the corrected and optimized example file for verification processing from S41 to S43 to form a closed-loop optimization process until all verifications pass and the maximum number of iterations is reached, and output the final verified numerical simulation example file.