Table header-based table generation method and device, equipment and storage medium

By acquiring and updating the status and association information of the header fields, a header tree structure is constructed to generate a table template, which solves the problems of low efficiency and poor display effect in creating multi-row header tables, and achieves efficient production and consistent display of frozen status.

CN115809648BActive Publication Date: 2026-02-03CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211101748.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-09
Publication Date
2026-02-03
Estimated Expiration
2042-09-09

AI Technical Summary

Technical Problem

In existing technologies, creating tables with multiple header rows is inefficient and produces poor display results, especially since content spanning multiple header rows is easily obscured.

Method used

By obtaining the status and association information of the header fields, the first header field and the target header field are determined, a header tree structure is constructed, and the status information of the target header field is updated to freeze its state, thus generating a table template.

Benefits of technology

It improves the efficiency of creating multi-row header tables and ensures that the frozen state of headers across different rows is consistent, preventing content from being obscured and improving the display effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115809648B_ABST
    Figure CN115809648B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a table generation method and device based on multiple row headers, equipment and storage medium, belong to data processing technical field. The method comprises: obtaining multiple header fields, state information and association information, the state information is used to represent the column freezing state or column non-freezing state corresponding to the header field; determining a first header field in each of the header fields based on the state information; determining a target header field in each of the header fields based on the first header field and the association information; updating the state information of the target header field to make the column corresponding to the target header field freeze; constructing a header tree structure according to the header field and the association information; generating a table template according to the header tree structure and the state information. Embodiments of the present application can improve the table production efficiency of multiple row headers, and ensure the display effect.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to, but is not limited to, the technical field of data processing, and in particular to a table generation method and device based on multi-row table headers, equipment and a storage medium. BACKGROUND

[0002] At present, in order to make a table with the same multi-row table header, a user needs to spend a lot of time to make a table template, and the table making efficiency is low. In addition, in order to ensure the display effect, the user needs to configure each table and set a specific column of each table to a frozen state, so that the table making efficiency is low. In addition, in the table with the multi-row table header, there is a cross table header. If one column of the cross table header is a specific column, part of the content of the cross table header will be blocked after the specific column is set to a frozen state, resulting in poor display effect. SUMMARY

[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

[0004] The embodiments of the present application provide a table generation method and device based on multi-row table headers, equipment and a storage medium, which can improve the table making efficiency of the multi-row table header and ensure the display effect.

[0005] To achieve the above-mentioned purpose, the first aspect of the embodiments of the present application provides a table generation method based on multi-row table headers, which comprises: acquiring a plurality of table header fields, state information and association information, wherein the state information corresponds to the table header field one by one, the state information is used to represent the column frozen state or the column non-frozen state of the table header field, and the association information is used to represent the association relationship between any two table header fields; determining a first table header field in each table header field based on the state information, wherein the first table header field corresponds to a column frozen state; determining a target table header field in each table header field based on the first table header field and the association information, wherein the association relationship between the target table header field and the first table header field meets a preset association rule; updating the state information of the target table header field to make the target table header field correspond to a column frozen state; constructing a table header tree structure according to the table header field and the association information, wherein the table header tree structure comprises a plurality of child nodes, and the child node corresponds to the table header field one by one; and generating a table template according to the table header tree structure and the state information.

[0006] In some embodiments, the association relationship includes a subordinate relationship and a parallel relationship.

[0007] In some embodiments, the determining the target table header field in each of the table header fields based on the first table header field and the association information comprises: performing grouping processing on each of the table header fields to determine column grouping information of each of the table header fields, wherein the column grouping information of any two of the table header fields is different; performing synchronization processing on the column grouping information of each of the table header fields based on the association information, wherein the synchronization processing is used to synchronize the column grouping information of any two of the table header fields that have the subordinate relationship; performing classification processing on each of the table header fields based on the column grouping information to obtain a plurality of table header field sets; determining a target table header field set in each of the table header field sets based on the first table header field, wherein the first table header field is located in the target table header field set; and taking each of the table header fields of the target table header field set as the target table header field.

[0008] In some embodiments, the performing classification processing on each of the table header fields based on the column grouping information to obtain a plurality of table header field sets comprises: based on the column grouping information, dividing the table header fields with synchronized column grouping information into the same table header field set, and dividing the table header fields with different column grouping information into different table header field sets, to obtain a plurality of table header field sets.

[0009] In some embodiments, the generating the table template according to the table header tree structure and the state information comprises: performing traversal processing on the table header tree structure to determine table header cell information, cross-row information and cross-column information of the table header cell information, wherein the table header cell information is in one-to-one correspondence with the child nodes; and generating the table template according to the state information, the table header cell information, the cross-row information and the cross-column information.

[0010] In some embodiments, the generating the table template according to the state information, the table header cell information, the cross-row information and the cross-column information comprises: obtaining attribute information of each of the table header cell information, wherein the attribute information at least includes one of the following: width information, font bold information and alignment information; and generating the table template according to the attribute information, the state information, the table header cell information, the cross-row information and the cross-column information.

[0011] In some embodiments, after the step of generating the table template according to the table header tree structure and the state information, the method further comprises: obtaining a plurality of data arrays, wherein each of the data arrays includes at least one table data corresponding to the table header field; and inputting the data arrays into the table template to obtain a target table.

[0012] To achieve the above object, a second aspect of the embodiment of the present application provides a table generation device based on multi-line table headers, the device comprising: an acquisition unit configured to acquire a plurality of table header fields, state information and association information, wherein the state information corresponds to the table header fields one by one, the state information is used to represent a column frozen state or a column non-frozen state corresponding to the table header fields, and the association information is used to represent an association relationship between any two table header fields; a first determination unit configured to determine a first table header field in each table header field based on the state information, wherein the first table header field corresponds to a column frozen state; a second determination unit configured to determine a target table header field in each table header field based on the first table header field and the association information, wherein an association relationship between the target table header field and the first table header field satisfies a preset association rule; an update unit configured to perform update processing on state information of the target table header field, so that the target table header field corresponds to a column frozen state; a construction unit configured to construct a table header tree structure according to the table header fields and the association information, wherein the table header tree structure comprises a plurality of child nodes, and the child nodes correspond to the table header fields one by one; and a generation unit configured to generate a table template according to the table header tree structure and the state information.

[0013] To achieve the above object, a third aspect of the embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the table generation method based on multi-line table headers when executing the computer program.

[0014] To achieve the above object, a fourth aspect of the embodiment of the present application provides a storage medium, the storage medium being a computer readable storage medium, the storage medium storing a computer program, and the computer program being executed by a processor to implement the table generation method based on multi-line table headers.

[0015] The table generation method, device and equipment based on multiple table headers and the storage medium provided in the application, the embodiments of the application include: obtaining multiple table header fields, state information and association information, wherein the state information corresponds to the table header fields one by one, the state information is used to represent a column frozen state or a column non-frozen state corresponding to the table header fields, and the association information is used to represent an association relationship between any two table header fields; determining a first table header field in each table header field based on the state information, wherein the first table header field corresponds to the column frozen state; determining a target table header field in each table header field based on the first table header field and the association information, wherein the association relationship between the target table header field and the first table header field meets a preset association rule; performing update processing on the state information of the target table header field to make the target table header field correspond to the column frozen state; constructing a table header tree structure according to the table header fields and the association information, wherein the table header tree structure includes multiple child nodes, and the child nodes correspond to the table header fields one by one; and generating a table template according to the table header tree structure and the state information. According to the scheme provided in the embodiments of the application, the table header field corresponding to the column frozen state is screened out through the state information of the table header field, and is used as the first table header field, then the target table header field meeting the association rule is screened out in combination of the first table header field and the association information, then the state information of each target table header field is updated, the table header tree structure is constructed first, and then the table template is generated by using the table header tree structure and the state information, so that the table template has high production efficiency, and the column frozen state of the table template is configured, thereby improving the table production efficiency of the multiple table headers, and in addition, in the table template of the multiple table headers, the frozen states of the columns in the cross table header can be ensured to be the same, the content of the cross table header is prevented from being shielded, and the display effect is ensured.

[0016] Other features and advantages of the application will be set forth in the following description, and in part will become apparent to those skilled in the art from the description, or can be learned by practice of the application. The objects and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings. BRIEF DESCRIPTION OF DRAWINGS

[0017] The accompanying drawings, which are included to provide a further understanding of the application and constitute a part of this specification, illustrate embodiments of the application and together with the description help to explain the application. The drawings are not intended to limit the scope of the application in any way.

[0018] Figure 1 is a flowchart of a table generation method based on multiple table headers provided by an embodiment of the application;

[0019] Figure 2 is a flowchart of a method for determining a target table header field provided by another embodiment of the application;

[0020] Figure 3 is a flow chart of a method for dividing a table header field set according to another embodiment of the present application;

[0021] Figure 4 is a flow chart of a method for traversing processing according to another embodiment of the present application;

[0022] Figure 5 is a flow chart of a method for generating a table template according to another embodiment of the present application;

[0023] Figure 6 is a flow chart of a method for obtaining a target table according to another embodiment of the present application;

[0024] Figure 7 is a schematic diagram of a table tree structure according to another embodiment of the present application;

[0025] Figure 8 is a schematic diagram of a table template with a multi-line table header according to another embodiment of the present application;

[0026] Figure 9 is another schematic diagram of a table template with a multi-line table header according to another embodiment of the present application;

[0027] Figure 10 is a structural schematic diagram of a table generating apparatus based on a multi-line table header according to another embodiment of the present application;

[0028] Figure 11 is a hardware structural schematic diagram of an electronic device according to another embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical scheme and advantages of the present application more clear, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.

[0030] In the description of the present application, the meaning of several is one or more, the meaning of multiple is two or more, greater than, less than, more than, etc. are understood as not including the number, above, below, within, etc. are understood as including the number.

[0031] It should be noted that although the functional modules are divided in the device schematic diagram, and the logical order is shown in the flow chart, in some cases, the steps shown or described can be executed in a different order from the module division in the device or the order in the flow chart. The terms "first", "second", etc. in the specification, claims or above drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.

[0032] Currently, in order to make a table with multiple rows of the same style table header, a user needs to spend a lot of time making a table template, and the table making efficiency is low, and in order to ensure the display effect, the user needs to configure each table, and set a specific column of each table to a frozen state, so the table making efficiency is low; in addition, in the table with multiple rows of table header, there is a cross table header, if one column of the cross table header is a specific column, after the specific column is set to a frozen state, part of the content of the cross table header will be blocked, resulting in poor display effect.

[0033] In view of the problems of low table making efficiency and poor display effect of the table with multiple rows of table header, the application provides a table generation method, device and equipment based on multiple rows of table header and a storage medium, and the method comprises the following steps: obtaining multiple table header fields, state information and association information, wherein the state information corresponds to the table header field one by one, the state information is used to represent the column frozen state or column non-frozen state of the table header field, and the association information is used to represent the association relationship between any two table header fields; determining a first table header field in each table header field based on the state information, wherein the first table header field corresponds to a column frozen state; determining a target table header field in each table header field based on the first table header field and the association information, wherein the association relationship between the target table header field and the first table header field meets a preset association rule; updating the state information of the target table header field to make the target table header field correspond to a column frozen state; constructing a table header tree structure according to the table header field and the association information, wherein the table header tree structure comprises multiple child nodes, and the child node corresponds to the table header field one by one; and generating a table template according to the table header tree structure and the state information. According to the scheme provided by the embodiment of the application, the table header field corresponding to the column frozen state is screened out through the state information of the table header field, and is used as the first table header field, then the target table header field meeting the association rule is screened out by combining the first table header field and the association information, then the state information of each target table header field is updated, the table header tree structure is constructed first, and then the table template is generated by using the table header tree structure and the state information, so the table making efficiency of the table template is high, and the column frozen state of the table template has been configured, thereby improving the table making efficiency of the table with multiple rows of table header, and in the table template with multiple rows of table header, the frozen states of the columns in the cross table header can be ensured to be the same, so as to avoid that part of the content of the cross table header is blocked, and ensure the display effect.

[0034] The table generation method, device and equipment based on multiple rows of table header provided by the embodiments of the application are described in detail through the following embodiments.

[0035] The table generation method based on the multi-row table header provided in the embodiments of the present application relates to the technical field of data processing. The table generation method based on the multi-row table header provided in the embodiments of the present application can be applied to a terminal, can also be applied to a server end, and can also be software running in the terminal or the server end. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like; the server end can be configured as a stand-alone physical server, can also be configured as a server cluster or a distributed system formed by multiple physical servers, and can also be configured as a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and big data and artificial intelligence platforms; and the software can be an application that implements the table generation method based on the multi-row table header, but is not limited to the above forms.

[0036] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment, in which tasks are performed by remote processing devices connected by a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0037] It should be noted that in each specific embodiment of the present application, when relevant processing needs to be performed on data related to the identity or characteristics of the user, such as user information, user behavior data, user history data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with relevant laws, regulations, and standards in relevant countries and regions. In addition, when the embodiments of the present application need to obtain sensitive personal information of the user, the separate permission or separate consent of the user will be obtained through a pop-up window or a jump to a confirmation page, and after obtaining the separate permission or separate consent of the user, the necessary user-related data for enabling the embodiments of the present application to normally operate will be obtained.

[0038] The embodiments of the present application will be further described below with reference to the accompanying drawings.

[0039] As Figure 1 shown, Figure 1is a flow chart of a table generation method based on a multi-row table header provided by an embodiment of the present application. The table generation method based on the multi-row table header includes but is not limited to the following steps:

[0040] In step S110, a plurality of table header fields, state information and association information are acquired, wherein the state information corresponds to the table header fields one by one, the state information is used to represent a column frozen state or a column non-frozen state corresponding to the table header fields, and the association information is used to represent an association relationship between any two table header fields.

[0041] In step S120, a first table header field is determined in each table header field based on the state information, wherein the first table header field corresponds to the column frozen state.

[0042] In step S130, a target table header field is determined in each table header field based on the first table header field and the association information, wherein an association relationship between the target table header field and the first table header field satisfies a preset association rule.

[0043] In step S140, the state information of the target table header field is updated to make the target table header field correspond to the column frozen state.

[0044] In step S150, a table header tree structure is constructed according to the table header fields and the association information, wherein the table header tree structure includes a plurality of child nodes, and the child nodes correspond to the table header fields one by one.

[0045] In step S160, a table template is generated according to the table header tree structure and the state information.

[0046] It can be understood that the table header information in the table template needs to be acquired first, and the table header information includes but is not limited to: table header fields, state information and relationship information, the table header field refers to a field name, the state information is used to determine whether the column where the table header field is located is in a frozen state in the table template, if yes, the column corresponding to the table header field is in a frozen state, otherwise, the column corresponding to the table header field is in a non-frozen state, then the table header field corresponding to the column in a frozen state is defined as a first table header field, and the table header field satisfying the association rule with the first table header field is determined as a target table header field in combination with the association information, and the state information of the target table header field is updated, after the table template is generated, it is realized that when a column in the cross table header is in a frozen state, other columns in the cross table header are set to be in a frozen state; the table header tree structure is constructed first, and then the table module is generated, the generation efficiency of the table template is high, and the structure of the table template is accurate; based on this, the table header field corresponding to the column in a frozen state is screened out through the state information of the table header field, and is used as the first table header field, then the target table header field satisfying the association rule is screened out in combination with the first table header field and the association information, and then the state information of each target table header field is updated, the table header tree structure is constructed first, and then the table template is generated by using the table header tree structure and the state information, the production efficiency of the table template is high, and the column frozen state of the table template has been configured, thereby improving the table production efficiency of the multi-row table header, in addition, in the table template of the multi-row table header, the frozen states of the columns in the cross table header are the same, avoiding that part of the content of the cross table header is blocked, and ensuring the display effect.

[0047] It should be noted that in the table header tree structure, the association relationship between each child node is the same as the association relationship between each table header field.

[0048] It is worth noting that in the table, when a specific column is in a frozen state, the cell of the specific column is fixed on the screen when the table is moved left and right, and the data of the specific column is always displayed on the screen, facilitating data comparison and data analysis.

[0049] In addition, in an embodiment, the association relationship includes a subordinate relationship and a parallel relationship.

[0050] It can be understood that in the table header field, the association relationship is used to represent the hierarchical relationship between the table header fields, for example, the table header field A is located in the upper layer of the table header field B, that is, the table header field A has a subordinate relationship with the table header field B, and the table header field C and the table header field D are located in the same level, that is, the table header field C and the table header field D have a parallel relationship; similarly, in the table header tree structure, the association relationship is also used to represent the hierarchical relationship between the child nodes.

[0051] In addition, with reference to Figure 2 In an embodiment, Figure 1The step S130 in the embodiment shown includes but is not limited to the following steps:

[0052] The step S210 includes grouping each table header field to determine column grouping information of each table header field, wherein the column grouping information of any two table header fields is different;

[0053] The step S220 includes synchronizing the column grouping information of each table header field based on the association information, wherein the synchronization is used to synchronize the column grouping information of any two table header fields having a subordinate relationship;

[0054] The step S230 includes classifying each table header field based on the column grouping information to obtain a plurality of table header field sets;

[0055] The step S240 includes determining a target table header field set based on the first table header field in each table header field set, wherein the first table header field is located in the target table header field set;

[0056] The step S250 includes taking each table header field of the target table header field set as a target table header field.

[0057] It can be understood that the column grouping information of each table header field is first synchronized, the column grouping information of the table header fields having a subordinate relationship is synchronized and divided into the same table header field set; after determining all table header field sets, the table header fields are layered according to the hierarchical relationship, the topmost table header field corresponds to the table header field set one by one, then the target table header field set containing the first table header field is screened out, and then the frozen configuration of all table header fields of the target table header field set is synchronized, so that when any column of the cross table header is in a frozen state, each column of each cross table header can be ensured to be in a frozen state, and the partial content of the cross table header is prevented from being blocked.

[0058] It should be noted that since the table header fields are arranged in a certain order, the column grouping information of each table header field needs to be determined according to the arrangement order and synchronized, for example, the group number of the column grouping is sequentially increased from front to back, then each table header field is traversed, the current table header field is analyzed with each table header field arranged behind, and when the two table header fields have a subordinate relationship, the column grouping information of the table header field arranged behind is updated to the column grouping information of the current table header field.

[0059] In addition, referring to Figure 3 In an embodiment, Figure 2 The step S230 in the embodiment shown includes but is not limited to the following steps:

[0060] In step S310, based on the column grouping information, table header fields of any two column grouping information synchronized are divided into the same table header field set, and table header fields of any two column grouping information unsynchronized are divided into different table header field sets, to obtain a plurality of table header field sets.

[0061] It can be understood that the column grouping information is used to represent the table header field set in which the table header field is located, and when classified processing is performed according to the column grouping information, the table header field can be effectively divided into the corresponding table header field set.

[0062] In addition, referring to Figure 4 In an embodiment, Figure 1 The step S160 in the embodiment shown includes but is not limited to the following steps:

[0063] In step S410, the table header tree structure is traversed to determine the table header cell information, the cross-row information and the cross-column information of the table header cell information, wherein the table header cell information is in one-to-one correspondence with the child node.

[0064] In step S420, the table template is generated according to the state information, the table header cell information, the cross-row information and the cross-column information.

[0065] It can be understood that traversing the table header tree structure is equivalent to flattening the table header tree structure, sequentially determining the table header cell information through each child node, and determining the cross-row information and the cross-column information corresponding to the table header cell through the association relationship of each child node, and then generating the table template of the multi-row table header in combination with the state information, which can ensure that the freeze states of each column in the cross-list table header are the same, avoid that part of the content of the cross-list table header is shielded, and ensure the display effect.

[0066] It should be noted that if the number of the subsidiary nodes of the child node is less than or equal to 1, it indicates that the child node corresponds to a non-cross-list table header; if the number of the subsidiary nodes of the child node is greater than 1, it indicates that the child node corresponds to a cross-list table header, and the cross-column number of the cross-list table header is equal to the sum of the cross-row numbers of the subsidiary nodes, for example, the child node A has three subsidiary nodes, the sum of the cross-row numbers of the three subsidiary nodes is 4, and the cross-row number of the child node A is 4, i.e., the child node A crosses 4 rows in total; in addition, if the child node has subsidiary nodes, it indicates that the child node corresponds to a non-cross-row table header; if the child node has no subsidiary nodes, the cross-row value of the child node needs to be calculated, which is equal to the difference between the total number of levels of the table header tree structure and the layer number of the child node plus one, when the cross-row value is equal to 1, it indicates that the child node corresponds to a non-cross-row table header, and when the cross-row value is greater than 1, it indicates that the child node corresponds to a cross-row table header, and the cross-row number of the cross-row table header is equal to the cross-row value, for example, in the table header tree structure, there are four levels in total, the child node B is located at the second level, and the child node B has no subsidiary nodes, and the cross-row value of the child node B is calculated to be 3, i.e., the child node B crosses 3 columns in total.

[0067] As Figure 5 shown in an embodiment, Figure 4 The step S420 in the embodiment shown, including but not limited to the following steps:

[0068] Step S510, get the attribute information of each table header cell information, wherein the attribute information includes at least one of the following: width information, font bold information and alignment information;

[0069] Step S520, according to the attribute information, state information, table header cell information, cross row information and cross column information, generate table template.

[0070] It can be understood that the table properties of the table template with multiple rows of table headers are set through the attribute information input by the user, which improves the efficiency. Specifically, the width value of each cell in the table can be set by using the width information, the font bold state of each cell in the table can be set by using the font bold information, and the alignment state of each cell in the table can be set by using the alignment information. The alignment state includes but is not limited to left alignment, right alignment and center alignment.

[0071] As Figure 6 shown in an embodiment, Figure 1 The step S160 in the embodiment shown, further including but not limited to the following steps:

[0072] Step S610, get a plurality of data arrays, wherein each data array includes at least one table data, and the table data corresponds to the table header field;

[0073] Step S610, input the data array into the table template to obtain the target table.

[0074] It can be understood that a plurality of data arrays input by the user are obtained, and then each data array is input into the table template with multiple rows of table headers which has been generated to obtain the target table. For any one data array, since the table data corresponds to the table header field, the target table header field can be determined through the target table data, and then the target cell in the new row in the table template is determined. In addition, the data array contains at least one table data, which means that the number of table data can be less than the number of table headers in the table template. When the number of table data is less than the number of table headers in the table template, the target table data is filled into the target cell, and there are blank cells without data filled in the new row.

[0075] In the specific practice, after the target table is generated, if the length of the table is too long, the table can be set to a mode of loading data in a rolling manner, only the data in the display area is loaded, and the data processing efficiency can be improved. In addition, according to the length of the table, after the table is loaded to the bottom of the table, a prompt that the loading is completed can be set.

[0076] In addition, referring to Figure 7 , Figure 7 is a schematic diagram of a table tree structure provided by another embodiment of the present application.

[0077] It can be understood that, in order to ensure the integrity of the table tree structure, a root node is set, and the child nodes connected to the root node are located at the first level, and therefore, the child node A, the child node B and the child node C are located at the first level; the child node A has two subsidiary nodes, which are the child node D and the child node E, and the child node C has two subsidiary nodes, which are the child node F and the child node G; the subsidiary nodes of the child nodes at the first level are located at the second level, and therefore, the child node D, the child node E, the child node F and the child node G are located at the second level; the child node E has two subsidiary nodes, which are the child node H and the child node I, and the subsidiary nodes of the child nodes at the second level are located at the third level, and therefore, the child node H and the child node I are located at the third level.

[0078] It should be noted that, in the table header tree structure, the association relationship between each child node is the same as the association relationship between each table header field, and therefore, the connection relationship between each child node is determined through the association relationship.

[0079] In addition, referring to Figure 8 , Figure 8 is a schematic diagram of a table template with a multi-row table header provided by another embodiment of the present application.

[0080] It can be understood that, through the table header tree structure as shown in Figure 7 , the table template with a multi-row table header as shown in Figure 8 is generated, in which the table header field A corresponds to the child node A, the table header field B corresponds to the child node B, the table header field C corresponds to the child node C, the table header field D corresponds to the child node D, the table header field E corresponds to the child node E, the table header field F corresponds to the child node F, the table header field G corresponds to the child node G, the table header field H corresponds to the child node H, and the table header field I corresponds to the child node I.

[0081] It should be noted that the table header field B, the table header field C and the table header field E are cross table header fields, the cross column quantity of the table header field B is 3, the cross column quantity of the table header field C is 2, and the cross column quantity of the table header field E is 2; in addition, the table header field A, the table header field D, the table header field F and the table header field G are cross row table header fields, the cross row quantity of the table header field A is 3, the cross row quantity of the table header field D is 2, the cross row quantity of the table header field F is 2, and the cross row quantity of the table header field G is 2.

[0082] In addition, referring to Figure 9 , Figure 9 is another schematic view of a table template with multi-row table headers provided by another embodiment of the present application.

[0083] It can be understood that, in the table template with multi-row table headers as shown in Figure 8 , since the table header field B, the table header field D, the table header field E, the table header field H and the table header field I are in the same table header field set, if any one of the table header field B, the table header field D, the table header field E, the table header field H and the table header field I corresponds to a column frozen state, each table header field in the table header field set corresponds to a column frozen state, and thus, when moving left and right, the table header field B, the table header field D, the table header field E, the table header field H and the table header field I are fixed on the screen, as shown in Figure 9 , the contents of the table header field B and the table header field E, which are cross table header fields, are not blocked, and the display effect is ensured, and the data corresponding to the above-mentioned fields is always displayed on the screen, facilitating data comparison and data analysis.

[0084] In addition, referring to Figure 10 , the present application further provides a table generation device 1000 based on multi-row table headers, comprising:

[0085] An acquisition unit 1010 is configured to acquire a plurality of table header fields, state information and association information, wherein the state information corresponds to the table header fields one by one, the state information is used to represent a column frozen state or a column non-frozen state corresponding to the table header fields, and the association information is used to represent an association relationship between any two table header fields;

[0086] A first determination unit 1020 is configured to determine a first table header field in the table header fields based on the state information, wherein the first table header field corresponds to a column frozen state;

[0087] A second determination unit 1030 is configured to determine a target table header field in the table header fields based on the first table header field and the association information, wherein an association relationship between the target table header field and the first table header field satisfies a preset association rule;

[0088] The updating unit 1040 is configured to perform updating processing on the state information of the target table header field, so that the target table header field corresponds to the column freeze state.

[0089] The constructing unit 1050 is configured to construct a table header tree structure according to the table header field and the association information, where the table header tree structure includes a plurality of child nodes, and the child nodes correspond to the table header field one by one.

[0090] The generating unit 1060 is configured to generate a table template according to the table header tree structure and the state information.

[0091] It can be understood that the specific embodiments of the table generation device 1000 based on the multi-row table header are basically the same as the specific embodiments of the table generation method based on the multi-row table header described above, and will not be repeated here. Based on this, the table header field corresponding to the column freeze state is filtered out through the state information of the table header field, and is used as the first table header field. Then, the target table header field satisfying the association rule is filtered out in combination with the first table header field and the association information. Then, the state information of each target table header field is updated, the table header tree structure is constructed first, and then the table template is generated by using the table header tree structure and the state information. The table template has high production efficiency, and the column freeze state of the table template has been configured. Therefore, the table production efficiency of the multi-row table header is improved. In addition, in the table template of the multi-row table header, the freeze states of the columns in the cross table header are ensured to be the same, the content of the cross table header is prevented from being blocked, and the display effect is ensured.

[0092] Further, the second determining unit includes but is not limited to a grouping unit, a synchronization unit, a classification unit, a set determining unit, and a defining unit (not shown in the figure).

[0093] The grouping unit is configured to perform grouping processing on each of the table header fields to determine column grouping information of each of the table header fields, where the column grouping information of any two of the table header fields is different.

[0094] The synchronization unit is configured to perform synchronization processing on the column grouping information of each of the table header fields based on the association information, where the synchronization processing is used to synchronize the column grouping information of any two of the table header fields having the subordinate relationship.

[0095] The classification unit is configured to perform classification processing on each of the table header fields based on the column grouping information to obtain a plurality of table header field sets.

[0096] The set determining unit is configured to determine a target table header field set in each of the table header field sets based on the first table header field, where the first table header field is located in the target table header field set.

[0097] A definition unit is configured to define each table header field of the target table header field set as a target table header field.

[0098] Further, the classification unit includes but is not limited to a division unit (not shown in the figure).

[0099] The division unit is configured to divide, based on the column grouping information, table header fields with synchronized column grouping information into the same table header field set, and divide table header fields with unsynchronized column grouping information into different table header field sets, to obtain a plurality of table header field sets.

[0100] Further, the generation unit includes but is not limited to a traversal unit, a first sub-generation unit (not shown in the figure)

[0101] The traversal unit is configured to perform traversal processing on the table header tree structure, and determine table header cell information, cross-row information and cross-column information of the table header cell information, wherein the table header cell information is in one-to-one correspondence with the sub-nodes.

[0102] The first sub-generation unit is configured to generate a table template according to the state information, the table header cell information, the cross-row information and the cross-column information.

[0103] Further, the first sub-generation unit includes but is not limited to an attribute acquisition unit, a second sub-generation unit (not shown in the figure)

[0104] The attribute acquisition unit is configured to acquire attribute information of each table header cell information, wherein the attribute information at least includes one of the following: width information, font bold information and alignment information.

[0105] The second sub-generation unit is configured to generate a table template according to the attribute information, the state information, the table header cell information, the cross-row information and the cross-column information.

[0106] Further, the table generation device based on the multi-row table header includes but is not limited to a data acquisition unit, a data input unit (not shown in the figure)

[0107] The data acquisition unit is configured to acquire a plurality of data arrays, wherein each data array includes at least one table data corresponding to the table header field.

[0108] The data input unit is configured to input the data array into the table template to obtain a target table.

[0109] In addition, with reference to Figure 11 , Figure 11 The hardware structure of the electronic device 1100 of another embodiment is illustrated, and the electronic device 1100 includes:

[0110] The processor 1101 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, etc., for executing relevant programs to implement the technical solutions provided by the embodiments of the present application.

[0111] The memory 1102 can be implemented by a ROM (Read Only Memory), a static storage device, a dynamic storage device, or a RAM (Random Access Memory), etc. The memory 1102 can store an operating system and other application programs. When the technical solutions provided by the embodiments of the present application are implemented by software or firmware, relevant program codes are stored in the memory 1102 and are called and executed by the processor 1101 to implement the table generation method based on multiple row headers provided by the embodiments of the present application, for example, to execute the method steps S110 to S160 in the method in the above description, Figure 1 the method steps S210 to S250 in the method in the above description, Figure 2 the method step S310 in the method in the above description, Figure 3 the method steps S410 to S420 in the method in the above description, Figure 4 the method steps S510 to S520 in the method in the above description, Figure 5 the method steps S610 to S620 in the method in the above description. Figure 6 The input / output interface 1103 is configured to implement information input and output.

[0112] The communication interface 1104 is configured to implement the communication interaction between the device and other devices. The communication can be implemented by a wired manner (for example, a USB, a network cable, etc.) or a wireless manner (for example, a mobile network, WIFI, Bluetooth, etc.).

[0113] The bus 1105 is configured to transmit information between various components (for example, the processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104) of the device.

[0114] The processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104 are connected to each other by the bus 1105 to realize the communication connection between them in the device.

[0115]

[0116] ​This application embodiment also provides a storage medium, which is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, which can be executed by one or more processors to implement the above-described table generation method based on multiple row headers. For example, it executes the above-described... Figure 1 Method steps S110 to S160, Figure 2 Method steps S210 to S250 Figure 3 Method steps S310, Figure 4 Method steps S410 to S420 in the text Figure 5 Method steps S510 to S520 in the text Figure 6 Method steps S610 to S620.

[0117] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0118] The method, device and equipment for generating a table based on multiple table headers and the storage medium provided by the embodiments of the present application obtain multiple table header fields, state information and association information, wherein the state information corresponds to the table header fields one by one, the state information is used to represent the column frozen state or the column non-frozen state corresponding to the table header fields, and the association information is used to represent the association relationship between any two table header fields; the first table header field is determined in each table header field based on the state information, wherein the first table header field corresponds to the column frozen state; the target table header field is determined in each table header field based on the first table header field and the association information, wherein the association relationship between the target table header field and the first table header field satisfies the preset association rule; the state information of the target table header field is updated to make the target table header field correspond to the column frozen state; the table header tree structure is constructed according to the table header fields and the association information, wherein the table header tree structure includes multiple child nodes, and the child nodes correspond to the table header fields one by one; the table template is generated according to the table header tree structure and the state information; based on this, the table header field corresponding to the column frozen state is screened out through the state information of the table header field, and is used as the first table header field, then the target table header field satisfying the association rule is screened out in combination with the first table header field and the association information, then the state information of each target table header field is updated, the table header tree structure is constructed first, and then the table template is generated by using the table header tree structure and the state information, so that the table template has high manufacturing efficiency, and the column frozen state of the table template has been configured, thereby improving the table manufacturing efficiency of the multiple table headers, in addition, in the table template of the multiple table headers, the frozen states of the columns in the cross table header can be ensured to be the same, the content of the cross table header is prevented from being shielded, and the display effect is ensured.

[0119] The embodiments described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0120] Those skilled in the art can understand that, Figures 1 to 6 The technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and can include more or fewer steps, or combine certain steps, or different steps.

[0121] The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separate, that is, can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0122] Those skilled in the art can understand that all or some of the steps in the method disclosed above, the function modules / units in the system and the device can be implemented as software, firmware, hardware or appropriate combination thereof.

[0123] The terms "first", "second", "third", "fourth" and the like in the description of the application and in the claims, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of these terms herein is to be construed to cover a general order and / or structure unless otherwise indicated. Furthermore, the terms "comprise", "comprising", "has", "having", "includes", "including", "contain", "containing" or any other similar forms are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises, has, includes, contains items or components does not include items or components not explicitly recited. The terms "a" or "an", as used herein in the detailed description and in the claims, mean "one or more" or "at least one", unless otherwise indicated.

[0124] It should be understood that, in the present application, "at least one" means one or more, and "multiple" means two or more. "And / or" is used to describe the relationship between associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that there are three cases: only A, only B, and A and B at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can mean a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be singular or plural.

[0125] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the above units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed objects can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.

[0126] The units described as separate components above can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0127] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0128] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application, essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes multiple instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program storage media.

[0129] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, and the scope of the rights of the embodiments of the present application is not limited thereto. Any modifications, equivalent replacements and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the rights of the embodiments of the present application.

Claims

1. A method for generating tables based on multi-row headers, characterized in that, The method includes: Obtain multiple header fields, status information, and association information, wherein the status information corresponds one-to-one with the header fields, the status information is used to characterize the frozen or unfrozen state of the column corresponding to the header field, and the association information is used to characterize the association relationship between any two header fields, the association relationship including a subordinate relationship; Based on the status information, a first header field is determined in each of the header fields, wherein the first header field corresponds to the column's frozen status; Each of the header fields is grouped to determine the column grouping information of each header field, wherein the column grouping information of any two header fields is different; Based on the association information, the column grouping information of each of the header fields is synchronized, wherein the synchronization process is used to synchronize the column grouping information of any two header fields that have the subordinate relationship. Based on the column grouping information, each of the header fields is classified to obtain multiple header field sets; A target header field set is determined based on the first header field in each of the header field sets, wherein the first header field is located in the target header field set; Each header field of the target header field set is used as the target header field, wherein the association between the target header field and the first header field satisfies a preset association rule; The status information of the target header field is updated to freeze the column corresponding to the target header field. Based on the header fields and the associated information, a header tree structure is constructed, wherein the header tree structure includes multiple child nodes, and each child node corresponds one-to-one with a header field; The header tree structure is traversed to determine the header cell information, the row span information, and the column span information of the header cell information, wherein the header cell information corresponds one-to-one with the child nodes; Obtain the attribute information of each of the header cells, wherein the attribute information includes at least one of the following: width information, font bolding information, and alignment information; A table template is generated based on the attribute information, the status information, the header cell information, the row span information, and the column span information.

2. The method according to claim 1, characterized in that, The relationships also include parallel relationships.

3. The method according to claim 1, characterized in that, The classification of each header field based on the column grouping information yields multiple header field sets, including: Based on the column grouping information, header fields of any two columns with synchronized grouping information are assigned to the same header field set, and header fields of any two columns with unsynchronized grouping information are assigned to different header field sets, so as to obtain multiple header field sets.

4. The method according to claim 1, characterized in that, The step of traversing the header tree structure to determine the header cell information, the row span information, and the column span information of the header cell information includes: Flatten the header tree structure, determine the header cell information sequentially through each of the child nodes, and determine the row spanning and column spanning information corresponding to the header cell information through the association relationship of each of the child nodes.

5. The method according to claim 1, characterized in that, After the step of generating a table template based on the header tree structure and the status information, the method further includes: Obtain multiple data arrays, wherein each data array includes at least one table data, and the table data corresponds to the table header field; Input the data array into the table template to obtain the target table.

6. A table generation device based on multi-row headers, characterized in that, The apparatus is used to implement the table generation method based on multiple header rows as described in any one of claims 1 to 5, the apparatus comprising: The acquisition unit is used to acquire multiple header fields, status information and association information, wherein the status information corresponds one-to-one with the header fields, the status information is used to characterize the frozen state or unfrozen state of the column corresponding to the header field, and the association information is used to characterize the association relationship between any two header fields. The first determining unit is used to determine a first header field in each of the header fields based on the status information, wherein the first header field corresponds to the column freeze status; The second determining unit is used to determine a target header field among the various header fields based on the first header field and the association information, wherein the association relationship between the target header field and the first header field satisfies a preset association rule; The update unit is used to update the status information of the target header field so that the column corresponding to the target header field is frozen. A construction unit is used to construct a header tree structure based on the header fields and the associated information, wherein the header tree structure includes multiple child nodes, and each child node corresponds one-to-one with a header field; The generation unit is used to generate a table template based on the header tree structure and the status information.

7. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the table generation method based on a multi-row header as described in any one of claims 1 to 5.

8. A storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the table generation method based on a multi-row header as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data table generation method and apparatus, storage medium and electronic apparatus

    CN107766309A

  • Data center mobile inspection platform

    CN110689149A