CN113177397B - Table adjusting method, device, equipment and storage medium - Google Patents
Table adjusting method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN113177397B CN113177397B CN202110430468.4A CN202110430468A CN113177397B CN 113177397 B CN113177397 B CN 113177397B CN 202110430468 A CN202110430468 A CN 202110430468A CN 113177397 B CN113177397 B CN 113177397B
- Authority
- CN
- China
- Prior art keywords
- column
- merged
- merging
- information
- columns
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 34
- 238000010586 diagram Methods 0.000 claims abstract description 105
- 238000013145 classification model Methods 0.000 claims abstract description 31
- 238000012545 processing Methods 0.000 claims abstract description 18
- 238000004590 computer program Methods 0.000 claims description 10
- 238000012549 training Methods 0.000 claims description 5
- 238000000605 extraction Methods 0.000 claims description 4
- 230000009286 beneficial effect Effects 0.000 abstract description 3
- 238000004364 calculation method Methods 0.000 description 10
- 230000008859 change Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000008094 contradictory effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/177—Editing, e.g. inserting or deleting of tables; using ruled lines
- G06F40/18—Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/106—Display of layout of documents; Previewing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention provides a table adjusting method, a table adjusting device, table adjusting equipment and a storage medium, wherein the method comprises the following steps: comparing the table display diagram with a table pre-display diagram set at the back end; inputting data information into a column merging and classifying model, and determining the merging direction of the to-be-merged rows; and merging the columns to be merged in the table set by the rear end according to the merging direction. The invention has the beneficial effects that: whether the table display diagram is complete or not can be judged through comparison of the table display diagram and the table pre-display diagram, when the table display diagram is incomplete, data information of the table set by the rear end is obtained, columns to be merged are determined based on the merging classification model, the columns are merged according to the direction characteristics and displayed at the front end again, so that automatic adjustment of the table set by the rear end is achieved, manual processing is not needed, human resources are saved, in addition, the processing efficiency of the table is better through real-time processing of a machine, and real-time display of the front end is achieved.
Description
Technical Field
The present invention relates to the field of data processing, and in particular, to a method, an apparatus, a device, and a storage medium for adjusting a table.
Background
In the front-end framework, the table set at the back end is automatically generated according to the data in the database, and the display interface at the front end is limited, so that the complete table set at the back end cannot be displayed sometimes. At present, in order to enable a front-end display interface to display a complete form set at the rear end, corresponding staff are generally required to adjust and then send the form to the front end, and a large amount of human resources are required undoubtedly, the form cannot be displayed in a front-end frame in real time, and automatic adjustment of the form set at the rear end cannot be achieved.
Disclosure of Invention
The invention mainly aims to provide a table adjusting method, a table adjusting device, table adjusting equipment and a table adjusting storage medium, and aims to solve the problem that automatic adjustment of a table set at the back end cannot be realized.
The invention provides a table adjusting method, which comprises the following steps:
acquiring a table display diagram of a front end;
comparing the table display diagram with a pre-display diagram of a table set at the back end; the table set by the back end is partial data or all data of the back end table;
if the content displayed in the table display diagram is inconsistent with the content of the table pre-display diagram, acquiring data information of the table set by the back end; the data information comprises cell information, row information and column information in a table set by the back end;
inputting the data information into a column merging and classifying model to obtain column information to be merged in the data information;
extracting the direction characteristics of the information of the columns to be merged, and determining the merging direction of the columns to be merged and parallel by using the direction characteristics;
and merging the columns to be merged in the table set by the rear end according to the merging direction, and displaying the merged columns at the front end.
Further, the step of comparing the table display diagram with a pre-display diagram of a table set at a back end includes:
graying the table display diagram and the table pre-display diagram to correspondingly obtain a first grayscale picture and a second grayscale picture;
calculating the average value A of the gray values of all the pixel points of the mth column or the mth row of the first gray picture m 1, calculating an average value B1 of gray values of all pixel points in the first gray picture; and
calculating the average value A of the gray values of all the pixel points of the mth column or the mth row of the second gray picture m 2, calculating an average value B2 of gray values of all pixel points in the first gray picture;
according to the formulaCalculating a global variance { (m-th row } or m-th column of the first grayscale picture>And the global variance of the mth column or row of the second grayscale picture->Wherein N is the total number of columns or rows in the grayscale picture;
according to the formulaObtaining a difference between the overall variances of the m-th column or m-th row of the first and second gray-scale pictures->Wherein +>For the global variance of the mth column or row of the first gray picture, < > H>A total variance of an mth column or an mth row of the second gray scale picture;
difference between the global variances according to calculationAnd judging whether the table display diagram is consistent with the table pre-display diagram.
Further, the step of inputting the data information into a column merging and classifying model to obtain information of a column to be merged in the data information includes:
analyzing the data information in the merged classification model to obtain a table identification result of the table set by the rear end;
and extracting the merging features of the table identification results, and determining the table to be merged and arranged set by the rear end by using the merging features.
Further, before the step of determining the merging direction to be merged and juxtaposed by using the direction feature, the method further includes:
acquiring the direction features used for determining merging features in a sample table and a target table after merging columns corresponding to the sample table;
inputting the target table and the direction characteristics into the cell merging direction determination model for training to obtain a pre-trained cell merging direction determination model; the pre-trained cell merging direction determination model is used for receiving the direction characteristics of the table set by the back end and giving the merging direction of the column to be merged.
Further, after the step of obtaining the data information of the table set by the backend, the method further includes:
calculating the column width ratio of each column of the column information and the chart width of the table display chart;
and resetting the width of each column of the table set at the back end according to the column width ratio and the diagram width, wherein the sum of the widths of the reset columns is less than or equal to the diagram width.
Further, before the step of inputting the data information into the column merge classification model, the method further includes:
judging whether the column information of each column belongs to a preset combinable information table or not;
and extracting the target column belonging to the mergeable information table and inputting the target column into the mergeable classification model to obtain the column to be merged.
Further, the step of inputting the data information into a column merging and classifying model to obtain the column information to be merged in the data information includes:
in the merged classification model, digitizing the cell information of each column in the table set at the back end, and arranging the cell information according to the sequence to respectively obtain a column set corresponding to each column;
according to the formulaCalculating correlation values of all column sets; wherein I (X, Y) represents the correlation of the column set X and the column set Y, X is the element in the column set X, Y represents the element in the column set Y, p (X, Y) represents the probability of the simultaneous occurrence of X and Y, and p 1 (x) Denotes the probability of x occurrence, p 2 (y) represents the probability of y occurring; />
Judging whether the correlation value is larger than a correlation threshold value;
and determining the two columns which are larger than the correlation threshold value and correspond to the two columns as the columns to be merged.
The invention also provides a table adjusting device, which comprises:
the graph acquisition module is used for acquiring a table display graph of the front end;
the comparison module is used for comparing the table display diagram with a pre-display diagram of a table set at the back end; the table set by the back end is partial data or all data of the back end table;
the information acquisition module is used for acquiring data information of the table set by the rear end if the content displayed in the table display diagram is inconsistent with the content of the table pre-display diagram; the data information comprises cell information, row information and column information in a table set by the back end;
the input module is used for inputting the data information into a column merging and classifying model to obtain column information to be merged in the data information;
the extraction module is used for extracting the direction characteristics of the information of the columns to be merged and determining the merging direction to be merged and parallel by using the direction characteristics;
and the merging module is used for merging the columns to be merged in the table set by the rear end according to the merging direction and displaying the merged columns at the front end.
The invention also provides a computer device comprising a memory storing a computer program and a processor implementing the steps of any of the above methods when the processor executes the computer program.
The invention also provides a computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method of any of the above.
The invention has the beneficial effects that: whether the table display diagram is complete or not can be judged through comparison of the table display diagram and the table pre-display diagram, when the table display diagram is incomplete, data information of a table set by a rear end is obtained, columns to be merged are determined based on a merging classification model, the columns are merged according to the direction characteristics, and display is conducted on the front end again, so that automatic adjustment of the table set by the rear end is achieved, manual processing is not needed, human resources are saved, in addition, the processing efficiency of the table is better through real-time processing of a machine, and real-time display on the front end is achieved.
Drawings
FIG. 1 is a flow chart illustrating a table adjustment method according to an embodiment of the present invention;
FIG. 2 is a block diagram schematically illustrating an apparatus for adjusting a table according to an embodiment of the present invention;
fig. 3 is a block diagram illustrating a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that all directional indicators (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used for explaining the relative position relationship between the components, the movement situation, etc. in a specific posture (as shown in the attached drawings), and if the specific posture is changed, the directional indicator is also changed accordingly, and the connection may be a direct connection or an indirect connection.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and B, may mean: a exists alone, A and B exist simultaneously, and B exists alone.
In addition, the descriptions related to "first", "second", etc. in the present invention are only for descriptive purposes and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Referring to fig. 1, the present invention provides a method for adjusting a table, including:
s1: acquiring a table display diagram of a front end;
s2: comparing the table display diagram with a pre-display diagram of a table set at the back end; the table set by the back end is partial data or all data of the back end table;
s3: if the content displayed in the table display diagram is inconsistent with the content of the table pre-display diagram, acquiring data information of the table set by the back end; the data information comprises cell information, row information and column information in a table set by the back end;
s4: inputting the data information into a column merging and classifying model to obtain column information to be merged in the data information;
s5: extracting the direction characteristics of the columns to be merged, and determining the merging direction of the columns to be merged and parallel by using the direction characteristics;
s6: and merging the columns to be merged in the table set by the rear end according to the merging direction, and displaying the merged columns at the front end.
As described in step S1, a table display diagram of the front end is obtained. The obtaining mode may be receiving a table screenshot sent by the front end, specifically, the front end may perform screenshot on the table, that is, obtain a corresponding table display diagram, and the tool for screenshot may be any one of the tools in the prior art, and the screenshot scheme is not described here again. In one embodiment, the front-end frame is an hungry frame (elementui) that is difficult to display when a complex table display is encountered while using the frame.
As described in step S2, the table display diagram is compared with the table pre-display diagram set at the back end. The comparison may be performed by identifying the text information in the table display diagram and the table pre-display diagram to obtain corresponding text information, and determining whether the text information in the table display diagram is consistent with the text information in the table pre-display diagram, thereby determining whether the table display diagram is consistent with the table pre-display diagram. In a preferred embodiment, it may be only detected whether the two diagrams of the table display diagram and the table pre-display diagram are similar, and the text information does not need to be identified, specifically, since the table display diagram is based on the table pre-display diagram, the content in the table display diagram is less than or equal to the table pre-display diagram, and therefore, the determination may be performed according to the pixel point, and the specific determination method is described in detail later, and is not described here again. The table pre-display diagram is part of data or all data of a table set by a back end, specifically, all data is recorded in the back end table, and the table set by the back end is a table calling part of data or all data in the back end table.
As described in step S3, if the content shown in the table display diagram does not match the content of the table preview diagram, the data information of the table set at the back end is acquired. If the contents do not match, it can be considered that the table set at the backend needs to be adjusted, and therefore the data information of the table set at the backend needs to be acquired for adjustment.
As described in step S4, the data information is input into a column merging and classifying model, so as to obtain information of a column to be merged in the data information. The merging classification model may be a model that is trained in advance and can be used to determine whether each column in the candidate table recognition result needs to participate in merging, specifically, the merging classification model may be a binary classification model, that is, an output result for each column may include: with or without participation in the merge.
As described in step S5, the direction feature of the column to be merged is extracted, and the merging direction of the column to be merged and parallel is determined by using the direction feature. The direction characteristics are obtained according to a statistical rule after statistical analysis is carried out on the characteristics of a large number of tables, and the merging direction characteristics can be used for determining columns to be merged. The direction features comprise left column combination or right column combination, and the left column combination refers to cancellation of a left frame to be combined and juxtaposed currently and a right frame of a left column adjacent to the left frame; merging to the right column means to cancel the right frame to be merged and juxtaposed currently and the left frame of the right column adjacent to the right frame. For example, when the column is located at the rightmost end of the table, merging needs to be performed to the left end, in an embodiment, the same kind of items may also be merged, that is, the column is not merged, it should be noted that the technical scheme that the column is not merged can only make the table more beautiful, and the size of the table set at the back end of the whole table does not change, so that the table set at the back end can be beautified after the directional features of the cells are obtained, and the experience effect of the user is better.
As described in step S6 above, the columns to be merged in the table set at the back end are merged according to the merging direction, and are displayed at the front end. Namely, the columns to be merged are merged and then displayed at the front end. Further, the detection of the above steps may be performed again on the diagram displayed at the front end, and if the diagram does not meet the requirements yet, the diagram may be sent to the corresponding staff for processing, or the size of the table may be scaled, so that the front end may display all the contents in the table set at the back end.
In an embodiment, the step S4 of inputting the data information into a column merging and classifying model to obtain information of a column to be merged in the data information includes:
s431: in the merged classification model, digitizing the cell information of each column in the table set at the back end, and arranging the cell information according to the sequence to respectively obtain a column set corresponding to each column;
s432: according to the formulaCalculating correlation values of all column sets; wherein I (X, Y) represents the correlation of the column set X and the column set Y, X is the element in the column set X, Y represents the element in the column set Y, p (X, Y) represents the probability of the simultaneous occurrence of X and Y, and p 1 (x) Denotes the probability of x occurrence, p 2 (y) represents the probability of y occurring;
s433: judging whether the correlation value is larger than a correlation threshold value;
s434: and determining the two columns which are larger than the correlation threshold value and correspond to the two columns as the columns to be merged.
As described in the foregoing steps S431 to S434, the determination of the columns to be merged is realized, where the merging classification model may specifically be to calculate a correlation value between the columns, that is, firstly, each cell information is digitized, that is, each cell information is processed into digital information according to a preset processing manner, where the preset processing manner is not limited and may be obtained by any one of the prior art, and each cell information forms a column set of the corresponding column, and then, according to a formula, the column set of the corresponding column is formed according to each cell informationAnd calculating the correlation between the column sets, and when the correlation is greater than a correlation threshold, determining that the two columns of data have correlation, and combining the two columns of data, so that the two columns of data are determined to be columns to be combined to facilitate subsequent combination.
In one embodiment, the step S2 of comparing the table display diagram with the pre-display diagram of the table set at the back end includes:
s201: graying the table display diagram and the table pre-display diagram to correspondingly obtain a first grayscale picture and a second grayscale picture;
s202: calculating the average value A of the gray values of all the pixel points of the m-th column or the m-th row of the first gray picture and the second gray picture m Calculating the average value B of the gray values of all pixel points in the gray picture;
s203: according to the formulaCalculating the total variance of the mth column or row of the first gray picture and the second gray picture, wherein N is the total number of columns or rows in the gray picture;
s204: according to the formulaObtaining a difference between the overall variances of the m-th column or m-th row of the first and second gray-scale pictures->Wherein it is present>Is the overall variance of the m-th column or m-th row of the first grayscale picture, device for combining or screening>A total variance of an m-th column or an m-th row of the second gray scale picture;
s205: difference between the global variances according to calculationAnd judging whether the table display diagram is consistent with the table pre-display diagram.
As described above in steps S201-S205, a comparison of the table pre-display diagram and the table display diagram is achieved.
In the RGB model, for example, if R = G = B, the color represents a gray color, where the value of R = G = B is called a gray value, and therefore, each pixel of the gray image only needs one byte to store the gray value (also called an intensity value, a brightness value), thereby reducing the storage amount. The gray scale range is, for example, 0 to 255 (when the values of R, G, and B are all 0 to 255, it will naturally change with the change of the value ranges of R, G, and B). The method of the grayscaling treatment may be any method, for example, a component method, a maximum value method, an average value method, a weighted average method, or the like. The gray values are only 256, so that the image comparison can greatly reduce the calculated amount on the basis. Then calculating the average value A of the gray values of all the pixel points of the mth column or the mth row of the gray picture m And calculating the average value B of the gray values of all the pixel points in the gray picture. The process of calculating the average value Am of the gray values of all the pixel points in the mth column or the mth row of the gray picture comprises the following steps: collecting gray values of all pixel points of an mth column or an mth row of the gray picture, adding the gray values of all pixel points of the mth column or the mth row, and dividing the sum of the gray values obtained through the addition by the number of all pixel points of the mth column or the mth row to obtain an average value Am of the gray values of all pixel points of the mth column or the mth row of the gray picture. The process of calculating the average value B of the gray values of all the pixel points in the gray picture comprises the following steps: and calculating the sum of the gray values of all the pixel points in the gray picture, and dividing the sum of the gray values by the number of the pixel points to obtain the average value B of the gray values of all the pixel points in the gray picture. According to the formulaCalculating a global variance ^ of the mth column or row of the grayscale picture>Where N is the total number of columns or rows in the grayscale picture. In this application, the sum is usedAnd measuring the difference between the average value Am of the gray values of the pixel points in the mth column or the mth row of the gray picture and the average value B of the gray values of all the pixel points in the gray picture by using the volume variance.
According to the formulaObtaining the difference between the total variances of the m-th column or the m-th row of the two gray-scale pictures>Wherein it is present>For the global variance of the mth column or row of the first gray picture, < > H>Is the overall variance of the m-th column or m-th row of the second gray scale picture. The difference in global variance->The difference of the gray values of the m-th column or the m-th row of the two gray pictures is reflected. When +>A smaller value, for example 0, indicates->Is equal or approximately equal to +>The gray value of the mth column or row of the first gray picture can be regarded as the same or approximately the same as the gray value of the mth column or row of the second gray picture (approximate judgment is performed to save calculation power, and the accuracy of the judgment is high because the overall variances of the two different pictures are generally not equal), otherwise, the gray value of the mth column or row of the first gray picture is regarded as the same as the gray value of the second gray pictureThe m-th column or m-th row of the image is different in gray value. Considering the system error and possible difference of the frame lines of the table, a preset variance value can be set, when the preset variance value is larger than the preset variance value, whether the table display diagram is consistent with the table pre-display diagram or not is judged, and when the preset variance value is smaller than the preset variance value, the table display diagram is inconsistent with the table pre-display diagram.
In an embodiment, the step S4 of inputting the data information into a column merging and classifying model to obtain information of a column to be merged in the data information includes:
s401: analyzing the data information in the merged classification model to obtain an identification result of the table set by the back end;
s402: and extracting the merging features of the recognition results, and determining the pending parallel of the table set by the rear end by using the merging features.
As described in the foregoing steps S401 to S402, to-be-merged and parallel recognition is implemented, where the merged classification model may be any pre-trained model that can be used to determine whether each row in the candidate table recognition result needs to participate in merging, and specifically may be a binary classification model, that is, the output result for each column may include: with or without participation in the merge. The merging characteristics include whether the character area includes numerical value type data, the ratio of the distance between the left row of right frames adjacent to the row to be merged and the distance between the left row of left frames adjacent to the row to be merged, the width difference between the character area (or called character frame) in the row to be merged and the character area in the left row, the width difference between the character area in the row to be merged and the character area in the right row, and the like, and the row to be merged is determined according to a preset corresponding rule.
In one embodiment, before the step S5 of determining the merging direction to be merged and juxtaposed by using the direction feature, the method further includes:
s411: acquiring the direction features used for determining merging features in a sample table and a target table after merging columns corresponding to the sample table;
s412: inputting the target table and the direction characteristics into the cell merging direction determination model for training to obtain a pre-trained cell merging direction determination model; the pre-trained cell merging direction determination model is used for receiving the direction characteristics of the table set by the back end and giving the merging direction of the column to be merged.
As described above in steps S411-S412, determination of the merging direction is achieved. The cell merging and classifying model may be any pre-trained model that can be used to determine whether each column in the candidate table recognition result needs to participate in merging, specifically may be a binary model, and the output result for each to-be-merged parallel may include: merging to the left column or merging to the right column, wherein the merging to the left column means canceling the left frame to be currently merged and juxtaposed and the right frame of the left column adjacent to the left frame; the right column merging refers to canceling the right frame to be merged and arranged currently and the left frame of the right column adjacent to the right frame. For example, when the column is located at the rightmost end of the table, merging is needed at the left end, in an embodiment, the same kind of items may also be merged, that is, the column is not merged, it should be noted that the technical solution of not merging the column only makes the table more beautiful, and the size of the table set at the back end of the whole table is not changed. After the target table and the direction features are input into the cell merging direction determination model for training, a corresponding pre-trained cell merging direction determination model can be obtained, so that the merging of columns is realized, the size of the table is reduced, and the content displayed at the front end can be closer to or the same as the table set at the rear end.
In one embodiment, after the step S3 of obtaining data information of a table set by the backend, the method further includes:
s421: calculating the column width ratio of each column of the column information and the chart width of the table display chart;
s422: and resetting the width of each column of the table set at the back end according to the column width ratio and the diagram width, wherein the sum of the widths of the reset columns is less than or equal to the diagram width.
As described in the above steps S421 to S422, the table set in the back end is narrowed down. Because the header is generally a title, if the data is too much, the front end can be viewed by sliding up and down, and the mouse does not have the function of sliding left and right, the problem of width needs to be mainly solved, and in a preferred embodiment, the height of the table can be zoomed at the same time. Specifically, the column width ratio of each column of the column information and the chart width of the table display chart can be calculated, so that the reduced ratio can be in the table display chart, wherein the width is reset in a non-limited manner, but is not small enough, otherwise, the reading of a client is easily influenced.
In an embodiment, before the step S4 of inputting the data information into the column merge classification model, the method further includes:
s301: judging whether the column information of each column belongs to a preset combinable information table or not;
s302: and extracting the target column belonging to the mergeable information table and inputting the target column into the mergeable classification model to obtain the column to be merged.
In an embodiment, the reduction of calculation of the classification model is achieved, that is, before the merged classification model is output, each column information is detected, and the detection method specifically may be to detect header information of each column, that is, a type to which the column information belongs, where the column information includes the header information, and then determine whether the header information belongs to a pre-set mergeable information table, and when the header information belongs to the mergeable information table, the column information may be output to the merged classification model again for detection, so that the merged classification model does not need to calculate columns that do not belong to mergence, which saves calculation power, and on the other hand, the calculation of a table set at a back end is accelerated, and the calculation efficiency is improved.
Referring to fig. 2, the present application also provides a table adjusting apparatus, including:
an image acquisition module 10, configured to acquire a table display image of a front end;
a comparison module 20, configured to compare the table display diagram with a table pre-display diagram set at a back end; the table pre-display diagram is part or all data of a table set at the back end;
an information obtaining module 30, configured to obtain data information of the table set by the back end if the content shown in the table display diagram is inconsistent with the content of the table pre-display diagram; the data information comprises cell information, row information and column information in a table set by the back end;
the input module 40 is configured to input the data information into a column merging and classifying model to obtain column information to be merged in the data information;
an extracting module 50, configured to extract a direction feature of the to-be-merged column information, and determine the merging direction to be merged and parallel by using the direction feature;
and a merging module 60, configured to merge the columns to be merged in the table set at the back end according to the merging direction, and display the merged columns at the front end.
In one embodiment, the comparison module 20 includes:
the graying processing sub-module is used for performing graying processing on the table display diagram and the table pre-display diagram to correspondingly obtain a first grayscale image and a second grayscale image;
a first average value calculating submodule for calculating an average value A of gray values of all pixel points in the mth column or the mth row of the first gray picture m 1, calculating an average value B1 of gray values of all pixel points in the first gray picture; and
a second average value calculating submodule for calculating an average value A of the gray values of all the pixel points in the m-th column or the m-th row of the second gray picture m 2, calculating an average value B2 of gray values of all pixel points in the first gray picture;
a variance calculation submodule for calculating a variance according to a formulaCalculating a global variance { (m-th row } or m-th column of the first grayscale picture>And the global variance of the mth column or row of the second grayscale picture->Wherein N is the total number of columns or rows in the grayscale picture;
a difference between variances calculation sub-module for calculating the difference between the variances according to a formulaObtaining a difference between the overall variances of the m-th column or m-th row of the first and second gray-scale pictures->
A graph judgment sub-module for judging the difference of the total varianceAnd judging whether the table display diagram is consistent with the table pre-display diagram.
In one embodiment, the input module 40 includes:
the data information analysis submodule is used for analyzing the data information in the combined classification model to obtain an identification result of the table set by the rear end;
and the merging feature extraction submodule is used for extracting merging features of the recognition results and determining the table to be merged and arranged set by the rear end by using the merging features.
In one embodiment, the table adjusting apparatus further includes:
the direction feature acquisition module is used for acquiring the direction features used for determining the merging features in the sample table and a target table after the merging columns corresponding to the sample table;
the direction characteristic input module is used for inputting the target table and the direction characteristics into the cell merging direction determination model for training to obtain a pre-trained cell merging direction determination model; the pre-trained cell merging direction determination model is used for receiving the direction characteristics of the table set by the back end and giving the merging direction of the column to be merged.
In one embodiment, the table adjusting apparatus further includes:
the column width ratio calculation module is used for calculating the column width ratio of each column of the column information and the diagram width of the table display diagram;
and the width setting module is used for resetting the width of each column of the table set at the rear end according to the column width ratio and the diagram width, wherein the sum of the widths of the reset columns is less than or equal to the diagram width.
In one embodiment, the table adjusting apparatus further includes:
the column information judging module is used for judging whether the column information of each column belongs to a preset combinable information table or not;
and the target column extraction module is used for extracting the target columns in the mergeable information table and inputting the target columns into the mergeable classification model so as to obtain the columns to be merged.
In one embodiment, the input module 40 includes:
the digital processing sub-module is used for carrying out digital processing on each cell information of each column in the table set by the rear end in the combined classification model and arranging the cell information according to the sequence to respectively obtain a column set corresponding to each column;
a correlation value operator module for calculating a correlation value based on the formulaCalculating correlation values of all column sets; wherein I (X, Y) represents the correlation of the column set X and the column set Y, X is the element in the column set X, Y represents the element in the column set Y, p (X, Y) represents the probability of the simultaneous occurrence of X and Y, and p 1 (x) Denotes the probability of x occurrence, p 2 (y) represents the probability of y occurring;
a correlation value judgment submodule for judging whether the correlation value is greater than a correlation threshold value;
and the column to be merged determining submodule is used for determining two columns which are larger than the correlation threshold value and correspond to the column to be merged as the column to be merged.
Referring to fig. 3, a computer device, which may be a server and whose internal structure may be as shown in fig. 3, is also provided in the embodiment of the present application. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operating system and the running of computer programs in the non-volatile storage medium. The database of the computer device is used for storing back-end tables and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program can implement the table adjusting method according to any of the above embodiments when executed by a processor.
The invention has the beneficial effects that: whether the table display diagram is complete or not can be judged through comparison of the table display diagram and the table pre-display diagram, when the table display diagram is incomplete, data information of a table set by a rear end is obtained, columns to be merged are determined based on a merging classification model, the columns are merged according to the direction characteristics, and display is conducted on the front end again, so that automatic adjustment of the table set by the rear end is achieved, manual processing is not needed, human resources are saved, in addition, the processing efficiency of the table is better through real-time processing of a machine, and real-time display on the front end is achieved.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims (8)
1. A method for adjusting a table, comprising:
acquiring a table display diagram of a front end;
comparing the table display diagram with a pre-display diagram of a table set at the back end; the table set by the back end is partial data or all data of the back end table;
if the content displayed in the table display diagram is inconsistent with the content of the table pre-display diagram, acquiring data information of the table set by the back end; the data information comprises cell information, row information and column information in a table set by the back end;
inputting the data information into a column merging classification model to obtain information of columns to be merged in the data information, wherein the merging classification model is pre-trained and can be used for judging whether each column in a table set at the back end needs to participate in merging of two classification models, the output result of the two classification models comprises the models which need to participate in merging or do not need to participate in merging, and the step of obtaining the information of the columns to be merged in the merging classification model comprises the following steps:
analyzing the data information to obtain an identification result of the table set by the back end;
extracting merging features of the recognition results, and determining the information of the columns to be merged of the table set at the rear end by using the merging features, wherein the merging features comprise at least one feature of whether the character areas comprise numerical value type data, the ratio of the distance between the column to be merged and the right frame of the left column adjacent to the column to be merged to the distance between the left frame of the right column adjacent to the column to be merged to the distance between the character areas of the right column adjacent to the column to be merged to the distance between the left frame of the right column to the distance between the character areas of the left column to be merged to the character areas of the right column to be merged to the character areas of the row to be merged to the character areas of the right column to be merged to the character areas of the row to be merged to the character areas;
or comprises the following steps:
digitizing the cell information of each column in the table set by the back end, and arranging the cell information according to the sequence to obtain a column set corresponding to each column;
according to the formulaCalculating a correlation value for the set of columns, wherein,representing the relevance of column set X to column set Y, X being an element in column set X, Y representing an element in column set Y,representing the probability of x and y occurring at the same time,which represents the probability of the occurrence of x,represents the probability of y occurring;
judging whether the correlation value is larger than a correlation threshold value;
determining two columns which are larger than the correlation threshold value and correspond to the information of the columns to be merged;
extracting the direction characteristics of the information of the columns to be merged, and determining the merging direction of the columns to be merged and parallel by using the direction characteristics;
and merging the columns to be merged in the table set by the rear end according to the merging direction, and displaying the merged columns at the front end.
2. The method for adjusting a form according to claim 1, wherein the step of comparing the form display diagram with a pre-display diagram of a form set at a back end comprises:
graying the table display diagram and the table pre-display diagram to correspondingly obtain a first gray picture and a second gray picture;
calculating the average value of the gray values of all the pixel points of the mth column or the mth row of the first gray pictureCalculating the average value B1 of the gray values of all pixel points in the first gray picture; and
calculating the average value of the gray values of all the pixel points of the mth column or the mth row of the second gray pictureAnd calculating an average value B2 of gray values of all pixel points in the first gray picture;
according to the formulaCalculating the overall variance of the m-th column or m-th row of the first gray pictureAnd the overall variance of the m-th column or m-th row of the second gray scale pictureWherein N is the total number of columns or rows in the grayscale picture;
according to the formulaObtaining the difference between the total variances of the m-th row or m-th row of the first gray picture and the second gray picture;
3. The method for adjusting table according to claim 1, wherein the step of determining the merging direction of the to-be-merged table using the direction feature is preceded by the steps of:
acquiring the direction features used for determining merging features in a sample table and a target table after merging columns corresponding to the sample table;
inputting the target table and the direction characteristics into the cell merging direction determination model for training to obtain a pre-trained cell merging direction determination model; the pre-trained cell merging direction determination model is used for receiving the direction characteristics of the table set by the back end and giving the merging direction of the column to be merged.
4. The method for adjusting a form according to claim 1, further comprising, after the step of obtaining the data information of the form set by the backend, the steps of:
calculating the column width ratio of each column of the column information and the chart width of the table display chart;
and resetting the width of each column of the table set at the back end according to the column width ratio and the diagram width, wherein the sum of the widths of the reset columns is less than or equal to the diagram width.
5. The method of adjusting a form of claim 1, wherein the step of inputting the data information into a column merge classification model is preceded by the step of:
judging whether the column information of each column belongs to a preset combinable information table or not;
and extracting the target column belonging to the mergeable information table and inputting the target column into the mergeable classification model to obtain the column to be merged.
6. An apparatus for adjusting a table, comprising:
the graph acquisition module is used for acquiring a table display graph of the front end;
the comparison module is used for comparing the table display diagram with a pre-display diagram of a table set at the back end; the table set by the back end is partial data or all data of the back end table;
the information acquisition module is used for acquiring data information of the table set by the rear end if the content displayed in the table display diagram is inconsistent with the content of the table pre-display diagram; the data information comprises cell information, row information and column information in a table set by the back end;
the input module is used for inputting the data information into a column merging and classifying model to obtain column information to be merged in the data information, wherein the merging and classifying model is pre-trained and can be used for judging whether each column in a table set at the rear end needs to participate in merging or not, the output result of the two classifying models comprises a binary model needing to participate in merging or not needing to participate in merging, and the column merging and classifying model comprises a recognition result acquisition unit and a first parallel information acquisition unit to be merged or comprises a column set acquisition unit, a correlation value acquisition unit, a judgment unit and a second column information acquisition unit to be merged;
the identification result unit is used for analyzing the data information to obtain an identification result of the table set by the rear end;
the first merging parallel information acquisition unit is used for extracting merging characteristics of the recognition results and determining the column information to be merged of the table set at the rear end by using the merging characteristics, wherein the merging characteristics comprise at least one of the characteristics of whether a character area comprises numerical type data, the ratio of the distance between a left column right frame adjacent to the distance of the column to be merged and the distance between the right column left frame adjacent to the distance of the column to be merged, the width difference between a character area (or called a character frame) in the column to be merged and a character area in the left column, and the width difference between a character area in the row to be merged and a character area in the right column to be merged;
the column set acquisition unit is used for carrying out digital processing on the cell information of each column in the table set by the rear end and arranging the cell information according to the sequence to respectively obtain a column set corresponding to each column;
the correlation value obtaining unit is used for obtaining a correlation value according to a formulaCalculating a correlation value for the set of columns, wherein,representing the relevance of column set X to column set Y, X being an element in column set X, Y representing an element in column set Y,representing the probability of x and y occurring at the same time,which represents the probability of the occurrence of x,represents the probability of y occurring;
the judging unit is used for judging whether the correlation value is larger than a correlation threshold value;
the second information acquiring unit of the column to be merged is used for determining two columns which are larger than the relevant threshold value and correspond to the column to be merged as the information of the column to be merged;
the extraction module is used for extracting the direction characteristics of the information of the columns to be combined and determining the combination direction of the columns to be combined and parallel by using the direction characteristics;
and the merging module is used for merging the columns to be merged in the table set by the rear end according to the merging direction and displaying the merged columns at the front end.
7. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110430468.4A CN113177397B (en) | 2021-04-21 | 2021-04-21 | Table adjusting method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110430468.4A CN113177397B (en) | 2021-04-21 | 2021-04-21 | Table adjusting method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113177397A CN113177397A (en) | 2021-07-27 |
CN113177397B true CN113177397B (en) | 2023-03-28 |
Family
ID=76924260
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110430468.4A Active CN113177397B (en) | 2021-04-21 | 2021-04-21 | Table adjusting method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113177397B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113688693B (en) * | 2021-07-29 | 2024-08-09 | 上海浦东发展银行股份有限公司 | Method, device, computer equipment and storage medium for processing adjacent tables |
CN116721556B (en) * | 2023-06-13 | 2024-02-06 | 联城科技(河北)股份有限公司 | Vehicle management and control method, system, equipment and medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111353272A (en) * | 2019-12-24 | 2020-06-30 | 浙江明度智控科技有限公司 | Information display method and device of web form |
CN111695553A (en) * | 2020-06-05 | 2020-09-22 | 北京百度网讯科技有限公司 | Form recognition method, device, equipment and medium |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7624114B2 (en) * | 2006-06-05 | 2009-11-24 | Microsoft Corporation | Automatically generating web forms from database schema |
CN103593473A (en) * | 2013-11-28 | 2014-02-19 | 国家电网公司 | Form displaying method and system |
CN107766314B (en) * | 2017-10-20 | 2021-07-09 | 网易(杭州)网络有限公司 | Data processing method and device for electronic forms |
CN110569469B (en) * | 2019-09-06 | 2022-02-01 | 四川长虹电器股份有限公司 | Method for dynamically generating HTML (hypertext markup language) form based on data configuration |
CN111767350A (en) * | 2020-06-30 | 2020-10-13 | 平安国际智慧城市科技股份有限公司 | Data warehouse testing method and device, terminal equipment and storage medium |
CN111814443A (en) * | 2020-07-21 | 2020-10-23 | 北京来也网络科技有限公司 | Table generation method and device combining RPA and AI, computing equipment and storage medium |
-
2021
- 2021-04-21 CN CN202110430468.4A patent/CN113177397B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111353272A (en) * | 2019-12-24 | 2020-06-30 | 浙江明度智控科技有限公司 | Information display method and device of web form |
CN111695553A (en) * | 2020-06-05 | 2020-09-22 | 北京百度网讯科技有限公司 | Form recognition method, device, equipment and medium |
Also Published As
Publication number | Publication date |
---|---|
CN113177397A (en) | 2021-07-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
AU2019275232B2 (en) | Multi-sample whole slide image processing via multi-resolution registration | |
CN111524137B (en) | Cell identification counting method and device based on image identification and computer equipment | |
CN109583449A (en) | Character identifying method and Related product | |
CN113177397B (en) | Table adjusting method, device, equipment and storage medium | |
CN108229418B (en) | Human body key point detection method and apparatus, electronic device, storage medium, and program | |
US10395091B2 (en) | Image processing apparatus, image processing method, and storage medium identifying cell candidate area | |
CN111935479B (en) | Target image determination method and device, computer equipment and storage medium | |
CN114972922B (en) | Coal gangue sorting and identifying method, device and equipment based on machine learning | |
CN107229560A (en) | A kind of interface display effect testing method, image specimen page acquisition methods and device | |
CN113744394A (en) | Shoe tree three-dimensional modeling method, device, equipment and storage medium | |
CN105678301B (en) | method, system and device for automatically identifying and segmenting text image | |
CN111126254A (en) | Image recognition method, device, equipment and storage medium | |
CN110751004A (en) | Two-dimensional code detection method, device, equipment and storage medium | |
CN112580584A (en) | Method, device and system for detecting standing behavior and storage medium | |
CN108256578B (en) | Gray level image identification method, device, equipment and readable storage medium | |
CN114846513A (en) | Motion analysis system and motion analysis program | |
CN115661903A (en) | Map recognizing method and device based on spatial mapping collaborative target filtering | |
CN112581001B (en) | Evaluation method and device of equipment, electronic equipment and readable storage medium | |
CN114627534A (en) | Living body discrimination method, electronic device, and storage medium | |
CN114399432A (en) | Target identification method, device, equipment, medium and product | |
CN114758384A (en) | Face detection method, device, equipment and storage medium | |
CN113963427A (en) | Method and system for rapid in vivo detection | |
CN115273215A (en) | Job recognition system and job recognition method | |
CN110472601B (en) | Remote sensing image target object identification method, device and storage medium | |
CN115249254B (en) | Target tracking method and system based on AR technology |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |