Table processing methods, devices, and electronic devices based on freely combinable cells
By using an algorithm based on free cell combination, table cells are automatically merged and display colors are added, solving the problems of low table processing efficiency and high error rate, and achieving more efficient and accurate table processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-01
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, when the number of cells for multiple sets of data in a table varies, manual processing is inefficient and prone to errors.
Using an algorithm based on free combination of cells, the system automatically identifies whether cells are merged and merges cells according to column direction. It then generates a merged table by combining baseline parameters and status parameters and adds display colors to distinguish rows.
It improves the efficiency of cell merging processing, enhances the accuracy of table processing, and improves the user experience.
Smart Images

Figure CN114626353B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information processing, and in particular to a table processing method, apparatus, and electronic device based on free combination of cells. Background Technology
[0002] In related technologies, if a table contains multiple sets of data and the number of non-empty cells in each column of each set of data is different, the table is usually processed manually. However, this method is inefficient and prone to errors. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a table processing method, apparatus and electronic device based on free combination of cells, so as to improve the efficiency of merging cells and improve the user experience.
[0004] In a first aspect, embodiments of the present invention provide a table processing method based on free combination of cells, comprising: determining multiple sub-tables to be merged based on an acquired initial table and pre-set baseline parameters; each sub-table includes at least two columns of cells; for each sub-table, determining the state parameters of each cell in the sub-table based on the column data volume of the sub-table; and generating a merged table corresponding to the initial table based on the state parameters of each cell and the initial table.
[0005] Furthermore, the aforementioned benchmark parameters include benchmark header parameters; the initial table includes multiple list headers; the step of determining multiple sub-tables to be merged based on the obtained initial table and the pre-set benchmark parameters includes: determining the cell content corresponding to the list headers in the multiple list headers of the initial table that are the same as the benchmark list headers as the labels of the sub-tables to be merged; determining the cells in the initial table whose cell content matches the labels and the cells where the labels are located as non-empty cells of the sub-tables; and determining the empty cells in the matrix table that match the non-empty cells as empty cells of the sub-tables.
[0006] Furthermore, the aforementioned sub-table includes multiple columns; the column data volume includes the number of non-empty cells corresponding to each column; the state parameters correspond to multiple parameter values; the step of determining the state parameters of each cell in the sub-table based on the column data volume includes: for each column of each sub-table, determining the parameter value of the state parameter corresponding to each cell of the column based on the number of non-empty cells in the column; wherein, the parameter values of the state parameters corresponding to any two non-empty cells are different; if the column includes non-empty cells, the parameter value of the state parameter corresponding to the non-empty cell is the same as the parameter value corresponding to the adjacent non-empty cell or the adjacent empty cell.
[0007] Furthermore, the step of generating the merged table corresponding to the initial table based on the state parameters of each cell and the initial table includes: for each sub-table to be merged, merging the sub-table based on the state parameters of each cell to obtain the merged sub-table; and determining the table composed of the merged sub-tables as the merged table corresponding to the initial table.
[0008] Furthermore, in each column of the sub-table, the parameter values of the state variables corresponding to any two non-empty cells are different; if the column includes non-empty cells, the parameter values of the state variables corresponding to the non-empty cells are the same as the parameter values corresponding to the adjacent non-empty cells or adjacent empty cells; the step of merging the sub-table based on the state variables of each cell to obtain the merged sub-table includes: for each column of the sub-table, processing the cells with the same state variable parameter values into the same cell; and determining the table composed of the merged cells as the merged sub-table.
[0009] Furthermore, the merged table includes merged sub-tables; the method further includes adding display colors to the merged table; wherein, in the merged table, adjacent sub-tables have different display colors.
[0010] Secondly, embodiments of the present invention also provide a table processing device based on free combination of cells, comprising: a sub-table determination module, used to determine multiple sub-tables to be merged based on an acquired initial table and pre-set benchmark parameters; the sub-table includes at least two columns of cells; a parameter determination module, used to determine the state parameters of each cell in the sub-table based on the column data volume of the sub-table; and a table merging module, used to generate a merged table corresponding to the initial table based on the state parameters of each cell and the initial table.
[0011] Furthermore, the aforementioned baseline parameters include baseline header parameters; the initial table includes multiple list headers; the sub-table determination module is also used to: determine the cell content corresponding to the list header that is the same as the baseline header in the multiple list headers of the initial table as the label of the sub-table to be merged; determine the cell in the initial table whose cell content matches the label and the cell where the label is located as the non-empty cell of the sub-table; and determine the empty cell that matches the non-empty cell as the matrix table as the empty cell of the sub-table.
[0012] Thirdly, embodiments of the present invention also provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described table processing method based on free combination of cells.
[0013] Fourthly, embodiments of the present invention also provide a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the above-described table processing method based on free combination of cells.
[0014] The embodiments of the present invention bring the following beneficial effects:
[0015] This invention provides a table processing method, apparatus, and electronic device based on free cell combination. First, based on an acquired initial table and pre-set baseline parameters, multiple sub-tables to be merged are determined. Then, for each sub-table, based on the number of columns in the sub-table, the state parameters of each cell are determined. Finally, based on the state parameters of each cell and the initial table, a merged table corresponding to the initial table is generated. This method improves the efficiency of cell merging and enhances the user experience.
[0016] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0017] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 A flowchart illustrating a table processing method based on free cell combination, provided as an embodiment of the present invention;
[0020] Figure 2 This is a schematic diagram illustrating the relationship between labels and cell content in a sub-table, provided as an embodiment of the present invention.
[0021] Figure 3 A schematic diagram of the structure of a table processing device based on free combination of cells provided in an embodiment of the present invention;
[0022] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] In a table with a large number of rows and columns, different colors are often used to distinguish each row to prevent users from misreading them, for example, the first row has a gray background, the second row has a white background. However, if the table is merged in different ways, it becomes difficult to distinguish rows using this method. For example, merging two cells vertically in the first column of the first row, merging three cells vertically in the second column, and merging only one cell vertically in the third column. In this case, cell merging needs to be done manually. This method requires manually determining which cells need to be merged, and then manually determining which of the merged cells belong to the same row. When the table has a large number of rows and columns, this manual method is inefficient and has a high error rate.
[0025] Based on this, the present invention provides a table processing method, apparatus, and electronic device based on free combination of cells, which can be used for processing various tables.
[0026] This invention provides an algorithm that automatically identifies whether any cell is merged and how many cells need to be merged in a column (vertical) direction. The algorithm includes: a table cell is divided into natural row numbers and calculated row numbers, as explained below; the processing consists of two steps: first, checking whether each cell in the calculated row is merged, and then displaying an alternating row demonstration. Details are as follows:
[0027] 1. The purpose of this invention is to display odd and even rows in alternating colors for the calculated row numbers.
[0028] 2. Classify the status of cells in the calculation row. If there are 2 rows of cells to be merged in the column (vertical) direction, each cell may have 3 states; if there are 3 rows, each cell may have 4 states; if there are N rows, each cell may have N+1 states. The following example illustrates merging 2 rows: Each cell in the calculation row may have 3 states; in state 1, all cells are merged without any column (vertical) cell merging, and each cell occupies only one natural cell; in state 2, the first row of 2 is processed, where each cell may be merged, depending on the data: if there is no data in the row, merge; if there is data, do not merge; in state 3, the second row of 2 is processed, where each cell is not merged.
[0029] To facilitate understanding of this embodiment, a table processing method based on free combination of cells disclosed in this embodiment of the invention will first be described in detail.
[0030] This invention provides a table processing method based on freely combinable cells, such as... Figure 1 As shown, the method includes the following steps:
[0031] Step S100: Based on the obtained initial table and the pre-set baseline parameters, determine multiple sub-tables to be merged; each sub-table includes at least two columns of cells.
[0032] The aforementioned baseline parameters include baseline header parameters; the initial table includes multiple headers; when determining multiple sub-tables to be merged, the cell content corresponding to the headers in the initial table that are identical to the baseline headers can first be determined as the labels of the sub-tables to be merged; then, the cells in the initial table whose cell content matches the labels, as well as the cells containing the labels, can be determined as non-empty cells of the sub-tables; finally, the empty cells in the matrix table that match the non-empty cells can be determined as empty cells of the sub-tables.
[0033] Taking Table 1 below as an example, Table 1 shows the staff arrangements for operating rooms 2 and 3. The baseline header parameters are the operating room number, surgeon, anesthesiologist, scrub nurse, and circulating nurse in Table 1. In fact, except for the operating room number, the content of the cells under the other headers is related to the cell content of the operating room number. Taking operating room number 2 as the label, surgeon Fang XX, anesthesiologist Yu XX, scrub nurse Ding XX, and circulating nurse Zhang XX are all cell contents matching the label operating room number 2, and their inclusion relationship is as follows: Figure 2 As shown, this identifies the sub-table to be merged corresponding to operating room number 2. However, since this sub-table contains only one row, it does not need to be merged.
[0034] Similarly, the sub-table to be merged corresponding to operating room number 3 can be determined. It is worth noting that since there are some empty cells around the non-empty cells, in order to make the display more intuitive, the empty cells that match the non-empty cells to form a matrix table also need to be included as part of the sub-table to be merged.
[0035] Table 1
[0036] Operating room number Surgeon Anesthesiologist handwashing nurse Circulating nurse 2 Fang XX Yu XX Ding XX Zhang XX 3 Song XX Liu XX Chen XX Xie XX Thousand XX Sun XX Fang XX
[0037] Step S102: For each sub-table, determine the status parameters of each cell in the sub-table based on the amount of column data in the sub-table.
[0038] Furthermore, the aforementioned sub-tables typically include multiple columns; the column data volume includes the number of non-empty cells corresponding to each column; and the status parameters typically correspond to multiple parameter values. When determining the status parameters of each cell in a sub-table, the parameter value of the status parameter corresponding to each cell in each column of each sub-table can be determined based on the number of non-empty cells in the column. To facilitate subsequent cell merging, the parameter values of the status parameters corresponding to any two non-empty cells in the column are set to be different. If the column includes non-empty cells, the parameter value of the status parameter corresponding to the non-empty cell is the same as the parameter value corresponding to the adjacent non-empty cell or the adjacent empty cell.
[0039] As shown in Table 1, when the operating room number is 3, the corresponding parameter values of the cell for surgeon Song XX and the cell for surgeon Wan XX are different; the parameter values of the cell for circulating nurse Xie XX and the empty cell below it are the same.
[0040] Step S104: Based on the state parameters of each cell and the initial table, generate the merged table corresponding to the initial table.
[0041] In the specific implementation process, for each sub-table to be merged, the sub-table can be merged based on the state variable parameters of each cell to obtain the merged sub-table. Specifically, for each column of the sub-table, tables with the same state variable parameter value are processed into the same cell; the table composed of the merged sub-tables is determined as the merged table corresponding to the initial table.
[0042] After merging tables, you can add display colors to the merged table; in the merged table, adjacent sub-tables will display different colors.
[0043] After merging cells and adding display colors to the table shown in Table 1, the resulting table is shown in Table 2:
[0044] Table 2
[0045]
[0046] This invention provides a table processing method based on free cell combination. First, based on an initial table and pre-set baseline parameters, multiple sub-tables to be merged are determined. Then, for each sub-table, based on the number of columns in the sub-table, the state parameters of each cell are determined. Finally, based on the state parameters of each cell and the initial table, a merged table corresponding to the initial table is generated. This method improves the efficiency of cell merging and enhances the user experience.
[0047] This invention also provides another table processing method based on free cell combination, which... Figure 1 This method is implemented based on the method shown. The method is explained in conjunction with the operating room surgical schedule.
[0048] Suppose we need to display the surgical schedule results for operating rooms 1, 2, and 3 in a tabular format. Typically, multiple operating room information is required to be displayed in one row. Each operating room may have 1-3 doctors or nurses, and each doctor or nurse may randomly occupy 1-3 column cells. Regardless of how many column cells a doctor or nurse has merged, the current row must be treated as a whole row when displayed, not as individual rows. Thus, for the 1-3 doctors or nurses in this operating room, the individual rows would be 1-3, but when displayed, they must be displayed as a whole row. An Excel-format schedule table will be automatically generated. Without table optimization, the table will have 10 rows, with 9 rows corresponding to the schedules of 4 operating rooms. The automatically generated table style is shown in Table 3.
[0049] Table 3
[0050]
[0051] In this table, each cell belongs to its own calculated row number, and different background colors are used depending on whether the calculated row number is odd or even.
[0052] To address the aforementioned issues, this invention employs a "row status" identifier that calculates row numbers and automatically increments the sequence number by 1. This not only allows for the automatic merging of necessary cells based on the data but also enables each operating room's schedule to be displayed in a separate row, with alternating background colors between rows, achieving the effect shown in Table 4. This approach makes the content presented in the table clearer and more organized.
[0053] Table 4
[0054]
[0055] If there are multiple operating rooms in a single row, they can also be merged and displayed, as shown in Table 5.
[0056] Table 5
[0057]
[0058]
[0059] This invention uses a combination of "row status identifier" and "row status auto-incrementing 1 sequence number" as the basis for calculating row numbers. The "row status identifier" is used to identify cells that can be merged and to mark their status accordingly. The "row status auto-incrementing 1 sequence number" is used to calculate the number of rows with alternating colors.
[0060] 1) "Row Status" identifier
[0061] The number of "row status" identifiers is 1 to N, where N equals the maximum number of cells in a column plus 1. Taking Table 2 as an example, in the schedule for operating room 3, the column with the fewest employees has only one person, and the column with the most employees has two people. Therefore, the required number of "row status" identifiers is 3 = 2 + 1, corresponding to the following three statuses:
[0062] State 1: There is only one person in all columns of this row, so there is no need to merge cells. In this case, every identifier in this row is in State 1.
[0063] State 2: The number of people corresponding to each column in this row is random, sometimes 1 person, sometimes 2 people, but at least one column corresponds to 2 people. In this case, when the system generates the table, it will determine whether to merge the two cells if the number of people in the corresponding column is 1, or not to merge the cells if the number of people in the corresponding column is 2.
[0064] State 3: When the "row status identifier" already exists in State 2, the system marks the cell with 2 people as State 3, that is, State 3 is equivalent to the sub-row identifier of the state.
[0065] After such labeling, the status of each cell in operating room 3 in Table 1 is shown in Table 6.
[0066] Table 6
[0067] line number Operating room number Surgeon Anesthesiologist handwashing nurse Circulating nurse 1. 2. State 1 State 2 State 2 State 2 State 1 3. State 3 State 3 State 3 4.
[0068] Similarly, when the system processes the table for operating room number 4, the number of "row status" identifiers is 4, corresponding to the following 4 states:
[0069] Status 1: There is only one person in all columns of this row, so there is no need to merge cells.
[0070] State 2: The number of people corresponding to each column in this row is random, sometimes 1, sometimes 2, and sometimes 3, but at least one column corresponds to 2 people. In this case, when the system generates the table, it will determine whether to merge the two cells if the number of people in the corresponding column is 1, merge the cells if the number of people in the corresponding column is 2, or not merge the cells if the number of people in the corresponding column is 3.
[0071] State 3: When the "row status identifier" already exists in State 2, the system marks the cell with 2 people as State 3, that is, State 3 is equivalent to the sub-row identifier of State 2.
[0072] State 4: When the "row status identifier" already exists in state 3, the system marks the cell with 3 people as state 4, that is, state 4 is equivalent to the sub-row identifier of state 3.
[0073] 2) The variable "Row status automatically increments by 1"
[0074] The variable "Automatically increment row number by 1" is used to identify rows after merging cells. The row number of the first row is initialized to 0. Based on the "row status identifier," the range of all cells in the next row is determined, and the "automatically increment row number by 1" calculation is performed accordingly to calculate the row number. This process continues until Table 1 is identified as having only 4 rows (including the header). If alternating background colors are needed for every other row, the row number is modulo 2, selecting odd and even rows, and then the background color is set by the software to achieve the desired Table 2 style. If alternating colors are needed every three rows, the row number is modulo 3, selecting rows with different background colors, and then the background color is set by the software to achieve the desired style.
[0075] Whether to perform the "automatic increment of row status number" calculation is determined by the status X corresponding to the "row status identifier" of each cell. Taking operating room 3 in Table 3 as an example, the "row status identifier" corresponding to this row has three possibilities: status 1, status 2, and status 3. For rows containing status 1 and status 2, the system will automatically perform the "automatic increment of row status number" calculation. When the row status identifier is 3, the "row number" remains unchanged. In this way, although operating room 3 actually occupies 2 rows, only one row is incremented during the row number increment calculation, while the other row is not incremented.
[0076] The above method provides a more organized and convenient way to present table content by setting the "row status identifier", setting the "row status auto-increment 1 sequence number" variable, and designing related algorithms.
[0077] Corresponding to the above method embodiments, this invention also provides a table processing device based on free cell combination, such as... Figure 3 As shown, the device includes:
[0078] The sub-table determination module 300 is used to determine multiple sub-tables to be merged based on the obtained initial table and pre-set baseline parameters; each sub-table includes at least two columns of cells.
[0079] The parameter determination module 302 is used to determine the status parameters of each cell in the sub-table based on the amount of column data in the sub-table.
[0080] The table merging module 304 is used to generate a merged table corresponding to the initial table based on the status parameters of each cell and the initial table.
[0081] Specifically, the aforementioned baseline parameters include baseline header parameters; the initial table includes multiple list headers; the sub-table determination module is further used to: determine the cell content corresponding to the list header that is the same as the baseline header in the multiple list headers of the initial table as the label of the sub-table to be merged; determine the cells in the initial table whose cell content matches the label and the cell where the label is located as non-empty cells of the sub-table; and determine the empty cells that match the non-empty cells as matrix tables as empty cells of the sub-table.
[0082] The table processing device based on free combination of cells provided in this embodiment of the invention has the same technical features as the table processing method based on free combination of cells provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.
[0083] This invention also provides an electronic device, see [link to relevant documentation]. Figure 4 As shown, the electronic device includes a processor 130 and a memory 131. The memory 131 stores machine-executable instructions that can be executed by the processor 130. The processor 130 executes the machine-executable instructions to implement the above-described data processing method.
[0084] Furthermore, Figure 4 The electronic device shown also includes a bus 132 and a communication interface 133, with the processor 130, the communication interface 133 and the memory 131 connected via the bus 132.
[0085] The memory 131 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 133 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 132 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0086] Processor 130 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 130 or by instructions in software form. Processor 130 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 131. The processor 130 reads information from memory 131 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0087] This invention also provides a machine-readable storage medium storing machine-executable instructions. When these machine-executable instructions are called and executed by a processor, they cause the processor to implement the aforementioned data processing method. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0088] The computer program products of the data processing method, apparatus, and electronic device provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0089] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0090] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A table processing method based on free combination of cells, characterized by, The method comprises the following steps: Based on the obtained initial table and the pre-set reference parameters, determine a plurality of sub-tables to be merged; The sub-tables at least include two columns of cells; the reference parameters include reference table header parameters; the initial table includes a plurality of table headers; For each sub-table, based on the column data amount of the sub-table, determine the state amount parameter of each cell in the sub-table; the column data amount includes the number of non-empty cells corresponding to each column; Based on the state amount parameter of each cell and the initial table, generate a merged table corresponding to the initial table; According to the calculation row number of all cells in the merged table, add background color to the merged table; wherein the calculation row number corresponds to the overall row range of the sub-table, which is used to adopt different background colors for the sub-table according to the overall row; the calculation row number corresponds to the row state identifier and the row state automatic increment number; the row state identifier is used to identify the cells that can be merged and make corresponding state annotations; the row state automatic increment number is used for row number calculation for alternating color display, that is, the row number of the first row is set as the initial value=0, the range of all cells in the next row is determined according to the row state identifier, and the row number of the current row is calculated according to the determination result; Wherein, based on the obtained initial table and the pre-set reference parameters, the step of determining a plurality of sub-tables to be merged comprises: Determine the cell content corresponding to the same table header in the plurality of table headers of the initial table as the label of the sub-table to be merged; wherein the labels of each of the sub-tables to be merged are different; Determine the cells with cell content matching the label and the cells where the label is located in the initial table as non-empty cells of the sub-table; Determine the empty cells matching the non-empty cells as matrix table as empty cells of the sub-table.
2. The method of claim 1, wherein, The sub-tables include a plurality of columns; the state amount parameter corresponds to a plurality of parameter values; Based on the column data amount of the sub-table, determine the state amount parameter of each cell in the sub-table; the column data amount includes the number of non-empty cells corresponding to each column; Based on the state amount parameter of each cell and the initial table, generate a merged table corresponding to the initial table; the step comprises:
3. The method of claim 1, wherein, For each sub-table to be merged, based on the state amount parameter of each cell, perform merging processing on the sub-table to obtain a merged sub-table; Determine the table composed of the merged sub-tables as the merged table corresponding to the initial table. The method comprises the following steps:
4. The method of claim 3, wherein, In each column of the sub-table, parameter values of state quantity parameters corresponding to any two non-empty cells are different; if the column includes a non-empty cell, a parameter value of a state quantity parameter corresponding to the non-empty cell is the same as a parameter value corresponding to an adjacent non-empty cell or an adjacent empty cell; The step of performing merging processing on the sub-table based on the state quantity parameters of the cells to obtain a merged sub-table includes: For each column of the sub-table, a table with the same parameter value of the state quantity parameter is processed as a same cell; The table composed of the merged cells is determined as the merged sub-table.
5. The method of claim 1, wherein, The merged table includes the merged sub-table; and the method further includes: Based on the state quantity parameters of the cells, display colors are added to the merged table; in the merged table, display colors of adjacent sub-tables are different.
6. A table processing apparatus based on free combination of cells, characterized by, It includes: A sub-table determination module is configured to determine a plurality of to-be-merged sub-tables based on an obtained initial table and a pre-set reference parameter; The sub-table includes at least two columns of cells; the reference parameter includes a reference table header parameter; and the initial table includes a plurality of table headers. A parameter determination module is configured to determine, for each sub-table, a state quantity parameter of each cell in the sub-table based on column data quantity of the sub-table; the column data quantity includes a number of non-empty cells corresponding to each column. A table merging module is configured to generate a merged table corresponding to the initial table based on the state quantity parameters of the cells and the initial table. The table merging module is further configured to add a background color to the merged table according to a calculation row number to which all cells in the merged table belong; the calculation row number corresponds to an overall row range of a sub-table, is used to adopt different background colors for the sub-table according to the overall row, and includes a row state identifier and a row state automatic increment number; the row state identifier is used to identify cells that can be merged and perform corresponding state annotation; and the row state automatic increment number is used to calculate a number of rows for alternate color display, that is, a row number of a first row is set as an initial value=0, a range of all cells of a next row is determined according to the row state identifier, and a row number of the row is calculated according to a determination result. The sub-table determination module is further configured to: Determine, as a label of a to-be-merged sub-table, cell content corresponding to a same table header as the reference table header in a plurality of table headers of the initial table; the labels of the to-be-merged sub-tables are different from each other; Determine, as non-empty cells of the sub-table, cells with cell content matching the label and the cells where the label is located in the initial table; Determine, as empty cells of the sub-table, empty cells matching the non-empty cells as a matrix table.
7. An electronic device, comprising: The electronic device includes a processor and a memory, the memory stores computer executable instructions capable of being executed by the processor, and the processor executes the computer executable instructions to implement the method in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer executable instructions, which when invoked and executed by the processor, cause the processor to implement the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Excel data table exporting method, system and device, and storage medium
CN108460055A
Data-based table cell merging method and system
CN111444689A