Data table field type identification method, device, electronic device and storage medium

By identifying and word segmentation data of cells in the data table and correcting ambiguity types in combination with statistical information, the problems of low efficiency and high cost of data table field type recognition in the prior art are solved, efficient and accurate field type recognition is achieved, and user experience is improved.

CN114004226BActive Publication Date: 2025-03-18ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111223634.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-20
Publication Date
2025-03-18
Estimated Expiration
2041-10-20

AI Technical Summary

Technical Problem

In the prior art, data table field type recognition is inefficient and costly, especially when facing massive data, manual processing is unrealistic.

Method used

By obtaining the data table to be identified, the data of each cell is identified and processed, the cell type is determined based on the recognition results, and the field type is determined based on the cell type corresponding to the target field. If the recognition results are unclear, word segmentation is performed to determine the type and correct the possible ambiguity types based on the statistical information.

Benefits of technology

It improves the accuracy and efficiency of data table field type recognition, reduces labor costs, is suitable for massive data processing, and improves data table processing efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114004226B_ABST
    Figure CN114004226B_ABST
Patent Text Reader

Abstract

The present invention provides a data table field type identification method, device, electronic device and storage medium, the method comprising: obtaining a data table to be identified; wherein the data table contains fields, the fields contain multiple cells, and the cells contain data; identifying the data contained in each cell, and determining the cell type for each cell in the data table according to the identification result; determining the type of the target field according to the type of each cell corresponding to the target field; wherein the target field is any field in the data table. The field type identification method provided by the present invention reduces labor costs, improves the accuracy and efficiency of field type identification in a data table when facing massive data identification processing, provides a basis for subsequent data table proofreading and field recommendation, improves the efficiency of data table processing, and enhances user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data table field type identification method, device, electronic device and storage medium. Background Art

[0002] In data standardization work, as new data tables are continuously connected to the database and as big data technology develops rapidly, the accuracy of data and the quality of field type identification in data tables are crucial to the value that the data can produce.

[0003] A data table is composed of fields in the table and the data in the cells corresponding to each field. The field types of a data table include text type, number type, date type, time type, currency type, autonumber type, note type, yes / no type, OLE object type, hyperlink type, and lookup wizard type. Among them, text type, number type, date type, time type, and currency type are the main types. However, users are more casual when writing table data, and often write some number type, date type, time type, and currency type data in the form of text type, which makes it impossible to accurately perform subsequent analysis and classification of the data in the data table.

[0004] In the prior art, when identifying and processing data field types, field types of data in a data table are often identified and modified manually. This processing method is relatively inefficient, costly, and wastes a lot of time. It is only suitable for situations where the amount of data is small. When faced with massive amounts of data, manual processing will not be realistic. Summary of the invention

[0005] Based on the problems existing in the prior art, the present invention proposes a data table field type identification method, device, electronic device and storage medium, which improves the accuracy and efficiency of data table field type identification, provides a basis for subsequent data table proofreading and field recommendation, and has the advantages of improving data table processing efficiency and enhancing user experience.

[0006] In a first aspect, the present invention provides a method for identifying a data table field type.

[0007] Obtain a data table to be identified; wherein the data table includes fields, the fields include multiple cells, and the cells include data;

[0008] Identify the data contained in each cell, and determine the cell type for each cell in the data table according to the identification result;

[0009] The type of the target field is determined according to the types of each cell corresponding to the target field; wherein the target field is any field in the data table.

[0010] Further, according to the data table field type identification method provided by the present invention, the data contained in each cell is identified and processed, and the cell type is determined for each cell in the data table according to the identification result, including:

[0011] The data contained in the target cell is identified. If the type of the target cell is not included in the identification result, the data contained in the target cell is segmented, and the type of the target cell is determined according to the segmentation result; wherein the target cell is any cell in the data table to be identified.

[0012] Further, according to the data table field type identification method provided by the present invention, the word segmentation processing is performed on the data contained in the target cell, and the type of the target cell is determined according to the word segmentation result, including:

[0013] Perform word segmentation processing on the data contained in the target cell to obtain the word and part of speech corresponding to the data contained in the target cell;

[0014] The sum of the string lengths of words with the same part of speech is calculated, and the part of speech corresponding to the words whose sum of string lengths meets a preset condition is used as the type of the target cell.

[0015] Further, according to the data table field type identification method provided by the present invention, the data contained in each cell is identified and processed, and the cell type is determined for each cell in the data table according to the identification result, including:

[0016] The data contained in the target cell is identified. When the type of the target cell is included in the identification result, it is determined that there are cells with ambiguous types among all the cells corresponding to the field to which the target cell belongs, based on statistical information of all the cells corresponding to the field to which the target cell belongs, and the type of the cell with ambiguous type is modified; wherein the target cell is any cell in the data table to be identified.

[0017] Further, according to the data table field type identification method provided by the present invention, the cell type is determined for each cell in the data table according to the data contained in the cell, and further includes:

[0018] When the recognition result includes the type of the target cell, it is determined that no ambiguous types exist in all cells corresponding to the field to which the target cell belongs, based on statistical information of all cells corresponding to the field to which the target cell belongs, and the types of each cell remain unchanged.

[0019] Further, according to the data table field type identification method provided by the present invention, determining that there are cells with ambiguous types among all cells corresponding to the field to which the target cell belongs based on statistical information of all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with ambiguous type includes:

[0020] According to the statistical information of all cells corresponding to the field to which the target cell belongs, when two different types of cells exist simultaneously in all the cells corresponding to the field to which the target cell belongs, it is determined that there is a cell with an ambiguous type in all the cells corresponding to the field to which the target cell belongs, and the type of the cell with the ambiguous type is modified.

[0021] Further, according to the data table field type identification method provided by the present invention, when two different types of cells exist at the same time in all cells corresponding to the field to which the target cell belongs, determining that there is a cell with an ambiguous type in all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with the ambiguous type includes:

[0022] According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is judged whether at least one of a first condition and a second condition is met, wherein the first condition includes: among all cells corresponding to the field to which the target cell belongs, there are both date-type cells and room number-type cells, and the cell format of the date-type cells is a date-type cell format; the second condition includes: the field name of the field to which the target cell belongs contains a preset keyword;

[0023] When at least one of the first condition and the second condition is met, it is determined that there are ambiguous types of date-type cells in all cells corresponding to the field to which the target cell belongs, and the type of the date-type cells is changed from a date type to a room number type.

[0024] Further, according to the data table field type identification method provided by the present invention, determining that there are cells with ambiguous types among all cells corresponding to the field to which the target cell belongs based on statistical information of all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with ambiguous type includes:

[0025] According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is judged whether a third condition is satisfied, wherein the third condition includes: among all cells corresponding to the field to which the target cell belongs, there are both date type cells and value type cells, there is only one cell of the value type and the cell format of the value type cell is 0 cell format;

[0026] In the case where the third condition is met, when the type of the target cell is a numerical type and the data of the target cell conforms to the first expression of the date, it is determined that the target cell has an ambiguous type;

[0027] Change the type of the target cell from a numeric type to a date type.

[0028] Further, according to the data table field type identification method provided by the present invention, when two different types of cells exist at the same time in all cells corresponding to the field to which the target cell belongs, determining that there is a cell with an ambiguous type in all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with the ambiguous type includes:

[0029] According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is judged whether a fourth condition is satisfied, wherein the fourth condition includes: among all cells corresponding to the field to which the target cell belongs, there are both date type cells and value type cells, and the data of the date type cells conform to the second expression of the date;

[0030] When the fourth condition is met, it is determined that there are ambiguous types of date-type cells in all cells corresponding to the field to which the target cell belongs, and the types of the date-type cells are changed from date type to value type.

[0031] Further, according to the data table field type identification method provided by the present invention, when two different types of cells exist at the same time in all cells corresponding to the field to which the target cell belongs, determining that there is a cell with an ambiguous type in all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with the ambiguous type includes:

[0032] According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is determined whether a fifth condition is satisfied, wherein the fifth condition includes: among all cells corresponding to the field to which the target cell belongs, there are both date type cells and telephone number type cells;

[0033] In the case where the fifth condition is met, when the type of the target cell is a telephone number type, the cell format of the target cell is a date type cell format, and the data of the target cell conforms to a regular expression of a date, it is determined that the target cell has an ambiguous type;

[0034] The type of the target cell is changed from a phone number type to a date type.

[0035] Further, according to the data table field type identification method provided by the present invention, the type of the target field is determined according to the types of each cell corresponding to the target field, including:

[0036] Count the types of all cells corresponding to the target field;

[0037] When the types of all cells corresponding to the target field are the same, the type of the cell is used as the type of the target field.

[0038] Further, according to the data table field type identification method provided by the present invention, the determining the type of the target field according to the types of each cell corresponding to the target field further includes:

[0039] When there are at least two types of all cells corresponding to the target field, a cell type whose number of appearances in all cells corresponding to the target field meets a preset condition is used as the type of the target field.

[0040] Further, according to the data table field type identification method provided by the present invention, the types of all cells corresponding to the statistical target field include:

[0041] The cell types obtained according to the word segmentation results, the cell types obtained after the cells with ambiguous types are modified, and the cell types with unambiguous types are counted in the cells corresponding to the target field to obtain the types of all cells corresponding to the target field.

[0042] In a second aspect, the present invention provides a data table field type identification device, comprising:

[0043] An acquisition module, used for acquiring a data table to be identified; wherein the data table includes a field, the field includes a plurality of cells, and the cell includes data;

[0044] An identification module, used to identify the data contained in each cell, and determine the cell type for each cell in the data table according to the identification result;

[0045] The determination module is used to determine the type of the target field according to the types of each cell corresponding to the target field; wherein the target field is any field in the data table.

[0046] In a third aspect, the present invention further provides an electronic device, comprising: a processor, a memory and a bus, wherein:

[0047] The processor and the memory communicate with each other via the bus;

[0048] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the steps of any of the above data table field type identification methods.

[0049] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions enable the computer to execute the steps of the data table field type identification method as described in any one of the above items.

[0050] The present invention provides a data table field type identification method, device, electronic device and storage medium, which performs identification processing according to the data contained in the cells in the data table to be identified, determines the cell type for each cell in the data table according to the identification result, and then determines the type of the target field according to the type of each cell corresponding to the target field. The identification method provided by the present invention reduces labor costs, improves the accuracy and efficiency of field type identification in the data table when facing massive data identification processing, provides a basis for subsequent data table proofreading and field recommendation, and at the same time improves the efficiency of data table processing and enhances user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 It is a flow chart of the data table field type identification method provided by the present invention;

[0053] Figure 2 It is a schematic diagram of the overall process of the data table field type identification method provided by the present invention;

[0054] Figure 3 It is a structural schematic diagram of a data table field type identification device provided by the present invention;

[0055] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0057] Figure 1 A flow chart of a method for identifying a data table field type provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the data table field type identification method provided by the present invention includes the following steps:

[0058] Step 101: Obtain a data table to be identified; wherein the data table contains fields, the fields contain multiple cells, and the cells contain data;

[0059] In this embodiment, it is first necessary to obtain a data table to be identified, which contains multiple fields and cells corresponding to the multiple fields. The cells contain corresponding data. For example, in the data table in Table 1 below, the field names are "month, date, product name, purchase order, specification model, unit, actual quantity, sales unit price", and each field name contains a corresponding cell. In the example shown in Table 1, the field represents a column in the data table, and the field type is used to describe the data type of the corresponding column. In other embodiments, the field can also represent other meanings, such as a row in a data table.

[0060] In this embodiment, the data table also includes cells, which are the intersection of rows and columns in the data table and are the smallest unit constituting the data table. The cells contain data content, such as the data contained in the cell in the second row and third column of Table 1 below is "2017-02-08". It should be noted that the content of the data table is not limited to the data in Table 1 provided in this embodiment, and may also include other data, which may be set according to actual needs and is not specifically limited here.

[0061] Table 1

[0062]

[0063] Step 102: Identify the data contained in each cell, and determine the cell type for each cell in the data table according to the identification result.

[0064] In this embodiment, each cell in the data table is traversed to extract the data in the cell, and then the data in the cell is recognized by means of a regular expression to obtain a recognition result, which includes the cell format and type of each cell. A regular expression, also known as a regular expression, is a logical formula for string operations, which uses some pre-defined specific characters and combinations of these specific characters to form a "regular string".

[0065] For example, assuming that the field to be processed is the third column in the above Table 1, where the field name is "Date", the data of each cell in the third column are "2017-02-08, 2017-02-09, 2017-02-09, 2017-02-09", and then the data of each cell corresponding to the third column are identified and processed through regular expressions to determine that the format of each cell is a date, that is, the type of each cell is a date type.

[0066] In this embodiment, there are two situations in the recognition results of each cell. One is that the type of the cell can be determined based on the recognition result, and the cell of the determined cell type needs to be corrected. The other is that the type of the cell cannot be determined based on the recognition result, and the next processing operation is required for this type of cell to determine the type of the cell. It should be noted that in this embodiment, for the two situations existing in the recognition results, the specific method of determining the type of the cell is shown in the following embodiment, which will not be described in detail here.

[0067] Step 103: Determine the type of the target field according to the types of each cell corresponding to the target field; wherein the target field is any field in the data table.

[0068] In this embodiment, the field type of the target field is determined according to the types of each cell corresponding to the target field, wherein the types of field types are shown in Table 2 below, including "room number type, mobile phone number type, date type, numerical type", etc. It should be noted that the field type is not limited to the following types, and can be set according to actual needs, and is not specifically limited here.

[0069] After the types of each cell are determined, the type of the target field can be determined based on the type of the cell corresponding to the target field. When the types of the cells corresponding to the target field are the same, the type of the cell is directly determined as the type of the target field. If the target field is the third column in Table 1 above, when it is confirmed that the type of each cell corresponding to the third column in Table 1 is a date type, the date type is determined as the type of the target field. It should be noted that the specific method for determining the field type can be set according to actual needs and is not specifically limited here.

[0070] Table 2

[0071]

[0072]

[0073] In this embodiment, the determined field type can be used in a subsequent pivot table, which plays an important role in analyzing and processing data, or provides a basis for generating field recommendations based on the determined field type.

[0074] According to the data table field type identification method provided by the embodiment of the present invention, the cell type is determined for each cell according to the data contained in the cell in the data table to be identified, and then the field type is determined according to the type of each cell corresponding to the field. The field type identification method provided by the present invention solves the technical problems of high cost and low efficiency caused by manual identification in the prior art, is suitable for field type identification of massive data, and at the same time, improves the accuracy of field type identification in the data table, provides a basis for subsequent data table proofreading and field recommendation, improves the efficiency of data table processing, and enhances user experience.

[0075] Based on any of the above embodiments, in this embodiment, the data contained in each cell is identified and processed, and the cell type is determined for each cell in the data table according to the identification result, including:

[0076] The data contained in the target cell is identified. If the type of the target cell is not included in the identification result, the data contained in the target cell is segmented, and the type of the target cell is determined according to the segmentation result; wherein the target cell is any cell in the data table to be identified.

[0077] In this embodiment, each cell in the data table is identified and processed by a regular expression. In this embodiment, the regular expression may identify the type of each cell in the data table, such as some cells are of date type, some are of value type, and some are of time type or ID number type, etc.; it is also possible that the regular expression cannot identify the type of some cells in the data table. For example, the regular expression can identify that the data in the cell is text data, but since the content described by the text data is diverse, it is impossible to determine the type of the cell based on the text data.

[0078] When the type of the target cell is not included in the recognition result, the data contained in the target cell is segmented, and then the type of the target cell is determined based on the segmentation result. The tool for the segmentation process can be a relatively mature one in the prior art.

[0079] In this embodiment, when the recognition result does not contain the type of the target cell, word segmentation is performed on it. Taking the data table described in Table 1 above as an example, if the types of cells in Table 1 are not recognized, the data of each cell in the data table are segmented, and the obtained word segmentation results are shown in Table 3 below.

[0080] Table 3

[0081]

[0082]

[0083] In this embodiment, the type of each cell is determined according to the word segmentation results of each cell, wherein the part of speech corresponding to the word with the longest string length can be determined as the type of the cell. As shown in Table 3 above, the data of each cell in the data table is split to obtain a list consisting of each word and the part of speech corresponding to each word. For example, the result of the word segmentation of "AAA herbicide in 2017" is "(2017, eng)|(year, m)|(AB, nz)|(C, ns)|(herbicide, nz)|(folding, n)", wherein the part of speech "eng" represents English, and the corresponding word has a string length of 1, the part of speech "m" represents a numeral, and the corresponding word has a string length of 1, the part of speech "nz" represents "other proper nouns", and the corresponding word has a string length of 2, n represents a noun, and the corresponding word has a string length of 1, and the type of the cell is determined to be "nz" according to the length of the string in the cell.

[0084] It should be noted that, in this embodiment, the type of each cell is determined according to the word segmentation results of each cell, and the type of the cell is determined by the part of speech corresponding to the word with the longest string length added together. In other embodiments, the type of the cell can also be determined according to the word segmentation results in other ways, such as comparing the string length with a threshold, which is not specifically limited here.

[0085] According to the data table field type identification method provided by the present invention, word segmentation processing is performed on cells whose cell types cannot be identified, and the type of the cell is determined according to the part of speech corresponding to each word after the word segmentation processing, thereby ensuring the comprehensiveness of the field type identification processing in the data table and improving the accuracy of field type identification.

[0086] Based on any of the above embodiments, in this embodiment, word segmentation is performed on the data contained in the target cell, and the type of the target cell is determined according to the word segmentation result, including:

[0087] Perform word segmentation on the data contained in the target cell to obtain the words and parts of speech corresponding to the data contained in the target cell;

[0088] The sum of the string lengths of words with the same part of speech is calculated, and the part of speech corresponding to the words whose sum of string lengths meets the preset conditions is used as the type of the target cell.

[0089] In this embodiment, the data contained in the target cell whose cell type cannot be accurately identified is segmented, and the type of the cell is determined by the part of speech of each word after the segmentation. Among them, word segmentation is the basis of natural language processing, and part of speech refers to the basis for dividing word classes based on the characteristics of words.

[0090] In this embodiment, the sum of the lengths of the character strings of words with the same part of speech is calculated, and when the sum of the calculated lengths of the character strings meets the preset condition, the part of speech corresponding to the word is determined as the type of the target cell. Assuming that the preset condition is that the length of the character string is 5, when the length of the character string of the word corresponding to the part of speech "n" in a cell is calculated to be 6, and the length of the character string of the word corresponding to the part of speech "a" is 4, that is, the length of the character string of the word corresponding to the part of speech "n" meets the preset condition, then the part of speech "n" is directly determined as the type of the cell.

[0091] In this embodiment, for a certain cell, the type of the cell can be determined by whether the length of the word string meets the preset conditions. The method provided by this embodiment can be used for each cell in the entire data table, wherein the preset condition can be to determine the part of speech corresponding to the word with the longest string length in the cell as the type of the cell.

[0092] As shown in Table 3 above, the word segmentation results obtained after the data of each cell in the data table of Table 1 are processed, and the character string lengths of the words corresponding to the same part of speech in each cell are calculated according to the word segmentation results shown in Table 3 to determine the type of each cell. For example, the word segmentation result of the cell in the third row and fifth column in Table 3 is "(20,eng)|(gram,m)|(*,x)|(25,eng)|(package,v)|(*,x)|(8,eng)|(box,q)", and the character string length of the word corresponding to each part of speech in the word segmentation result is calculated. Among them, the character string length of the word corresponding to the part of speech "eng" is 5, and the calculation process is len("20")+len("25")+len("8")=2+2+1=5; the character string length of the word corresponding to the part of speech "m" is 1, the character string length of the word corresponding to the part of speech "x" is 2, the character string length of the word corresponding to the part of speech "v" is 1, and the character string length of the word corresponding to the part of speech "q" is 1. By comparing the lengths of the character strings, that is, the character string length of the word corresponding to the part of speech "eng" is the largest, which is 5, and the part of speech "eng" is determined as the type of the cell. The other cells are processed in the same way to obtain the cell types described in Table 4 below.

[0093] Table 4

[0094]

[0095] According to the data table field type identification method provided by the present invention, by performing word segmentation processing on the data of the target cells whose cell types cannot be identified by regular expressions, and calculating the sum of the string lengths of words with the same part of speech, the part of speech corresponding to the words whose sum of string lengths meets preset conditions is used as the type of the target cell. This can achieve comprehensive identification of cells in the data table and determine the type of each cell, provide support for the subsequent accurate identification of the field type of each field, and improve the accuracy of field type identification.

[0096] Based on any of the above embodiments, in this embodiment, the data contained in each cell is identified and processed, and the cell type is determined for each cell in the data table according to the identification result, including:

[0097] The data contained in the target cell is identified. When the type of the target cell is included in the identification result, it is determined that there are cells with ambiguous types among all the cells corresponding to the field to which the target cell belongs, based on statistical information of all the cells corresponding to the field to which the target cell belongs, and the type of the cell with ambiguous type is modified; wherein the target cell is any cell in the data table to be identified.

[0098] In this embodiment, the statistical information refers to the cell format information of all cells corresponding to the field to which the target cell belongs, the type information of each cell, and the data contained in each cell.

[0099] In this embodiment, when the recognition result includes the type of the target cell, the cell with an ambiguous type can be determined based on the statistical information of all cells corresponding to the field to which the target cell belongs. The cell with an ambiguous type may be the target cell itself, or one or more cells in the cell set corresponding to the field to which the target cell belongs.

[0100] It should be noted that a cell with an ambiguous type refers to a cell whose cell type meets a preset condition. In this embodiment, an ambiguous type exists only when there are two cell types in the cell corresponding to a certain field, specifically, when two cell types exist at the same time and one of the cell types meets the preset condition, the cell type is determined to be an ambiguous type.

[0101] For example, according to the statistical information, it can be known that the cell types in the column where the target cell is located include date type and numeric type, and only the type of the target cell is the numeric type, and the cell format of the target cell is the "0" cell format, then it is determined that the target cell is a cell with an ambiguous type, and the type of the target cell is changed from the numeric type to the date type.

[0102] For another example, according to the statistical information, the cell types in the column where the target cell is located are of two types: numeric type and date type, among which there are 5 numeric type cells and 15 date type cells. Through comparative analysis, it is determined that the cell type of the numeric type may be a cell with an ambiguous type, so the type of the cell with an ambiguous type (i.e., a cell of the numeric type) in the column where the target cell is located is changed from a numeric type to a date type. It should be noted that the method for determining a cell with an ambiguous type is not specifically limited.

[0103] According to the data table field type identification method provided by the present invention, when the type of the target cell is identified, the cell formats of all cells corresponding to the field to which the target cell belongs are counted, and the cells with ambiguous types in the column are determined based on the statistical information, and the types of the cells with ambiguous types are modified. The accuracy of the cell type is ensured by further correcting the determined cell type.

[0104] Based on any of the above embodiments, in this embodiment, the cell type is determined for each cell in the data table according to the data contained in the cell, and the method further includes:

[0105] When the recognition result includes the type of the target cell, it is determined that no ambiguous types exist in all cells corresponding to the field to which the target cell belongs, based on the statistical information of all cells corresponding to the field to which the target cell belongs, and the types of each cell remain unchanged.

[0106] In this embodiment, when the target cell type is included in the recognition result, all cell types corresponding to the field to which the target cell belongs are statistically analyzed to determine that there are no ambiguous types of cells corresponding to the field to which the target cell belongs, and the types of each cell remain unchanged. For example, Table 5 below is the type information of the identifiable cells obtained by identifying each cell in the data table of Table 1. When the field name of the field to which the target cell belongs is "Month", according to the fact that the types of each cell corresponding to the field are all "Date", it can be determined that there are no cells with ambiguous types in the field, and the types of each cell remain unchanged. It should be noted that when judging whether the type of a cell is ambiguous, in this embodiment, it is determined by comparing whether the types of each cell are consistent. In other embodiments, other judgment methods can be used, which are not specifically limited here.

[0107] Table 5

[0108]

[0109] According to the data table field type identification method provided by the present invention, for the target cell whose type has been identified in the identification result, it is necessary to further determine, based on the statistical information of the cell formats of all cells corresponding to the field to which the target cell belongs, that there is no cell with an ambiguous type among all cells corresponding to the field to which the target cell belongs, and keep the type of each cell unchanged. By further correcting the type of the cell whose type has been determined, the accuracy of cell type identification is guaranteed.

[0110] Based on any of the above embodiments, in this embodiment, according to the statistical information of all cells corresponding to the field to which the target cell belongs, determining that there are cells with ambiguous types among all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with ambiguous type includes:

[0111] According to statistical information of all cells corresponding to the field to which the target cell belongs, when two different types of cells exist simultaneously in all cells corresponding to the field to which the target cell belongs, it is determined that there is a cell with an ambiguous type in all cells corresponding to the field to which the target cell belongs, and the type of the cell with the ambiguous type is modified.

[0112] In this embodiment, according to the statistical information of all cells corresponding to the field to which the target cell belongs, when there are two types of cell types in all cells, it is determined that there are cells with ambiguous types in all cells corresponding to the field to which the target cell belongs. For example, if the type of the target cell is a date type, according to the statistical information, the cell type of the field to which the target cell belongs also includes a room number type. If there are cells of different types, it can be determined that the type of the cells in the field to which the target cell belongs is incorrectly identified, and there are cells with ambiguous types, and the type of the cells with ambiguous types is modified according to the specific judgment conditions. It should be noted that the specific judgment conditions can be determined by the following embodiments and are not described in detail here.

[0113] According to the data table field type identification method provided by this embodiment, based on the statistical information of all cells corresponding to the field to which the target cell belongs, when it is determined that there are two different types of cells in all cells corresponding to the field to which the target cell belongs, it is determined that there are cells with ambiguous types in all cells corresponding to the field to which the target cell belongs, and the types of the cells with ambiguous types are modified. By correcting the types of cells with ambiguous types, the accuracy of cell type identification is guaranteed, and the accuracy of subsequent field type identification is improved.

[0114] Based on any of the foregoing embodiments, in this embodiment, when two different types of cells exist simultaneously in all cells corresponding to the field to which the target cell belongs, determining that a cell with an ambiguous type exists in all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with the ambiguous type includes:

[0115] According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is judged whether at least one of the first condition and the second condition is met, the first condition including: there are both date type cells and room number type cells in all cells corresponding to the field to which the target cell belongs, and the cell format of the date type cells is the date type cell format; the second condition including: the field name of the field to which the target cell belongs contains a preset keyword;

[0116] When at least one of the first condition and the second condition is met, it is determined that there are ambiguous types of date-type cells in all cells corresponding to the field to which the target cell belongs, and the type of the date-type cells is changed from a date type to a room number type.

[0117] In this embodiment, the first condition includes that there are both date type cells and room number type cells in all cells corresponding to the field to which the target cell belongs, and the cell format of the date type cells is the date type cell format, wherein the date type cell format can be "md-yyyy" or "mm-dd-yyyy" or "mm-dd-yy", or "md-yy"; wherein "yyyy" is used to represent the year, "m" or "mm" is used to represent the month, and "d" or "dd" is used to represent the date. When all cells corresponding to the field to which the target cell belongs contain both date type cells and room number type cells, and the cell format of the date type cells is any one of the above date type cell formats, it is determined that the cell type is ambiguous, and the date type of the cell is automatically modified to the room number type. It should be noted that the date type cell format can also be in other forms, which can be set according to actual needs and is not specifically limited here.

[0118] In this embodiment, the second condition includes that the field name of the field to which the target cell belongs contains a preset keyword, and the preset keyword includes any one or more of the following words: "room number", "room number", "number", "project number", "serial number", "room" or "room". When the field name contains the above keywords, the type of the ambiguous type cell (i.e., the date type cell) in all cells corresponding to the field to which the target cell belongs is changed from the date type to the room number type.

[0119] According to the data table field type identification method provided by the present invention, by judging whether the statistical information of all cells corresponding to the field to which the target cell belongs meets the first condition or the second condition, when any one of the conditions is met, it is determined that there are cells with ambiguous types, and the type of the cells with ambiguous types is modified from the date type to the room number type. By correcting the type of the cells with ambiguous types, the accuracy of cell type identification is guaranteed, and the accuracy of subsequent field type identification is improved.

[0120] Based on any of the foregoing embodiments, in this embodiment, when two different types of cells exist simultaneously in all cells corresponding to the field to which the target cell belongs, determining that a cell with an ambiguous type exists in all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with the ambiguous type includes:

[0121] According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is judged whether the third condition is met, and the third condition includes: all cells corresponding to the field to which the target cell belongs have both date type cells and value type cells, there is only one value type cell and the cell format of the value type cell is 0 cell format;

[0122] When the third condition is met, when the type of the target cell is a numeric type and the data of the target cell conforms to the first expression of the date, it is determined that the target cell has an ambiguous type;

[0123] Change the type of the target cell from a numeric type to a date type.

[0124] In this embodiment, the third condition means that in all cells corresponding to the field to which the target cell belongs, there are both date type cells and value type cells, and there is only one value type cell and the cell format of the value type cell is 0 cell format, wherein 0 cell format is a type of cell format, and if the value in the cell is a number, the result is displayed as an integer. In this embodiment, the first expression is used to determine whether the value is a year, wherein the first expression can be expressed as a positive integer with a length of 2, or as a positive integer with a length of 4 and the value range of the positive integer is between [1900 2400], such as 21, 2021 and other values.

[0125] In this embodiment, when the cell corresponding to the field to which the target cell belongs meets the third condition, that is, there is a cell of a numeric type among all the cells corresponding to the field to which the target cell belongs, and the cell format of the cell is "0", such as the data of the cell is "2012", the type of the cell is changed from a numeric type to a date type.

[0126] According to the data table field type identification method provided by the present invention, when the cell corresponding to the field to which the target cell belongs meets the third condition, the type of the only existing cell of numerical type is directly modified, and the type is changed from numerical type to date type. By performing type correction processing on the only cell with ambiguous type, the accuracy of cell type identification is guaranteed, and the accuracy of subsequent field type identification is improved.

[0127] Based on any of the foregoing embodiments, in this embodiment, when two different types of cells exist simultaneously in all cells corresponding to the field to which the target cell belongs, determining that a cell with an ambiguous type exists in all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with the ambiguous type includes:

[0128] Judging whether a fourth condition is satisfied according to statistical information of all cells corresponding to the field to which the target cell belongs, the fourth condition comprising: there are both date type cells and value type cells in all cells corresponding to the field to which the target cell belongs, and the data of the date type cells conform to the second expression of the date;

[0129] When the fourth condition is met, it is determined that there are ambiguous types of date type cells in all cells corresponding to the field to which the target cell belongs, and the types of the date type cells are changed from date type to value type.

[0130] In this embodiment, the fourth condition refers to the existence of date type cells and value type cells in all cells corresponding to the field to which the target cell belongs, and the data of the date type cells all conform to the second expression of the date. Among them, the second expression refers to the two cell formats of yyyy.m and yyyy.mm, which can be specifically expressed as 2021.1 or 2021.01.

[0131] It should be noted that the two cell formats corresponding to the second expression conform to both the date type and the floating-point type. However, when the floating-point type has appeared in all cells corresponding to the field to which the target cell belongs, the type of the cell that was originally of the date type is modified from the date type to the numeric type.

[0132] As shown in the data table of Table 6 below, assume that the target cell is the intersection of the second row and the second column, the data of the cell is "2019.12", and the cell type is a date type. The cell data of the third row and the second column in the table is "2019", and the cell type is a numeric type. Since both numeric type cells and date type cells appear in all cells (cells in the second column) corresponding to the field ("quantity") to which the target cell belongs, and the data "2019.12" of the target cell meets the second expression, it is necessary to change the type of all date type cells in all cells corresponding to the field to which the target cell belongs from date type to numeric type.

[0133] Table 6

[0134] month quantity Product Name May 2019.12 A May 2019 B May 2008 C May 1900 D

[0135] According to the data table field type identification method provided by the present invention, when the cell corresponding to the field to which the target cell belongs meets the fourth condition, the cell type is directly changed from a date type to a numerical type. By correcting the type of cells with ambiguous types, the accuracy of cell type identification is ensured, and the accuracy of subsequent field type identification is improved.

[0136] Based on any of the foregoing embodiments, in this embodiment, when two different types of cells exist simultaneously in all cells corresponding to the field to which the target cell belongs, determining that a cell with an ambiguous type exists in all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with the ambiguous type includes:

[0137] According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is determined whether a fifth condition is satisfied, wherein the fifth condition includes: among all cells corresponding to the field to which the target cell belongs, there are both date type cells and telephone number type cells;

[0138] When the fifth condition is met, when the type of the target cell is a telephone number type, the cell format of the target cell is a date type cell format, and the data of the target cell conforms to a regular expression of a date, it is determined that the target cell has an ambiguous type;

[0139] Change the type of the target cell from phone number type to date type.

[0140] In this embodiment, the fifth condition refers to the situation where there are both date type cells and telephone number type cells in all cells corresponding to the field to which the target cell belongs. Among them, when this condition is met, when the type of the target cell is a telephone number type, the cell format of the target cell is a date type cell format, and the data of the target cell conforms to the regular expression of the date, it is determined that the target cell has an ambiguous type. Among them, the date type cell format can be in the form of yyyymmd, yyyymdd or yyyymmdd. Such as 2021129 or 2021823, etc.

[0141] In this embodiment, when the type of the target cell is determined to be a telephone number type, but its cell format is a date type cell format and the data conforms to the regular expression of the date, it can be determined that the type of the target cell is ambiguous, and the data in the cell is not a telephone number, but date data, and the type of the telephone number of the target cell is modified to a date type.

[0142] According to the data table field type identification method provided by the present invention, when the cell corresponding to the field to which the target cell belongs meets the fifth condition, it is determined that the type of the target cell is a telephone number type and the data in the cell meets the regular expression of the date, and the cell corresponding to the field to which the target cell belongs contains both a cell of the date type and a cell of the telephone number type, then the telephone number type of the target cell is directly modified to the date type. By performing type correction processing on cells with ambiguous types, the accuracy of cell type identification is guaranteed, and the accuracy of subsequent field type identification is improved.

[0143] Based on any of the above embodiments, in this embodiment, determining the type of the target field according to the types of each cell corresponding to the target field includes:

[0144] Count the types of all cells corresponding to the target field;

[0145] If the types of all cells corresponding to the target field are the same, the type of the cell is used as the type of the target field.

[0146] In this embodiment, when it is necessary to determine the type of the target field, the types of all cells corresponding to the target field are counted. If the types of cells corresponding to the target field are the same, the same cell type is directly determined as the type of the target field. For example, for the cell types described in Table 6 above, when the target field is the second column, the types of the cells in the second column are the same, all of which are "Date". "Date" can be directly determined as the field type of the second column, that is, the field type of the second column is "date type". It should be noted that the method provided in this embodiment is only for the case where the cell types corresponding to the various fields are the same. In other embodiments, further explanation will be given for the case where the cell types are different.

[0147] According to the data table field type identification method provided by the present invention, when the types of all cells corresponding to the target field are the same, the type of the cell is determined as the type of the target field, thereby improving the accuracy and efficiency of field type identification.

[0148] Based on any of the above embodiments, in this embodiment, determining the type of the target field according to the types of each cell corresponding to the target field further includes:

[0149] When there are at least two types of all cells corresponding to the target field, the cell type whose number of appearances in all cells corresponding to the target field meets a preset condition is used as the type of the target field.

[0150] In this embodiment, the preset condition is to determine the type with the largest number of occurrences as the type of the target field. When the number of types of all cells corresponding to the target field is at least two, the cell type with the largest number of occurrences in all cells corresponding to the target field is used as the type of the target field. As shown in Table 6 above, if the name of the target field is "unit", the types of all cells of the target field are "q, q, q, q, zg", and there are two types of cells, "q" and "zg", of which "q" appears 4 times and "zg" appears 1 time. "q" with the largest number of occurrences is determined as the type of the target field, that is, the type of the target field is "quantifier". The other fields can be processed by the method provided in this embodiment to obtain the field types shown in Table 7 below.

[0151] It should be noted that the preset condition may also be that the number of occurrences of the cell type meets a certain preset threshold, such as when the number of occurrences of a cell type is greater than or equal to 3, the cell type may be determined as the type of the field to which it belongs. The specific determination method is not specifically limited here.

[0152] Table 7

[0153] Field Name Field Type Field Type Description month Date date date Date date Product Name nz noun Purchase order nr Name Specifications mix mix unit q quantifier Actual quantity Number Numeric Sales price Number Numeric Sales Amount Number Numeric

[0154] According to the data table field type identification method provided by the present invention, when the types of all cells corresponding to the target field are different, the type of the cell with the most occurrences is determined as the type of the target field, thereby improving the accuracy and efficiency of field type identification.

[0155] Based on any of the above embodiments, in this embodiment, the types of all cells corresponding to the target field are counted, specifically including:

[0156] The cell types obtained according to the word segmentation results, the cell types obtained after the cells with ambiguous types are modified, and the cell types with unambiguous types are counted in the cells corresponding to the target field to obtain the types of all cells corresponding to the target field.

[0157] In this embodiment, before determining the field type of the target field based on the number of times the types of all cells corresponding to the target field appear, it is also necessary to perform statistical processing on the cell types determined after word segmentation processing, the cell types accurately identified according to the data content, and the cell types obtained after modification of cells with ambiguous types, and determine the field type of the target field based on the statistical results.

[0158] According to the data table field type identification method provided by this embodiment, the cell types obtained according to the word segmentation processing results, the cell types obtained after modifying the cells with ambiguous types, and the cell types with non-ambiguous types are counted, and the field type of the target field is determined according to the statistical results, and the field type of the target field is accurately determined, thereby ensuring the accuracy of data processing.

[0159] Based on any of the above embodiments, Figure 2 As shown, in this embodiment, a data table containing fields and cells is obtained, the type of each cell in the data table is determined according to the data contained in the cell, and then the type of the field is determined according to the type of the cell corresponding to each field.

[0160] Among them, in the process of identifying the type of cells in the data table, there may be cells whose cell types cannot be identified. It is necessary to perform word segmentation processing on such cells whose cell types cannot be identified, such as segmenting the data content in the target cell to obtain a result list containing "words and parts of speech", and then traverse the result list to determine the part of speech corresponding to the word with the longest string length as the type of the target cell, and then determine the type of the target field according to the types of all cells corresponding to the field to which the target cell belongs.

[0161] In this embodiment, for cells whose cell types are identified, it is also necessary to perform type correction processing on cells with ambiguous types. When the type of the target cell is included in the identification result, the cells with ambiguous types can be determined based on the statistical information of all cells corresponding to each field, which can be specifically divided into the following four cases:

[0162] 1) In all cells corresponding to the field to which the target cell belongs, there are both date type cells and room number type cells, and the cell format of the date type cells is the date type cell format, wherein the date type cell format is md-yyyy or mm-dd-yyyy or mm-dd-yy or md-yy; when all cells corresponding to the field to which the target cell belongs contain both date type cells and room number type cells, and the cell format of the date type cells is any one of the above date type cell formats, it is determined that the cell type is ambiguous, and the date type of the cell is automatically changed to the room number type. Alternatively, the field name of the field to which the target cell belongs contains preset keywords, and the preset keywords include any one or more of the following words: "room number", "room number", "number", "project number", "serial number", "room" or "room". When the field name contains the above keywords, the type of the ambiguous type cell (i.e., the date type cell) in all cells corresponding to the field to which the target cell belongs is changed from the date type to the room number type.

[0163] 2) If all cells corresponding to the field to which the target cell belongs contain both a date type cell and a numeric type cell, and the format of the numeric type cell is 0 cell format, then the type of the cell is ambiguous, and the type of the cell is changed from numeric type to date type;

[0164] 3) If date type cells and numeric type cells appear simultaneously in all cells corresponding to the field to which the target cell belongs, and the formats of the date type cells are yyyy.m and yyyy.mm, then change the date type corresponding to these cells to numeric type.

[0165] 4) The cells corresponding to the field to which the target cell belongs contain both date type cells and phone number type cells, and the format of the cells corresponding to the phone number type meets the date type cell format, such as yyyymmd, yyyymdd or yyyymmdd, etc. The cell type of the phone number type is modified from the phone number type to the date type.

[0166] Through the above-mentioned cell type identification and confirmation method, the type identification and confirmation of each cell in the data table is completed, the type of each cell is obtained, and then the types of each cell are summarized, and then the type of the target field is determined according to the types of each cell corresponding to the target field. It should be noted that the field type can be determined according to the number of times the cell type corresponding to the field appears, such as determining the cell type with the most occurrences as the type of the field to which it belongs. It can be determined according to actual needs and is not specifically limited here.

[0167] The field type identification method provided by the present invention improves the accuracy of field type identification in a data table, provides a basis for subsequent data table proofreading and field recommendation, improves the efficiency of data table processing, and enhances user experience.

[0168] Figure 3 The present invention provides a data table field type identification device, such as Figure 3 As shown, the data table field type identification device provided by the present invention includes:

[0169] The acquisition module 301 is used to acquire a data table to be identified; wherein the data table includes fields, the fields include multiple cells, and the cells include data;

[0170] The identification module 302 is used to identify the data contained in each cell and determine the cell type for each cell in the data table according to the identification result;

[0171] The determination module 303 is used to determine the type of the target field according to the types of each cell corresponding to the target field; wherein the target field is any field in the data table.

[0172] The data table field type identification device provided by the present invention can accurately and quickly identify the field type of each field, solving the technical problems of low recognition efficiency and high cost caused by manual recognition in the prior art. It is suitable for field type recognition and processing of massive data, improves the accuracy of field type recognition in data tables, provides a basis for subsequent data table proofreading and field recommendation, improves the efficiency of data table processing, and enhances user experience.

[0173] Based on any of the above embodiments, in this embodiment, the identification module 203 is further used for:

[0174] The data contained in the target cell is identified. If the type of the target cell is not included in the identification result, the data contained in the target cell is segmented, and the type of the target cell is determined according to the segmentation result; wherein the target cell is any cell in the data table to be identified.

[0175] According to the data table field type identification device provided by the present invention, word segmentation processing is performed on cells whose cell types cannot be identified, and the type of the cell is determined according to the part of speech corresponding to each word after the word segmentation processing, thereby ensuring the comprehensiveness of the field type identification processing in the data table and improving the accuracy of field type identification.

[0176] Based on any of the above embodiments, in this embodiment, the device further includes a word segmentation module, and the word segmentation module is used to:

[0177] Perform word segmentation on the data contained in the target cell to obtain the words and parts of speech corresponding to the data contained in the target cell;

[0178] The sum of the string lengths of words with the same part of speech is calculated, and the part of speech corresponding to the words whose sum of string lengths meets a preset condition is used as the type of the target cell.

[0179] According to the data table field type identification device provided by the present invention, by performing word segmentation processing on the data of the target cell whose cell type cannot be identified by a regular expression, and calculating the sum of the string lengths of words with the same part of speech, the part of speech corresponding to the word whose sum of string length meets a preset condition is used as the type of the target cell. This can achieve comprehensive identification of cells in the data table, determine the type of each cell, provide support for the subsequent accurate identification of the field type of each field, and improve the accuracy of field type identification.

[0180] Based on any of the above embodiments, in this embodiment, the identification module 302 is further used for:

[0181] The data contained in the target cell is identified. When the type of the target cell is included in the identification result, it is determined that there are cells with ambiguous types among all the cells corresponding to the field to which the target cell belongs, based on statistical information of all the cells corresponding to the field to which the target cell belongs, and the type of the cell with ambiguous type is modified; wherein the target cell is any cell in the data table to be identified.

[0182] According to the data table field type identification device provided by the present invention, after identifying the type of the target cell, the cell formats of all cells corresponding to the field to which the target cell belongs are counted, and the cells with ambiguous types in the column are determined based on the statistical information, and the types of the cells with ambiguous types are modified. The accuracy of the cell type is ensured by further correcting the determined cell type.

[0183] Based on any of the above embodiments, in this embodiment, the identification module 302 is further used for:

[0184] In the case where the type of the target cell is included in the recognition result, it is determined that there is no ambiguity in the target cell based on the cell format statistics of all cells corresponding to the field where the target cell is located, and the type of the target cell remains unchanged.

[0185] According to the data table field type identification device provided by the present invention, for the target cell whose type has been identified in the identification result, it is necessary to further determine, based on the statistical information of the cell formats of all cells corresponding to the field to which the target cell belongs, that there is no cell with an ambiguous type among all cells corresponding to the field to which the target cell belongs, and keep the type of each cell unchanged. By further correcting the type of the cell whose type has been determined, the accuracy of cell type identification is guaranteed.

[0186] Based on any of the above embodiments, in this embodiment, the identification module 302 is further used for:

[0187] According to statistical information of all cells corresponding to the field to which the target cell belongs, when two different types of cells exist simultaneously in all cells corresponding to the field to which the target cell belongs, it is determined that there is a cell with an ambiguous type in all cells corresponding to the field to which the target cell belongs, and the type of the cell with the ambiguous type is modified.

[0188] According to the data table field type identification device provided by the present invention, based on the statistical information of all cells corresponding to the field to which the target cell belongs, when it is determined that there are two different types of cells in all cells corresponding to the field to which the target cell belongs, it is determined that there is a cell with an ambiguous type in all cells corresponding to the field to which the target cell belongs, and the type of the cell with the ambiguous type is modified. By correcting the type of the cell with the ambiguous type, the accuracy of cell type identification is guaranteed, and the accuracy of subsequent field type identification is improved.

[0189] Based on any of the above embodiments, in this embodiment, the identification module 302 is further used for:

[0190] According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is judged whether at least one of the first condition and the second condition is met, the first condition including: there are both date type cells and room number type cells in all cells corresponding to the field to which the target cell belongs, and the cell format of the date type cells is the date type cell format; the second condition including: the field name of the field to which the target cell belongs contains a preset keyword;

[0191] When at least one of the first condition and the second condition is met, it is determined that there are ambiguous types of date-type cells in all cells corresponding to the field to which the target cell belongs, and the type of the date-type cells is changed from a date type to a room number type.

[0192] According to the data table field type identification device provided by the present invention, by judging whether the statistical information of all cells corresponding to the field to which the target cell belongs meets the first condition or the second condition, when any one of the conditions is met, the cell with ambiguous type is determined according to the first condition or the second condition, and the date type of the cell with ambiguous type is modified to the room number type. By correcting the type of the cell with ambiguous type, the accuracy of cell type identification is guaranteed, and the accuracy of subsequent field type identification is improved.

[0193] Based on any of the above embodiments, in this embodiment, the identification module 302 is further used for:

[0194] According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is judged whether the third condition is met, and the third condition includes: all cells corresponding to the field to which the target cell belongs have both date type cells and value type cells, there is only one value type cell and the cell format of the value type cell is 0 cell format;

[0195] When the third condition is met, when the type of the target cell is a numeric type and the data of the target cell conforms to the first expression of the date, it is determined that the target cell has an ambiguous type;

[0196] Change the type of the target cell from a numeric type to a date type.

[0197] According to the data table field type identification device provided by the present invention, when the cell corresponding to the field to which the target cell belongs meets the third condition, the type of the only existing cell of numerical type is directly modified, and the type is changed from numerical type to date type. By performing type correction processing on the only cell with ambiguous type, the accuracy of cell type identification is guaranteed, and the accuracy of subsequent field type identification is improved.

[0198] Based on any of the above embodiments, in this embodiment, the identification module 302 is further used for:

[0199] According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is judged whether a fourth condition is satisfied, the fourth condition comprising: among all cells corresponding to the field to which the target cell belongs, there are both date type cells and value type cells, and the data of the date type cells conforms to the second expression of the date;

[0200] When the fourth condition is met, it is determined that there are ambiguous types of date type cells in all cells corresponding to the field to which the target cell belongs, and the types of the date type cells are changed from date type to value type.

[0201] According to the data table field type identification device provided by the present invention, when the cell corresponding to the field to which the target cell belongs meets the fourth condition, the cell type is directly changed from a date type to a numerical type. By correcting the type of cells with ambiguous types, the accuracy of cell type identification is ensured, and the accuracy of subsequent field type identification is improved.

[0202] Based on any of the above embodiments, in this embodiment, the identification module 302 is further used for:

[0203] According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is determined whether a fifth condition is satisfied, wherein the fifth condition includes: among all cells corresponding to the field to which the target cell belongs, there are both date type cells and telephone number type cells;

[0204] When the fifth condition is met, when the type of the target cell is a telephone number type, the cell format of the target cell is a date type cell format, and the data of the target cell conforms to a regular expression of a date, it is determined that the target cell has an ambiguous type;

[0205] The type of the target cell is changed from a phone number type to a date type.

[0206] According to the data table field type identification device provided by the present invention, when the cell corresponding to the field to which the target cell belongs meets the fifth condition, it is determined that the type of the target cell is a telephone number type and the data meets the regular expression of the date, and the telephone number type of the target cell is directly modified to a date type. By performing type correction processing on cells with ambiguous types, the accuracy of cell type identification is guaranteed, and the accuracy of subsequent field type identification is improved.

[0207] Based on any of the above embodiments, in this embodiment, the determination module 303 is further used to:

[0208] Count the types of all cells corresponding to the target field;

[0209] When the types of all cells corresponding to the target field are the same, the type of the cell is used as the type of the target field.

[0210] According to the data table field type identification device provided by the present invention, when the types of all cells corresponding to the target field are the same, the type of the cell is determined as the type of the target field, thereby improving the accuracy and efficiency of field type identification.

[0211] Based on any of the above embodiments, in this embodiment, the determination module 303 is further used to:

[0212] When there are at least two types of all cells corresponding to the target field, the cell type whose number of appearances in all cells corresponding to the target field meets a preset condition is used as the type of the target field.

[0213] According to the data table field type identification device provided by the present invention, when the types of all cells corresponding to the target field are different, the type of the cell with the most occurrences is determined as the type of the target field, thereby improving the accuracy and efficiency of field type identification.

[0214] Based on any of the above embodiments, in this embodiment, the determination module 303 is further used to:

[0215] The cell types obtained according to the word segmentation results, the cell types obtained after the cells with ambiguous types are modified, and the cell types with unambiguous types are counted in the cells corresponding to the target field to obtain the types of all cells corresponding to the target field.

[0216] According to the data table field type identification device provided by this embodiment, by statistically analyzing the cell types obtained according to the word segmentation processing results, the cell types obtained after modifying the cells with ambiguous types, and the cell types with non-ambiguous types, the field type of the target field is determined according to the statistical results, and the field type of the target field is accurately determined, thereby ensuring the accuracy of data processing.

[0217] Since the principle of the device described in the embodiment of the present invention is the same as that of the method described in the above embodiment, a more detailed explanation will not be repeated here.

[0218] Figure 4 Schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. Figure 4 As shown, the present invention provides an electronic device, including: a processor (processor) 401, a memory (memory) 402 and a bus 403;

[0219] The processor 401 and the memory 402 communicate with each other via the bus 403;

[0220] The processor 401 is used to call the program instructions in the memory 402 to execute the methods provided in the above-mentioned method embodiments, for example, including: obtaining a data table to be identified; wherein the data table contains fields, the fields contain multiple cells, and the cells contain data; identifying and processing the data contained in each cell, and determining the cell type for each cell in the data table according to the identification result; determining the type of the target field according to the type of each cell corresponding to the target field; wherein the target field is any field in the data table.

[0221] In an embodiment of the present invention, a non-transitory computer-readable storage medium is provided, and the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the methods provided in the above-mentioned method embodiments, for example, including: obtaining a data table to be identified; wherein the data table contains fields, the fields contain multiple cells, and the cells contain data; identifying and processing the data contained in each cell, and determining the cell type for each cell in the data table according to the identification result; determining the type of the target field according to the type of each cell corresponding to the target field; wherein the target field is any field in the data table.

[0222] The present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above methods, which include: obtaining a data table to be identified; wherein the data table contains fields, the fields contain multiple cells, and the cells contain data; performing identification processing on the data contained in each cell, and determining the type of the cell for each unit in the data table according to the identification result; determining the type of the target field according to the type of each cell corresponding to the target field; wherein the target field is any field in the data table.

[0223] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.

[0224] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data table field type identification method, characterized in that: include: Obtain a data table to be identified; wherein the data table includes fields, the fields include multiple cells, and the cells include data; Identify the data contained in each cell, and determine the cell type for each cell in the data table according to the identification result; Determining the type of the target field according to the types of each cell corresponding to the target field; wherein the target field is any field in the data table; The identifying and processing the data contained in each cell, and determining the cell type for each cell in the data table according to the identification result, includes: The data contained in the target cell is identified. If the type of the target cell is not included in the identification result, the data contained in the target cell is segmented, and the type of the target cell is determined according to the segmentation result; wherein the target cell is any cell in the data table to be identified.

2. The data table field type identification method according to claim 1, characterized in that: The performing word segmentation processing on the data contained in the target cell and determining the type of the target cell according to the word segmentation result includes: Perform word segmentation processing on the data contained in the target cell to obtain the word and part of speech corresponding to the data contained in the target cell; The sum of the string lengths of words with the same part of speech is calculated, and the part of speech corresponding to the words whose sum of string lengths meets a preset condition is used as the type of the target cell.

3. The data table field type identification method according to claim 1, characterized in that: The identifying and processing the data contained in each cell, and determining the cell type for each cell in the data table according to the identification result, includes: The data contained in the target cell is identified. When the type of the target cell is included in the identification result, it is determined that there are cells with ambiguous types among all the cells corresponding to the field to which the target cell belongs, based on statistical information of all the cells corresponding to the field to which the target cell belongs, and the type of the cell with ambiguous type is modified; wherein the target cell is any cell in the data table to be identified.

4. The data table field type identification method according to claim 1, characterized in that: The step of identifying the data contained in each cell and determining the cell type for each cell in the data table according to the identification result also includes: When the recognition result includes the type of the target cell, it is determined that no ambiguous types exist in all cells corresponding to the field to which the target cell belongs, based on statistical information of all cells corresponding to the field to which the target cell belongs, and the types of each cell remain unchanged.

5. The data table field type identification method according to claim 3, characterized in that: The step of determining, based on the statistical information of all cells corresponding to the field to which the target cell belongs, that there is a cell with an ambiguous type among all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with an ambiguous type includes: According to the statistical information of all cells corresponding to the field to which the target cell belongs, when two different types of cells exist simultaneously in all the cells corresponding to the field to which the target cell belongs, it is determined that there is a cell with an ambiguous type in all the cells corresponding to the field to which the target cell belongs, and the type of the cell with the ambiguous type is modified.

6. The data table field type identification method according to claim 5, characterized in that: In the case that two different types of cells exist at the same time in all cells corresponding to the field to which the target cell belongs, determining that there is a cell with an ambiguous type in all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with the ambiguous type includes: According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is judged whether at least one of a first condition and a second condition is met, wherein the first condition includes: among all cells corresponding to the field to which the target cell belongs, there are both date-type cells and room number-type cells, and the cell format of the date-type cells is a date-type cell format; the second condition includes: the field name of the field to which the target cell belongs contains a preset keyword; When at least one of the first condition and the second condition is met, it is determined that there are ambiguous types of date-type cells in all cells corresponding to the field to which the target cell belongs, and the type of the date-type cells is changed from a date type to a room number type.

7. The data table field type identification method according to claim 5, characterized in that: In the case that two different types of cells exist at the same time in all cells corresponding to the field to which the target cell belongs, determining that there is a cell with an ambiguous type in all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with the ambiguous type includes: According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is judged whether a third condition is satisfied, wherein the third condition includes: among all cells corresponding to the field to which the target cell belongs, there are both date type cells and value type cells, there is only one cell of the value type and the cell format of the value type cell is 0 cell format; In the case where the third condition is met, when the type of the target cell is a numerical type and the data of the target cell conforms to the first expression of the date, it is determined that the target cell has an ambiguous type; Change the type of the target cell from a numeric type to a date type.

8. The data table field type identification method according to claim 5, characterized in that: In the case that two different types of cells exist at the same time in all cells corresponding to the field to which the target cell belongs, determining that there is a cell with an ambiguous type in all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with the ambiguous type includes: Judging whether a fourth condition is satisfied according to statistical information of all cells corresponding to the field to which the target cell belongs, the fourth condition comprising: there are both date type cells and value type cells in all cells corresponding to the field to which the target cell belongs, and the data of the date type cells conform to the second expression of the date; When the fourth condition is met, it is determined that there are ambiguous types of date-type cells in all cells corresponding to the field to which the target cell belongs, and the types of the date-type cells are changed from date type to value type.

9. The data table field type identification method according to claim 5, characterized in that: In the case that two different types of cells exist at the same time in all cells corresponding to the field to which the target cell belongs, determining that there is a cell with an ambiguous type in all cells corresponding to the field to which the target cell belongs, and modifying the type of the cell with the ambiguous type includes: According to the statistical information of all cells corresponding to the field to which the target cell belongs, it is judged whether a fifth condition is satisfied, wherein the fifth condition includes: among all cells corresponding to the field to which the target cell belongs, there are both date type cells and telephone number type cells; In the case where the fifth condition is met, when the type of the target cell is a telephone number type, the cell format of the target cell is a date type cell format, and the data of the target cell conforms to a regular expression of a date, it is determined that the target cell has an ambiguous type; The type of the target cell is changed from a phone number type to a date type.

10. The data table field type identification method according to claim 1, characterized in that: The step of determining the type of the target field according to the types of each cell corresponding to the target field includes: Count the types of all cells corresponding to the target field; When the types of all cells corresponding to the target field are the same, the type of the cell is used as the type of the target field; When there are at least two types of all cells corresponding to the target field, a cell type whose number of appearances in all cells corresponding to the target field meets a preset condition is used as the type of the target field.

11. The data table field type identification method according to claim 10, characterized in that: The types of all cells corresponding to the statistical target field include: The cell types obtained according to the word segmentation results, the cell types obtained after the cells with ambiguous types are modified, and the cell types with unambiguous types are counted in the cells corresponding to the target field to obtain the types of all cells corresponding to the target field.

12. A data table field type identification device, characterized in that: include: An acquisition module, used for acquiring a data table to be identified; wherein the data table includes a field, the field includes a plurality of cells, and the cell includes data; An identification module, used to identify the data contained in each cell, and determine the cell type for each cell in the data table according to the identification result; The recognition module is further used to recognize the data contained in the target cell, and when the type of the target cell is not included in the recognition result, perform word segmentation processing on the data contained in the target cell, and determine the type of the target cell according to the word segmentation result; wherein the target cell is any cell in the data table to be recognized; The determination module is used to determine the type of the target field according to the types of each cell corresponding to the target field; wherein the target field is any field in the data table.

13. An electronic device, characterized in that: include: processor, memory and bus, wherein, The processor and the memory communicate with each other via the bus; The memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the steps of the data table field type identification method as described in any one of claims 1 to 11.

14. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the steps of the data table field type identification method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Data table processing method and device, electronic equipment and storage medium

    CN113204555A