CN115510823A - Header merging method, apparatus, device, medium, and program product - Google Patents
Header merging method, apparatus, device, medium, and program product Download PDFInfo
- Publication number
- CN115510823A CN115510823A CN202211183695.2A CN202211183695A CN115510823A CN 115510823 A CN115510823 A CN 115510823A CN 202211183695 A CN202211183695 A CN 202211183695A CN 115510823 A CN115510823 A CN 115510823A
- Authority
- CN
- China
- Prior art keywords
- cell
- name information
- header
- level
- identification information
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/174—Form filling; Merging
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
- G06F40/177—Editing, e.g. inserting or deleting of tables; using ruled lines
- G06F40/18—Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
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)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the application discloses a header merging method, a header merging device, header merging equipment, a header merging medium and a header merging program product. The method comprises the following steps: acquiring configuration information of each cell in a header to be processed, wherein the configuration information comprises name information, column identification information and level of the cell; respectively determining a first mergeable area corresponding to each level cell based on the name information and the column identification information; sequentially determining a second mergeable area of each level cell and the corresponding upper level cell based on the name information, the column identification information and the first mergeable area; and merging the to-be-processed headers based on the second mergeable area. The embodiment of the application can efficiently and accurately realize automatic combination of the gauge outfit.
Description
Technical Field
The present application relates to the field of information processing technologies, and in particular, to a method, an apparatus, a device, a medium, and a program product for header merging.
Background
Tabular display of report type data is often used in the context of enterprise data, and column-row consolidation of table cells is an important implementation for aesthetically and efficiently displaying key data information.
Currently, the related art mostly generates a single-level header through a POI framework. In the face of dynamic change and complex headers in actual services, an effective processing method is lacked, and automatic multi-level compounding of the headers is difficult to realize.
Disclosure of Invention
The embodiment of the application provides a header merging method, a header merging device, equipment, a computer storage medium and a computer program product, which can automatically merge headers.
In a first aspect, an embodiment of the present application provides a header merging method, including:
acquiring configuration information of each cell in a header to be processed, wherein the configuration information comprises name information, column identification information and level of the cell;
respectively determining a first mergeable area corresponding to each level cell based on the name information and the column identification information;
sequentially determining a second mergeable area of each level cell and the corresponding upper level cell based on the name information, the column identification information and the first mergeable area;
and merging the to-be-processed headers based on the second mergeable area.
In an optional implementation manner, respectively determining the first mergeable area corresponding to each level cell based on the name information and the column identification information includes:
respectively determining a first father cell of each cell based on the column identification information, wherein the first father cell is a last-level cell which comprises the same column identification information as the cell in the table header to be processed;
for each level cell, respectively judging whether the name information of the adjacent cells is the same;
under the condition that the name information of the adjacent cells is the same, judging whether the name information of the first father cell of the adjacent cells is the same;
in a case where the name information of the first parent cell of the adjacent cells is the same, the adjacent cells are determined as the first mergeable area.
In an optional implementation manner, sequentially determining, based on the name information, the column identification information, and the first mergeable area, a second mergeable area of each level cell and a corresponding upper level cell includes:
performing analog combination on the to-be-processed header based on the first combinable region;
respectively determining a second father cell of each cell in the simulated and merged table header to be processed based on the column identification information, wherein the second father cell is a last-level cell which comprises the same column identification information as the cell in the simulated and merged table header to be processed;
for each cell, respectively judging whether the name information of the cell is the same as that of the second father cell;
in a case where the name information of the cell is the same as the name information of the second parent cell, the cell and the second parent cell are determined as the second mergeable area.
In an optional implementation manner, merging the headers to be processed based on the second mergeable area includes:
taking the column identification information and the level of the cells of the second mergeable area as the column identification information and the level of the merged cells respectively;
and taking the name information of any cell in the second mergeable area as the name information of the merged cell.
In a second aspect, an embodiment of the present application provides a meter head merging apparatus, including:
the acquisition module is used for acquiring the configuration information of each cell in the header to be processed, and the configuration information comprises the name information, the column identification information and the level of the cell;
the determining module is used for respectively determining a first mergeable area corresponding to each level cell based on the name information and the column identification information;
the determining module is used for sequentially determining a second mergeable area of each level cell and the corresponding upper level cell based on the name information, the column identification information and the first mergeable area;
and the merging module is used for merging the to-be-processed headers based on the second mergeable area.
In an optional implementation manner, the determining module is configured to determine, based on the name information and the column identification information, a first mergeable area corresponding to each level cell respectively, and includes:
the determining module is used for respectively determining a first father cell of each cell based on the column identification information, wherein the first father cell is a last-level cell which is in the header of the table to be processed and comprises the same column identification information as the cell;
the judging module is used for respectively judging whether the name information of the adjacent cells is the same or not for each level cell;
the judging module is used for judging whether the name information of the first father cell of the adjacent cell is the same or not under the condition that the name information of the adjacent cell is the same;
and the determining module is used for determining the adjacent cell as the first mergeable area under the condition that the name information of the first parent cell of the adjacent cell is the same.
In an optional embodiment, the determining module is configured to sequentially determine, based on the name information, the column identification information, and the first mergeable area, a second mergeable area of each level cell and a corresponding upper level cell, and includes:
the simulation module is used for simulating and combining the meter heads to be processed based on the first combinable area;
the determining module is used for respectively determining a second father cell of each cell in the simulated and merged table header to be processed based on the column identification information, wherein the second father cell is a last-level cell which comprises the same column identification information as the cell in the simulated and merged table header to be processed;
the judging module is used for respectively judging whether the name information of the cell is the same as that of the second father cell or not for each cell;
and the determining module is used for determining the cell and the second father cell as the second mergeable area under the condition that the name information of the cell is the same as that of the second father cell.
In a third aspect, an embodiment of the present application provides an electronic device, where the device includes: a processor and a memory storing computer program instructions;
a processor, when executing the computer program instructions, implements the header merging method according to any one of the alternative embodiments of the first aspect of the present application.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where computer program instructions are stored on the computer-readable storage medium, and when executed by a processor, the computer program instructions implement the table header merging method according to any optional implementation manner of the first aspect of the present application.
In a fifth aspect, an embodiment of the present application provides a computer program product, where instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform a header merging method as in any optional implementation of the first aspect of the present application.
The header merging method, apparatus, device, computer storage medium, and computer program product of the embodiments of the present application can obtain configuration information of each cell in a header to be processed, respectively determine a mergeable region of each level of cells based on name information and column identification information in the configuration information, and then determine a mergeable region of the header to be processed based on the name information, the column identification information, and the mergeable region of each level of cells. Therefore, after each level of unit cells are traversed and the mergeable areas in each level of unit cells are determined, the unit cells of different levels are traversed sequentially, and therefore the mergeable areas of the table headers to be processed are determined conveniently and accurately. And then merging the to-be-processed headers according to the mergeable areas of the to-be-processed headers. Therefore, the automatic combination of the meter heads can be efficiently and accurately realized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly described below, and for those skilled in the art, other drawings may be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a header to be processed according to one embodiment of the present application;
fig. 2 is a schematic flow chart diagram of a header merging method according to another embodiment of the present application;
FIG. 3 is a schematic view of a header provided in accordance with yet another embodiment of the present application;
FIG. 4 is a schematic illustration of a merged header provided by yet another embodiment of the present application;
fig. 5 is a schematic structural diagram of a header merging device according to still another embodiment of the present application;
fig. 6 is a schematic structural diagram of a header merging device according to still another embodiment of the present application.
Detailed Description
Features and exemplary embodiments of various aspects of the present application will be described in detail below, and in order to make objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are intended to be illustrative only and are not intended to be limiting. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present application by illustrating examples thereof.
It should be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising 8230; \8230;" comprises 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
As described in the background art, the automatic multilevel compounding of the meter head is significant for displaying key data information beautifully and effectively.
In view of this, the inventors have made extensive consideration and have skillfully designed a header merging method, apparatus, device, computer storage medium, and computer program product. According to the header merging method, the headers to be processed can be automatically merged, so that the multi-level composite header is obtained.
The header merging method provided in the embodiments of the present application is described below with reference to the accompanying drawings by specific embodiments and application scenarios thereof. In the header merging method provided in the embodiment of the present application, the apparatus for performing the method may be a header merging apparatus, or a partial module used for performing the header merging method in the header merging apparatus. In the embodiment of the present application, a header merging device is taken as an example to execute a header merging method, and the header merging method provided in the embodiment of the present application is described in detail.
The meter header combination method provided by the embodiment of the application can automatically combine single-stage meter headers and can also automatically combine meter headers which can be further combined in composite meter headers.
In one embodiment, before performing the header merging method provided by the embodiment of the present application, a single-level header may be generated based on the table to be processed. In one embodiment, generating a single-level header based on the table to be processed may include: a header object is customized to establish a multi-level composite header list; and reading the list of the table headers, writing the list into word processing software, and obtaining a single-level table header. As one example, the custom header class object may include column name information as well as column identification information.
As an example, the header list may be generated by customizing the header class object through a column-list (column-list) according to the table information to be processed, for example, the header list may be generated by including the following customized header class objects: the user-defined header class objects a (column name information includes 'Fujian', 'Fuzhou', 'project A'; 001 column identification information), custom header type object B (column name information includes "Fujian", "Fuzhou", "project B"; 002 columns of column identification information), custom header type objects c (column name information comprises "Fujian", "Xiamen", "item B"; column identification information: 003 columns), custom header type objects d (column name information comprises "Fujian", "Xiamen", "item A"; column identification information: 004 columns), custom header type objects e (column name information comprises "Zhejiang", "Hangzhou", "item A"; column identification information: 005 columns), custom header type objects f (column name information comprises "Zhejiang", "Hangzhou", "item B"; column identification information: 006 columns), custom header type objects g (column name information comprises Zhejiang "," Jiang "," warm state "," item A "; column identification information: 007 columns), custom header type objects h (column name information comprises" Zhejiang "," warm state "," item B "; column identification information: 008 columns); reading the header list and writing the header list into the word processor to obtain a single-level header as shown in fig. 1.
The header merging method provided in the embodiment of the present application is described in detail below with reference to fig. 2.
Fig. 2 is a flowchart illustrating a header merging method according to an embodiment of the present application. As shown in fig. 2, the header merging method may specifically include the following steps S110 to S140.
S110, obtaining configuration information of each cell in the header of the table to be processed, wherein the configuration information comprises name information, column identification information and level of the cell.
And S120, respectively determining a first mergeable area corresponding to each level cell based on the name information and the column identification information.
S130, sequentially determining a second mergeable area of each level cell and the corresponding upper level cell based on the name information, the column identification information, and the first mergeable area.
And S140, merging the to-be-processed headers based on the second mergeable area.
The name information may indicate the contents of the cell; the column identification information may include the column number where the cell is located; the level may include a row number where the cell is located, or a level set based on the row number of the cell. As an example, as shown in fig. 1, the name information of the cell A1 may be "fujian", the column identification information may be "a column", and the level may be "one level".
The determining the first mergeable area corresponding to each level cell based on the name information and the column identification information may include: and traversing each level cell in a certain direction, so as to respectively determine a first mergeable area corresponding to each level cell based on the name information and the column identification information. As an example, the cells in each row may be traversed from left to right or from right to left, so as to determine whether the cells may be merged according to the name information and the column identification information of the cells, and then determine the first mergeable area according to the determination result.
The determining, based on the name information, the column identification information, and the first mergeable area, the second mergeable area of each level cell and the corresponding upper level cell in sequence may include: and sequentially judging whether the cells between adjacent rows can be combined from low level to high level based on the name information, the column identification information and the first combinable area, and determining a second combinable area according to a judgment result.
The header merging method of the embodiment of the application can acquire the configuration information of each cell in the header to be processed, respectively determine the mergeable area of each level of cell based on the name information and the column identification information in the configuration information, and then determine the mergeable area of the header to be processed based on the name information, the column identification information and the mergeable area of each level of cell. Therefore, after each level of unit cells are traversed and the mergeable areas in each level of unit cells are determined, the unit cells of different levels are traversed sequentially, and therefore the mergeable areas of the table headers to be processed are determined conveniently and accurately. And then merging the to-be-processed headers according to the mergeable areas of the to-be-processed headers. Therefore, the automatic combination of the meter heads can be efficiently and accurately realized.
In an embodiment, the determining the first mergeable area corresponding to each level cell based on the name information and the column identification information may specifically include:
and respectively determining a first father cell of each cell based on the column identification information, wherein the first father cell is a last-level cell which comprises the column identification information same as the cell in the table header to be processed.
And respectively judging whether the name information of the adjacent cells is the same or not for each level cell.
When the name information of the adjacent cells is the same, it is determined whether the name information of the first parent cell of the adjacent cells is the same.
In a case where the name information of the first parent cell of the adjacent cells is the same, the adjacent cells are determined as the first mergeable area.
As an example, when the single-level headers shown in fig. 1 are merged, it may be determined that the name information of the cell A4 is different from that of the cell B4, and the cell A4 cannot be merged with the cell B4 for the cell in the fourth row; then, the name information of the cell B4 is judged to be the same as that of the cell C4, at this time, the name information of the parent cell B3 of the cell B4 is compared with that of the parent cell C3 of the cell C4, it can be judged that the name information of the parent cell B3 is different from that of the parent cell C3, the cell B4 and the cell C4 cannot be merged, and thus, whether the rest cells in the fourth row can be merged or not is sequentially judged, and it can be determined that the fourth row cell does not have the first mergeable area. For the cells in the third row, it may be determined that the name information of the cell A3 is the same as the name information of the cell B3, at this time, the name information of the parent cell A2 of the cell A3 is compared with the name information of the parent cell B2 of the cell B3, it may be determined that the name information of the parent cell A2 is the same as the name information of the parent cell B2, and the cell A3 and the cell B3 may be merged; then, it is determined that the name information of the cell B3 is different from that of the cell C3, and the cell B3 cannot be merged with the cell C3, and thus it is sequentially determined whether the remaining cells in the third row can be merged, and it is determined that the first mergeable area of the cells in the third row includes the cells (A3 to B3), the cells (C3 to D3), the cells (E3 to F3), and the cells (G3 to H3). Similarly, it may be determined that the first mergeable area of the second row of cells includes cells (A2 to D2) and cells (E2 to H2), respectively; the first mergeable region of the first row of cells includes cells (A1 to D1) and cells (E1 to H1).
In this embodiment, it may be determined whether the name information of the first parent cell of the adjacent cell is the same or not under the condition that the name information of the adjacent cells at the same level is the same, and the adjacent cell is determined as the first mergeable area under the condition that the name information of the first parent cell of the adjacent cell is the same, so that the accuracy of merging cells in the header can be improved.
In an embodiment, the determining, based on the name information, the column identification information, and the first mergeable area, the second mergeable area of each level cell and the corresponding upper level cell in turn may specifically include:
and performing simulation merging on the to-be-processed header based on the first mergeable area.
And respectively determining a second father cell of each cell in the simulated and merged table header to be processed based on the column identification information, wherein the second father cell is a last-level cell which comprises the same column identification information as the cell in the simulated and merged table header to be processed.
And respectively judging whether the name information of the cell is the same as that of the second father cell or not for each cell.
In the case where the name information of the cell is the same as the name information of the second parent cell, the cell and the second parent cell are determined as the second mergeable area.
The above analog merging of the headers to be processed based on the first mergeable area may include: and performing simulation merging on each level of cells in the header to be processed based on the first mergeable area, thereby obtaining configuration information of each cell in the header after merging the cells of each level respectively, so as to determine a second mergeable area.
As an example, based on the first mergeable area, the header to be processed shown in fig. 1 is subjected to analog merging, and configuration information corresponding to the header shown in fig. 3 can be obtained. For the header shown in fig. 3, the second parent cell of each cell may be determined separately. For example, in the header shown in fig. 3, the parent cell of the cell A4 may be the cells (A3 to B3), and the name information of the cell A4 is different from the name information of the cells (A3 to B3), so that the cell A4 and the cells (A3 to B3) cannot be merged. Thus, it can be determined that no mergeable area exists in the fourth row of cells and the third row of cells. Similarly, it may be determined that there is no mergeable area in the third row of cells and the second row of cells, and in the second row of cells and the first row of cells, the cells (A2 to D2) and the cells (A1 to D1) may be merged, and the cells (E2 to H2) and the cells (E1 to G1) may be merged. Thus, it can be determined that the second mergeable area in the header to be processed includes: cells (A1 to D2), cells (E1 to H2), cells (A3 to B3), cells (C3 to D3), cells (E3 to F3), and cells (G3 to H3).
In one embodiment, merging the headers to be processed based on the second mergeable region may include:
and taking the column identification information and the level of the cell of the second mergeable area as the column identification information and the level of the merged cell respectively.
And taking the name information of any cell in the second mergeable area as the name information of the merged cell.
As an example, based on the header to be processed as shown in fig. 1, after the header merging method of the present application is executed, the header as shown in fig. 4 can be obtained. In the header shown in fig. 4, the cells (A1 to D2) are combined by the cells A1, B1, C1, D1, A2, B2, C2, D2 in the header to be processed, the name information "fujian" of the cells is the same as any one of the cells A1, B1, C1, D1, A2, B2, C2, D2 in the header to be processed, the column identification information may be "column a to column D", and the level may be "level one to level two".
Therefore, the combined header can be more visual, and the configuration information of the combined cells can be determined, so that whether the newly added header cells and the combined cells can be combined or not can be more accurately judged when the header cells are newly added, and the flexibility of header combination is improved.
Based on the same inventive concept, the embodiment of the present application further provides a header merging device 200.
As shown in fig. 5, the header merging apparatus 200 may include an obtaining block 201, a determining module 202, and a merging module 203.
An obtaining module 201, configured to obtain configuration information of each cell in a header to be processed, where the configuration information includes name information, column identification information, and a level of the cell;
a determining module 202, configured to determine, based on the name information and the column identifier information, a first mergeable area corresponding to each level cell;
a determining module 202, configured to sequentially determine, based on the name information, the column identification information, and the first mergeable area, a second mergeable area of each level cell and a corresponding upper level cell;
and a merging module 203, configured to merge the headers to be processed based on the second mergeable area.
The header merging device of the embodiment of the application can acquire the configuration information of each cell in the header to be processed, respectively determine the mergeable area of each level of cell based on the name information and the column identification information in the configuration information, and then determine the mergeable area of the header to be processed based on the name information, the column identification information and the mergeable area of each level of cell. Therefore, after each level of unit cells are traversed and the mergeable areas in each level of unit cells are determined, the unit cells of different levels are traversed sequentially, and therefore the mergeable areas of the table headers to be processed are determined conveniently and accurately. And then merging the to-be-processed headers according to the mergeable areas of the to-be-processed headers. Therefore, the automatic combination of the meter heads can be efficiently and accurately realized.
In an embodiment, the determining module is configured to determine, based on the name information and the column identification information, a first mergeable area corresponding to each level cell, and specifically may include:
and the determining module is used for respectively determining a first father cell of each cell based on the column identification information, wherein the first father cell is a last-level cell which comprises the same column identification information as the cell and is in the header of the table to be processed.
And the judging module is used for respectively judging whether the name information of the adjacent cells is the same or not for each level cell.
And the judging module is used for judging whether the name information of the first father cell of the adjacent cell is the same or not under the condition that the name information of the adjacent cell is the same.
And the determining module is used for determining the adjacent cell as the first mergeable area under the condition that the name information of the first parent cell of the adjacent cell is the same.
In an embodiment, the determining module is configured to sequentially determine, based on the name information, the column identification information, and the first mergeable area, a second mergeable area of each level of cells and a corresponding upper level of cells, and specifically may include:
and the simulation module is used for simulating and combining the to-be-processed meter heads based on the first combinable area.
And the determining module is used for respectively determining a second father cell of each cell in the simulated and merged table header to be processed based on the column identification information, wherein the second father cell is a last-level cell which comprises the same column identification information as the cell in the simulated and merged table header to be processed.
And the judging module is used for respectively judging whether the name information of the cell is the same as that of the second father cell or not for each cell.
And the determining module is used for determining the cell and the second father cell as the second mergeable area under the condition that the name information of the cell is the same as that of the second father cell.
In an embodiment, the merging module is configured to merge the headers to be processed based on the second mergeable area, and specifically may include:
and the processing module is used for respectively taking the column identification information and the level of the cell of the second mergeable area as the column identification information and the level of the merged cell.
And the processing module is further used for taking the name information of any cell in the second mergeable area as the name information of the merged cell.
The header merging device provided in the embodiment of the present application can implement each process implemented in the method embodiment of fig. 2, and is not described here again to avoid repetition.
Fig. 6 shows a hardware structure diagram of a header merging device according to an embodiment of the present application.
The merging device at the head of the table may comprise a processor 301 and a memory 302 in which computer program instructions are stored.
Specifically, the processor 301 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of the embodiments of the present Application.
The memory may include Read Only Memory (ROM), random Access Memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical/tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software comprising computer-executable instructions and when the software is executed (e.g., by one or more processors), it is operable to perform operations described with reference to the methods according to an aspect of the present disclosure.
The processor 301 implements any one of the header merging methods in the above embodiments by reading and executing the computer program instructions stored in the memory 302.
In one example, the head-merge device may also include a communication interface 303 and a bus 310. As shown in fig. 6, the processor 301, the memory 302, and the communication interface 303 are connected via a bus 310 to complete communication therebetween.
The communication interface 303 is mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiment of the present application.
The header merging device may perform the header merging method in the embodiment of the present application, so as to implement the header merging method and apparatus described in conjunction with fig. 2 and fig. 5.
In addition, in combination with the header merging method in the foregoing embodiments, the embodiments of the present application may provide a computer storage medium to implement. The computer storage medium having computer program instructions stored thereon; the computer program instructions, when executed by a processor, implement any of the header merging methods in the above embodiments.
It is to be understood that the present application is not limited to the particular arrangements and instrumentalities described above and shown in the attached drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions or change the order between the steps after comprehending the spirit of the present application.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the present application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranets, etc.
It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
Aspects of the present disclosure are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based computer instructions which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As described above, only the specific embodiments of the present application are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present application, and these modifications or substitutions should be covered within the scope of the present application.
Claims (10)
1. A header merging method, comprising:
acquiring configuration information of each cell in a header to be processed, wherein the configuration information comprises name information, column identification information and level of the cell;
respectively determining a first mergeable area corresponding to each level cell based on the name information and the column identification information;
sequentially determining a second mergeable area of each level cell and the corresponding upper level cell based on the name information, the column identification information and the first mergeable area;
and merging the to-be-processed headers based on the second mergeable area.
2. The method according to claim 1, wherein the determining the first mergeable area corresponding to each level cell based on the name information and the column identification information respectively comprises:
respectively determining a first father cell of each cell based on the column identification information, wherein the first father cell is a previous-level cell which comprises column identification information same as the cell in the table header to be processed;
for each level cell, respectively judging whether the name information of the adjacent cells is the same;
under the condition that the name information of the adjacent cells is the same, judging whether the name information of the first father cell of the adjacent cells is the same;
determining the neighboring cells as the first mergeable area if the name information of a first parent cell of the neighboring cells is the same.
3. The method according to claim 2, wherein the sequentially determining a second mergeable area of each level cell and a corresponding upper level cell based on the name information, the column identification information, and the first mergeable area comprises:
performing simulation merging on the table head to be processed based on the first mergeable area;
respectively determining a second father cell of each cell in the simulated and merged table header to be processed based on the column identification information, wherein the second father cell is a last-level cell which comprises the same column identification information as the cell in the simulated and merged table header to be processed;
for each cell, respectively judging whether the name information of the cell is the same as the name information of the second father cell;
determining the cell and the second parent cell as the second mergeable area in a case where the name information of the cell is the same as the name information of the second parent cell.
4. The method according to any one of claims 1 to 3, wherein merging the to-be-processed headers based on the second mergeable region includes:
taking the column identification information and the level of the cell of the second mergeable area as the column identification information and the level of the merged cell respectively;
and taking the name information of any cell in the second mergeable area as the name information of the merged cell.
5. A header merger device, comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring configuration information of each cell in a header to be processed, and the configuration information comprises name information, column identification information and level of the cell;
a determining module, configured to determine, based on the name information and the column identification information, a first mergeable area corresponding to each level cell respectively;
the determining module is configured to sequentially determine, based on the name information, the column identification information, and the first mergeable area, a second mergeable area of each level of cells and a corresponding upper level of cells;
and the merging module is used for merging the to-be-processed table headers based on the second mergeable area.
6. The apparatus of claim 5, wherein the determining module is configured to determine the first mergeable area corresponding to each level cell based on the name information and the column identification information, respectively, and includes:
the determining module is configured to determine, based on the column identifier information, a first parent cell of each cell, where the first parent cell is a previous-level cell in the header of the to-be-processed table that includes the same column identifier information as the cell;
the judging module is used for respectively judging whether the name information of the adjacent cells is the same or not for each level cell;
the judging module is used for judging whether the name information of the first father cell of the adjacent cells is the same or not under the condition that the name information of the adjacent cells is the same;
the determining module is configured to determine the neighboring cells as the first mergeable area when the name information of the first parent cell of the neighboring cells is the same.
7. The apparatus of claim 6, wherein the determining module is configured to sequentially determine a second mergeable area of each level cell and the corresponding upper level cell based on the name information, the column identification information, and the first mergeable area, and includes:
the simulation module is used for simulating and combining the table head to be processed based on the first combinable region;
the determining module is configured to determine, based on the column identification information, a second parent cell of each cell in the simulated and merged table header to be processed, where the second parent cell is a previous-level cell in the simulated and merged table header to be processed that includes the same column identification information as the cell;
the judging module is used for respectively judging whether the name information of the cell is the same as that of the second father cell or not for each cell;
the determining module is configured to determine the cell and the second parent cell as the second mergeable area when the name information of the cell is the same as the name information of the second parent cell.
8. An electronic device, characterized in that the device comprises: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements the header merging method of any of claims 1-4.
9. A computer-readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the header merging method according to any one of claims 1-4.
10. A computer program product, wherein instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the header merging method of any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211183695.2A CN115510823A (en) | 2022-09-27 | 2022-09-27 | Header merging method, apparatus, device, medium, and program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211183695.2A CN115510823A (en) | 2022-09-27 | 2022-09-27 | Header merging method, apparatus, device, medium, and program product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115510823A true CN115510823A (en) | 2022-12-23 |
Family
ID=84506576
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211183695.2A Pending CN115510823A (en) | 2022-09-27 | 2022-09-27 | Header merging method, apparatus, device, medium, and program product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115510823A (en) |
-
2022
- 2022-09-27 CN CN202211183695.2A patent/CN115510823A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115222361A (en) | Business process flow transfer method, device, equipment and computer storage medium | |
CN115392955A (en) | Store duplicate removal processing method, device, equipment and storage medium | |
CN114095332A (en) | Information processing method, device, equipment and computer storage medium | |
CN111784246B (en) | Logistics path estimation method | |
CN115510823A (en) | Header merging method, apparatus, device, medium, and program product | |
CN116092066A (en) | Text recognition method, device, equipment, medium and product | |
CN115587143A (en) | Data synchronization method, device, equipment and computer readable storage medium | |
CN115393617A (en) | Simulated trademark rapid detection method and system based on multi-convolution kernel inspection | |
CN114820242A (en) | Scientific and technological enterprise innovation achievement evaluation method and device, equipment and medium thereof | |
CN114372072A (en) | Data storage method, device, equipment, computer storage medium and program product | |
CN107633246A (en) | Water system collection direction checks automatically, restorative procedure and system | |
CN114417830A (en) | Risk evaluation method, device, equipment and computer readable storage medium | |
CN110309313B (en) | Method and device for generating event transfer graph | |
CN103886562A (en) | SAR image edge detection method and system | |
CN112784903B (en) | Method, device and equipment for training target recognition model | |
CN115908998B (en) | Training method of water depth data identification model, water depth data identification method and device | |
CN110287191B (en) | Data alignment method and device, storage medium and electronic device | |
CN116186063A (en) | Data query method, device, equipment and computer storage medium | |
CN115374069A (en) | Data storage and reading method and device | |
CN116257592A (en) | Method and device for determining similar items of data items, electronic equipment and storage medium | |
CN114661604A (en) | Data generation method, device, equipment and computer storage medium | |
CN117033390A (en) | Information comparison method, device, equipment, medium and product | |
CN114663218A (en) | Interest rate determination method, device, equipment and computer storage medium | |
CN112016919B (en) | Data processing method and device for calculating total amount | |
CN116775808A (en) | Data processing method and device, equipment, medium and product thereof |
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 |