Method, system, medium and computer device for automatically matching field names of well files with field names
Through automated methods, the similarity between the well file field names and database field names is solved, and the problem of inefficient manual inspection in the prior art is achieved, fast and accurate field name matching is achieved, and data processing efficiency is improved.
Patent Information
- Application Number
- CN202210360322.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-06
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2042-04-06
AI Technical Summary
In the process of building a seismic geological data resource pool for exploration, the existing technology requires manual inspection and correction of whether the field names and contents in the well file match, which is inefficient, and due to inconsistent field names naming rules, automatic matching is difficult.
An automated method is adopted to obtain the user fields and data characteristics of the file to be matched, and to calculate the similarity with the field names and data characteristics in the database, generate a similarity matrix, and select the field name with the highest similarity as the matching result.
It realizes the rapid and accurate automatic matching of field names of well files, reducing manual intervention and improving data processing efficiency.
Smart Images

Figure CN114896466B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, system, medium and computer device for automatically matching field names of well files having field names. Background Art
[0002] In the process of building an exploration seismic geological data resource pool, the collected data are all original well file data. This type of data has a large amount of data, multiple file types, and inconsistent file naming methods.
[0003] The main well data files include logging curve files, well head files, well trajectory files, well layer files, lithology files, etc. The file types are also varied, including .las type, excel type, prn, txt, dat, etc.
[0004] There is no unified rule or standard for naming field names. The field name naming methods in existing documents are as follows: (1) there is a field name but it does not match the field content; (3) there is a field name and it matches the field content, but the field name naming rules are not unified. There are all-Chinese names, all-English names, a mixture of Chinese and English, or various abbreviations, etc.
[0005] To address this problem, the traditional method is to manually check whether the field name matches the field content, whether the field name is standardized, etc. If it matches and is standardized, it is directly uploaded to the exploration seismic geological data resource pool. If it does not match or is not standardized, it is manually corrected and uploaded to the exploration seismic geological data resource pool. Although the above method can realize data upload, manual inspection and manual correction of well data files will take a long time and have low efficiency. Therefore, there is an urgent need for an intelligent and automatic way to match file names to replace the traditional manual method to reduce the workload of staff. Summary of the invention
[0006] In order to improve the efficiency of correcting the field names of files, the present application provides a method for automatically matching the field names of files having field names.
[0007] In the first aspect, the present application provides a method for automatically matching field names of well files with field names, which adopts the following technical solutions:
[0008] The method for automatically matching field names of well files having field names comprises the following steps:
[0009] Get the file name of the file to be matched.
[0010] Obtain the user field of the file to be matched, calculate the similarity between the feature of the user field and the feature of the database field name, and obtain a field similarity matrix based on the user field, wherein the database field name refers to the field name corresponding to the file name in the database,
[0011] Obtain user data (fields) of the file to be matched, calculate the similarity between the features of the user data and the features of the database fields, and obtain a field similarity matrix based on the user data, wherein the database field refers to the field corresponding to the file name in the database,
[0012] The field similarity matrix based on user fields and the field similarity matrix based on user data are calculated to obtain the final field similarity matrix.
[0013] Based on the obtained field similarity matrix, the field name corresponding to the highest similarity is selected as the field name of the file to be matched.
[0014] Through the above technical scheme, when the field name naming method in the file exists that there is a field name but it does not match the field content, or there is a field name and it matches the field content, but the field name naming rules are not unified, there are all-Chinese naming, all-English naming, a mixture of Chinese and English, or various abbreviations, etc., the automatic matching of field names can be used instead of the traditional manual method to reduce the workload of the staff, and the field name features and data features are used to calculate the similarity of each field name in the table in the database respectively, and the two similarities are calculated to obtain a similarity matrix. The field name corresponding to the feature with the highest similarity in the similarity matrix is selected as the field name of the file to be matched, which can more accurately and quickly match the appropriate field name for the file to be matched.
[0015] As a more preferred technical solution, the calculation method of the calculation includes weighted summation.
[0016] Through the above technical solution, weights are set for weighted summation. On the one hand, the matching results based on user fields and the matching results based on user data are considered at the same time. By assigning different weights to the two, a more humane and intelligent result division is achieved. In terms of matching accuracy, it can be said that this method improves the matching accuracy and reduces the matching error by better allocating weights. In addition, the weights of the weighted summation are all between 0 and 1, and the sum of the two weights is 1, which ensures that the values of the two similarity matrices obtained are both within the range of less than 1, which is also in line with the traditional probability expression form. Finally, it facilitates the calculation between the two matrices.
[0017] As a preferred technical solution, the method of obtaining the user field of the to-be-matched file, calculating the similarity between the features of the user field and the features of the database field name, and obtaining the field similarity matrix based on the user field specifically includes: using the TF-ID weighting technology to calculate the weight of each word in the field name, and using the Levenshtein ratio algorithm to calculate the similarity between each word in the user field and each word in the field name in the database, performing weighted summation on the weight and the similarity to obtain the field similarity matrix based on the user field, performing weighted summation on the similarity and the weight to obtain the field similarity matrix based on the user field,
[0018] and / or,
[0019] The step of obtaining user data (field) of the file to be matched, calculating the similarity between the features of the user data and the features of the database field, and obtaining a field similarity matrix based on the user data specifically includes:
[0020] The TF-ID weighting technology is used to calculate the weight of each word in the field, and the Levenshtein ratio algorithm is used to calculate the similarity between each word in the user data and each word in the field in the database. The weight and the similarity are weighted and summed to obtain a field similarity matrix based on the user data.
[0021] Through the above technical solution, when performing user field matching, the field is split into words one by one, and the Levenshtein ratio algorithm is used in conjunction with the TF-ID weighting technology, so that the data of the similarity matrix obtained is more accurate.
[0022] As a better technical solution, the method of selecting the field name corresponding to the highest similarity as the field name of the file to be matched based on the acquired field similarity matrix specifically includes:
[0023] A two-way matching method is used to select the field name corresponding to the highest similarity as the field name of the file to be matched. The two-way matching method includes: selecting the maximum value of the corresponding row and column in the similarity matrix.
[0024] The above technical solution is different from the conventional one-way matching method. The one-way matching method only considers the similarity relationship between the column data and the different fields to be compared when matching the column name for each column of data, and selects the column name corresponding to the highest similarity. The one-way matching method is prone to the disadvantage that multiple columns to be matched may eventually be determined as the same field name. In order to avoid this problem, the present technical solution adopts a two-way matching method, that is, not only the field selected by the column name, but also the column name selected by the field is considered. When the column 1 to be matched and the column 2 to be matched point to the same field at the same time, the similarity between the two is compared, and the higher one is the column selected by the field at the same time.
[0025] As a better technical solution, the database is a field name knowledge base, and each field is split into words. The splitting methods include: 1) English: split into words according to characters such as underscores; 2) Chinese: split each word.
[0026] Through the above technical solution, each field is split into words, which facilitates the subsequent feature extraction and similarity calculation.
[0027] As a better technical solution, for the to-be-matched files with unmatched field names, the similarity between the features of the user data and the features of the remaining database field names is calculated, and the database field name with the greatest similarity is selected as the final matching field name.
[0028] Through the above technical solution, the field names of all files to be matched can be automatically matched, which can reduce manual input and improve the efficiency of field name matching.
[0029] As a better technical solution, in the step of obtaining the file name of the file to be matched, if the file to be matched has no file name, the file name matching step is performed first:
[0030] Obtain the user field of the file to be matched (the user field refers to the header corresponding to the user uploaded file, that is, the field name), calculate the similarity between the features of the user field and the features of the field names corresponding to all file names in the database, and obtain a file name similarity matrix based on the user field.
[0031] Obtain user data (fields) of the file to be matched, calculate the similarity between the features of the user data and the features of the fields corresponding to all file names in the database, and obtain a file name similarity matrix based on the user data.
[0032] The file name similarity matrix based on user fields and the file name similarity matrix based on user data are weighted and summed to obtain the final file name similarity matrix.
[0033] Based on the obtained file name similarity matrix, the file name corresponding to the highest similarity is selected as the file name of the file to be matched.
[0034] Through the above technical solution, when a file to be matched does not have a file name, a suitable file name can be automatically matched for the file, which can greatly improve work efficiency compared with manual matching of file names.
[0035] As a preferred technical solution, before the step of obtaining the file name of the file to be matched, a file name correction step is first performed:
[0036] Determine whether the inherent file name of the file to be matched contains an extension. If so,
[0037] Then, the extension of the inherent file name of the file to be matched is obtained, and a new file name is matched for the file to be matched according to the extension.
[0038] Through the above technical solution, in the case where the file to be matched has a file name and an extension, a suitable file name can be automatically matched for the file to be matched according to the extension, which can greatly improve work efficiency compared with manual matching of file names.
[0039] As a preferred technical solution, in the file name correction step, if the inherent file name of the file to be matched has no extension, a file name matching step is performed: obtaining the user field of the file to be matched (the user field refers to the header corresponding to the user uploaded file, that is, the field name), calculating the similarity between the characteristics of the user field and the characteristics of the field names corresponding to all file names in the database, and obtaining a file name similarity matrix based on the user field,
[0040] Obtain user data (fields) of the file to be matched, calculate the similarity between the features of the user data and the features of the fields corresponding to all file names in the database, and obtain a file name similarity matrix based on the user data.
[0041] The file name similarity matrix based on user fields and the file name similarity matrix based on user data are weighted and summed to obtain the final file name similarity matrix.
[0042] Based on the obtained file name similarity matrix, the file name corresponding to the highest similarity is selected as the file name of the file to be matched.
[0043] Through the above technical solution, if the file to be matched has a file name but no extension, it is impossible to determine whether the file name is correct, so it is necessary to re-match the file to be matched with a suitable file name. This technical solution uses an automatic file name matching method to replace the traditional manual method to reduce the workload of the staff. The field name features and data features are used to calculate the similarity with each file name feature in the table in the database, and the two similarities are calculated to obtain the final comprehensive consideration result, which can more accurately and quickly match the file to be matched with a suitable file name.
[0044] As a preferred technical solution, the similarity calculation method specifically includes: comparing the similarity of the features of each column of data in the to-be-matched file with the minimum standard column of features of all files in the database in turn.
[0045] Through the above technical solution, the method of matching with the minimum standard column can not only achieve the purpose of quickly locking the file, but also speed up the matching speed and shorten the matching time.
[0046] As a preferred technical solution, the characteristics of the database field include element length, pure numbers, time type and combination mode, and the feature extraction of the user data also includes element length, pure numbers, time type and combination mode.
[0047] Since each column of data in each type of file has its own characteristics, for example, if the number of digits of the YX coordinate data in the wellhead file exceeds 6, if the number of digits of a column of data in the wellhead file exceeds 6, it will be most likely identified as the XY coordinate. This is the data characteristic of the XY coordinate. Or, in the lithology color column of the lithology file, when words representing colors appear,
[0048] For example, "black", "black", this column of data will be identified as a lithology color column with a high probability. Based on the characteristics of the current data, the data features are finally extracted from four aspects through analysis, namely element length, pure numbers, time type and combination method. The technical means used are mainly regular matching. Since various data features have been fully analyzed, the above four aspects are selected to extract data features, which will make the extraction of data features more accurate and usable.
[0049] As a preferred technical solution, the method for extracting the features of the user data is as follows:
[0050] Extraction of element length: Determine whether the element length of the column data exceeds A bits. If so, record the element length as ">A; otherwise, record the element length as null.
[0051] and / or,
[0052] Extraction of pure numbers: Determine whether the data type of the column is numeric. If so, extract the following features from the column: minimum value, maximum value, mean value, variance, and minimum digit, and record the features. Otherwise, record the pure numbers as empty.
[0053] and / or,
[0054] Extraction of time type: determine whether the data contains time features, if so, record the time type as the time type, otherwise, record the time type as empty, wherein the time feature includes two ":" symbols or two " / " symbols;
[0055] and / or,
[0056] Extraction of combination mode: Determine whether the column data is not entirely composed of one data type. If so, record all data type information. Otherwise, the record is empty. The data types include Chinese, English, numbers, and symbols.
[0057] Through the above technical solutions, features can be quickly locked and extracted, thereby improving the efficiency of feature extraction.
[0058] In the second aspect, the present application provides a well file field name automatic matching system with field names, which adopts the following technical solution:
[0059] A well file field name automatic matching system with field names, including the following modules:
[0060] File name acquisition module: used to obtain the file name of the file to be matched.
[0061] The first matrix generation module is used to obtain the user field of the file to be matched, calculate the similarity between the characteristics of the user field and the characteristics of the database field name, and obtain a field similarity matrix based on the user field, wherein the database field name refers to the field name corresponding to the file name in the database,
[0062] The second matrix generation module is used to obtain the user data (field) of the file to be matched, calculate the similarity between the characteristics of the user data and the characteristics of the database field, and obtain a field similarity matrix based on the user data, wherein the database field refers to the field corresponding to the file name in the database,
[0063] The final matrix generation module is used to perform weighted summation of the field similarity matrix based on user fields and the field similarity matrix based on user data to obtain the final field similarity matrix. The field name matching module is used to select the field name corresponding to the highest similarity as the field name of the file to be matched based on the obtained field similarity matrix.
[0064] Through the above technical scheme, when the field name naming method in the file exists that there is a field name but it does not match the field content, or there is a field name and it matches the field content, but the field name naming rules are not unified, there are all-Chinese naming, all-English naming, a mixture of Chinese and English, or various abbreviations, etc., the automatic matching of field names can be used instead of the traditional manual method to reduce the workload of the staff, and the field name features and data features are used to calculate the similarity of each field name in the table in the database respectively, and the two similarities are calculated to obtain a similarity matrix. The field name corresponding to the feature with the highest similarity in the similarity matrix is selected as the field name of the file to be matched, which can more accurately and quickly match the appropriate field name for the file to be matched.
[0065] In a third aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:
[0066] A computer-readable storage medium stores a computer program, which, when called by a processor, executes the steps of the method for automatically matching field names of well files with field names as described in any of the above technical solutions.
[0067] Through the above technical scheme, when the field name naming method in the file exists that there is a field name but it does not match the field content, or there is a field name and it matches the field content, but the field name naming rules are not unified, there are all-Chinese naming, all-English naming, a mixture of Chinese and English, or various abbreviations, etc., the automatic matching of field names can be used instead of the traditional manual method to reduce the workload of the staff, and the field name features and data features are used to calculate the similarity of each field name in the table in the database respectively, and the two similarities are calculated to obtain a similarity matrix. The field name corresponding to the feature with the highest similarity in the similarity matrix is selected as the field name of the file to be matched, which can more accurately and quickly match the appropriate field name for the file to be matched.
[0068] In a fourth aspect, the present application provides a computer device, which adopts the following technical solution:
[0069] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is called by the processor, the steps of the method for automatically matching field names of well files with field names described in any of the above technical solutions are executed.
[0070] Through the above technical scheme, when the field name naming method in the file exists that there is a field name but it does not match the field content, or there is a field name and it matches the field content, but the field name naming rules are not unified, there are all-Chinese naming, all-English naming, a mixture of Chinese and English, or various abbreviations, etc., the automatic matching of field names can be used instead of the traditional manual method to reduce the workload of the staff, and the field name features and data features are used to calculate the similarity of each field name in the table in the database respectively, and the two similarities are calculated to obtain a similarity matrix. The field name corresponding to the feature with the highest similarity in the similarity matrix is selected as the field name of the file to be matched, which can more accurately and quickly match the appropriate field name for the file to be matched.
[0071] In summary, this application mainly includes the following beneficial technical effects:
[0072] 1. When the field names in the file are named in a way that there are field names but they do not match the field content, or there are field names and they match the field content, but the field name naming rules are not unified, there are all-Chinese names, all-English names, mixed Chinese and English names, or various abbreviations, etc., the automatic matching of field names can be used instead of the traditional manual method to reduce the workload of the staff. The field name features and data features are used to calculate the similarity of each field name in the table in the database respectively, and the two similarities are calculated to obtain a similarity matrix. The field name corresponding to the feature with the highest similarity in the similarity matrix is selected as the field name of the file to be matched, which can more accurately and quickly match the appropriate field name for the file to be matched.
[0073] Secondly, this application also includes the following beneficial technical effects:
[0074] 2. When there is a file name in the file that has a file name but does not match the field content, or there is a file name and matches the field content, but the naming rules of the file name are not unified, there are all-Chinese names, all-English names, a mixture of Chinese and English, or various abbreviations, etc., the automatic file name matching method can be used instead of the traditional manual method to reduce the workload of the staff. The field name features and data features are used to calculate the similarity of each field name in all tables in the database respectively, and the two similarities are calculated to obtain a similarity matrix. The file name corresponding to the feature with the highest similarity in the similarity matrix is selected as the file name of the file to be matched, which can more accurately and quickly match the appropriate field name for the file to be matched.
[0075] 3. The Levenshtein ratio algorithm is used in conjunction with the TF-ID weighting technology to obtain a more accurate similarity matrix.
[0076] 4. The two-way matching method is used to select the field name corresponding to the highest similarity as the field name of the file to be matched, which can solve the disadvantages that are easily caused by the one-way matching method, that is, multiple columns to be matched may eventually be determined as the same field name.
[0077] 5. Compare the similarity of the features of each column of data in the file to be matched with the minimum standard column of the features of all files in the database in turn, which can not only achieve the purpose of quickly locking the file, but also speed up the matching speed and shorten the matching time.
[0078] 6. By analyzing the data characteristics of the well file, the features to be extracted are selected, including element length, pure numbers, time type and combination method, which will make the extraction of data features more accurate and usable.
[0079] 7. Develop a feature extraction method suitable for well files, which can quickly lock features and extract them, thereby improving the efficiency of feature extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 It is a flow chart of a method for automatically matching field names of well files with field names according to an embodiment of the present application;
[0081] Figure 2 is a flowchart of the automatic file name matching method of an embodiment of the present application;
[0082] Figure 3 to Figure 4 A schematic diagram of the fields of the well header file;
[0083] Figure 5 It is a schematic diagram of the file name of the well trajectory file;
[0084] Figure 6 and Figure 7 It is a schematic diagram of the fields that may appear in the field names of the well trajectory files in the database;
[0085] Figure 8 and Fig. 9 It is a schematic diagram of the fields of well name and layer name of the well layer file;
[0086] Figures 10 to 12 It is a field diagram of depth and subsurface elevation of the well stratification file;
[0087] Fig.13 It is a field diagram of the lithology file. DETAILED DESCRIPTION
[0088] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-13 And embodiments, the present application is further described in detail.
[0089] In the process of building an exploration seismic geological data resource pool, the collected data are all original well file data. This type of data has a large amount of data, multiple file types, and inconsistent file naming methods.
[0090] The main well data files include logging curve files, well head files, well trajectory files, well layer files, lithology files, etc. The file types are also varied, including .las type, excel type, prn, txt, dat, etc.
[0091] There are no unified rules and standards for naming field names. The field name naming methods in existing documents are as follows: (1) there is a field name but it does not match the field content; (3) there is a field name and it matches the field content, but the field name naming rules are not unified. There are all-Chinese names, all-English names, a mixture of Chinese and English, or various abbreviations, etc.
[0092] In response to this phenomenon, the traditional method is to manually check whether the field name matches the field content, whether the field name is standardized, etc. If it matches and is standardized, it is directly uploaded to the exploration seismic geological data resource pool. If it does not match or is not standardized, it is manually corrected and uploaded to the exploration seismic geological data resource pool. Although the above method can realize the upload of data, the manual inspection and manual correction of well data files will take a long time and have low efficiency. Therefore, this application provides an intelligent and automatic way to match file names instead of the traditional manual method to reduce the workload of staff.
[0093] Common well files mainly include logging curve files, well head files, well trajectory files, well stratification files, and lithology files.
[0094] By analyzing the data of existing files, the identification of file types is mainly divided into two categories: logging curve file identification and other types of file identification. Since the data characteristics of logging curve files are more obvious and easier to identify, the field name matching method of this application may not be used.
[0095] Next, we will explain in detail how to perform the field name matching process for wellhead files, well trajectory files, well stratification files, and lithology files.
[0096] Example 1.
[0097] For files that have field names (but the field names do not match the field contents or the field name naming rules are not uniform), the following method can be used to match the field names.
[0098] Specifically, the method for automatically matching field names of well files with field names provided in this application adopts the following technical solution:
[0099] Automatic matching method for well file field names with field names, such as Figure 1 As shown, the following steps are included:
[0100] Get the file name of the file to be matched.
[0101] Obtain the user field of the file to be matched, calculate the similarity between the feature of the user field and the feature of the database field name, and obtain a field similarity matrix based on the user field, wherein the database field name refers to the field name corresponding to the file name in the database,
[0102] Obtain user data (fields) of the file to be matched, calculate the similarity between the features of the user data and the features of the database fields, and obtain a field similarity matrix based on the user data, wherein the database field refers to the field corresponding to the file name in the database,
[0103] The field similarity matrix based on user fields and the field similarity matrix based on user data are weighted and summed to obtain the final field similarity matrix.
[0104] Based on the obtained field similarity matrix, the field name corresponding to the highest similarity is selected as the field name of the file to be matched.
[0105] Through the above technical scheme, when the field name naming method in the file exists that there is a field name but it does not match the field content, or there is a field name and it matches the field content, but the field name naming rules are not unified, there are all-Chinese naming, all-English naming, a mixture of Chinese and English, or various abbreviations, etc., the automatic matching of field names can be used instead of the traditional manual method to reduce the workload of the staff, and the field name features and data features are used to calculate the similarity of each field name in the table in the database respectively, and the two similarities are calculated to obtain a similarity matrix. The field name corresponding to the feature with the highest similarity in the similarity matrix is selected as the field name of the file to be matched, which can more accurately and quickly match the appropriate field name for the file to be matched.
[0106] The following describes the process of calculating the similarity between the field names of the corresponding table in the database based on the user data.
[0107] Step 1: Establish field name knowledge base:
[0108] Based on experience, we manually count the possible field names corresponding to the fields in the table of the database and establish a knowledge base of possible field names. This knowledge base will be continuously accumulated and supplemented in the subsequent matching process.
[0109] Step 2: Implement data preparation (set the weight of each field name):
[0110] In order to obtain the keyness of the field name, the above field name knowledge base is used to split each field name into words. The splitting methods are mainly: 1) English: split into words by characters such as underscores; 2) Chinese: split each word. The TF-IDF technology is used to obtain the importance coefficient of each word, which is also the weight of each word. This weight plays a certain role in the subsequent calculation of the similarity between field names.
[0111] Step 3: Form a field similarity matrix based on user fields:
[0112] The Levenshtein ratio method is used to calculate the similarity between the features of each user field and the features of each field in the database. At the same time, TF-ID is used to obtain the weight of each field name, and the similarity and weight are weighted summed to obtain the final field similarity matrix based on user fields.
[0113] It should be noted that: the process of calculating the similarity between the field names of the corresponding table in the database and the field similarity matrix based on the user field is the same as the calculation process based on the user data, which will not be repeated here.
[0114] After obtaining the field similarity matrix based on user fields and the field similarity matrix based on user data, the field similarity matrix based on user fields and the field similarity matrix based on user data are weightedly summed to obtain the final field similarity matrix.
[0115] Based on the obtained field similarity matrix, the field name corresponding to the highest similarity is selected as the field name of the file to be matched.
[0116] The following is a detailed description of the process of selecting the field name corresponding to the highest similarity as the field name of the file to be matched based on the obtained field similarity matrix:
[0117] Each stage of the entire matching process matches the unmatched user fields. The user fields mentioned above refer to the field names (also called headers) corresponding to the files uploaded by the user, and the database fields refer to the field names corresponding to the file names in the database.
[0118] It should be noted that before calculating the similarity, the user fields are screened using all possible field names in the field name knowledge base, and the field names that appear in the field name knowledge base are directly matched.
[0119] The following is a detailed description of the Levenshtein ratio algorithm and TF-IDF technology:
[0120] This embodiment adopts the Levenshtein ratio algorithm because it is more accurate than the Levenshtein distance algorithm.
[0121] The following is the Levenshtein distance algorithm:
[0122] First, let's introduce the Levenshtein distance, also known as the edit distance. The so-called edit distance is used to calculate the minimum number of operations required to convert the original string (str1) to the target string (str2) (the number of operations is also called the edit distance), in which the operations include insertion, deletion, and replacement.
[0123] Take calculating the similarity of the strings "abc" and "abe" as an example.
[0124] 1. Initialize a two-dimensional array:
[0125] null a b c null 0 1 2 3 a 1 b 2 e 3
[0126] Here, it is initialized to 1, which means that one insertion is required to change from an empty string to a, and the edit distance is 1. 2 means that two insertions are required to change from an empty string to ab, and the same applies to the edit distances of 2 and 3.
[0127] 2. Process other cells:
[0128] Taking cell ① as an example, the value of this cell depends on the position of its left side, top side and upper left corner.
[0129] 1) Left side +1 deleted,
[0130] 2) Upper side +1 insert,
[0131] 3) If the letters of the corresponding rows and columns of the cells are different, add 1 to the upper left corner, otherwise add 0. The minimum value of the three is the value of the current cell, and ① is filled with 0.
[0132] Fill in the entire table in order as follows:
[0133] null a b c null 0 1 2 3 a 1 0 1 2 b 2 1 0 1 e 3 2 1 1
[0134] Finally, it is found that it only takes one step (edit distance) to change from abc to abe, which is the value in the lower right corner.
[0135] Finally, the similarity is calculated as r = 1-step / maxlen(str1,str2) = 1-1 / 3 = 2 / 3.
[0136] Compare this to the Levenshtein ratio algorithm:
[0137] Levenshtein.ratio and Levenshtein.distance differ slightly in the way they are calculated.
[0138] Levenshtein.ratio is calculated by calculating the Levenshtein ratio to get the similarity.
[0139] The calculation formula is: r = (sum-ldist)) / sum
[0140] Where sum refers to the sum of the lengths of str1 and str2, and ldist is the class edit distance.
[0141] Note: The class edit distance here is not the edit distance mentioned above. In Levenshtein.distance, each of the three operations is +1, while here, deletion and insertion are still +1, but replacement is +2.
[0142] The purpose of this design is: Take ratio('a', 'c') as an example, it needs to be replaced once, and the total length sum = 2. According to the calculation in 2.1, the replacement operation is +1, then r = (2-1) / 2 = 0.5, but 'a' and 'c' do not overlap, which is obviously not cost-effective. If the replacement operation is +2, this problem can be solved.
[0143] The two-dimensional array of "abc" becoming "abe" becomes:
[0144] null a b c null 0 1 2 3 a 1 0 1 2 b 2 1 0 1 e 3 2 1 2
[0145] It takes 2 steps to change from abc to abe, r = (6-2) / 6 = 2 / 3.
[0146] The following describes the TF-IDF technology:
[0147] TF-IDF is a weighting technique. TF-IDF is a statistical method used to assess the importance of a word to a document set or a document in a corpus. The importance of a word increases in direct proportion to the number of times it appears in a document, but decreases in inverse proportion to the frequency of its occurrence in the corpus.
[0148] (1) TF is word frequency
[0149] Term frequency (TF) indicates the frequency of a term (keyword) appearing in a text.
[0150]
[0151] (2) IDF is the inverse document frequency,
[0152]
[0153] The more common a word is, the smaller its inverse document frequency will be.
[0154] (3) Calculate TF-IDF,
[0155] TF-IDF=TF×IDF,
[0156] From the formula, we can see that TF-IDF is proportional to the number of times a word appears in a document, and inversely proportional to the number of times the word appears in the entire corpus.
[0157] Example 2.
[0158] The other steps of the automatic matching method of field names of well files with field names in this embodiment are the same as those in Embodiment 1, except that:
[0159] The step of selecting the field name corresponding to the highest similarity as the field name of the file to be matched based on the acquired field similarity matrix specifically includes:
[0160] A two-way matching method is used to select the field name corresponding to the highest similarity as the field name of the file to be matched. The two-way matching method includes: selecting the maximum value of the corresponding row and column in the similarity matrix.
[0161] When performing the above similarity comparison, the main method used is the two-way matching method, which is different from the conventional one-way matching method. The one-way matching method only considers the similarity relationship between the column data and the different fields to be compared when matching the column name for each column of data, and selects the column name corresponding to the highest similarity. For example, the following table shows that when the similarity between the to-be-matched column 1 and the three minimum fields of a certain file type is compared, the conventional method is to select the field name corresponding to the one with the highest similarity, that is, the field name matched by the to-be-matched column 1 is field 1.
[0162] The one-way matching method is as follows:
[0163]
[0164]
[0165] The above-mentioned one-way matching method is prone to the disadvantage that multiple columns to be matched may eventually be determined as the same field name. If the column to be matched 1 and the column to be matched 2 in the following table are both identified as matching fields according to the above-mentioned one-way matching method, the field name is field 1. It is incorrect to assign the same field name to two columns of data in the same detection file. Therefore, in order to avoid this problem, this embodiment proposes a two-way matching method, that is, not only the field selected by the column name, but also the column name selected by the field should be considered. When the column to be matched 1 and the column to be matched 2 point to the same field at the same time, the similarity between the two should be compared, and the higher one is the column selected by the field at the same time. It can be seen from the following table that both the column to be matched 1 and the column to be matched 2 have a high similarity in field 1, but the similarity of the column to be matched 2 is higher than that of the column to be matched 1. Finally, the matching field of the column to be matched 2 is field 1, and the column to be matched 1 selects the second highest one, that is, field 2 as the matching field.
[0166] The two-way matching method is as follows:
[0167] Field 1 Field 2 Field 3 Column 1 to be matched 0.72 0.67 0.35 Column 2 to be matched 0.87 0.32 0.14
[0168] Based on the obtained similarity matrix, a two-way match is performed, that is, if the value is the maximum value of the corresponding row and column in the matrix, the match is successful.
[0169] Example 3.
[0170] The method for automatically matching field names of well files with field names in this embodiment is the same as that in Embodiment 1 in other steps, except that: for the remaining user fields that have not been successfully matched, the similarity between the characteristics of the user fields and the characteristics of the remaining database fields is calculated, and the database field with the greatest similarity is selected as the final matching field.
[0171] In this embodiment, the field names of all files to be matched can be automatically matched, which can reduce manual input and improve the efficiency of field name matching.
[0172] Example 4.
[0173] The other steps of the automatic matching method of field names of well files with field names in this embodiment are the same as those in Embodiment 1, except that:
[0174] like Figure 2 As shown, in the step of obtaining the file name of the file to be matched, if the file to be matched has no file name, the file name matching step is performed first:
[0175] Obtain the user field of the file to be matched (the user field refers to the header corresponding to the user uploaded file, that is, the field name), calculate the similarity between the features of the user field and the features of the field names of all file names in the database, and obtain a file name similarity matrix based on the user field.
[0176] Obtain user data (fields) of the file to be matched, calculate the similarity between the features of the user data and the features of the fields corresponding to all file names in the database, and obtain a file name similarity matrix based on the user data.
[0177] The file name similarity matrix based on user fields and the file name similarity matrix based on user data are weightedly summed to obtain the final file name similarity matrix. Based on the obtained file name similarity matrix, the file name corresponding to the highest similarity is selected as the file name of the file to be matched.
[0178] In this embodiment, when a file to be matched does not have a file name, a suitable file name can be automatically matched for the file, which can greatly improve work efficiency compared to manual matching of file names.
[0179] Example 5.
[0180] The other steps of the automatic matching method of field names of well files with field names in this embodiment are the same as those in Embodiment 1, except that:
[0181] For the file to be matched, there is a file name, but the file name does not match the field content, or there is a file name and it matches the field content, but the naming rules of the file name are not unified, there are all Chinese names, all English names, mixed Chinese and English names, or various abbreviations, etc.
[0182] Before the step of obtaining the file name of the file to be matched, the file name correction step is performed first:
[0183] Determine whether the inherent file name of the file to be matched contains an extension. If so,
[0184] Then, the extension of the inherent file name of the file to be matched is obtained, and a new file name is matched for the file to be matched according to the extension.
[0185] In this embodiment, in the case where the file to be matched has a file name and an extension, a suitable file name can be automatically matched for the file to be matched according to the extension, which can greatly improve work efficiency compared with manual matching of file names.
[0186] In the file name correction step, if no, the file name matching step is performed: obtaining the user field of the file to be matched (the user field refers to the header corresponding to the user uploaded file, that is, the field name), calculating the similarity between the characteristics of the user field and the characteristics of the field names corresponding to all file names in the database, and obtaining a file name similarity matrix based on the user field,
[0187] Obtain user data (fields) of the file to be matched, calculate the similarity between the features of the user data and the features of the fields corresponding to all file names in the database, and obtain a file name similarity matrix based on the user data.
[0188] The file name similarity matrix based on user fields and the file name similarity matrix based on user data are weighted and summed to obtain the final file name similarity matrix.
[0189] Based on the obtained file name similarity matrix, the file name corresponding to the highest similarity is selected as the file name of the file to be matched.
[0190] In this embodiment, if the file to be matched has a file name but no extension, it is impossible to determine whether the file name is correct, so it is necessary to re-match a suitable file name for the file to be matched. This technical solution replaces the traditional manual method with an automatic file name matching method to reduce the workload of the staff. The field name features and data features are used to calculate the similarity with the features of each file name in the table in the database, and the two similarities are weighted and summed to obtain the final comprehensive consideration result, which can more accurately and quickly match the suitable file name for the file to be matched.
[0191] It should be noted that the method for generating the file name similarity matrix in the file name matching process is the same as the method for generating the field similarity matrix in the field name matching process in the previous embodiment, and will not be described in detail here.
[0192] Example 6.
[0193] The difference between this embodiment and other embodiments is that: the similarity calculation method specifically includes: comparing the similarity of the features of each column of data in the file to be matched with the minimum standard column of the features of all files in the database in turn, wherein the minimum standard column can be used to uniquely identify a set of columns of the file type to which it belongs, and the set has the following characteristics: it contains the least number of columns, and the number of columns varies with the file name, and the column can be used to uniquely identify the file name.
[0194] The core idea of field name matching is to match the features of each column of data in the to-be-matched file with the features of the minimum standard column of each file in the database in turn. When the minimum standard column is matched, the total similarity of each to-be-matched file belonging to the type of file can be obtained. Based on the total similarity of each file, the similarity of the to-be-matched file belonging to a certain type of file can be obtained.
[0195] The following describes the selection rules for the minimum standard column (that is, the minimum fields below):
[0196] (1) Wellhead file:
[0197] Minimum fields: 4 columns of well name, X coordinate, Y coordinate, and altitude;
[0198] Standard fields: 6 columns: well name, X coordinate, Y coordinate, altitude, altitude type, depth.
[0199] (2) Well trajectory file:
[0200] Minimum fields: 3 columns for depth, well inclination, and azimuth;
[0201] Standard fields: 3-6 columns of sounding, vertical depth, inclination, azimuth, X offset, Y offset.
[0202] (3) Well stratification files:
[0203] Minimum fields: 3 columns of well name, layer name, bottom depth;
[0204] Standard fields: 4 columns of well name, layer English name, top depth, bottom depth.
[0205] (4) Lithology files:
[0206] Minimum fields: 3 columns of well name, lithology, and bottom depth;
[0207] Standard fields: 4 columns of well name, English name of lithology, top depth, bottom depth. To illustrate the meaning of the above matching process, when matching a file to be matched that belongs to a certain field name / file name, it is only necessary to match the file to be matched with the minimum standard column of a certain file, that is, the column of the file to be matched ≥ the minimum standard column of a certain file. For a clearer description, the following table shows all the columns of the file to be matched, as well as all the columns of 3 different field names and their minimum standard columns.
[0208]
[0209]
[0210] When determining the field name, all columns of the to-be-matched file are compared with the minimum standard column of the field name for similarity. The premise of the similarity comparison is to extract the features of each column of the to-be-matched file.
[0211] If the similarity between the file to be matched and each field name is as follows after similarity comparison:
[0212] The similarities between the file to be matched and field name 1 are expressed as follows:
[0213]
[0214] Similarly, the total similarity between the file to be matched and field name 2 and field name 3 can be obtained, and the one with the highest total similarity is selected as the field name to which the file to be matched belongs. This method of matching with the minimum standard column can not only achieve the purpose of quickly locking the file, but also speed up the matching speed and shorten the matching time.
[0215] The method of this embodiment is also applicable to matching of file names.
[0216] Example 7.
[0217] In the process of similarity calculation, it is necessary to extract the features of each column of data. It is also necessary to extract data features from the database data and use the data features to further perform similarity calculation.
[0218] The following is an analysis of the field characteristics of the well file:
[0219] Well header file:
[0220] See also Figure 3 to Figure 4 , Figure 3 to Figure 4 A schematic diagram of the fields of the well header file.
[0221] Field characteristics:
[0222] Well name: metadata contains English, numbers, characters, and even a mixture of Chinese and numbers;
[0223] YX coordinates: The median of metadata with more than 6 digits is the X and Y coordinates. In China, the X coordinate has 8 digits before the decimal point, and the Y coordinate has 7 digits before the decimal point.
[0224] Well trajectory file:
[0225] Field characteristics:
[0226] Identify the well name according to the file name. The well names in the file name can be in Chinese or English. Split the file name and use the split file name to compare with the table in the database to find the well with the highest matching similarity.
[0227] Please refer to Figure 5 , Figure 5 which is a schematic diagram of the file name of the well trajectory file.
[0228] Please refer to Figure 6 and Figure 7 , Figure 6 and Figure 7 which are schematic diagrams of the field names that may appear in the well trajectory file in the database.
[0229] Well layering file:
[0230] Field characteristics:
[0231] Well name, layering name: There are two columns of data with English, letters, numbers, and special characters together. If one column is identified as the well name, then the other column must be the layering name.
[0232] Please refer to Figure 8 and Fig. 9 , Figure 8 and Fig. 9 which are schematic diagrams of the well name and layering name fields in the well layering file.
[0233] Depth: There are two depth values. For the same layer, the smaller depth value is the top depth, and the larger depth value is the bottom depth; if there is only one column of depth value, then it is the bottom depth.
[0234] Subsurface elevation: The value has a negative sign and decreases.
[0235] Please refer to Figures 10 to 12 , Figures 10 to 12 which is a schematic diagram of the depth and subsurface elevation fields in the well layering file.
[0236] Lithology file:
[0237] Field characteristics:
[0238] Well name: In the metadata, if there are English, numbers, characters, or even a mixture of Chinese and numbers, it may be the well name or the lithology name; if both columns of the well name and lithology are in Chinese, the one with ***rock must be the lithology;
[0239] Depth: There are two columns of depth values. For the same layer, the smaller depth value is the top depth, and the larger depth value is the bottom depth. If there is only one column of depth value, then it is the bottom depth.
[0240] Please refer to Fig.13 , Fig.13 which is a schematic diagram of the fields in the lithology file.
[0241] Therefore, this embodiment targets the characteristics of well files (mainly wellhead files, well trajectory files, well stratification files, and lithology files) and determines that the characteristics of the file feature library include element length, pure numbers, time type, and combination method, and the feature extraction of the user data also includes element length, pure numbers, time type, and combination method.
[0242] Here are the reasons:
[0243] Since each column of data in each type of file has its own characteristics, for example, if the number of digits of the YX coordinate data in the wellhead file exceeds 6, if the number of digits of a column of data in the wellhead file exceeds 6, it will be identified as the XY coordinate with a high probability. This is the data characteristic of the XY coordinate. Or in the lithology color column in the lithology file, when words representing colors appear, such as "black" and "black", the column of data will be identified as the lithology color column with a high probability. Based on the characteristics of the current data, the data features are finally extracted from four aspects through analysis, namely element length, pure numbers, time type and combination method. The technical means used are mainly regular matching. Since various data features have been fully analyzed, the above four aspects are selected to extract data features, which will make the extraction of data features more accurate and usable.
[0244] Specifically, the method for extracting the features of the user data is as follows:
[0245] Extraction of element length: Determine whether the element length of the column data exceeds 32 bits. If so, record the element length as ">32; otherwise, record the element length as null.
[0246] Extraction of pure numbers: Determine whether the data type of the column is numeric. If so, extract the minimum value, maximum value, mean value, variance, minimum digit and other features and record them. Otherwise, record the pure numbers as empty.
[0247] Extraction of time type: determine whether the data contains time features, if so, record the time type as the time type, otherwise, record the time type as empty, wherein the time feature includes two ":" symbols or two " / " symbols;
[0248] Extraction of combination mode: Determine whether the column data is not entirely composed of one data type. If so, record all data type information. Otherwise, the record is empty. The data types include Chinese, English, numbers, and symbols.
[0249] Through the above technical solutions, features can be quickly locked and extracted, the efficiency of feature extraction is improved, and the extracted features have a high degree of matching with the fields.
[0250] Example 8.
[0251] This embodiment provides a well file field name automatic matching system, which adopts the following technical solution: A well file field name automatic matching system, which includes the following modules:
[0252] File name acquisition module: used to obtain the file name of the file to be matched.
[0253] The first matrix generation module is used to obtain the user field of the file to be matched, calculate the similarity between the characteristics of the user field and the characteristics of the database field name, and obtain a field similarity matrix based on the user field, wherein the database field name refers to the field name corresponding to the file name in the database,
[0254] The second matrix generation module is used to obtain the user data (field) of the file to be matched, calculate the similarity between the characteristics of the user data and the characteristics of the database field, and obtain a field similarity matrix based on the user data, wherein the database field refers to the field corresponding to the file name in the database,
[0255] Final matrix generation module: used to perform weighted summation of the field similarity matrix based on user fields and the field similarity matrix based on user data to obtain the final field similarity matrix.
[0256] Field name matching module: used to select the field name corresponding to the highest similarity as the field name of the file to be matched based on the obtained field similarity matrix.
[0257] In this embodiment, when the field names in the file are named in a way that there are field names but they do not match the field content, or there are field names and they match the field content, but the field name naming rules are not unified, there are all-Chinese names, all-English names, a mixture of Chinese and English, or various abbreviations, etc., the automatic matching of field names can be used instead of the traditional manual method to reduce the workload of the staff, and the field name features and data features are used to calculate the similarity with each field name in the table in the database respectively, and the two similarities are calculated to obtain a similarity matrix. The field name corresponding to the feature with the highest similarity in the similarity matrix is selected as the field name of the file to be matched, which can more accurately and quickly match the appropriate field name for the file to be matched.
[0258] Example 9.
[0259] This embodiment provides a computer-readable storage medium, which adopts the following technical solution:
[0260] A computer-readable storage medium stores a computer program, which, when called by a processor, executes the steps of the method for automatically matching field names of well files with field names described in any of the above embodiments.
[0261] In this embodiment, when the field names in the file are named in a way that there are field names but they do not match the field content, or there are field names and they match the field content, but the field name naming rules are not unified, there are all-Chinese names, all-English names, a mixture of Chinese and English, or various abbreviations, etc., the automatic matching of field names can be used instead of the traditional manual method to reduce the workload of the staff, and the field name features and data features are used to calculate the similarity with each field name in the table in the database respectively, and the two similarities are calculated to obtain a similarity matrix. The field name corresponding to the feature with the highest similarity in the similarity matrix is selected as the field name of the file to be matched, which can more accurately and quickly match the appropriate field name for the file to be matched.
[0262] Example 10.
[0263] This embodiment provides a computer device, which adopts the following technical solution:
[0264] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is called by the processor, the steps of the method for automatically matching field names of well files with field names described in any of the above embodiments are executed.
[0265] In this embodiment, when the field names in the file are named in a way that there are field names but they do not match the field content, or there are field names and they match the field content, but the field name naming rules are not unified, there are all-Chinese names, all-English names, a mixture of Chinese and English, or various abbreviations, etc., the automatic matching of field names can be used instead of the traditional manual method to reduce the workload of the staff, and the field name features and data features are used to calculate the similarity with each field name in the table in the database respectively, and the two similarities are calculated to obtain a similarity matrix. The field name corresponding to the feature with the highest similarity in the similarity matrix is selected as the field name of the file to be matched, which can more accurately and quickly match the appropriate field name for the file to be matched.
[0266] It can be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories.
[0267] The nonvolatile memory may be a ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), or a flash memory.
[0268] The volatile memory may be a RAM, which is used as an external cache. There are many different types of RAM, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct memory bus RAM.
[0269] The processor mentioned in any of the above places can be a CPU, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the program of the above-mentioned feedback information transmission method. The processing unit and the storage unit can be decoupled and respectively set on different physical devices, and connected by wire or wireless means to realize the respective functions of the processing unit and the storage unit to support the system chip to realize the various functions in the above-mentioned embodiments. Alternatively, the processing unit and the memory can also be coupled on the same device.
[0270] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a computer-readable storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned computer-readable storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0271] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.
Claims
1. A method for automatically matching field names of well files with field names, characterized in that: The method comprises the following step: Get the file name of the file to be matched. Obtain the user field of the file to be matched, calculate the similarity between the feature of the user field and the feature of the database field name, and obtain a field similarity matrix based on the user field, wherein the database field name refers to the field name corresponding to the file name in the database, Obtain user data of the file to be matched, calculate the similarity between the features of the user data and the features of the database field, and obtain a field similarity matrix based on the user data, wherein the database field refers to the field corresponding to the file name in the database, The field similarity matrix based on user fields and the field similarity matrix based on user data are calculated to obtain the final field similarity matrix. Based on the obtained field similarity matrix, the field name corresponding to the highest similarity is selected as the field name of the file to be matched.
2. The method for automatically matching field names of well files with field names according to claim 1, characterized in that At: The step of obtaining the user field of the to-be-matched file, calculating the similarity between the feature of the user field and the feature of the database field name, and obtaining the field similarity matrix based on the user field specifically includes: using the TF-IDF weighting technology to calculate the weight of each word in the field name, and using the Levenshtein ratio algorithm to calculate the similarity between each word in the user field and each word in the field name in the database, performing weighted summation on the weight and the similarity, and obtaining the field similarity matrix based on the user field. and / or, The step of obtaining user data of the file to be matched, calculating the similarity between the features of the user data and the features of the database fields, and obtaining a field similarity matrix based on the user data specifically includes: The TF-IDF weighting technique is used to calculate the weight of each word in each field, and the Levenshtein ratio algorithm is used to calculate the similarity between each word in the user data and each word in the database field. The weight and the database similarity are weighted and summed to obtain a field similarity matrix based on the user field.
3. The method for automatically matching field names of well files with field names according to claim 1, characterized in that At: The step of selecting the field name corresponding to the highest similarity as the field name of the file to be matched based on the acquired field similarity matrix specifically includes: A two-way matching method is used to select the field name corresponding to the highest similarity as the field name of the file to be matched. The two-way matching method includes: selecting the maximum value of the corresponding row and column in the similarity matrix.
4. The method for automatically matching field names of well files with field names according to claim 1, characterized in that: For the to-be-matched files with unmatched field names, the similarity between the features of the user data and the features of the remaining database field names is calculated, and the database field name with the greatest similarity is selected as the final matching field name.
5. The method for automatically matching field names of well files with field names according to claim 1, characterized in that: In the step of obtaining the file name of the file to be matched, if the file to be matched has no file name, the file name matching step is performed first: Obtain the user field of the file to be matched, calculate the similarity between the features of the user field and the features of the field names corresponding to all file names in the database, and obtain a file name similarity matrix based on the user field. Obtain user data of the file to be matched, calculate the similarity between the features of the user data and the features of the fields corresponding to all file names in the database, and obtain a file name similarity matrix based on the user data. Calculate the file name similarity matrix based on user fields and the file name similarity matrix based on user data to obtain the final file name similarity matrix. Based on the obtained file name similarity matrix, the file name corresponding to the highest similarity is selected as the file name of the file to be matched.
6. The method for automatically matching field names of well files with field names according to claim 1, characterized in that: Before the step of obtaining the file name of the file to be matched, the step of correcting the file name is performed first: Determine whether the inherent file name of the file to be matched contains an extension. If so, Then, the extension of the inherent file name of the file to be matched is obtained, and a new file name is matched for the file to be matched according to the extension.
7. The method for automatically matching field names of well files with field names according to claim 6, characterized in that: In the file name correction step, if no, then the file name matching step is performed: obtaining the user field of the file to be matched, calculating the similarity between the features of the user field and the features of the field names corresponding to all the file names in the database, and obtaining a file name similarity matrix based on the user field, Obtain user data of the file to be matched, calculate the similarity between the features of the user data and the features of the fields corresponding to all file names in the database, and obtain a file name similarity matrix based on the user data. Calculate the file name similarity matrix based on user fields and the file name similarity matrix based on user data to obtain the final file name similarity matrix. Based on the obtained file name similarity matrix, the file name corresponding to the highest similarity is selected as the file name of the file to be matched.
8. The method for automatically matching field names of well files with field names according to claim 1, 5 or 7, characterized in that: The similarity calculation method specifically includes: comparing the similarity of the feature of each column of data in the to-be-matched file with the minimum standard column of the features of all files in the database in turn.
9. The method for automatically matching field names of well files with field names according to claim 1, characterized in that: The characteristics of the database field include element length, pure numbers, time type and combination mode, and the feature extraction of the user data also includes element length, pure numbers, time type and combination mode.
10. The method for automatically matching field names of well files with field names according to claim 9, characterized in that: The method for extracting the features of the user data is as follows: Extraction of element length: Determine whether the element length of the column data exceeds A bits. If so, record the element length as ">A", otherwise, record the element length as null; and / or, Extraction of pure numbers: Determine whether the data type of the column is numeric. If so, extract the following features from the column: minimum value, maximum value, mean value, variance, and minimum digit, and record the features. Otherwise, record the pure numbers as empty. and / or, Extraction of time type: determine whether the data contains time features, if so, record the time type as the time type, otherwise, record the time type as empty, wherein the time feature includes two ":" symbols or two " / " symbols; and / or, Extraction of combination mode: Determine whether the column data is not entirely composed of one data type. If so, record all data type information. Otherwise, the record is empty. The data types include Chinese, English, numbers, and symbols.
11. A system for automatically matching field names of well files with field names, characterized in that: The system includes the following modules: File name acquisition module: used to obtain the file name of the file to be matched. The first matrix generation module is used to obtain the user field of the file to be matched, calculate the similarity between the characteristics of the user field and the characteristics of the database field name, and obtain a field similarity matrix based on the user field, wherein the database field name refers to the field name corresponding to the file name in the database, The second matrix generation module is used to obtain user data of the file to be matched, calculate the similarity between the characteristics of the user data and the characteristics of the database field, and obtain a field similarity matrix based on the user data, wherein the database field refers to the field corresponding to the file name in the database, Final matrix generation module: used to calculate the field similarity matrix based on user fields and the field similarity matrix based on user data to obtain the final field similarity matrix. Field name matching module: used to select the field name corresponding to the highest similarity as the field name of the file to be matched based on the obtained field similarity matrix.
12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is called by a processor, the steps of the method for automatically matching field names of well files with field names as described in any one of claims 1 to 10 are executed.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the computer program is called by a processor, the steps of the method for automatically matching field names of well files with field names as described in any one of claims 1 to 10 are executed.
Citation Information
Patent Citations
Field matching method and terminal equipment
CN108629046A
Cashier system identification method and identification device and computer-readable storage medium
CN109034781A