Oil and gas production data intelligent meter reading method based on large model and coding model
By automatically identifying and matching oil and gas production data headers using large-scale and coded models, the problem of data migration between different table formats is solved, achieving efficient automated data processing and a user-friendly data import process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA NAT OFFSHORE OIL CORP
- Filing Date
- 2026-01-15
- Publication Date
- 2026-05-12
AI Technical Summary
Oil and gas production data comes from a wide range of sources and comes in various formats, resulting in low data import efficiency and high manual cleaning costs. Existing fixed template import methods are cumbersome to operate and have a low error tolerance.
By employing large-scale models and coding models, the system automatically identifies the header mapping relationship between the source table and the standard template, intelligently parses drop-down options, and enables automated data migration between tables of different formats.
Significantly shortens data import time, greatly improves data processing efficiency and user experience, and enables a complete automated meter reading process.
Smart Images

Figure CN122021576A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of oil and gas production technology, and in particular to an intelligent meter reading method for oil and gas production data based on a large model and a coding model. Background Technology
[0002] With the continuous advancement of technology, oil and gas exploration and development is accelerating its digital transformation.
[0003] However, technological evolution has also brought new challenges: upstream oil and gas production data comes from a wide range of sources and is in diverse formats. The data tables used by different operating units and at different times vary greatly in structure and standards, severely hindering the efficiency of data import. The currently prevalent fixed-template import method requires business personnel to manually organize data strictly according to preset formats, with strict requirements on field order, naming conventions, and dictionary values. This is not only cumbersome and has a low error tolerance, but also leads to high manual data cleaning costs and makes it difficult to improve efficiency. Summary of the Invention
[0004] To address the aforementioned problems, the present invention aims to provide an intelligent meter reading method for oil and gas production data based on a large model and a coding model. This method can automatically identify the header mapping relationship between the source table and the standard template, intelligently parse and match semantic content containing drop-down options, realize automated data migration between tables of different formats, shorten the user's data import time, and significantly improve the efficiency and accuracy of data processing.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: Firstly, this application provides a method for intelligent meter reading of oil and gas production data using large-scale models and coded models, including: Step (1): Receive the source table transmitted by the user for recording oil and gas production data, and obtain the template selection information input by the user; Step (2): Parse the source table and extract the information of the header fields. Step (3): Based on the template selection information input by the user, determine the form of the target template table to be converted from the source table, and extract the information of the header fields and drop-down list configuration of the target template table; Step (4): Based on the large model, match the header fields of the source table with the header fields of the target template table to establish a mapping relationship; Step (5): Based on the mapping relationship, using the encoding model, according to the drop-down list configuration contained in the target template table, the data content of each column of oil and gas production data under the header field in the source table is migrated to the corresponding position in the target template table.
[0006] In one implementation, step (2) includes: Read the table file of the source table uploaded by the user based on the client, and identify the position of the header row of the source table file; Process merged cells in multi-level headers to generate complete hierarchical header names.
[0007] In one implementation, step (3) includes: Based on the template selection information input by the user, determine the form of the target template table to be converted from the source table, read the corresponding target template table file, and identify the position of the header row in the table file; Process merged cells in multi-level headers to generate complete hierarchical header names; Extract the fields and their option lists that are configured as dropdown lists from the template table.
[0008] In one implementation, step (4) includes: Based on the header matching requirements of the source table and the target template table, construct structured prompt words; Call the large model, extract the returned results, and parse them; Extract and examine the matching result dictionary object to generate the header mapping dictionary for the source table and the target template table.
[0009] In one implementation, during step (5), for fields in the target template table that have drop-down configuration constraints, a hybrid matching strategy is adopted to convert and migrate the data content of the corresponding column in the source table; for fields in the target template table that do not have drop-down configuration constraints, the data content of the corresponding column in the source table is directly migrated.
[0010] The present invention has the following advantages due to the adoption of the above technical solutions: The technical solution of this invention can automatically complete the intelligent matching of header fields based on the standard template table selected by the user and the provided original table data. During the data filling process, it automatically identifies whether the fields have drop-down constraints, and performs secondary intelligent matching on the data with drop-down constraints, realizing a complete automated meter reading process, greatly shortening the user's data import time, and significantly improving the efficiency of data processing and the overall user experience. Attached Figure Description
[0011] Figure 1 A flowchart illustrating an intelligent meter reading method for oil and gas production data based on a large model and a coding model, provided as an embodiment of the present invention; Figure 2 A flowchart for parsing source table data and extracting header field information is provided as an embodiment of the present invention; Figure 3A flowchart illustrating the parsing of template table data, extraction of header field information, and dropdown list configuration is provided in one embodiment of the present invention. Figure 4 A flowchart of a field mapping method based on a large language model is provided as an embodiment of the present invention; Figure 5 This is a flowchart of a data migration and dropdown matching method provided in one embodiment of the present invention.
[0012] Figure 6 This is a structural diagram of an intelligent meter reading system for oil and gas production data based on a large model and a coding model, provided as an embodiment of the present invention. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention are within the scope of protection of the present invention.
[0014] This application provides a smart meter reading method for oil and gas production data based on large-scale models and coded models, including: Step (1): Receive the source table transmitted by the user for recording oil and gas production data, and obtain the template selection information input by the user; Step (2): Parse the source table and extract the information of the header fields. Step (3): Based on the template selection information input by the user, determine the form of the target template table to be converted from the source table, and extract the information of the header fields and drop-down list configuration of the target template table; Step (4): Based on the large model, match the header fields of the source table with the header fields of the target template table to establish a mapping relationship; Step (5): Based on the mapping relationship, using the encoding model, according to the drop-down list configuration contained in the target template table, the data content of each column of oil and gas production data under the header field in the source table is migrated to the corresponding position in the target template table.
[0015] The methods and systems of this application are described below in more detail with reference to the accompanying drawings.
[0016] based on Figure 1 In one embodiment, the body includes the following steps: S110, receives template selection information and oil and gas production form files from the client; Specifically, the system receives template selection information and oil and gas production data table files from the client. The client can be understood as the user terminal, where users can select templates and upload oil and gas production data table files via mobile phones, personal computers, or other devices.
[0017] S120, parse the source table data and extract its header field information; S130, parse the template table data and extract its header field information and drop-down list configuration; S140 utilizes a large language model to perform semantic-level intelligent matching between the source table header and the template table header, establishing accurate field mapping relationships. S150, based on the mapping relationship of S140, migrates the source table data column by column to the corresponding position in the template. For fields in the template with drop-down constraints, a hybrid matching strategy is used for content matching. S160, save the completed template table.
[0018] exist Figure 2 In a more detailed embodiment, the method for parsing source table data and extracting its header field information includes the following steps: S210: Read the source table file and identify the specified header row position.
[0019] Specifically, by using the openpyxl library to load the source template Excel file, it supports the recognition of three types of header row positions, including single-row header (such as only row 0), multi-row consecutive header (such as the first two rows: row 0 and row 1), and multi-row non-consecutive header (such as row 0 and row 2).
[0020] S220 processes merged cells in multi-level headers to generate complete hierarchical header names.
[0021] Specifically, before extracting the header, a coordinate mapping table is created for each merged area by traversing all merged cell areas in the worksheet. The value of the top-left cell is then filled into all positions of the entire merged area to ensure that each physical column can obtain complete hierarchical information when extracting the header.
[0022] It's important to note that when extracting the header, the system iterates through each column of the Excel file, sequentially reading the value of each cell in the specified header row. If the cell is merged, the already filled value is retrieved from the mapping table; if it's a regular cell, the original value is read directly. The retrieved header text at each level is first processed to remove newline characters and extra spaces, then connected using the slash " / " to form the complete header name. For example, the first-level header "Basic Information" and the second-level header "Hash" will be merged into "Basic Information / Hash".
[0023] like Figure 3 As shown, the specific steps for parsing the template table data and extracting its header field information and dropdown list configuration include: S310 reads the template table file and identifies the specified header row position.
[0024] S320 processes merged cells in multi-level headers to generate complete hierarchical header names.
[0025] S330, Extract the fields and their option lists that are configured with drop-down boxes from the template table.
[0026] When extracting dropdown configurations, the data validation function based on openpyxl iterates through all validation rules set in the template table, filtering out rules of type list for processing. For each identified dropdown column, its validation formula (e.g., "Sheet2!$A$1:$A$10") is parsed to separate the worksheet sheet and cell range. Then, the range string is parsed to obtain four boundary values: starting row number, ending row number, starting column number, and ending column number. The cell content within this range is read row by row, skipping empty values, and non-empty values are converted to strings and stored in the option list. Finally, the column letter is extracted by parsing the application range of the validation rule, and the column name corresponding to the dropdown is determined according to the column name mapping table pre-established in S320.
[0027] Figure 4 In this process, a large language model is used to perform semantic-level intelligent matching between the source table header and the template table header to establish accurate field mapping relationships. Specifically, this includes: S410: Based on the table header matching requirements, construct structured prompt words.
[0028] In this step, the prompt word design follows these principles: First, the role is positioned as a "senior expert in the field of oil and gas production data table matching"; second, the task requirement is to conduct "in-depth analysis" of the two sets of table headers and establish a "scientific and reasonable matching relationship".
[0029] The prompts must include detailed matching requirements and constraints. The first is a "one-to-one matching" principle, ensuring each header matches at most once, avoiding chaotic many-to-one or one-to-many matching. The second is "prioritize semantic similarity," a key difference from traditional string matching, emphasizing understanding the meaning of the header rather than simply comparing literal text. The third allows "marking as unmatched," preventing forced matching of headers that are clearly unmatchable. The fourth is a special requirement: "Do not change header names, do not delete existing asterisks," ensuring that required field markers and other special symbols in the template are preserved.
[0030] The output format of the prompt words must strictly adhere to the JSON format and provide a detailed structure template. The JSON object contains three main fields: the `matches` array stores all successfully matched header pairs, with each match including the source header name, template header name, match confidence, and a reason for matching; the `unmatched_table1_headers` array records headers in the source table that could not be matched; and the `unmatched_table2_headers` array records headers in the template table that could not be matched.
[0031] S420 calls the large model API, extracts the returned results, and parses them.
[0032] Specifically, the request must specify the model, user message, maximum character limit, and temperature parameter to ensure the stability and determinism of the generated results. The request header carries the content type and API key, and sets timeout and error checking. If the call fails, it returns None. During parsing, it first attempts to parse the entire response text into JSON; if that fails, it uses regular expressions to match possible JSON structure blocks in the response and attempts to parse them one by one until valid data is successfully extracted; otherwise, it returns None to indicate parsing failure.
[0033] S430: Extract and inspect the dictionary object of the matching results, and generate the source table and template table header mapping dictionary.
[0034] Specifically, after successful parsing, a dictionary object containing the matching results is obtained. First, the `matches` field is checked to ensure it exists and is not empty; otherwise, the match is considered a failure. The `matches` array is iterated through, extracting the source header and template header names for each item. If both are not empty, they are stored in the mapping dictionary in the format `{template header: source header}`. Then, the template header list is iterated through, setting the values of unmatched columns to `None`, indicating that the column has no corresponding data in the source table. An example of the final generated mapping dictionary is: `{"Well Identifier": "Basic Information / Well Number", "*Section Identifier": "Section", "Casing Pressure": "Pressure / Casing Pressure"}`.
[0035] like Figure 5 The diagram illustrates the data content migration process, which specifically includes: S510: Migrate data column by column, and determine if the current template column has a drop-down constraint. If not, proceed to S520; if it is, proceed to S530.
[0036] Specifically, during the data migration process, the system iterates through each column of the template table. For the current template column, it first queries the corresponding source column name based on the mapping dictionary established by S430. If the query result is None, it enters None in the template column and skips that column to continue processing the next column; if the corresponding source column name is found, it extracts the data for that column from the source table. After obtaining the source data column, it determines whether the template column has a drop-down constraint and decides the next operation accordingly.
[0037] S520: The current template column does not have a drop-down constraint. Directly fill the source data into the corresponding column of the template.
[0038] S530, the current template column has a drop-down list constraint, and a hybrid matching strategy is used for filling.
[0039] Specifically, if the template column has dropdown constraints, the data migration needs to go through an intelligent matching process. The matching process is divided into two layers. The first layer is exact keyword matching, which requires traversing each row of values in the source data column. If the value is empty, None is appended to the template column and the matching is skipped; if the value is not empty, it is converted into a string and exact keyword matching is attempted.
[0040] If an exact match fails to find a matching item, the system proceeds to the second layer of vector semantic matching. This involves encoding the current source value into a 768-dimensional semantic vector using an encoding model, calculating the cosine similarity between this vector and the vectors of all dropdown options, and selecting the option index with the highest similarity and its corresponding similarity value. The system then checks if the highest similarity score reaches a preset threshold: if it does, a matching option is entered; if not, it indicates a significant semantic difference between the source value and all options, making a reliable match impossible, and the system returns a corresponding unmatched message.
[0041] Corresponding to the method flow in the foregoing embodiments, this application also provides a system to realize intelligent meter reading.
[0042] like Figure 6 As shown, the system includes a template selection module, a table upload module, a source table parsing module, a template parsing module, a header matching module, a data filling module, and a result storage module. Among these: The template selection module S610 is used to receive standardized template information selected by the user.
[0043] The table upload module S620 is used to receive oil and gas production data table files uploaded by users from the client.
[0044] The source table parsing module S630 receives the table, and the system automatically parses the table content, extracts the table header information, and processes merged cells.
[0045] The template parsing module S640 loads the standard template selected by the user, extracts the header field names, parses the data validation rules set in the template, and extracts the reference range limited by the drop-down list in the drop-down list column.
[0046] The header matching module S650 calls the large language model to semantically align the headers of the source table and the template, establishing a reliable field mapping relationship between the two tables.
[0047] The data population module S660 migrates the source data column by column to the corresponding positions in the template. For ordinary fields, it directly fills in the data according to the mapping relationship. For fields with drop-down constraints set in the template, a mixed matching strategy is used.
[0048] The result storage module S670 is used to store the filled standard template table.
[0049] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0050] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.
[0051] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0052] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for intelligent meter reading of oil and gas production data using a large-scale model and a coded model, characterized in that, include: Step (1): Receive the source table transmitted by the user for recording oil and gas production data, and obtain the template selection information input by the user; Step (2): Parse the source table and extract the information of the header fields. Step (3): Based on the template selection information input by the user, determine the form of the target template table to be converted from the source table, and extract the information of the header fields and drop-down list configuration of the target template table; Step (4): Based on the large model, match the header fields of the source table with the header fields of the target template table to establish a mapping relationship; Step (5): Based on the mapping relationship, using the encoding model, according to the drop-down list configuration contained in the target template table, the data content of each column of oil and gas production data under the header field in the source table is migrated to the corresponding position in the target template table.
2. The method according to claim 1, characterized in that, Step (2) includes: Read the table file of the source table uploaded by the user based on the client, and identify the position of the header row of the source table file; Process merged cells in multi-level headers to generate complete hierarchical header names.
3. The method according to claim 2, characterized in that, Step (3) includes: Based on the template selection information input by the user, determine the form of the target template table to be converted from the source table, read the corresponding target template table file, and identify the position of the header row in the table file; Process merged cells in multi-level headers to generate complete hierarchical header names; Extract the fields and their option lists that are configured as dropdown lists from the template table.
4. The method according to claim 3, characterized in that, Step (4) includes: Based on the header matching requirements of the source table and the target template table, construct structured prompt words; Call the large model, extract the returned results, and parse them; Extract and examine the matching result dictionary object to generate the header mapping dictionary for the source table and the target template table.
5. The method according to claim 4, characterized in that, In step (5), during the data content migration process, for fields in the target template table that have drop-down configuration constraints, a hybrid matching strategy is adopted to convert and migrate the data content of the corresponding columns in the source table. For fields in the target template table that do not have dropdown configuration constraints, the data content of the corresponding column in the source table is directly migrated.
6. A smart meter reading system for oil and gas production data based on a large-scale model and a coded model, characterized in that, include: The table upload module is used to receive source tables from users that record oil and gas production data. The template selection module is used to obtain template selection information input by the user; The source table parsing module is used to parse the source table and extract information from the header fields. The template parsing model is used to determine the form of the target template table to be converted from the source table based on the template selection information input by the user, and to extract the header field information and drop-down list configuration of the target template table. The header matching module, based on a large model, matches the header fields of the source table with the header fields of the target template table to establish a mapping relationship. The data filling module, based on the mapping relationship, uses an encoding model and, according to the drop-down list configuration contained in the target template table, migrates the data content of each column of oil and gas production data under the header field of the source table to the corresponding position in the target template table.
7. A computer storage medium, characterized in that, The device contains a computer program, which is executed by a processor to implement the method of any one of claims 1 to 5.
8. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method of any one of claims 1 to 5.