Table generation method, device, electronic device and storage medium combining RPA and AI

By combining RPA and AI technology, table lines and intersection points in the image are extracted, and tables are generated and filled, the problem of low table generation efficiency in the prior art is solved, and automated and efficient table data conversion is achieved.

CN113836878BActive Publication Date: 2024-11-05BEIJING LAIYE NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111026974.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-02
Publication Date
2024-11-05
Estimated Expiration
2041-09-02

AI Technical Summary

Technical Problem

In the prior art, the process of manually converting tables in pictures into online table documents is cumbersome and inefficient, and wastes manpower and cannot effectively improve the efficiency of table generation.

Method used

Combining RPA and AI technology, by extracting horizontal and vertical lines in the image, obtaining a collection of intersection points, generating a blank table consistent with the original table, and using OCR to identify text entries to fill them into the blank table, realizing automated table generation.

Benefits of technology

The table generation process is automated, efficiency is improved, tedious steps of manual processing are reduced, and offline data is quickly converted into online data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113836878B_ABST
    Figure CN113836878B_ABST
Patent Text Reader

Abstract

The present disclosure provides a table generation method, device, electronic device and storage medium combining RPA and AI, and relates to the field of artificial intelligence. The scheme is: executed by an RPA system, the RPA system extracts the horizontal and vertical lines of the first table from the image based on artificial intelligence AI; the RPA system obtains a set of intersections of the horizontal and vertical lines, wherein the intersection set includes a first type of intersection formed by the intersection of the horizontal and vertical lines, and a second type of intersection formed by the intersection of the extension of the horizontal line and / or the extension of the vertical line; the RPA system generates a blank second table consistent with the first table based on the intersection set; the RPA system fills the text entries identified from the image based on OCR into the blank second table to obtain the target table. The present disclosure uses RPA technology to identify the table in the image and restore it to a table document with the same table structure, automatically converting offline data into online data, replacing the cumbersome manual processing process, and improving the efficiency of table generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence, and in particular to a table generation method, device, electronic device and storage medium combining RPA and AI. Background Art

[0002] Robotic Process Automation (RPA) uses specific "robot software" to simulate human operations on computers and automatically execute process tasks according to rules.

[0003] Artificial Intelligence (AI) is a technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence.

[0004] In the related technology, the staff typed, copied and pasted to convert the table in the picture into an online table document, which was repetitive and mechanical, wasted manpower and was inefficient. Therefore, how to improve the efficiency of table generation and free up manpower is an urgent issue that needs to be solved now. Summary of the invention

[0005] The present disclosure provides a table generation method, device, electronic device and storage medium combining RPA and AI.

[0006] According to one aspect of the present disclosure, a table generation method combining RPA and AI is provided, including:

[0007] The RPA system extracts the horizontal and vertical lines of the first table from the image based on artificial intelligence AI;

[0008] The RPA system obtains a set of intersections of the horizontal line and the vertical line, wherein the set of intersections includes a first type of intersection formed by the intersection of the horizontal line and the vertical line, and a second type of intersection formed by the intersection of the extension line of the horizontal line and / or the extension line of the vertical line;

[0009] The RPA system generates a blank second table consistent with the first table based on the set of intersection points;

[0010] The RPA system fills the text entries recognized based on OCR from the image into the blank second table to obtain the target table.

[0011] The disclosed embodiment uses RPA technology to identify tables in images and restore them to table documents with the same table structure, automatically converting offline data into online data, replacing cumbersome manual processing procedures and improving the efficiency of table generation.

[0012] According to another aspect of the present disclosure, a table generation device combining RPA and AI is provided, including:

[0013] An extraction module, used for extracting horizontal lines and vertical lines of the first table from the image based on artificial intelligence AI;

[0014] An intersection acquisition module, used to acquire a set of intersections of horizontal lines and vertical lines, wherein the set of intersections includes first-type intersections formed by the intersection of horizontal lines and vertical lines, and second-type intersections formed by the intersection of extended lines of horizontal lines and / or extended lines of vertical lines;

[0015] A generating module, used for generating a blank second table consistent with the first table according to the intersection point set;

[0016] The filling module is used to fill the text entries recognized based on OCR in the image into the blank second table to obtain the target table.

[0017] According to another aspect of the present disclosure, there is provided an electronic device, including a memory and a processor;

[0018] Among them, the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the table generation method combining RPA and AI in the embodiment of the first aspect of the present disclosure.

[0019] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the table generation method combining RPA and AI of the first aspect of the present disclosure is implemented.

[0020] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the table generation method combining RPA and AI of the first aspect of the present disclosure.

[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure;

[0023] Figure 2 is a schematic diagram of the table to be recognized and the detected horizontal and vertical lines;

[0024] Figure 3 It is a schematic diagram of the set of intersection points formed by the detected horizontal and vertical lines;

[0025] Figure 4is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure;

[0026] Figure 5 is a schematic diagram of enumerating candidate cells;

[0027] Figure 6 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure;

[0028] Figure 7 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure;

[0029] Figure 8 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure;

[0030] Fig. 9 It is a schematic diagram of intersection pairs composed of intersection points;

[0031] Fig.10 It is a schematic diagram of the basic unit cell composed of intersection pairs;

[0032] Fig.11 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure;

[0033] Fig.12 It is a schematic diagram of updating the values ​​of matrix elements after determining the target cell;

[0034] Fig.13 It is a schematic diagram of splitting into two sub-target Boolean matrices after detecting the target row;

[0035] Fig.14 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure;

[0036] Fig.15 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure;

[0037] Fig.16 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure;

[0038] Fig.17 is a structural diagram of a table generation device combining RPA and AI according to an embodiment of the present disclosure;

[0039] Fig.18 It is a block diagram of an electronic device used to implement the table generation method combining RPA and AI in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0040] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0041] The following describes the table generation method, device, electronic device and storage medium combining RPA and AI in the present disclosure with reference to the accompanying drawings.

[0042] Figure 1 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure, such as Figure 1 As shown, the method comprises the following steps:

[0043] S101, the RPA system extracts horizontal lines and vertical lines of the first table from the image based on artificial intelligence AI.

[0044] RPA is a technology that simulates human operation on a PC and has begun to be applied to corporate production and office. The core of RPA is to use automation technology to "replace people" to perform repetitive, low-value, fixed process operations that do not require manual decision-making, thereby effectively improving work efficiency and reducing errors.

[0045] The RPA system obtains an image with a table. The first table is the table to be recognized in the image. The table model is used to detect the horizontal and vertical table lines in the image. The table lines can be tilted and curved to a certain extent. The horizontal and vertical lines of the first table are extracted based on artificial intelligence AI. Optionally, the horizontal and vertical lines in the image can be extracted using traditional computer vision (CV) algorithms. Line segments with close endpoints are connected to prevent recognition errors and obtain the final horizontal and vertical lines. Figure 2 As an example, from left to right are the original image, the detected horizontal line, and the detected vertical line.

[0046] S102: The RPA system obtains a set of intersections of horizontal lines and vertical lines, wherein the set of intersections includes first-type intersections formed by the intersection of horizontal lines and vertical lines, and second-type intersections formed by the intersection of extended lines of the horizontal lines and / or extended lines of the vertical lines.

[0047] The RPA system obtains the set of intersection points of horizontal and vertical lines. Assuming that x horizontal lines and y vertical lines are obtained in the above steps, the coordinates of the intersection points of each pair of horizontal and vertical lines are calculated. Regardless of whether the line segments intersect or not, a total of x*y points can be obtained, such as Figure 3 shown.

[0048] The intersection point set includes first-class intersection points formed by the intersection of horizontal lines and vertical lines, and such intersection points are crossed by both horizontal and vertical lines.

[0049] The intersection set also includes second-type intersections formed by the intersection of the extension lines of the lines and / or the extension lines of the vertical lines. This type of intersection is only crossed by one horizontal line / one vertical line.

[0050] S103: The RPA system generates a blank second table consistent with the first table according to the intersection point set.

[0051] refer to Figure 3 As shown, these intersections can form many tables. The RPA system identifies the table structure of the first table based on the set of the first type of intersections and the second type of intersections, and performs operations such as screening and deduplication on these tables to screen out blank tables that are consistent with the structure of the first table, namely, the second table.

[0052] S104, the RPA system fills the text entries recognized from the image based on OCR into the blank second table to obtain a target table.

[0053] Optical Character Recognition (ORC) technology converts the text of various bills, newspapers, books, manuscripts and other printed materials into image information through optical input methods such as scanning, and then uses text recognition technology to convert the image information into usable computer input technology.

[0054] The RPA system identifies the text entries of the first table in the image based on ORC technology, and fills them into the corresponding positions of the second table to obtain the target table. The table format and table content of the target table are the same as those of the first table. The first table is paper table data, while the target table is electronic table data.

[0055] In the disclosed embodiment, the RPA system extracts the horizontal and vertical lines of the first table from the image based on artificial intelligence AI, and the RPA system obtains a set of intersections of the horizontal and vertical lines, wherein the set of intersections includes a first type of intersection formed by the intersection of the horizontal and vertical lines, and a second type of intersection formed by the intersection of the extensions of the horizontal and / or vertical lines. The RPA system generates a blank second table consistent with the first table based on the set of intersections, and the RPA system fills the text entries identified from the image based on OCR into the blank second table to obtain the target table. In the disclosed embodiment, RPA technology is used to identify the table in the image and restore it to a table document with the same table structure, automatically converting offline data into online data, replacing the cumbersome manual processing flow and improving the efficiency of table generation.

[0056] Figure 4 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure. Figure 4, a process of generating a blank second table consistent with the first table according to the set of intersection points by the RPA system is explained, including the following steps:

[0057] S401, the RPA system enumerates cells according to the intersection points in the intersection point set to obtain candidate cells and attribute information of the candidate cells.

[0058] Assuming that x horizontal lines and y vertical lines are obtained in the above steps, a total of x*y intersections can be obtained. For these x*y intersections, all possible cells are enumerated as candidate cells. Each cell consists of a starting row, an ending row, a starting column, an ending column, and four intersection coordinates.

[0059] The attribute information of the candidate cell includes the area of ​​the cell, the coordinates of the four corners of the cell, the starting and ending points of the horizontal line and the starting and ending points of the vertical line corresponding to the cell.

[0060] by Figure 5 As an example, the process of unit enumeration is explained. For the convenience of description, these three pairs of intersections are numbered a, b, and c. Figure 5 As shown, a and b can form a candidate cell, and accordingly, b and c can also form a candidate cell, and finally, a and c can also form a candidate cell.

[0061] S402: The RPA system identifies a target cell for generating a blank second table from the candidate cells according to the attribute information of the candidate cells.

[0062] The RPA system traverses all candidate cells according to the attribute information of the candidate cells, and determines whether all four edges of each candidate cell exist one by one. If all four edges exist, the candidate cell is used as the target cell.

[0063] S403, the RPA system generates a blank second table for the target cells according to the position arrangement.

[0064] The RPA system obtains all target cells and attribute information of the target cells, arranges the cells according to the four corner coordinates of the target cells, and generates a blank second table.

[0065] In the disclosed embodiment, the RPA system enumerates the cells according to the intersections in the intersection set, obtains the candidate cells and the attribute information of the candidate cells, and the RPA system identifies the target cells for generating the blank second table from the candidate cells according to the attribute information of the candidate cells, and the RPA system generates the blank second table according to the position arrangement of the target cells. In the disclosed embodiment, a blank second table with the same structure as the first table is generated according to the intersection set, and the detection and generation of the table structure is realized, which is the most important step in table generation and lays the foundation for the subsequent filling of text entries.

[0066] Figure 6 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure. Figure 6 , a process for the RPA system to identify a target cell for generating a blank second table from the candidate cells according to the attribute information of the candidate cells is explained, including the following steps:

[0067] S601, the RPA system sorts all the enumerated candidate cells in ascending order of cell area.

[0068] According to the coordinates of the four corners of the candidate cells, the area of ​​the cells can be calculated, and all the enumerated candidate cells are sorted from small to large according to the cell area.

[0069] S602: The RPA system traverses the candidate cells in order and determines the existence of the traversed target candidate cells.

[0070] The candidate cells are traversed in order of area from small to large, and the existence of the traversed target candidate cells is judged.

[0071] The RPA system obtains the first starting and ending points of the horizontal line and the second starting and ending points of the vertical line corresponding to the target candidate cell, and determines whether all four sides of the target candidate cell exist based on the four corner coordinates, the first starting and ending points, and the second starting and ending points of the target candidate cell. When all four sides exist, it is determined that the target candidate cell exists.

[0072] S603, whenever the RPA system determines that a target candidate cell exists, the RPA system deletes cells that overlap with the target candidate cell from the candidate cells that have not been traversed, and determines the target candidate cell that is determined to exist as a target cell.

[0073] When it is determined that a target candidate cell exists, the candidate cell that overlaps with it must not exist. The RPA system deletes the cells that overlap with the target candidate cell from the candidate cells that have not been traversed, reducing the workload of subsequent traversal.

[0074] The RPA system determines the target candidate cell that exists as a target cell for generating a blank second table.

[0075] S604, the RPA system continues to traverse the candidate cells that have not been traversed after deletion in order until all target cells are obtained after the traversal.

[0076] The RPA system continues to traverse the candidate cells that have not been traversed after deletion in order, pauses the traversal after obtaining a new target cell, deletes the candidate cells that have not been traversed subsequently and overlap with the new target cell, and repeats this operation until the traversal is completed and all the target cells are obtained.

[0077] In the disclosed embodiment, the RPA system sorts all the enumerated candidate cells according to the cell area from small to large, and the RPA system traverses the candidate cells in order, and judges the existence of the traversed target candidate cells. Whenever the RPA system determines that the target candidate cell exists, it deletes the cells that overlap with the target candidate cells from the candidate cells that have not been traversed, and determines the target candidate cells that are determined to exist as a target cell. The RPA system continues to traverse the candidate cells that have not been traversed after the deletion in order until all the target cells are obtained after the traversal. In the disclosed embodiment, the target cells for generating the second table are obtained from the candidate cells, and the structural composition of the second table is preliminarily determined, laying the foundation for the generation of the second table.

[0078] Figure 7 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure. Figure 7 , the process of the RPA system traversing the candidate cells in order and judging the existence of the traversed target candidate cells is explained, including the following steps:

[0079] S701: The RPA system obtains the first starting and ending points of the horizontal line and the second starting and ending points of the vertical line corresponding to the target candidate cell.

[0080] The RPA system obtains the first starting and ending points of the horizontal line and the second starting and ending points of the vertical line corresponding to the target candidate cell, that is, obtains the spatial orientation and length of the corresponding horizontal and vertical lines.

[0081] S702: The RPA system determines whether all four sides of the target candidate cell exist based on the coordinates of the four corners, the first starting point, and the second starting point of the target candidate cell.

[0082] According to the coordinates of the four corners of the candidate cell, we can get the four edges formed by the four corners. Take the edge formed by the upper left corner and the lower left corner as an example:

[0083] Project this edge onto the Y axis to get its position and length on the Y axis, and project the scanned vertical line corresponding to this edge onto the Y axis to get its position and length on the Y axis. See if there is any overlap between the two. If there is, it proves that this edge exists, and if there is no overlap, it proves that this edge does not exist. Similarly, we can prove whether the edge formed by the two points in the upper right corner and the lower right corner exists.

[0084] Accordingly, take the edge formed by the upper left and upper right points as an example:

[0085] Project this edge onto the X-axis to get its position and length on the X-axis, and project the scanned horizontal line corresponding to this edge onto the X-axis to get its position and length on the X-axis. See if there is any overlap between the two. If there is, it proves that this edge exists, and if there is no overlap, it proves that this edge does not exist. Similarly, we can prove whether the edge formed by the two points in the lower left corner and the lower right corner exists.

[0086] S703, when the RPA system determines that all four edges exist, it determines that the target candidate cell exists.

[0087] If all four sides of the candidate cell exist, it is determined that the target candidate cell exists and can be used as the target cell.

[0088] In the disclosed embodiment, the RPA system obtains the first starting and ending point of the horizontal line and the second starting and ending point of the vertical line corresponding to the target candidate cell. The RPA system determines whether all four sides of the target candidate cell exist based on the four corner coordinates, the first starting and ending points, and the second starting and ending points of the target candidate cell. When the RPA system determines that all four sides exist, it determines that the target candidate cell exists. The disclosed embodiment provides a method for determining whether a target candidate cell exists, which lays the foundation for the RPA system to traverse the candidate cells to obtain all target cells.

[0089] Figure 8 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure. Based on the above embodiment, the RPA system identifies a target cell for generating a blank second table from the candidate cells according to the attribute information of the candidate cells, such as Figure 8 As shown, it also includes:

[0090] S801, the RPA system arranges the intersection points in the intersection point set in order, and groups the adjacent intersection points in the intersection point set into a plurality of intersection point pairs in the same direction.

[0091] The RPA system arranges the intersections of each row and column in the intersection set in spatial order, and groups adjacent intersections in the intersection set into multiple intersection pairs in the same direction, optionally horizontally or vertically.

[0092] like Fig. 9 As shown, when the intersection pairs are formed horizontally, an intersection will form an intersection pair with the intersection on its left, and another intersection pair with the intersection on its right. An intersection cannot exist in only one intersection pair.

[0093] Correspondingly, when forming intersection pairs in the vertical direction, an intersection will form an intersection pair with the intersection above it, and another intersection pair with the intersection below it.

[0094] S802, the RPA system sequentially obtains adjacent intersection pairs in the same direction, and forms basic cells from the adjacent intersection pairs.

[0095] The RPA system sequentially obtains adjacent intersection pairs in the horizontal or vertical direction, and the adjacent intersection pairs form basic cells. When adjacent intersection pairs are formed into intersection pairs in the horizontal direction, adjacent intersection pairs are obtained in the vertical direction. Correspondingly, when adjacent intersection pairs are formed into intersection pairs in the vertical direction, adjacent intersection pairs are obtained in the horizontal direction.

[0096] like Fig.10 As shown, when adjacent intersection pairs are obtained horizontally to form basic cells, a group of intersection pairs b will form a basic cell with the intersection pair a on its left, and another basic cell with the intersection pair c on its right. A group of intersection pairs cannot only constitute one basic cell.

[0097] Correspondingly, when adjacent intersection pairs are obtained vertically to form basic cells, a group of intersection pairs e will form a basic cell with the intersection pair d above it, and form another basic cell with the intersection pair f below it.

[0098] S803, the RPA system uses the basic cells as matrix elements to construct a Boolean matrix.

[0099] The RPA system uses the basic cells as matrix elements to construct a two-dimensional Boolean matrix. Assuming that x horizontal lines and y vertical lines are extracted in the above steps, x*y intersections can be obtained. At this time, a (x-1)*(y-1) Boolean matrix can be constructed to identify whether a cell exists at each position.

[0100] In the embodiment of the present disclosure, the RPA system arranges the intersections in the intersection set in order, and forms multiple intersection pairs with adjacent intersections in the intersection set in the same direction. The RPA system sequentially obtains adjacent intersection pairs in the same direction, and forms basic cells with adjacent intersection pairs. The RPA system uses the basic cells as matrix elements to construct a Boolean matrix. In the implementation of the present disclosure, a Boolean matrix is ​​constructed to identify whether a cell at each position exists, which can assist in recording the target cell determined by traversal and the position of the target cell, and facilitate subsequent operations.

[0101] Fig.11 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure. Fig.11 , the process of generating a blank second table by the RPA system according to the position arrangement of the target cells is explained, including the following steps:

[0102] S1101, the RPA system assigns a value to each matrix element in the Boolean matrix according to the target cell to generate a target Boolean matrix.

[0103] The initial matrix elements in the Boolean matrix are all F, which is the first value. When a target cell is determined, the RPA system obtains the first basic cell included in the target cell based on the four corner coordinates of the target cell, and updates the matrix element corresponding to the first basic cell from the first value F to the second value T.

[0104] like Fig.12 As shown, for example, the target cell in the second row includes three basic cells, and the corresponding matrix elements of these three basic cells need to be updated from the first value F to the second value T.

[0105] Each matrix element in the Boolean matrix is ​​assigned a value according to the target cell to generate a target Boolean matrix, wherein the matrix element corresponding to the target cell is updated to the second value, and the remaining matrix elements remain unchanged at the initial first value.

[0106] S1102: The RPA system identifies whether the target Boolean matrix includes target rows and / or target columns that are all first values.

[0107] The RPA system detects the value of each matrix element in the target Boolean matrix row by row and column by column, and identifies whether the target Boolean matrix includes target rows and / or target columns that all have the first value.

[0108] S1103: When there are target rows and / or target columns, the RPA system splits the Boolean matrix according to the target rows and / or target columns to generate sub-target Boolean matrices.

[0109] If a target row and / or a target column is detected, it proves that there are no target cells in this row and / or column, indicating that there are two tables with an up / down or left / right relationship in the figure. Split the Boolean matrix according to the target row and / or target column to generate a sub-target Boolean matrix.

[0110] As Fig.13 shown, if a target row is detected, it proves that there are no target cells in this row, indicating that there are two tables with an up / down relationship in the figure.

[0111] If a target column is detected, it proves that there are no target cells in this column, indicating that there are two tables with a left / right relationship in the figure.

[0112] If a target row and a target column are detected, it proves that there are no target cells in this row and this column, indicating that there are four tables with a "field" character relationship in the figure.

[0113] S1104. The RPA system obtains the target cells corresponding to the sub-target Boolean matrix and arranges them according to the positions to generate a blank second table corresponding to the sub-target Boolean matrix.

[0114] For the process of generating the blank second table corresponding to the sub-target Boolean matrix in step S1104, refer to the process of generating the blank second table by arranging the target cells according to the positions in step S403, which will not be elaborated here.

[0115] In the embodiments of the present disclosure, the RPA system assigns values to each matrix element in the Boolean matrix according to the target cells to generate a target Boolean matrix. The RPA system identifies whether there are target rows and / or target columns in the target Boolean matrix that are all the first value. When there are target rows and / or target columns, the RPA system splits the Boolean matrix according to the target rows and / or target columns to generate sub-target Boolean matrices. The RPA system obtains the target cells corresponding to the sub-target Boolean matrices and arranges them according to the positions to generate blank second tables corresponding to the sub-target Boolean matrices. In the embodiments of the present disclosure, the RPA system determines whether there are two tables with an up / down or left / right relationship in the figure according to the values of each matrix element in the Boolean matrix, further determining the structure of the tables.

[0116] Fig.14 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure. On the basis of the above embodiments, after the RPA system splits the Boolean matrix according to the target rows and / or target columns to generate sub-target Boolean matrices when there are target rows and / or target columns, as Fig.14 shown, it further includes:

[0117] S1401. The RPA system identifies whether there are target matrix elements with the first value in the sub-target Boolean matrix.

[0118] The RPA system traverses each matrix element in the sub-target Boolean matrix in order to determine whether the value of each matrix element is the first value F. If it is determined that the currently traversed matrix element is the first value, the matrix element is marked as the target matrix element. Continue to traverse the remaining matrix elements until the last matrix element is traversed to obtain all the target matrix elements included in the sub-target Boolean matrix.

[0119] S1402: The RPA system updates the value of the target matrix element from the first value to the second value.

[0120] In order to ensure the integrity of the table, the value of the target matrix element needs to be updated from the first value to the second value to obtain the final second table. However, the target matrix element with the first value may have two situations: it may be an independent target cell that has been missed, or it may belong to a target cell that has been identified. In the embodiment of the present application, the target matrix element can be judged, such as Fig.15 shown.

[0121] The RPA system obtains the target basic cell corresponding to the target matrix element. In the present disclosure, a matrix element in a Boolean matrix corresponds to a basic cell. After determining the target matrix element, the RPA system can obtain the basic cell corresponding to the target matrix element based on the position of the target matrix element in the Boolean matrix, which is referred to as the target basic cell.

[0122] The RPA system determines whether the target basic cell needs to be merged into the target cell corresponding to the adjacent matrix element adjacent to the target matrix element. The RPA system can obtain the four corner coordinates of the target basic cell, and determine whether the target basic cell needs to be merged into the existing target cell based on the four corner coordinates. If the coverage of the existing target cell includes the four corner coordinates of the target basic cell, it is determined that it needs to be merged into the existing target cell. If the coverage of the existing target cell does not include the four corner coordinates of the target basic cell, it is determined that it does not need to be merged into the existing target cell, and the target basic cell is an independent target cell. Among them, the existing target cell is the target cell corresponding to the adjacent matrix element adjacent to the target matrix element.

[0123] If the RPA system determines that a merge is required, the target base cell is merged into the target cell corresponding to the adjacent matrix element to form a larger target cell.

[0124] If the RPA system determines that there is no need to merge, the target basic cell is determined as a missing target cell, and the value of this place is filled with T as an independent target cell, and the missing target cell is filled when the target cells are arranged according to the position.

[0125] In the embodiment of the present disclosure, the RPA system identifies whether there is a target matrix element with a first value in the sub-target Boolean matrix, and the RPA system updates the value of the target matrix element from the first value to the second value. In the embodiment of the present disclosure, the target matrix element with a first value in the sub-target Boolean matrix is ​​updated to the second value, the missing cells are completed, and the table structure is determined.

[0126] Fig.16 is a flowchart of a table generation method combining RPA and AI according to an embodiment of the present disclosure. Fig.16 , the process of filling the text entries recognized by the RPA system from the image based on OCR into the blank second table to obtain the target table is explained, including the following steps:

[0127] S1601, the RPA system obtains the four corner coordinates of the text entry.

[0128] The RPA system obtains the text recognition box where the text entry is located, and uses the four corner coordinates of the text recognition box as the four corner coordinates of the text entry.

[0129] Alternatively, an algorithm can be used to extract text entries from a text image containing a table. The algorithm forms a rectangular frame surrounding the foreground pixels of the image through template scanning, thereby extracting the foreground pixels, and then combining the rectangular frames to form a pattern chain. The three statistical features of the maximum black run, length, and width of the pattern are used to classify the pattern and extract the text.

[0130] S1602: The RPA system matches the four corner coordinates of the text entry with the four corner coordinates of the target cell to obtain the target text entry corresponding to the target cell.

[0131] The RPA system matches the four corner coordinates of the text entry with the four corner coordinates of the target cell to determine whether there is a first text entry that occupies at least two target cells.

[0132] The four corner coordinates of a text entry can form an area. If the four corner coordinates of a cell all fall within the area, and two corner coordinates of another cell also fall within the area, then it occupies two cells.

[0133] Similarly, if the coordinates of the four corners of two cells fall inside it, and the coordinates of the third cell fall inside it, it means that three cells are occupied.

[0134] If the first text entry exists, the RPA system divides the first text entry according to at least two occupied cells to obtain a target text entry for each target cell occupied by the first text entry.

[0135] For example, if the first text entry occupies two adjacent cells, the adjacent cells are segmented using the common edges to obtain the text entries of the two occupied target cells.

[0136] If a text entry only occupies one target cell, it is directly used as the target text entry corresponding to the target cell.

[0137] S1603, the RPA system fills the target text entry into the corresponding target unit to obtain a target table.

[0138] For the specific implementation of step S1603, please refer to the relevant introduction in each embodiment of the present disclosure, which will not be repeated here.

[0139] In the disclosed embodiment, the RPA system obtains the four corner coordinates of the text entry, matches the four corner coordinates of the text entry with the four corner coordinates of the target cell to obtain the target text entry corresponding to the target cell, and fills the target text entry into the corresponding target cell to obtain the target table. In the disclosed embodiment, the text entry across cells is split, and the text entry can be accurately filled into the corresponding target cell to generate a complete table document.

[0140] Fig.17 is a structural diagram of a table generation device combining RPA and AI according to an embodiment of the present disclosure, such as Fig.17 As shown, the table generation device 1700 combining RPA and AI includes:

[0141] An extraction module 1710 is used to extract horizontal lines and vertical lines of the first table from the image based on artificial intelligence AI;

[0142] The intersection acquisition module 1720 is used to acquire a set of intersections of horizontal lines and vertical lines, wherein the set of intersections includes first-type intersections formed by the intersection of horizontal lines and vertical lines, and second-type intersections formed by the intersection of extended lines of horizontal lines and / or extended lines of vertical lines;

[0143] A generating module 1730, configured to generate a blank second table consistent with the first table according to the intersection point set;

[0144] The filling module 1740 is used to fill the text entries recognized from the image based on OCR into the blank second table to obtain a target table.

[0145] In the disclosed embodiment, RPA and AI technologies are used to identify tables in images and restore them to table documents with the same table structure, automatically converting offline data into online data, replacing cumbersome manual processing procedures and improving the efficiency of table generation.

[0146] It should be noted that the above explanation of the embodiment of the table generation method combining RPA and AI is also applicable to the table generation device combining RPA and AI in this embodiment, and will not be repeated here.

[0147] Furthermore, in a possible implementation of the embodiment of the present disclosure, the generation module 1730 is also used to: enumerate the cells according to the intersections in the intersection set to obtain candidate cells and attribute information of the candidate cells; identify target cells for generating a blank second table from the candidate cells according to the attribute information of the candidate cells; and generate a blank second table for the target cells according to their positional arrangements.

[0148] Furthermore, in a possible implementation of the disclosed embodiment, the generation module 1730 is also used to: sort all the enumerated candidate cells in ascending order according to the cell area; traverse the candidate cells in order, and judge the existence of the traversed target candidate cells; whenever it is judged that the target candidate cell exists, delete the cells that overlap with the target candidate cell from the candidate cells that have not been traversed, and determine the target candidate cell that is judged to exist as a target cell; continue to traverse the candidate cells that have not been traversed after the deletion in order until all the target cells are obtained after the traversal.

[0149] Furthermore, in a possible implementation of the embodiment of the present disclosure, the generation module 1730 is also used to: obtain the first starting and ending points of the horizontal line and the second starting and ending points of the vertical line corresponding to the target candidate cell; determine whether all four sides of the target candidate cell exist based on the four corner coordinates, the first starting and ending points, and the second starting and ending points of the target candidate cell; and determine that the target candidate cell exists when it is determined that all four sides exist.

[0150] Furthermore, in a possible implementation of the embodiment of the present disclosure, the generation module 1730 is also used to: arrange the intersections in the intersection set in order, and group the adjacent intersections in the intersection set into multiple intersection pairs in the same direction; obtain adjacent intersection pairs in sequence in the same direction, and group the adjacent intersection pairs into basic cells; and construct a Boolean matrix using the basic cells as matrix elements.

[0151] Furthermore, in a possible implementation of the embodiment of the present disclosure, the generation module 1730 is also used to: assign values ​​to each matrix element in the Boolean matrix according to the target cell to generate a target Boolean matrix; identify whether the target Boolean matrix includes target rows and / or target columns that all have the first value; if there are target rows and / or target columns, split the Boolean matrix according to the target rows and / or target columns to generate a sub-target Boolean matrix; obtain the target cells corresponding to the sub-target Boolean matrix, and arrange them according to the position to generate a blank second table corresponding to the sub-target Boolean matrix.

[0152] Furthermore, in a possible implementation of the embodiment of the present disclosure, the generation module 1730 is also used to: obtain the first basic cell included in the target cell according to the four corner coordinates of the target cell, and update the matrix element corresponding to the first basic cell from the first value to the second value.

[0153] Furthermore, in a possible implementation of the embodiment of the present disclosure, the generation module 1730 is also used to: identify whether there is a target matrix element with a first value in the sub-target Boolean matrix; and update the value of the target matrix element from the first value to the second value.

[0154] Furthermore, in a possible implementation of the embodiment of the present disclosure, the generation module 1730 is also used to: obtain the target basic cell corresponding to the target matrix element; determine whether the target basic cell needs to be merged into the target cell corresponding to the adjacent matrix element adjacent to the target matrix element; and merge the target basic cell into the target cell corresponding to the adjacent matrix element if it is determined that merging is required.

[0155] Furthermore, in a possible implementation of the embodiment of the present disclosure, the generation module 1730 is also used to: if it is determined that no merging is required, determine the target basic cell as a missing target cell, and complete the missing target cell when arranging the target cells according to the position.

[0156] Furthermore, in a possible implementation of the embodiment of the present disclosure, the filling module 1740 is also used to: obtain the four corner coordinates of the text entry; match the four corner coordinates of the text entry with the four corner coordinates of the target cell to obtain the target text entry corresponding to the target cell; fill the target text entry into the corresponding target cell to obtain the target table.

[0157] Furthermore, in a possible implementation of the embodiment of the present disclosure, the filling module 1740 is also used to: match the four corner coordinates of the text entry with the four corner coordinates of the target cell to determine whether there is a first text entry that occupies at least two target cells; and divide the first text entry according to the at least two occupied cells to obtain a target text entry for each target cell occupied by the first text entry.

[0158] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0159] Fig.18 A schematic block diagram of an example electronic device 1800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0160] like Fig.18 As shown, it includes a memory 181, a processor 182, and a computer program stored in the memory 181 and executable on the processor 182. When the processor 182 executes the program, the aforementioned table generation method is implemented.

[0161] 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", "axial", "radial", "circumferential" 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, and do not indicate or imply 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.

[0162] 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.

[0163] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0164] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A table generation method combining RPA and AI, characterized in that: Executed by the RPA system, the method includes: The RPA system extracts horizontal lines and vertical lines of the first table from the image based on artificial intelligence AI; The RPA system acquires a set of intersections of the horizontal line and the vertical line, wherein the set of intersections includes a first type of intersection formed by the intersection of the horizontal line and the vertical line, and a second type of intersection formed by the intersection of an extension line of the horizontal line and / or an extension line of the vertical line; The RPA system generates a blank second table consistent with the first table according to the set of intersection points; The RPA system fills the text entries recognized from the image based on optical character recognition (ORC) into the blank second table to obtain a target table; The RPA system generates a blank second table consistent with the first table according to the intersection set, including: The RPA system enumerates cells according to the intersection points in the intersection point set to obtain candidate cells and attribute information of the candidate cells; The RPA system sorts all the enumerated candidate cells in ascending order of cell area; The RPA system traverses the candidate cells in order and determines the existence of the traversed target candidate cells; Whenever the RPA system determines that the target candidate cell exists, the RPA system deletes cells that overlap with the target candidate cell from the candidate cells that have not been traversed, and determines the target candidate cell that is determined to exist as a target cell; The RPA system continues to traverse the candidate cells that have not been traversed after deletion in order until all the target cells are obtained after the traversal is completed; The RPA system generates the blank second table for the target cells according to position arrangement.

2. The method according to claim 1, characterized in that The RPA system traverses the candidate cells in order and determines the existence of the traversed target candidate cells, including: The RPA system obtains a first starting point and a second starting point of the horizontal line and a second starting point of the vertical line corresponding to the target candidate cell; The RPA system determines whether all four sides of the target candidate cell exist according to the four corner coordinates of the target candidate cell, the first starting and ending points, and the second starting and ending points; When the RPA system determines that all four edges exist, it determines that the target candidate cell exists.

3. The method according to any one of claims 1 to 2, characterized in that: Before the RPA system identifies a target cell for generating the blank second table from the candidate cells according to the attribute information of the candidate cells, the RPA system further includes: The RPA system arranges the intersection points in the intersection point set in order, and groups adjacent intersection points in the intersection point set into a plurality of intersection point pairs in the same direction; The RPA system sequentially acquires adjacent pairs of intersections in the same direction, and forms basic cells from the adjacent pairs of intersections; The RPA system uses the basic cells as matrix elements to construct a Boolean matrix.

4. The method according to claim 3, characterized in that The RPA system generates the blank second table for the target cells according to position arrangement, including: The RPA system assigns a value to each matrix element in the Boolean matrix according to the target cell to generate a target Boolean matrix; The RPA system identifies whether the target Boolean matrix includes target rows and / or target columns that all have first values; When the target row and / or the target column exist, the RPA system splits the Boolean matrix according to the target row and / or the target column to generate a sub-target Boolean matrix; The RPA system obtains the target cells corresponding to the sub-target Boolean matrix, and arranges them according to positions to generate the blank second table corresponding to the sub-target Boolean matrix.

5. The method according to claim 4, characterized in that The RPA system assigns a value to each matrix element in the Boolean matrix according to the target cell to generate a target Boolean matrix, including: The RPA system obtains a first basic cell included in the target cell based on the four corner coordinates of the target cell and the four corner coordinates, and updates a matrix element corresponding to the first basic cell from the first value to a second value.

6. The method according to claim 4, characterized in that When the target row and / or the target column exist, the RPA system splits the Boolean matrix according to the target row and / or the target column to generate a sub-target Boolean matrix, further comprising: The RPA system identifies whether there is a target matrix element whose value is the first value in the sub-target Boolean matrix; The RPA system updates the value of the target matrix element from the first value to a second value.

7. The method according to claim 6, characterized in that Before the RPA system updates the value of the matrix element from the first value to the second value, the method further includes: The RPA system obtains a target basic cell corresponding to the target matrix element; The RPA system determines whether the target basic cell needs to be merged into the target cell corresponding to the adjacent matrix element adjacent to the target matrix element; When the RPA system determines that merging is required, it merges the target basic cell into the target cell corresponding to the adjacent matrix element.

8. The method according to claim 7, characterized in that The method further comprises: If the RPA system determines that merging is not necessary, the target basic cell is determined as a missing target cell, and the missing target cell is completed when arranging the target cells according to positions.

9. The method according to any one of claims 1-2, characterized in that: The RPA system fills the text entries recognized based on OCR from the image into the blank second table to obtain a target table, including: The RPA system obtains the four corner coordinates of the text entry; The RPA system matches the four corner coordinates of the text entry with the four corner coordinates of the target cell to obtain a target text entry corresponding to the target cell; The RPA system fills the target text entry into the corresponding target unit to obtain the target table.

10. The method according to claim 9, characterized in that The RPA system matches the four corner coordinates of the text entry with the four corner coordinates of the target cell to obtain a target text entry corresponding to the target cell, including: The RPA system matches the four corner coordinates of the text entry with the four corner coordinates of the target cell, and determines whether the text entry includes a first text entry occupying at least two target cells; The RPA system divides the first text entry according to the at least two occupied cells to obtain a target text entry for each target cell occupied by the first text entry.

11. A table generation device combining RPA and AI, characterized in that: include: An extraction module, used for extracting horizontal lines and vertical lines of the first table from the image based on artificial intelligence AI; An intersection acquisition module, used for acquiring a set of intersections of the horizontal line and the vertical line, wherein the set of intersections includes first-type intersections formed by the intersection of the horizontal line and the vertical line, and second-type intersections formed by the intersection of the extension lines of the horizontal line and / or the extension lines of the vertical line; A generating module, configured to generate a blank second table consistent with the first table according to the intersection point set; A filling module, used for filling the text entries recognized based on OCR from the image into the blank second table to obtain a target table; The generating module is further used for: Enumerating cells according to the intersection points in the intersection point set to obtain candidate cells and attribute information of the candidate cells; For all the enumerated candidate cells, sort them from small to large according to the cell area; Traversing the candidate cells in order, and judging the existence of the traversed target candidate cells; Whenever it is determined that the target candidate cell exists, cells overlapping with the target candidate cell are deleted from the candidate cells that have not been traversed, and the target candidate cell that is determined to exist is determined as a target cell; Continue to traverse the candidate cells that have not been traversed after deletion in order until all the target cells are obtained after the traversal is completed; The blank second table is generated by arranging the target cells according to their positions.

12. The device according to claim 11, characterized in that The generating module is further used for: Obtaining the first starting and ending points of the horizontal line and the second starting and ending points of the vertical line corresponding to the target candidate cell; According to the coordinates of the four corners of the target candidate cell, the first starting and ending points, and the second starting and ending points, determining whether all four sides of the target candidate cell exist; When it is determined that the four edges all exist, it is determined that the target candidate cell exists.

13. The device according to any one of claims 11 to 12, characterized in that: The filling module is also used for: Get the four corner coordinates of the text entry; Matching the four corner coordinates of the text entry with the four corner coordinates of the target cell to obtain a target text entry corresponding to the target cell; The target text entries are filled into the corresponding target cells to obtain the target table.

14. An electronic device, characterized in that: Including memory and processor; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the method according to any one of claims 1 to 10.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

16. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 10.