Abnormal data analysis method, system and storage medium in electronic documents

By analyzing and marking the abnormal data of the form in the drug declaration materials, the problem of error discovery under the high similarity and nesting of the form in the drug declaration materials is solved, and the progress and compliance of the drug declaration are improved.

CN112949279BActive Publication Date: 2025-01-07MINGDU ZHIYUN (ZHEJIANG) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110224175.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-07-28
Filing Date
2021-02-27
Publication Date
2025-01-07
Estimated Expiration
2041-02-27

AI Technical Summary

Technical Problem

In the processing of drug declaration materials, there are a large number of tables with high similarity, mutual reference and nesting, which leads to a large amount of human inspection work and difficult to detect errors, which affects the progress and compliance of drug declaration.

Method used

By obtaining the cell coordinates and content of the table in the electronic document to be analyzed, identifying the cells that are consistent in content, calculating the minimum table matrix difference between the two tables, obtaining abnormal cell groups, analyzing the table structured data, judging the association relationship, and marking inconsistent cells , reduce the amount of calculation and quickly detect errors.

Benefits of technology

It realizes rapid comparative analysis of a large number of similar forms, reduces manual inspections, improves the compliance and efficiency of drug declaration materials, and reduces the difficulty of error discovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112949279B_ABST
    Figure CN112949279B_ABST
Patent Text Reader

Abstract

The present invention discloses an abnormal data analysis method, system and storage medium in an electronic document, including obtaining the coordinates and content of each cell of a table in an electronic document to be analyzed, identifying cells with consistent content; obtaining the minimum table matrix of two tables, when the minimum table matrix of the first table has N more rows than the minimum table matrix of the second table, but the same number of columns, or the number of columns is N more than the minimum table matrix of the second table, but the number of rows is the same, and N is less than a preset value, obtaining the N rows or N columns with the most inconsistent cells in the minimum table matrix of the first table, and entering each cell in the N rows or N columns into an abnormal cell group; after removing the N rows or N columns from the minimum table matrix of the first table, a transition table matrix is ​​formed, and the contents of each cell in the corresponding position of the transition table matrix and the minimum table matrix of the second table are compared in turn, and if they are different, they are supplemented and entered into the abnormal cell group. Finally, the number of abnormal data cell results presented to the user is reduced, so that the user can quickly check and find errors and abnormal tables.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing and analysis, and in particular to a method, system and storage medium for analyzing abnormal data in an electronic document. Background Art

[0002] In recent years, the state has tightened its supervision over pharmaceutical companies, and more and more regulations have been introduced, and the implementation has become increasingly strict. According to regulatory requirements, pharmaceutical companies need to submit a large number of documents when applying for new drugs, and all submitted documents must be authentic and compliant. If there are inconsistencies in the content of the document, the compliance of the entire product will not be met, and the company will be subject to compulsory measures such as rectification, and the listing of the drug will be seriously affected. Therefore, a special team will be set up within the company to be responsible for the review of all documents; if there are subsequent adjustments to the experimental methods or materials used, the previously approved documents must also be modified one by one, so the review of drug application documents is a very detailed and extremely important task.

[0003] In the work of processing drug application materials, it is often necessary to process a large number of documents, and there are a large number of tables in these documents. These tables have high similarity, mutual references, and nesting. At the same time, due to the large processing workload and other reasons, multiple users are often required to collaborate in document editing. For example, when pharmaceutical research and development institutions prepare to organize drug application materials, there are a large number of documents and a large number of tables in the documents. These tables have various situations such as high similarity, mutual references, and nesting. At the same time, since these related tables are manually organized by multiple people, there are often various errors such as inconsistent corresponding cell content, missing table rows and columns, and disordered table row and column order. However, due to the large number of tables and their distribution in a large number of different documents, this causes a huge workload for later manual inspections, and the above-mentioned errors are difficult to find, which ultimately directly leads to data errors and difficulty in meeting compliance requirements, which seriously delays the progress of drug application. Summary of the invention

[0004] In view of the deficiencies in the prior art, the present invention provides a method for analyzing abnormal data in an electronic document, comprising the following steps:

[0005] Obtain the coordinates and contents of each cell in the table of the electronic document to be analyzed, and identify cells with consistent contents;

[0006] Obtain the minimum table matrix of the two tables, and obtain the abnormal cell group with data abnormality according to the difference between the minimum table matrices of the two tables and the position in the corresponding table. The minimum table matrix is ​​the minimum rectangular table area containing all cells with consistent content in the table. The abnormal cell group includes but is not limited to the coordinates and content of cells with inconsistent content, specifically including:

[0007] When the minimum table matrix of the first table has N more rows than the minimum table matrix of the second table but the same number of columns, or N more columns than the minimum table matrix of the second table but the same number of rows, and N is less than a preset value, obtain the N rows or N columns with the most inconsistent cells in the minimum table matrix of the first table, and enter each cell in the N rows or N columns into the abnormal cell group;

[0008] After removing the N rows or N columns from the minimum table matrix of the first table, a transition table matrix is ​​formed, and the contents of each cell at the corresponding position of the transition table matrix and the minimum table matrix of the second table are compared in turn to see if they are the same. If they are different, they are added to the abnormal cell group.

[0009] Preferably, the step of obtaining the abnormal cell group with data anomalies according to the difference between the minimum table matrices of the two tables and the positions in the corresponding tables specifically includes:

[0010] When the number of rows of the minimum table matrix of the first table in the associated table pair is N more than the minimum table matrix of the second table, and N is less than a preset value, obtain the N rows with the most inconsistent cells in the minimum table matrix of the first table, and record the coordinates and contents of each cell in these N rows;

[0011] After removing the N rows from the minimum table matrix of the first table, a transition table matrix is ​​formed;

[0012] Compare the cell contents at corresponding positions of the transition table matrix and the minimum table matrix of the second table in turn to see if they are the same. If there are different cells, enter an abnormal cell group, which includes but is not limited to the coordinates and contents of cells whose contents are inconsistent between the transition table matrix and the second table, and the coordinates and contents of the N rows of cells.

[0013] Preferably, the step of obtaining the abnormal cell group with data anomalies according to the difference between the minimum table matrices of the two tables and the positions in the corresponding tables specifically includes:

[0014] When the number of columns of the minimum table matrix of the first table is N more than that of the minimum table matrix of the second table, and N is less than a preset value, obtain the N columns with the most inconsistent cells in the minimum table matrix of the first table, and record the coordinates and contents of each cell in these N columns;

[0015] After removing the N columns from the minimum table matrix of the first table, a transition table matrix is ​​formed;

[0016] Compare the cell contents at corresponding positions of the transition table matrix and the minimum table matrix of the second table in turn to see if they are the same. If there are different cells, enter an abnormal cell group, which includes but is not limited to the coordinates and contents of cells whose contents are inconsistent between the transition table matrix and the second table, and the coordinates and contents of the N columns of cells.

[0017] Preferably, the method for analyzing abnormal data in an electronic document also includes the following steps: comparing the structured data of each table in the electronic document pair by pair, obtaining the coordinates and contents of cells with consistent contents in the two tables, determining whether there is an association relationship between the two tables, and performing subsequent analysis of abnormal cell groups on the two tables with an association relationship.

[0018] Preferably, the step of determining whether there is an association relationship between the two tables specifically includes the following steps: comparing the structured data of the two tables pair by pair to obtain the coordinates and contents of the cells with consistent contents in the two tables; determining the association status of the two tables based on the number and / or distribution position of the cells with consistent contents.

[0019] Preferably, the step of determining the association status of the two tables according to the number and / or distribution position of cells with consistent content specifically includes:

[0020] Get the number of cells with consistent content in each table and their distribution positions in the table;

[0021] Obtaining the minimum table matrix of each table, wherein the minimum table matrix is ​​the minimum rectangular table area containing all cells with consistent contents in the table;

[0022] When the number of cells with consistent content is greater than a preset value, and / or twice the number of cells with consistent content is greater than a preset ratio of the sum of the number of cells contained in the two tables, and / or the number of cells with consistent content is greater than a preset ratio of the total number of cells in the smallest table matrix in which it is located, the two tables are judged to be an associated table pair with an associated relationship.

[0023] Preferably, the method for analyzing abnormal data in an electronic document further comprises the following steps: comparing the contents of cells with inconsistent contents in the abnormal cell group, and finding and marking inconsistent character sets in the cell contents.

[0024] Preferably, the first table and the second table are located in two different electronic documents.

[0025] The present invention also discloses an abnormal data analysis system in an electronic document, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above methods when executing the computer program.

[0026] The present invention also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0027] The abnormal data analysis method in the electronic document disclosed by the present invention obtains the coordinates and contents of the cells in the first table and the second table to be analyzed respectively, identifies the cells with the same contents, and performs subsequent comparative analysis through the two table pairs, thereby greatly reducing the amount of calculation for comparative analysis. In the process of comparative analysis of the two tables, various situations such as the embedding of a small table into a large table, the transposition of the rows and columns of the table, the disorder of the order of the rows and columns of the table, the missing of the rows and columns inside and around the table, etc. are fully considered, and the inconsistent cell coordinates and positions between the two tables are found out according to the states of each situation of the two tables. The final abnormal result processing step can exclude the inconsistent cells generated by the disorder of the order of rows and columns and the missing of rows and columns, and screen out the truly abnormal table pairs and the inconsistent character sets in the inconsistent cells according to the real inconsistent cells found and the inconsistent character sets in the inconsistent cell contents, and finally reduce the number of results presented to the user, so as to facilitate the user to quickly check and find errors and abnormal tables. The comparative analysis of the two tables can be realized, and the cells and cell content differences of the associated tables that are inconsistent can be found and located. It is suitable for the scene where a large number of similar tables need to be processed, and the tables are nested and reused in many places, which can reduce a large amount of repetitive work of manually checking the consistency of the tables and avoid the errors of the inconsistent contents of the corresponding cells of the associated tables.

[0028] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0030] Figure 1 It is a flowchart of the abnormal data analysis method in the electronic document disclosed in this embodiment.

[0031] Figure 2 This is a schematic diagram of a specific flow chart of step S21 disclosed in this embodiment.

[0032] Figure 3 This is a schematic diagram of the transformation of the table to be analyzed disclosed in this embodiment.

[0033] Figure 4 This is a schematic diagram of a specific flow of step S212 disclosed in this embodiment.

[0034] Figure 5 This is a schematic diagram of the specific flow of step S3 disclosed in this embodiment.

[0035] Figure 6 This is a schematic diagram of a specific flow chart of step S32 in state 1 disclosed in this embodiment.

[0036] Figure 7 This is a schematic diagram of a specific flow chart of step S32 disclosed in this embodiment in state two.

[0037] Figure 8 This is a schematic diagram of a specific flow chart of step S32 disclosed in this embodiment in state three-one.

[0038] Fig. 9 This is a specific flowchart of step S32 disclosed in this embodiment in another situation of state three.

[0039] Fig.10 This is a schematic diagram of a specific flow chart of step S32 disclosed in this embodiment in state 41.

[0040] Fig.11 This is a specific flowchart of step S32 disclosed in this embodiment in another situation of state 4. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment 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.

[0042] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.

[0043] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0044] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0045] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.

[0046] Unless otherwise defined, the technical or scientific terms used herein shall have the common meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the patent application specification and claims of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "a" do not indicate a quantity limitation, but indicate the existence of at least one.

[0047] At present, various enterprises, such as pharmaceutical research and development institutions, have a large number of documents when preparing and organizing drug application materials, and there are a large number of tables in the documents. These tables generally have high similarities, mutual references, and nesting. Since these related tables are often manually organized by multiple people, it is inevitable that various errors will appear in these tables, such as inconsistent corresponding cell contents, missing rows and columns in tables, and disordered row and column order. In addition, since there are many tables and they are distributed in a large number of different documents, the workload of manual inspection in the later stage is extremely large, making it difficult to discover the above errors completely and quickly, resulting in data errors and difficulty in meeting material compliance requirements. In response to these technical issues, as shown in the attached Figure 1 As shown, this embodiment discloses a method for analyzing abnormal data in an electronic document, which specifically includes:

[0048] Step S1, obtaining the coordinates and contents of each cell of a table in an electronic document to be analyzed, and identifying cells with consistent contents.

[0049] Specifically, the coordinates and contents of each cell of two tables in the electronic document to be analyzed are obtained, and table structured data corresponding to the coordinates and contents of each table cell are generated respectively. The table structured data may include information such as the document to which the table belongs, the position of the table in the document, the coordinates of the cells in the table, and / or the contents of the cells. The first table and the second table may be located in different electronic documents or in the same electronic document.

[0050] By obtaining the coordinates and contents of each cell of the table, each table is processed into a data structure in which the cell coordinates and the cell contents correspond one to one. Specifically, existing tools and methods can be used to read tables in documents of various formats such as Word, Excel, PDF, etc., traverse each cell of the table, and form a string with the coordinates of all cells separated by spaces; the contents of all cells are also separated by spaces to form a string, and it is necessary to ensure that the coordinates of the cells correspond to the contents one to one. In some specific embodiments, due to the presence of merged cells in the table, when reading the coordinates of each cell of the table, it is necessary to ensure that the row coordinates of the cells in the same row are equal, and the column coordinates of the cells in the same column are equal. For the missing cell coordinates generated by the merged cells in this type of situation, they can be supplemented with empty content, or the cell content of the corresponding coordinates can be empty.

[0051] Specifically, each table can form the following data structure:

[0052] {

[0053] String fileId; / / The id of the document where the table is located

[0054] Integer location; / / The location of the table in the document

[0055] String coordinate; / / Coordinate information of all cells in the table

[0056] String content; / / Content information of all cells in the table

[0057] }

[0058] The fileId and location fields are used to indicate the document to which the table belongs and its position in the document, and are used to locate the table when presenting the table analysis and comparison results to the user. The coordinate and content fields are cell coordinates and content information, which are used for table association analysis and comparison analysis. The structured data of the table can be used directly for subsequent analysis, but when the number of tables is large, the structured data will take up a lot of memory; in order to avoid performing structured operations for each analysis, it is recommended to persist the table structured data. You can choose any relational or non-relational database, such as MySQL, SqlServer, Oracle, MongoDB, Elasticsearch, etc. to persist the table structured data. By extracting the table cell coordinates and content to form table structured data, ensure that the row and column coordinates of cells in the same row and column are consistent, in preparation for subsequent analysis.

[0059] Step S2, obtaining a minimum table matrix of the two tables, wherein the minimum table matrix is ​​a minimum rectangular table area containing cells with all the consistent contents in the table.

[0060] In some specific embodiments, the step further includes:

[0061] Step S21, compare the structured data of each table pair by pair, obtain the coordinates and contents of the cells with the same contents in the two tables, and determine whether the two tables have an association relationship. This step is used to filter out tables with associated contents for the next step of comparative analysis. Non-associated tables are treated as two completely different tables and no longer subjected to comparative analysis. That is, when two tables do not have an association relationship, they can be considered as normal different tables, and there is no need to present the difference between different tables without an association relationship to the user. Because the method disclosed in the present invention is used to identify to the user those cells whose contents should be the same in different documents or different tables of the same document but may have inconsistent contents due to human errors.

[0062] As attached Figure 2 As shown, the step S21 specifically includes:

[0063] Step S211 , comparing the two tables of structured data pair by pair, and obtaining the coordinates and contents of cells with consistent contents in the two tables.

[0064] Step S212, judging the association status of the two tables according to the number and / or distribution position of cells with the same content. Figure 4 As shown, the step S212 further includes:

[0065] Step S2121, obtaining the number of cells with consistent content in each table and their distribution positions in the table

[0066] Step S2122, obtaining the minimum table matrix of each table, wherein the minimum table matrix is ​​the minimum rectangular table area containing all cells with consistent contents in the table.

[0067] Specifically, taking the two tables A and B as examples, take the structured data of table A, and parse the coordinate and content fields into two linked lists, coordinateListA and contentListA respectively. The coordinates and contents of the corresponding index positions of the two linked lists correspond one to one. Similarly, take the structured data of table B and parse it to get coordinateListB and contentListB. Traverse the linked lists contentListA and contentListB to find the equal elements; find the corresponding coordinates in coordinateListA and coordinateListB according to the content elements respectively. The coordinates of the cells with the same content in tables A and B can form a dictionary sameCell, where the key value is the coordinates of the cells with the same content in table A, and the value is the coordinates of the cells with the same content in table B.

[0068] Convert tables A and B into matrices, as shown in the following figure. Figure 3 As shown, taking Form A as an example, Figure 3 The table shown is the original table matrix. The table matrix A is initialized as the original matrix according to the coordinates, and the initial value of each element is 0. According to the dictionary sameCell, the elements at the same cell coordinate position are rewritten as 1, and the coordinate of the lower right corner 1 is formed into a large matrix. Remove the rows and columns with all 0s on the top and left of the large matrix to obtain the minimum table matrix and the coordinates of the first element of the minimum table matrix. Specifically, the multiple cells surrounded by the dotted border constitute the large matrix, and the multiple cells filled with gray constitute the minimum table matrix. The minimum table matrix can be regarded as a small table embedded in the large table. The coordinates of each matrix start from 0. The coordinates of the first element [0, 0] of the minimum table matrix in the above figure are [2, 2] in the large matrix, that is, the coordinates of the first element of the minimum table matrix.

[0069] Step S2123, when the number of cells with consistent content is greater than a preset value, and / or twice the number of cells with consistent content is greater than a preset ratio of the sum of the number of cells contained in the two tables, and / or the number of cells with consistent content is greater than a preset ratio of the total number of cells in the minimum table matrix, the two tables are judged to be an associated table pair with an association.

[0070] Specifically, after obtaining the matrices of tables A and B, it is determined whether the two tables A and B are associated tables. The determination rule of the associated tables can be formulated based on experience and actual conditions. The preset determination rule in this embodiment can be:

[0071] The two tables must have at least n cells with the same content, that is, the number of 1s in the minimum table matrix is ​​greater than n.

[0072] The twice of the number of identical cells must be greater than m percent of the sum of the number of cells in the two tables.

[0073] The number of rows and columns of the minimum table matrix of Table A and Table B must be greater than 1, and the number of 1s must be greater than L percent of the total number of elements in the minimum table matrix.

[0074] Only when one or more of the above rules are met can they be associated tables with an associated relationship, otherwise they may be two unrelated tables. In this embodiment, the preferred recommended value of n is 3, the recommended value of m is 50, and the recommended value of L is 50. Of course, they can also be set separately according to the specific document situation.

[0075] By analyzing the minimum table matrix of the two tables, we can fully consider the situation where some table contents are nested, that is, when a small table is embedded in the rest of the large table, only the embedded small table content has an association relationship with the other table. At this time, it is necessary to obtain the minimum table matrix to distinguish the area where the small table is embedded in the table, and then compare the embedded table area with other tables or nested areas in other tables to determine the mutual association relationship. In addition, under normal circumstances, human errors will only cause a small number of errors, that is, a small number of inconsistent cells are generated in the associated table. Therefore, when the number of inconsistent cells in the two tables being analyzed is too large, that is, the two tables are very different, they can be considered as normal unrelated different tables and do not need to be presented to the user.

[0076] Through the above steps, all structured tables are traversed to find the associated table pairs, their consistent cell coordinate dictionary sameCell, and the table matrix as the input parameters for the next comparative analysis. Table association analysis is performed by comparing the cell contents of each table, and the minimum table matrix formed by cells with consistent contents is established. The two tables are screened to see whether they are associated table pairs according to the preset custom criteria. Subsequent comparative analysis is only performed on associated table pairs, which greatly reduces the amount of calculation for comparative analysis.

[0077] Step S3, obtaining an abnormal cell group according to the difference between the minimum table matrices of the two tables and the positions in the corresponding tables, wherein the abnormal cell group includes but is not limited to the coordinates and contents of cells with inconsistent contents.

[0078] As attached Figure 5 As shown, the step S3 specifically includes:

[0079] S31, respectively obtaining the number of rows and the number of columns of the first table and the second table;

[0080] S32, when the difference in the number of rows or columns between the first table and the second table is less than a preset value, the abnormal cell group is obtained according to the difference between the minimum table matrices of the two tables and the position in the corresponding table, otherwise no subsequent difference analysis is performed.

[0081] In this embodiment, step S3 can be specifically divided into the following states for processing respectively:

[0082] In state 1, it is determined that the number of rows and columns of the minimum table matrices in the two tables of the associated table pair is the same.

[0083] In state 2, the minimum table matrix of one of the two tables judged to be an associated table pair has the same number of rows and columns as the minimum table matrix of the other table after transposition.

[0084] State three: the minimum table matrices in the two tables of the associated table pair differ by n in number of rows or n in number of columns, where n is less than a preset value.

[0085] State 4: the number of rows of the two tables judged as the associated table pair differs by n, or the number of columns differs by n, where n is less than a preset value.

[0086] For state 1, the step is to obtain the abnormal cell group according to the difference between the minimum table matrices of the two tables and the position in the corresponding table, as shown in the attached Figure 6 As shown, specifically including:

[0087] Step S101 , when the number of rows and columns of the minimum table matrix of the first table is the same as the number of rows and columns of the minimum table matrix of the second table, traverse each cell of the minimum table matrix.

[0088] Step S102, compare whether the contents of the corresponding positions of the two minimum table matrices are equal, if they are equal, do not record the abnormal cell group, otherwise record the abnormal cell group. That is, if the cell contents of the corresponding positions of the two minimum table matrices are the same, do not record. That is, there are no abnormal cells with incorrect contents in the associated table pair.

[0089] Specifically, taking the associated table pair A and B in this embodiment as an example, when the number of rows and columns of the minimum table matrices of tables A and B are the same. Traverse each element of the minimum table matrix, compare whether the contents of the corresponding coordinates of the minimum table matrices of A and B are equal, record all unequal cell coordinates and contents in A and B respectively, and record the associated table pair at the same time to generate an abnormal cell group. The abnormal cell group can use a dictionary data structure DifTableCells, and the key value is an associated table pair, such as AB. The value value is a linked list formed by an array, and each element of the linked list is the coordinates and content of the inconsistent cells of the two tables, such as [A cell coordinates, A cell content, B cell coordinates, B cell content]. If the contents of the corresponding coordinates of the minimum table matrices of A and B are equal, the contents of tables A and B are consistent and no record is made.

[0090] For the situation in state 1, the step of filtering out the abnormal cell group on the associated table pair according to the distribution positions of the cells with inconsistent contents may specifically include the following steps:

[0091] S103, if the number of rows and the number of columns of the minimum table matrix of the first table are also the same, transposing the first table to form a first transposed table;

[0092] S104, comparing the minimum table matrix of the second table with the minimum table matrix of the first transposed table and identifying cells with inconsistent contents;

[0093] S105, if there are no cells with inconsistent contents, no subsequent difference analysis is performed, otherwise a second abnormal cell group is generated, the second abnormal cell group including but not limited to the coordinates and contents of cells with inconsistent contents between the first transposed table minimum table matrix and the second table minimum table matrix.

[0094] S106, comparing the number of inconsistent cells between the two minimum table matrices of the first and second tables with the number of inconsistent cells between the two minimum table matrices of the first transposed table and the second table;

[0095] S107, if the number of inconsistent cells between the two minimum table matrices of the first transposed table and the second table is small, obtain the inconsistent cell coordinates and contents between the two minimum table matrices of the first transposed table and the second table, and update the inconsistent cell coordinates and contents corresponding to the first and second tables in the abnormal cell group.

[0096] S108: If the number of inconsistent cells between the two minimum table matrices of the first transposed table and the second table is not less than the number of inconsistent cells between the two minimum table matrices of the first and second tables, then the abnormal cell group is not updated.

[0097] For example, in this embodiment, if the number of rows and columns of the minimum table matrices of A and B are equal, there is also the possibility that the contents of the two tables are consistent after transposition. After transposing a table, compare whether the elements of the corresponding coordinates are equal, and compare the number of cells with inconsistent contents obtained with the number of cells with inconsistent contents between the previous A and B tables. The smaller number is the correct comparison result. For example, in the transposed table C formed after the transposition of table A, traverse each cell in the minimum table matrix area of ​​transposed table C and table B, compare whether the elements or contents of the corresponding coordinates of the minimum table matrices of C and B are equal, and record all corresponding coordinates and contents of inconsistent cells in the minimum table matrices of C and B respectively, and record the associated table pair at the same time. If the number of inconsistent cells obtained after the analysis of the transposed table C formed after the transposition of table A and the minimum table matrix of table B is less than the number of inconsistent cells in the minimum table matrix of tables A and B obtained in the above steps. This indicates that the row content of table A may just correspond to the column content of table B, and the column content of table A may just correspond to the row content of table B. Only in this way can the transposed table have fewer cells with inconsistent content than the original table and the other table. By obtaining and screening the inconsistent cells before and after the transposition of two tables with the same number of rows and columns in the minimum table matrix, it is possible to effectively distinguish those tables that only swap the row and column content of the table. Such tables that only swap the row and column content can be considered as normal associated tables with the same content and do not need to be presented to the user.

[0098] For state 2, as shown in the attached Figure 7 As shown, the steps of obtaining the abnormal cell group according to the difference between the minimum table matrices of the two tables and the position in the corresponding table specifically include:

[0099] S201 , when the number of rows and the number of columns of the minimum table matrix of the second table after transposition are equal to those of the minimum table matrix of the first table, the second table is transposed to form a second transposed table.

[0100] S202, comparing the contents of the corresponding positions of the two minimum table matrices of the second transposed table and the first table to see if they are equal, if they are equal, then the abnormal cell group is not recorded, otherwise, the abnormal cell group is recorded. Specifically, if there are cells with inconsistent contents in the two minimum table matrices of the second transposed table and the first table, then the coordinates and contents of the cells with inconsistent contents are recorded in the abnormal cell groups corresponding to the first and second tables.

[0101] Specifically, in this embodiment, when one of the minimum table matrices of A and B is transposed, the number of rows and columns of the two matrices is consistent. For this situation, after transposing a table, traverse each cell in the minimum table matrix, compare whether the cell content or element of the corresponding coordinates of the minimum table matrices of A and B are equal, record all unequal cell coordinates and contents in A and B respectively, and record the associated table pair at the same time, generate or enter the abnormal cell group, wherein the data format of the abnormal cell group can be parameterized in the above steps. If the comparison results are equal, the contents of tables A and B are consistent and no recording is performed. In this embodiment, when one of the minimum table matrices of A and B is transposed, the number of rows and columns of the two matrices is consistent, which indicates that the content of the small table nested in the A table and the small table nested in the B table is likely to be replaced by each other between the row content and the column content, and the conversion of the table row and column content is only a difference in the way of expression, which can be considered as a normal associated table with the same content, and does not need to be presented to the user. It is only necessary to compare one of the small tables with the other small table after transposition, find out the real inconsistent content cells and present them to the user.

[0102] For state three, when the minimum table matrix of the first table has N more rows than the minimum table matrix of the second table but the same number of columns, or has N more columns but the same number of rows, and N is less than a preset value, obtain the N rows or N columns with the most inconsistent cells in the minimum table matrix of the first table, and enter each cell in the N rows or N columns into the abnormal cell group.

[0103] After removing the N rows or N columns from the minimum table matrix of the first table, a transition table matrix is ​​formed, and the contents of each cell at the corresponding position of the transition table matrix and the minimum table matrix of the second table are compared in turn to see if they are the same. If they are different, they are added to the abnormal cell group.

[0104] Specifically, if the number of rows in the minimum table matrix in the two tables in state three differs by n, as shown in the attached Figure 8 As shown, the steps of obtaining the abnormal cell group according to the difference between the minimum table matrices of the two tables and the position in the corresponding table specifically include:

[0105] Step S301, when the number of rows of the minimum table matrix of the first table in the associated table pair is N more than the minimum table matrix of the second table, and N is less than a preset value, obtain the N rows with the most inconsistent cells in the minimum table matrix of the first table, and record the coordinates and contents of each cell in these N rows;

[0106] Step S302, removing the N rows from the minimum table matrix of the first table to form a transition table matrix;

[0107] Step S303, compare in turn whether the cell contents at corresponding positions of the transition table matrix and the minimum table matrix of the second table are the same. If there are different cells, an abnormal cell group is generated or entered. The abnormal cell group includes but is not limited to associated table pairs, coordinates and contents of cells with inconsistent contents between the transition table matrix and the second table, and coordinates and contents of the N rows of cells.

[0108] In this embodiment, the value of n can be pre-set according to the actual use environment, and in this embodiment, n is 2 for example. Specifically, when the number of rows of the minimum table matrix of A and B differs by more than 2 rows, it is considered that the two tables A and B are not associated tables, and no comparative analysis is performed. The case where the minimum table matrix of A has one more row than the minimum table matrix of B is specifically described. Find the row with the most "0" in the minimum table matrix of A, which is the extra row, and record the coordinates and content of each cell element in the row. Remove the row in the minimum table matrix of A, move up the elements below the row, and form table A'. Compare whether the cell content or elements of the corresponding coordinates of the minimum table matrix of A' and the minimum table matrix of B are equal. If they are not equal, record all unequal cell coordinates and contents respectively, and record the associated table pair at the same time, generate or enter the abnormal cell group, wherein the abnormal cell group includes but is not limited to the associated table pair, the coordinates and contents of the cells whose contents are inconsistent with the transition table matrix and the second table, and the coordinates and contents of the extra N rows of cells. The situation of other difference rows can be compared and analyzed with reference to the above method.

[0109] For the difference in the number of columns of the minimum table matrix between the two tables in state three, as shown in the attached Fig. 9 As shown, the steps of obtaining the abnormal cell group according to the difference between the minimum table matrices of the two tables and the position in the corresponding table specifically include:

[0110] Step S401, when the number of columns of the minimum table matrix of the first table in the associated table pair is N more than the minimum table matrix of the second table, and N is less than a preset value, obtain the N columns with the most inconsistent cells in the minimum table matrix of the first table, and record the coordinates and contents of each cell in these N columns;

[0111] Step S402, removing the N columns from the minimum table matrix of the first table to form a transition table matrix;

[0112] Step S403, compare in turn whether the cell contents at corresponding positions of the transition table matrix and the minimum table matrix of the second table are the same. If there are different cells, an abnormal cell group is generated or entered. The abnormal cell group includes but is not limited to associated table pairs, coordinates and contents of cells with inconsistent contents between the transition table matrix and the second table, and coordinates and contents of the N columns of cells.

[0113] In this embodiment, the value of n can be pre-set according to the actual use environment. In this embodiment, n is 2 for example. Specifically, when the number of columns of the minimum table matrix of A and B differs by more than 2 columns, it is considered that the two tables A and B are not associated tables, and no comparative analysis is performed. The case where the minimum table matrix of A has one more column than the minimum table matrix of B is specifically described. Find the column with the most "0" in the minimum table matrix of A, which is the extra column, and record the coordinates and content of each cell element in the column. Remove the column in the minimum table matrix of A, shift the elements on the right side of the column to the left, and form table A'. Compare whether the cell content or elements of the corresponding coordinates of the minimum table matrix of A' and the minimum table matrix of B are equal. If they are not equal, record all unequal cell coordinates and contents respectively, and record the associated table pair at the same time, generate or enter the abnormal cell group, wherein the abnormal cell group includes but is not limited to the associated table pair, the coordinates and contents of the cells whose contents are inconsistent with the transition table matrix and the second table, and the coordinates and contents of the extra N columns of cells. The other phase difference situations can be compared and analyzed by referring to the above method.

[0114] In this embodiment, when the number of rows or columns of the minimum table matrices of Tables A and B differs by n rows or n columns. This means that the inconsistency of the cells in the rows or columns in the content of the small table nested in Table A and the small table nested in Table B is likely caused by human negligence during the specific table processing, which leads to disordered order of some rows and columns in the table and loss of rows and columns. Therefore, it is necessary to first exclude the inconsistent cells in the rows or columns in the nested tables caused by human errors, and then perform a comparison analysis of the corresponding cell contents to avoid the comparison of other cells being affected by these inconsistent cells in the entire row or column, so as to more accurately and quickly find the cells with inconsistent contents that may be caused by disordered order of rows and columns or loss of rows and columns, as well as other single inconsistent cells caused by input errors.

[0115] For one of the situations in state 4, the difference in the number of columns of the two tables in the associated table pair is n, where n is less than the preset value. Fig.10 As shown, the steps of obtaining the abnormal cell group according to the difference between the minimum table matrices of the two tables and the position in the corresponding table specifically include:

[0116] Step S501, when the difference in the number of columns between the two tables is greater than R, where R is a preset value, the two tables are considered not to be related tables and no column comparison analysis is performed;

[0117] Step S502, otherwise when the number of columns of the two tables differs by n columns, where n is not greater than R, obtain the column positions of all inconsistent cells in the table with more columns, and if the column is partially or completely located in the minimum table matrix of the table, proceed according to the steps of the aforementioned state three;

[0118] Step S503: if the column is outside the minimum table matrix of the table, then record the coordinates and contents of all cells in the column, and generate or enter them into the abnormal cell group of the associated table pair.

[0119] Specifically, in this embodiment, since the minimum table matrix of the table is formed by removing inconsistent cells on all sides, the two tables may have different rows and columns on the outermost layers on all sides. The R value can be specified according to the actual situation. In this embodiment, R is set to 2. For example, when the difference between Table A and B exceeds 2, it is considered that the two tables are not related tables and no comparative analysis is performed. Take the case where Table A has one more column than Table B as a specific example. Determine whether the extra column of A is the first column or the last column compared to B. If the extra column is no longer on both sides, it belongs to situation 3 and has been analyzed and processed. Determine whether the first column of Table A is all 0. If so, the first column is the extra column. If not, determine whether the last column is all 0. If so, the last column is the extra column. If otherwise, the extra column is not on both sides of the table, it belongs to state three and no comparative analysis is performed. After finding an extra column, if the associated table pair A and B already exists in DifTableCells, the value will be increased by the coordinates and content of the cells in this column; if the associated table pair A and B does not exist in DifTableCells, the associated table pair AB and the coordinates and content of the cells in this column will be added to the dictionary DifTableCells, where the coordinates and content of the corresponding cells in table B are empty.

[0120] For another situation of state 4, the number of rows of the two tables in the associated table pair differs by n, where n is less than a preset value. Fig.11 As shown, the steps of obtaining the abnormal cell group according to the difference between the minimum table matrices of the two tables and the position in the corresponding table specifically include:

[0121] Step S601, when the difference between the number of rows of the two tables is greater than R, where R is a preset value, the two tables are considered not to be related tables and no comparative analysis is performed;

[0122] Step S602, otherwise when the number of rows of the two tables differs by n rows, where n is not greater than R, obtain the row position of all inconsistent cells in the table with more rows, and if the row is partially or completely located in the minimum table matrix of the table, proceed according to the steps of the aforementioned state three;

[0123] Step S603: if the row is outside the minimum table matrix of the table, then record the coordinates and contents of all cells in the row, and generate or enter them into the abnormal cell group of the associated table pair.

[0124] Specifically, in this embodiment, since the minimum table matrix of the table is formed by removing inconsistent cells on all sides, the two tables may have rows that differ on the outermost layers on all sides. The R value can be specified according to the actual situation. In this embodiment, R is set to 2. For example, when the difference between Table A and B exceeds 2, the two tables are considered not to be related tables, and no comparative analysis is performed. Take the case where Table A has one more row than Table B as an example. Determine whether the one more row of A than B is the first row or the last row. If the extra row is no longer on both sides, it belongs to situation 3 and has been analyzed and processed. Determine whether the first row of Table A is all 0. If so, the first row is an extra row. If not, determine whether the last row is all 0. If so, the last row is an extra row. If otherwise, the extra row is not on both sides of the table. It belongs to state three and no comparative analysis is performed. After finding an extra row, if the associated table pair A and B already exist in DifTableCells, then add the coordinates and content of the cells in the row to value; if the associated table pair A and B does not exist in DifTableCells, then add the associated table pair AB and the coordinates and content of the cells in the row to the dictionary DifTableCells, where the coordinates and content of the corresponding cells in table B are empty. The dictionary DifTableCells obtained in the above steps can be used as the input parameter for the difference content processing in the following step S4.

[0125] The comparative analysis algorithm can consider the situations where a small table is embedded in a large table, the table rows and columns are transposed, the order of the table rows and columns is disordered, and the rows and columns inside and around the table are missing, and find out the inconsistent cell coordinates and positions of the associated table pairs.

[0126] The table comparison and analysis in the above step S3 fully considers the situations where a small table is embedded in a large table, the rows and columns of a table are transposed, the order of the rows and columns of a table is disordered, and the rows and columns inside and around the table are missing, and finds out the inconsistent cell coordinates and positions of the associated table pairs. It has stronger applicability and versatility to various types of tables, and can help users compare and analyze various types of tables.

[0127] In some specific embodiments, the method for analyzing abnormal data in an electronic document further includes step S4, comparing the contents of cells with inconsistent contents in the abnormal cell group, and finding and marking inconsistent character sets in the cell contents.

[0128] Specifically, the above step S4 is used to screen the above-mentioned associated table pair according to the number of cells with inconsistent content, and at the same time compare the contents of the cells with inconsistent content, find and mark the inconsistent character sets in the cell content. Because under normal circumstances, human errors will only cause a small number of errors and generate a small number of inconsistent cells. When the number of inconsistent cells in the associated table pair is too large, the two tables are quite different, and can be considered as normal different tables and are not presented to the user. Except for this case, it can be considered as an abnormal table caused by various reasons, which needs to be presented to the user for inspection and processing. Because a human error may generate one or more relatively discrete inconsistent cells, or may cause the order of rows and columns to be disordered or rows and columns to be lost, thereby generating multiple inconsistent cells in rows or columns. Therefore, the number of cells obtained by subtracting the number of cells generated by the disorder of the order of rows and columns and the loss of rows and columns from the number of all inconsistent cells is defined as the number of cells that are actually inconsistent. When the number of actually inconsistent cells is less than or equal to M, the associated table pair is considered to be an abnormal table and needs to be presented to the user for processing; otherwise, it is considered to be a normal different table and is not presented to the user. In this embodiment, the preferred M value can be 3.

[0129] By traversing the abnormal cell group, that is, traversing the dictionary DifTableCells, first remove the inconsistent cells caused by missing rows and columns, that is, remove the array elements in the dictionary value list whose cell coordinates in table A are empty or the cell coordinates in table B are empty. Then remove the inconsistent cells caused by disordered row and column order. The inconsistent cell list after removing the inconsistent cells caused by missing rows and columns in the difference results of tables A and B is difCell, and the data structure is List<String[]> , where the array String[] is [A cell coordinates, A cell content, B cell coordinates, B cell content]. Take out all A cell coordinates in difCell, and use the method of converting the table to the minimum table matrix to convert it to the minimum table matrix difMA of the difference result. For this minimum table matrix, the coordinates with element values ​​of 1 represent the coordinates of inconsistent cells. The necessary and sufficient condition for the existence of two columns of disordered cells is that two columns in difMA have all 1 values, and after exchanging the column coordinates of the two columns of cells, the contents are equal to the corresponding cells in the B table. The necessary and sufficient condition for the existence of two rows of disordered cells is that two rows in difMA have all 1 values, and after exchanging the row coordinates of the two rows of cells, the contents are equal to the corresponding cells in the B table. If there are more than 2 columns or 2 rows of disordered cells, refer to the above conditions for expansion. It is recommended to consider the case of disordered cell order of 3 rows or 3 columns at most. Other cases are considered to be normal different tables and are not presented to the user. According to the above necessary and sufficient conditions, find out the cells with disordered row and column order, remove these cells from difCell, and the number of cells left is the number of real inconsistent cells. Remove the associated table pairs whose actual inconsistent cell numbers are greater than n from the dictionary DifTableCells, and the remaining results are the difference table pairs that need to be presented to the user.

[0130] Since the contents of two corresponding inconsistent cells may be very similar, it is difficult for users to quickly find the real inconsistency between the two cell contents. Therefore, it is necessary to compare and analyze the corresponding inconsistent cell contents of the difference table pair to identify the inconsistent character sets. The two cell contents can be regarded as two strings a and b. Find the longest common subsequence l of a and b. The character set after removing l from a and b is the inconsistent character set, which can be highlighted by adding labels before and after the characters.

[0131] The above step S4 filters the analysis results again according to the number of real inconsistent cells, and can exclude inconsistent cells caused by disordered row and column order and missing rows and columns, and the inconsistent character sets of the inconsistent cell contents are based on the real inconsistent cells found. The truly abnormal table pairs and the inconsistent character sets in the inconsistent cells are screened out to reduce the number of results presented to the user, which is convenient for the user to quickly check and find errors and abnormal tables. At the same time, the contents of the inconsistent cells are compared and analyzed, and the inconsistent character sets can be found and highlighted, which is convenient for the user to find abnormal contents of the table.

[0132] The abnormal data analysis method in the electronic document disclosed by the present invention, by respectively obtaining the cell coordinates and contents in the first table and the second table to be analyzed, identifying the cells with consistent contents, and performing subsequent comparative analysis through the two table pairs, greatly reducing the calculation amount of comparative analysis. In the process of comparative analysis of the two tables, various situations such as the embedding of a small table into a large table, the transposition of table rows and columns, the disorder of table row and column order, the missing of rows and columns inside and around the table are fully considered, and the two tables are analyzed respectively according to the states of each situation, and the inconsistent cell coordinates and positions between the two tables are found. The last abnormal result processing step can exclude the inconsistent cells caused by disordered row and column order and missing rows and columns, and filter out the truly abnormal table pairs and the inconsistent character sets in the inconsistent cells according to the real inconsistent cells found and the inconsistent character sets in the inconsistent cell contents, and finally reduce the number of results presented to the user, so as to facilitate the user to quickly check and find errors and abnormal tables. The comparative analysis of the two tables can be realized, and the cells and cell content differences of the associated tables that are inconsistent can be found and located. It is suitable for scenes where a large number of similar tables need to be processed, and the tables are nested and reused in multiple places, which can reduce a large amount of repetitive work of manually checking the consistency of the tables and avoid errors in the inconsistent contents of the corresponding cells of the associated tables.

[0133] The present invention also provides a system for analyzing abnormal data in electronic documents, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, each step of the method for analyzing abnormal data in electronic documents as described in the above embodiments is implemented.

[0134] The abnormal data analysis system in the electronic document may include, but is not limited to, a processor and a memory. Those skilled in the art may understand that the schematic diagram is only an example of the abnormal data analysis system in the electronic document, and does not constitute a limitation on the abnormal data analysis system device in the electronic document, and may include more or fewer components than shown in the figure, or combine certain components, or different components, for example, the abnormal data analysis system device in the electronic document may also include input and output devices, network access devices, buses, etc.

[0135] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the abnormal data analysis system device in the electronic document, and uses various interfaces and lines to connect various parts of the abnormal data analysis system device in the entire electronic document.

[0136] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the abnormal data analysis system device in the electronic document by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0137] If the abnormal data analysis system in the electronic document is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can be executed by a processor to implement the steps of the above-mentioned abnormal data analysis method embodiments in each electronic document. Wherein, the computer program includes a computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device that can carry the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media does not include electrical carrier signals and telecommunication signals.

[0138] 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 cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

[0139] In conclusion, the above is only a preferred embodiment of the present invention, and all equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the patent of the present invention.

Claims

1. A method for analyzing abnormal data in an electronic document, characterized in that: The steps include: Obtain the coordinates and contents of each cell of two tables in the electronic document to be analyzed, and identify cells with consistent contents; The minimum table matrix of the two tables is obtained, and the abnormal cell group with data abnormality is obtained according to the difference between the minimum table matrices of the two tables and the position of the minimum table matrices of the two tables in the corresponding table. The minimum table matrix is ​​the minimum rectangular table area containing all cells with consistent content in the table. The abnormal cell group includes the coordinates and content of cells with inconsistent content, specifically including: When the minimum table matrix of the first table has N more rows than the minimum table matrix of the second table but the same number of columns, or N more columns than the minimum table matrix of the second table but the same number of rows, and N is less than a preset value, obtain the N rows or N columns with the most inconsistent cells in the minimum table matrix of the first table, and enter each cell in the N rows or N columns into the abnormal cell group; After removing the N rows or N columns from the minimum table matrix of the first table, a transition table matrix is ​​formed, and the contents of each cell at the corresponding position of the transition table matrix and the minimum table matrix of the second table are compared in turn to see if they are the same. If they are different, they are added to the abnormal cell group.

2. The method for analyzing abnormal data in an electronic document according to claim 1, characterized in that: The following steps are also included: The structured data of each table in the electronic document are compared pair by pair, the coordinates and contents of the cells with consistent contents in the two tables are obtained, it is determined whether there is an association between the two tables, and subsequent abnormal cell group analysis is performed on the two tables with an associated relationship.

3. The method for analyzing abnormal data in an electronic document according to claim 2, characterized in that: The step of determining whether there is an association relationship between the two tables specifically includes the following steps: Compare the structured data of the two tables pair by pair, and obtain the coordinates and contents of the cells with the same contents in the two tables; The association status of the two tables is determined according to the number and / or distribution positions of cells with consistent contents.

4. The method for analyzing abnormal data in electronic documents according to claim 3, characterized in that: The step of determining the association status of the two tables according to the number and / or distribution position of cells with consistent contents specifically includes: Get the number of cells with consistent content in each table and their distribution positions in the table; Obtaining the minimum table matrix of each table, wherein the minimum table matrix is ​​the minimum rectangular table area containing all cells with consistent contents in the table; When the number of cells with consistent content is greater than a preset value, and / or twice the number of cells with consistent content is greater than a preset ratio of the sum of the number of cells contained in the two tables, and / or the number of cells with consistent content is greater than a preset ratio of the total number of cells in the smallest table matrix in which it is located, the two tables are judged to be an associated table pair with an associated relationship.

5. The method for analyzing abnormal data in electronic documents according to claim 4, characterized in that: The following steps are also included: Compare the contents of cells with inconsistent contents in the abnormal cell group, and find and mark the inconsistent character sets in the cell contents.

6. The method for analyzing abnormal data in an electronic document according to any one of claims 1 to 5, characterized in that: The first table and the second table are located in two different electronic documents.

7. A system for analyzing abnormal data in an electronic document, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Structural extracting method of table information, electronic device, and computer readable storage medium

    CN107818075A

  • Comparison method and device of file differences

    CN108446394A