CN113177397A - Table adjusting method, device, equipment and storage medium - Google Patents

Table adjusting method, device, equipment and storage medium Download PDF

Info

Publication number
CN113177397A
CN113177397A CN202110430468.4A CN202110430468A CN113177397A CN 113177397 A CN113177397 A CN 113177397A CN 202110430468 A CN202110430468 A CN 202110430468A CN 113177397 A CN113177397 A CN 113177397A
Authority
CN
China
Prior art keywords
column
merging
merged
information
display diagram
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.)
Granted
Application number
CN202110430468.4A
Other languages
Chinese (zh)
Other versions
CN113177397B (en
Inventor
孔雪娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Consumer Finance Co Ltd
Original Assignee
Ping An Consumer Finance Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ping An Consumer Finance Co Ltd filed Critical Ping An Consumer Finance Co Ltd
Priority to CN202110430468.4A priority Critical patent/CN113177397B/en
Publication of CN113177397A publication Critical patent/CN113177397A/en
Application granted granted Critical
Publication of CN113177397B publication Critical patent/CN113177397B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display 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

Table adjusting method, device, equipment and storage medium
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 picturem1, 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 picturem2, calculating an average value B2 of gray values of all pixel points in the first gray picture;
according to the formula
Figure BDA0003031270340000021
Calculating the overall variance of the m-th column or m-th row of the first gray picture
Figure BDA0003031270340000022
And the overall variance of the m-th column or m-th row of the second gray scale picture
Figure BDA0003031270340000023
Wherein N is the total number of columns or rows in the grayscale picture;
according to the formula
Figure BDA0003031270340000024
Obtaining the difference of the total variances of the m-th row or the m-th row of the first gray picture and the second gray picture
Figure BDA0003031270340000025
Wherein the content of the first and second substances,
Figure BDA0003031270340000026
is the overall variance of the m-th column or m-th row of the first grayscale picture,
Figure BDA0003031270340000027
a total variance of an m-th column or an m-th row of the second gray scale picture;
difference between the global variances according to calculation
Figure BDA0003031270340000028
And 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 characteristics of the table identification results, and determining the table to be merged and arranged set by the rear end by using the merging characteristics.
Further, before the step of determining the merging direction to be merged and juxtaposed by using the direction features, 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 information of a column 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 formula
Figure BDA0003031270340000041
Calculating 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 p1(x) Denotes the probability of x occurrence, p2(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 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.
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 objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below 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 to explain the relative position relationship between the components, the motion situation, etc. in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indicator is 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, the table display diagram of the front end is acquired. 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 is determined using the direction feature. The direction features 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 features 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, 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 graph displayed at the front end, and if the graph does not meet the requirement yet, the graph 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 classification model to obtain column information 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 formula
Figure BDA0003031270340000081
Calculating 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 p1(x) Denotes the probability of x occurrence, p2(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, wherein the merging classification model may specifically be to calculate the correlation value between the columns, that is, the information of each cell is firstly performedThe digital processing is that each cell information is processed into digital information according to a preset processing mode, wherein the preset processing mode is not limited and can be obtained by any one of the prior art, each cell information forms a column set of corresponding columns, and then the column set is processed according to a formula
Figure BDA0003031270340000091
And 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 picturemCalculating the average value B of the gray values of all pixel points in the gray picture;
s203: according to the formula
Figure BDA0003031270340000092
Calculating the overall variance of the m-th column or m-th 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 formula
Figure BDA0003031270340000093
Obtaining the difference of the total variances of the m-th row or the m-th row of the first gray picture and the second gray picture
Figure BDA0003031270340000094
Wherein the content of the first and second substances,
Figure BDA0003031270340000095
is the overall variance of the m-th column or m-th row of the first grayscale picture,
Figure BDA0003031270340000096
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 calculation
Figure BDA0003031270340000097
And 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, so that the gray image only needs to store one byte of gray value (also called an intensity value and a brightness value) per pixel, thereby reducing the storage capacity. 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 using the graying processing 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 calculation amount can be greatly reduced by comparing the images 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 picturemAnd 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 the mth column or the mth row of the gray picture, and performing gray value comparison on all pixel points of the mth column or the mth rowAnd adding the gray values of the pixels, and dividing the sum of the gray values obtained by adding by the number of all the pixels in the mth column or the mth row to obtain an average value Am of the gray values of all the pixels in 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 formula
Figure BDA0003031270340000101
Calculating the overall variance of the m-th column or m-th row of the gray-scale picture
Figure BDA0003031270340000102
Where N is the total number of columns or rows in the grayscale picture. In the application, 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 is measured by adopting the overall variance.
According to the formula
Figure BDA0003031270340000111
Obtaining the difference of the total variances of the m-th column or the m-th row of the two gray-scale pictures
Figure BDA0003031270340000112
Wherein the content of the first and second substances,
Figure BDA0003031270340000113
is the overall variance of the m-th column or m-th row of the first grayscale picture,
Figure BDA0003031270340000114
is the overall variance of the m-th column or m-th row of the second gray scale picture. Difference in global variance
Figure BDA0003031270340000115
The difference of the gray values of the m-th column or the m-th row of the two gray pictures is reflected. When in use
Figure BDA0003031270340000116
Smaller, e.g. 0, indicates
Figure BDA0003031270340000117
Is equal or approximately equal to
Figure BDA0003031270340000118
The gray value of the mth column or row of the first gray picture can be regarded as the same or approximately the same 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 unequal), otherwise, the gray value of the mth column or row of the first gray picture is regarded as the same gray value of the mth column or row of the second gray picture. 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 classification model to obtain column information 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 characteristics of the recognition results, and determining the to-be-merged list of the table set by the rear end by using the merging characteristics.
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; 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 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 usually the 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 line height 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 one 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 at 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 picturem1, 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 mth column or the mth row of the second gray picturem2, 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 formula
Figure BDA0003031270340000141
Calculating the overall variance of the m-th column or m-th row of the first gray picture
Figure BDA0003031270340000142
And the overall variance of the m-th column or m-th row of the second gray scale picture
Figure BDA0003031270340000143
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 formula
Figure BDA0003031270340000144
Obtaining the difference of the total variances of the m-th row or the m-th row of the first gray picture and the second gray picture
Figure BDA0003031270340000145
A graph judgment sub-module for judging the difference of the total variance
Figure BDA0003031270340000146
And 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 merging and classifying 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 submodule is used for carrying out digital processing on the cell information of each column in the table set by the rear end in the merging and classifying 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 formula
Figure BDA0003031270340000151
Calculating 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 p1(x) Denotes the probability of x occurrence, p2(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.
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 operation of the operating system and the computer program 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 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.
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 (10)

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 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.
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 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 picturem1, 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 picturem2, calculating an average value B2 of gray values of all pixel points in the first gray picture;
according to the formula
Figure FDA0003031270330000011
Calculating the overall variance of the m-th column or m-th row of the first gray picture
Figure FDA0003031270330000012
And the overall variance of the m-th column or m-th row of the second gray scale picture
Figure FDA0003031270330000021
Wherein N is the total number of columns or rows in the grayscale picture;
according to the formula
Figure FDA0003031270330000022
Obtaining the difference of the total variances of the m-th row or the m-th row of the first gray picture and the second gray picture
Figure FDA0003031270330000023
According to the difference between the total variances
Figure FDA0003031270330000024
And judging whether the table display diagram is consistent with the table pre-display diagram.
3. The method for adjusting table according to claim 1, wherein the step of inputting the data information into a column merging classification model to obtain column information to be merged in the data information comprises:
analyzing the data information in the merged classification model to obtain an identification result of the table set by the back end;
and extracting the merging characteristics of the recognition results, and determining the to-be-merged list of the table set by the rear end by using the merging characteristics.
4. The method for adjusting tables according to claim 1, wherein the step of determining the merging direction of the candidate list using the direction feature further comprises:
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.
5. The method for adjusting tables according to claim 1, wherein after the step of obtaining the data information of the table set by the backend, the method further comprises:
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.
6. 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.
7. The method for adjusting table according to claim 1, wherein the step of inputting the data information into a column merging classification model to obtain column information to be merged in the data information comprises:
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 formula
Figure FDA0003031270330000031
Calculating 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 p1(x) Denotes the probability of x occurrence, p2(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.
8. 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;
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.
9. 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 7 when executing the computer program.
10. 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 7.
CN202110430468.4A 2021-04-21 2021-04-21 Table adjusting method, device, equipment and storage medium Active CN113177397B (en)

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 true CN113177397A (en) 2021-07-27
CN113177397B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113688693A (en) * 2021-07-29 2021-11-23 上海浦东发展银行股份有限公司 Adjacent table processing method and device, computer equipment and storage medium
CN116721556A (en) * 2023-06-13 2023-09-08 联城科技(河北)股份有限公司 Vehicle management and control method, system, equipment and medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070282869A1 (en) * 2006-06-05 2007-12-06 Microsoft Corporation Automatically generating web forms from database schema
CN103593473A (en) * 2013-11-28 2014-02-19 国家电网公司 Form displaying method and system
CN107766314A (en) * 2017-10-20 2018-03-06 网易(杭州)网络有限公司 The data processing method and device of electrical form
CN110569469A (en) * 2019-09-06 2019-12-13 四川长虹电器股份有限公司 Method for dynamically generating HTML (hypertext markup language) form based on data configuration
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
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

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070282869A1 (en) * 2006-06-05 2007-12-06 Microsoft Corporation Automatically generating web forms from database schema
CN103593473A (en) * 2013-11-28 2014-02-19 国家电网公司 Form displaying method and system
CN107766314A (en) * 2017-10-20 2018-03-06 网易(杭州)网络有限公司 The data processing method and device of electrical form
CN110569469A (en) * 2019-09-06 2019-12-13 四川长虹电器股份有限公司 Method for dynamically generating HTML (hypertext markup language) form based on data configuration
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
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

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113688693A (en) * 2021-07-29 2021-11-23 上海浦东发展银行股份有限公司 Adjacent table processing method and device, computer equipment and storage medium
CN116721556A (en) * 2023-06-13 2023-09-08 联城科技(河北)股份有限公司 Vehicle management and control method, system, equipment and medium
CN116721556B (en) * 2023-06-13 2024-02-06 联城科技(河北)股份有限公司 Vehicle management and control method, system, equipment and medium

Also Published As

Publication number Publication date
CN113177397B (en) 2023-03-28

Similar Documents

Publication Publication Date Title
US9189842B2 (en) Paper identifying method and related device
CN111524137B (en) Cell identification counting method and device based on image identification and computer equipment
CN110781839A (en) Sliding window-based small and medium target identification method in large-size image
AU2019275232A1 (en) Multi-sample whole slide image processing via multi-resolution registration
CN113177397B (en) Table adjusting method, device, equipment and storage medium
CN111935479B (en) Target image determination method and device, computer equipment and storage medium
US10395091B2 (en) Image processing apparatus, image processing method, and storage medium identifying cell candidate area
CN107229560A (en) A kind of interface display effect testing method, image specimen page acquisition methods and device
CN110059666B (en) Attention detection method 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
EP2249307B1 (en) Method for image reframing
CN111461070B (en) Text recognition method, device, electronic equipment and storage medium
CN110688950B (en) Face living body detection method and device based on depth information
CN110991256A (en) System and method for carrying out age estimation and/or gender identification based on face features
CN110751004A (en) Two-dimensional code detection method, device, equipment and storage medium
CN112153320A (en) Method and device for measuring size of article, electronic equipment and storage medium
CN108256578B (en) Gray level image identification method, device, equipment and readable storage medium
CN115661903A (en) Map recognizing method and device based on spatial mapping collaborative target filtering
CN114399432A (en) Target identification method, device, equipment, medium and product
CN114758384A (en) Face detection method, device, equipment and storage medium
CN115273215A (en) Job recognition system and job recognition method
CN112581001A (en) Device evaluation method and device, electronic device and readable storage medium
CN113516609A (en) Split screen video detection method and device, computer equipment 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