Table processing method and device, equipment and storage medium
By using group identifiers in table files to achieve sharing and reuse of cell data, the problem of waste of storage space caused by duplicate data in traditional table files is solved, and more efficient data storage and processing is achieved.
Patent Information
- Application Number
- CN202411861012.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-11
AI Technical Summary
Each cell in a traditional table file stores data content independently, resulting in a large amount of duplicate data increasing the file volume and wasting storage space.
Data sharing and multiplexing are achieved by writing group identifiers in cells. In response to the write operation, the target data is matched with the shared data of the same cell group, and if it matches, the group identity is written, otherwise a new cell group is formed and the group identity is assigned.
Reduces redundancy in the data in the table, significantly saves storage space, and simplifies data maintenance and processing operations.
Smart Images

Figure CN119807144A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a table processing method, device, equipment and storage medium. Background Art
[0002] In modern information processing systems, effective storage and management of data are crucial. Tables, as an efficient and intuitive way to organize information, are widely used in various software applications.
[0003] In traditional spreadsheet files, each cell stores its data content independently, including the cell content to be displayed and the cell format data (such as font, font size, color, alignment, border attributes, etc.). In other words, there are as many copies of cell content and format data as there are cells in the table. However, in actual applications, there are often cases where there is a large amount of duplicate data in the table, especially when the amount of data in the table is large. A large amount of duplicate data will increase the size of the spreadsheet file, thereby increasing the storage requirements of the spreadsheet file, and further affecting the overall performance and response speed of the spreadsheet processing software.
[0004] Therefore, as the amount of data grows, data storage and maintenance becomes a key issue that requires attention. Summary of the invention
[0005] The present application provides a table processing method, device, equipment and storage medium to solve the technical problem that traditional table files use a storage mode in which each cell independently stores its data content, which easily leads to a significant increase in the storage requirements of the table due to the presence of a large amount of duplicate data in the table, thereby significantly wasting storage space.
[0006] In a first aspect, the present application provides a table processing method, the method comprising:
[0007] In response to a write operation for target data in a cell, matching the target data with shared data of an existing group of cells of the same type, wherein the group of cells of the same type is provided with a group identifier, and the cells in the group of cells of the same type have the same shared data;
[0008] In the case where it is determined that there is target shared data matching the target data, writing a group identifier corresponding to the target shared data into the cell; or,
[0009] When it is determined that there is no shared data matching the target data, the cells are formed into a similar cell group, and the shared data of the currently formed similar cell group is determined according to the target data, and a corresponding group identifier is assigned to the currently formed similar cell group, and the currently assigned group identifier is written in the cell.
[0010] In a possible implementation manner, before responding to the write operation for the target data in the cell, the method further includes:
[0011] The original table file of the table is loaded into the memory, and the format of the original table file is converted in the following manner to obtain a table file after the format conversion:
[0012] Determine a similar cell group from the table represented by the original table file, determine shared data of cells in the similar cell group, and assign a corresponding group identifier to the shared data;
[0013] The corresponding group identifier is written into the cells in the same cell group, and the designated data originally stored in the cells in the same cell group is deleted, wherein the designated data refers to data that is the same as the corresponding shared data.
[0014] In a possible implementation, it further includes:
[0015] In response to the table storage instruction, storing the table file after format conversion to a designated storage medium;
[0016] The table file after format conversion includes the correspondence between the same type of cell groups, shared data and group identifiers, and the corresponding group identifiers are written into the cells in the table represented by the table file after format conversion.
[0017] In a possible implementation, it further includes:
[0018] Reading a table file, and when a group identifier is written in a cell read, searching for shared data corresponding to the group identifier from the table file after the format conversion;
[0019] The found shared data is used to display the read cells.
[0020] In a possible implementation, the method further includes:
[0021] Read the table file and render the table view of the table;
[0022] In the table view, at least two cells that meet a set condition are merged and displayed;
[0023] The setting condition is used to indicate that at least two cells can form a connected rectangular area and have the same group identifier.
[0024] In a possible implementation, the method further includes:
[0025] The description information of at least two cells that are merged and displayed is displayed in the table view.
[0026] In a possible implementation manner, before rendering to obtain the table view of the table, the method further includes:
[0027] In response to a triggering operation of the automatic classification and display data function of the table, the rendering to obtain the table view of the table and subsequent steps are performed.
[0028] In a possible implementation, it further includes:
[0029] In response to a data processing instruction for a target cell, when it is determined that a group identifier is written in the target cell, determining shared data corresponding to the group identifier;
[0030] The data processing instructions are executed using the shared data.
[0031] In a possible implementation, the data processing instruction includes: a screening instruction, and the using the shared data to execute the data processing instruction includes:
[0032] Determining a screening condition corresponding to the screening instruction;
[0033] Cells having shared data that meet the screening condition are determined from the target cells as screened cells.
[0034] In a possible implementation manner, determining a group of cells of the same type from the table represented by the original table file includes:
[0035] Determine the criteria for determining cells of the same type;
[0036] Traversing each cell in the table represented by the original table file, determining data of a target type in each of the cells, wherein the target type refers to a sharing type indicated by the determination condition of the same type of cells;
[0037] According to the target type of data in each of the cells, the cells in the table are divided into a plurality of similar cell groups;
[0038] The cells in the same cell group have the same target type of data; the cells in different cell groups have different target type of data;
[0039] The determining of shared data of cells in the same cell group includes:
[0040] The data of the target type in any cell of the same type of cells is determined as shared data of the cells in the same type of cell group.
[0041] In a possible implementation manner, determining the data of the target type in each of the cells includes:
[0042] In a case where the sharing type indicated by the determination condition of the same type of cells is content sharing, determining the cell content in each of the cells as the data of the target type in the cell;
[0043] In the case where the sharing type indicated by the determination condition of the same type of cells is format sharing, determining the format data of each of the cells as data of the target type in the cell;
[0044] In the case that the sharing type indicated by the same type cell determination condition is content and format sharing, the cell content and format data thereof in each of the cells are determined as target type data in the cell.
[0045] In a possible implementation manner, determining the shared data of the currently formed group of cells of the same type according to the target data includes:
[0046] Get the similar cell determination conditions corresponding to the existing similar cell groups;
[0047] The data in the target data that matches the sharing type indicated by the same type cell determination condition is determined as the shared data of the currently formed same type cell group.
[0048] In a second aspect, the present application provides a table processing device, the device comprising:
[0049] a matching module, configured to match the target data with the shared data of an existing similar cell group in response to a write operation on the target data in the cell, wherein the similar cell group is provided with a group identifier, and the cells in the similar cell group have the same shared data;
[0050] A group identifier writing module, configured to write a group identifier corresponding to the target shared data into the cell when it is determined that there is target shared data matching the target data;
[0051] A homogeneous group forming module, configured to form the cells into a homogeneous cell group when it is determined that there is no shared data matching the target data;
[0052] A shared data generation module, used to determine the shared data of the currently formed group of cells of the same type according to the target data;
[0053] A group identification assignment module is used to assign corresponding group identifications to the currently formed groups of cells of the same type;
[0054] The group identifier writing module is further used to write the currently allocated group identifier into the cell.
[0055] In a possible implementation, the device further includes:
[0056] A format conversion module is used to load the original table file of the table in the memory before the write operation for the target data in the cell is responded to, and perform format conversion on the original table file in the following manner to obtain a table file after format conversion:
[0057] Determine a similar cell group from the table represented by the original table file, determine shared data of cells in the similar cell group, and assign a corresponding group identifier to the shared data;
[0058] The corresponding group identifier is written into the cells in the same cell group, and the designated data originally stored in the cells in the same cell group is deleted, wherein the designated data refers to data that is the same as the corresponding shared data.
[0059] In a possible implementation, the device further includes:
[0060] A storage module, configured to store the table file after format conversion to a designated storage medium in response to a table storage instruction;
[0061] The table file after format conversion includes the correspondence between the same type of cell groups, shared data and group identifiers, and the corresponding group identifiers are written into the cells in the table represented by the table file after format conversion.
[0062] In a possible implementation, the device further includes:
[0063] The table display module is used to read the table file, and when a group identifier is written in the read cell, find the shared data corresponding to the group identifier from the table file after the format conversion;
[0064] The found shared data is used to display the read cells.
[0065] In a possible implementation, the device further includes:
[0066] The view display module is used to read the table file and render the table view of the table;
[0067] In the table view, at least two cells that meet a set condition are merged and displayed;
[0068] The setting condition is used to indicate that at least two cells can form a connected rectangular area and have the same group identifier.
[0069] In a possible implementation, the device further includes:
[0070] The additional information display module is used to display the description information of at least two cells that are merged and displayed in the table view.
[0071] In a possible implementation, the device further includes:
[0072] A function triggering module is used for executing the rendering to obtain the table view of the table and subsequent steps in response to a triggering operation of the automatic classification and display data function of the table before the rendering to obtain the table view of the table.
[0073] In a possible implementation, the device further includes:
[0074] A data processing module, configured to respond to a data processing instruction for a target cell and, if it is determined that a group identifier is written in the target cell, determine shared data corresponding to the group identifier;
[0075] The data processing instructions are executed using the shared data.
[0076] In a possible implementation, the data processing instruction includes: a screening instruction, and the data processing module is specifically used to:
[0077] Determining a screening condition corresponding to the screening instruction;
[0078] Cells having shared data that meet the screening condition are determined from the target cells as screened cells.
[0079] In a possible implementation, the format conversion module includes:
[0080] A homogeneous group determination unit, used to determine a homogeneous cell group from the table represented by the original table file, comprising:
[0081] Determine the criteria for determining cells of the same type;
[0082] Traversing each cell in the table represented by the original table file, determining data of a target type in each of the cells, wherein the target type refers to a sharing type indicated by the determination condition of the same type of cells;
[0083] According to the target type of data in each of the cells, the cells in the table are divided into a plurality of similar cell groups;
[0084] The cells in the same cell group have the same target type of data; the cells in different cell groups have different target type of data;
[0085] The shared data determination unit is used to determine the shared data of cells in the same cell group, including:
[0086] The data of the target type in any cell of the same type of cells is determined as shared data of the cells in the same type of cell group.
[0087] In a possible implementation manner, the homogeneous group determination unit includes:
[0088] The target data determination subunit is used to determine the target type data in each of the cells, including:
[0089] In a case where the sharing type indicated by the determination condition of the same type of cells is content sharing, determining the cell content in each of the cells as the data of the target type in the cell;
[0090] In the case where the sharing type indicated by the determination condition of the same type of cells is format sharing, determining the format data of each of the cells as data of the target type in the cell;
[0091] In the case that the sharing type indicated by the same type cell determination condition is content and format sharing, the cell content and format data thereof in each of the cells are determined as target type data in the cell.
[0092] In a possible implementation manner, the shared data generation module is specifically used to:
[0093] Get the similar cell determination conditions corresponding to the existing similar cell groups;
[0094] The data in the target data that matches the sharing type indicated by the same type cell determination condition is determined as the shared data of the currently formed same type cell group.
[0095] In a third aspect, the present application provides a device, comprising: a processor and a memory, wherein the processor is used to execute a table processing program stored in the memory to implement the table processing method described in any one of the first aspects.
[0096] In a fourth aspect, the present application provides a storage medium storing one or more programs, wherein the one or more programs can be executed by one or more processors to implement the table processing method described in any one of the first aspects.
[0097] The above-mentioned technical scheme provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, by responding to the write operation for the target data in the cell, matches the target data with the shared data of the existing similar cell group, and writes the group identifier corresponding to the target shared data in the cell when it is determined that there is target shared data matching the target data; or when it is determined that there is no shared data matching the target data, the cells are formed into a similar cell group, and the shared data of the currently formed similar cell group is determined according to the target data, and the corresponding group identifier is assigned to the currently formed similar cell group, and the currently assigned group identifier is written into the cell, thereby realizing the formation of a new format of table file different from the traditional table file. In the table file of this new format, the repeated data in different cells are no longer stored one by one, but are stored in the form of shared data and group identifiers. This storage method cleverly realizes data sharing and reuse, thereby greatly reducing the redundancy of data in the table and significantly saving storage space.
[0098] At the same time, this storage method also has good support for more advanced data processing functions. For example, under this storage method, to modify duplicate data in a table, you only need to update the shared data without having to pay attention to modifying each cell containing the data. This not only simplifies the maintenance operations of the table data, but also enhances the consistency of the table data and can avoid errors caused by missing data. BRIEF DESCRIPTION OF THE DRAWINGS
[0099] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0100] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0101] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0102] Figure 1 A flowchart of an embodiment of a table processing method provided in an embodiment of the present application;
[0103] Figure 2A flowchart of another table processing method provided in an embodiment of the present application;
[0104] Figure 3 A schematic diagram of the effect of displaying a table in a viewing manner provided in an embodiment of the present application;
[0105] Figure 4 This is a diagram showing the table display effect when deleting the first child cell in a merged cell in the traditional way;
[0106] Figure 5 A block diagram of an embodiment of a table processing device provided in an embodiment of the present application;
[0107] Figure 6 A schematic diagram of the structure of a device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0108] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0109] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0110] In order to solve the technical problem that traditional table files in the prior art adopt a storage mode in which each cell independently stores its data content, which easily leads to a significant increase in the storage demand of the table due to the presence of a large amount of duplicate data and a significant waste of storage space, the present application provides a table processing method, device, equipment and storage medium, which can realize the sharing and reuse of duplicate data in the table, greatly reduce the redundancy of data in the table, and significantly save storage space.
[0111] Figure 1 A flowchart of an embodiment of a table processing method provided in an embodiment of the present application.
[0112] like Figure 1 As shown, the process includes the following steps:
[0113] Step 101, in response to a write operation for target data in a cell, match the target data with the shared data of an existing group of similar cells; if it is determined that there is target shared data matching the target data, execute step 102; if it is determined that there is no shared data matching the target data, execute step 103.
[0114] Step 102: Write the group identifier corresponding to the target shared data into the cell.
[0115] Step 103, forming the cells into a similar cell group, determining the shared data of the currently formed similar cell group according to the target data, assigning a corresponding group identifier to the currently formed similar cell group, and writing the currently assigned group identifier into the cell.
[0116] For ease of understanding, steps 101 to 103 are described in a unified manner as follows:
[0117] First of all, it should be noted that the table processed in steps 101 to 103 is not a table in a traditional format (such as .xls, .xlsx, etc.), but a table represented by a table file in a new format proposed in an embodiment of the present application. In the table file in the new format, the cells in the table are divided into different cell groups. Here, different cells in the same cell group have the same data. Therefore, the divided cell groups are called the same cell groups, and the same data in different cells in the same cell group is called the shared data of these cells, that is, the cells in the same cell group have the same shared data.
[0118] Because cells in the same cell group have the same shared data, storing the corresponding shared data for each cell in the same cell group one by one in a traditional format table file will cause the problem of duplicate storage of the shared data. This duplicate storage will cause the table file to occupy storage space unnecessarily, thereby resulting in a waste of storage space. Especially when the amount of table data is large and there is a lot of duplicate data, the problem of storage space waste in the traditional format table file will be more prominent.
[0119] For step 102, the group identifier corresponding to the target shared data is written into the cell, the purpose of which is to establish an association relationship between the cell and the group identifier. In this embodiment, the specific implementation method is not limited. Specifically, any one of the following methods or a combination thereof can be used:
[0120] (1) Create or use a first file that has been created to write the association relationship between cells and group identifiers. The first file is a subfile of a table file, and stores the cell identifiers of all cells with values (data) in the table represented by the table file, and the group identifier corresponding to the target shared data.
[0121] (2) Create or use a created second file to write the association relationship between the cell and the group identifier. The second file is a subfile of the table file and stores the group identifier and the cell identifier of the cell associated with the group identifier.
[0122] The cell identifier of the above cell may be an address of the cell, a unique identification number of the cell, or the like, which is used to uniquely identify the cell.
[0123] In one embodiment, the target data is any data written into the cell.
[0124] In another embodiment, the target data is data written into the cell that meets a preset condition. The preset condition may include but is not limited to at least one of the following:
[0125] (1) The size of a target data is greater than or equal to a first preset threshold, for example, the first preset threshold is set to 1 megabyte (M);
[0126] (2) The target data is a preset type of data, such as pictures, videos, graphics, etc.;
[0127] (3) The frequency of the target data in the table represented by the table file exceeds the preset number of times;
[0128] (4) The size occupied by the target data in the table represented by the table file is greater than or equal to a second preset threshold, for example, the second preset threshold is set to 10 megabytes (M).
[0129] When the data written into the cell by the write operation does not meet the preset condition, the data is written into the cell. Specifically, the first file mentioned above can be used to store the association relationship between the cell identifier of the cell and the data.
[0130] Based on this, the technical solution of the embodiment of the present application proposes: setting a group identifier for a similar cell group, which is used to uniquely identify a similar cell group, and establishing a correspondence between the similar cell group, the group identifier and the shared data, and writing the corresponding group identifier in the cells in the similar cell group, and at the same time deleting the specified data originally stored in the cells in the similar cell group, where the specified data refers to the data in the cell that is the same as the corresponding shared data.
[0131] In one embodiment, a corresponding group identifier is written into a cell in a cell group of the same type, and the specified data originally stored in the cell group of the same type is deleted. Different deletion methods can be used based on the difference in the storage group identifier and the target data. The first file and the second file mentioned above are used as examples for illustration.
[0132] The first case: storing the cell identifiers of all cells having values in the table based on the first file, and the group identifier corresponding to the target shared data.
[0133] In the first case, the specified data originally stored in the cell is deleted in the first file, and the group identifier is stored instead.
[0134] The second case: storing the group identifier and the cell identifier of the cell associated with the group identifier based on the second file.
[0135] In the second case: if the first file exists, the specified data originally stored in the cell is deleted in the first file, and the cell identifier of the cell is written in the second file at the group identifier corresponding to the specified data. If the first file does not exist, the cell identifier of the cell is directly written in the second file at the group identifier corresponding to the specified data.
[0136] Since the group identifier is usually smaller than the designated data originally stored in the cell, storing the group identifier in the cell can reduce the size of the table file compared to storing the designated data in the cell, especially when the table data volume is large and there is a lot of repeated data, the size of the table file will be reduced more significantly, thereby reducing the storage space occupied by the table file, saving storage space, and transmitting the table file between media more quickly. At the same time, since the correspondence between the same type of cell groups, group identifiers and shared data is established, when reading the table file, the group identifier stored in the cell and the above correspondence can be used to reference the originally stored shared data without affecting the normal display and processing of the table.
[0137] It can be seen that in the table file of the new format provided in the embodiment of the present application, each cell in each similar cell no longer directly stores the corresponding shared data itself, but holds a reference to the shared data. This design cleverly realizes the sharing and reuse of data, greatly saving storage space. In addition, this storage method also has good support for more advanced data processing functions. For example, in this storage method, the modification of repeated data in the table only needs to update the shared data, without paying attention to modifying each cell containing the data. This not only simplifies the maintenance operation of the table data, but also enhances the consistency of the table data, and can avoid errors caused by missing data.
[0138] In one embodiment, the table file of the new format can be obtained by converting the format of the table file of the traditional format. Exemplarily, the conversion process from the traditional format to the new format occurs in the process of reading the table file of the traditional format from the hard disk and loading it into the memory, so that the table file of the new format can be stored in the memory, which can effectively save the storage space of the memory. As for how to convert the format of the table file of the traditional format to obtain the table file of the new format proposed in the embodiment of the present application, it will be described below through Figure 2 The illustrated embodiments are provided for illustrative purposes only and will not be described in detail herein.
[0139] The above briefly describes the organization mechanism of cell data in a new format of a table file proposed in the embodiment of the present application. Based on this, the specific implementation of steps 101 to 103 is explained below:
[0140] In response to the write operation for the target data in the cell, the target data is not directly written into the cell, but the target data is matched with the shared data of the similar cell group currently existing in the table. When it is determined that there is shared data matching the target data (for the convenience of description, the shared data matching the target data is referred to as the target shared data), it means that the target data is the same as the target shared data, which means that the target data is also present in the cell of the similar cell group corresponding to the target shared data (of course, "having" here does not mean "storage", but "reference"). Then, according to the above definition of the similar cell group, the cell can be classified into the similar cell group corresponding to the target shared data, and then the group identifier corresponding to the target shared data is written in the cell, without having to write the target data itself in the cell. This realizes the sharing and reuse of the target data, which can save storage space.
[0141] If there is no shared data that matches the target data, it means that there is currently no shared data that is the same as the target data, which means that the target data does not exist in the table. At this time, the target data itself is not written in the cell, but the cell itself is formed into a similar cell group, and the shared data of the currently formed similar cell group is determined according to the target data, and the corresponding group identifier is assigned to the currently formed similar cell group, and the currently assigned group identifier is written in the cell. This processing method can correctly divide the similar cell groups when the target data is subsequently written to other cells, thereby ensuring the implementation of the reference storage mode and ensuring the accuracy and consistency of the table format.
[0142] Among them, in one embodiment, the specific implementation of assigning a corresponding group identifier to the currently formed group of similar cells includes: using a set random number generation algorithm to generate a random number of set bits, and concatenating the random number with a preset character string according to a set rule to obtain a group identifier.
[0143] For example, if the random number is "01", the preset string is "sstring", and the rule is set to "preset string - random number", the resulting group identifier is "sstring-01". Alternatively, in order to save more storage space, the rule can be set to "random part of the preset string - random number", for example, the resulting group identifier is "st-01".
[0144] Here, only one allocation method of group identifiers is exemplified. In practical applications, other allocation methods may also be used. The embodiments of the present application do not limit this. As long as the allocation method can generate a unique identifier for a group of cells of the same type, it can be applied.
[0145] Generally speaking, for a cell with data (value), the data may include at least one of the following: cell content, cell format, cell style, cell comment, and cell history.
[0146] The format data of the cell is attribute data for setting the format of at least part of the cell content in the cell, such as font, font size, font color, background color, etc.
[0147] The style data of a cell is the attribute data for setting the entire cell, such as the font, font size, font color, background color, alignment, border attributes, etc. of the entire cell.
[0148] In this embodiment, the target shared data may be one of multiple types of cell data or a combination of at least two types.
[0149] In one embodiment, a table file may include multiple different types of similar cell groups, which can be divided into groups represented by one type of cell data, such as a group of cell content type, a group of cell format type, a group of cell style type, a group of cell comment type, a group of cell history type, etc., according to the types of corresponding target shared data. Exemplarily, since the target shared data can also be data represented by a combination of at least two types of cell data, it can also be classified into groups of content combination format type, content combination style type, content / style / format combination type, etc.
[0150] The following description takes the example that the target shared data can be one of multiple types of cell data.
[0151] In one embodiment, the above-mentioned shared data is the cell content. Accordingly, the shared data of the currently formed group of cells of the same type determined according to the target data is also the cell content in the target data.
[0152] For example, the cell contents in cell A1 and cell A2 are both "123", and the cell content in cell A3 is "12a". In the case of using cell contents as shared data, cell A1 and cell A2 can be divided into a similar cell group, and the shared data corresponding to the similar cell group is "123". Similarly, cell A3 is divided into a similar cell group, and the shared data corresponding to the similar cell group is "12a". It can also be seen from this that a similar cell group can include one or more cells, and the embodiments of the present application do not limit this.
[0153] Afterwards, assume that the user triggers a write operation for the target data "123, format data 1" to cell A3 (which means that the user triggers a write operation and a formatting operation for the data "123" to cell A3). At this time, according to the above description, the target shared data "123" that matches the "123" in the target data will be matched in the table, and then cell A3 will be classified into the same cell group corresponding to the target shared data "123", and the group identifier "01" corresponding to the target shared data "123" will be written into cell A3, without writing the "123" in the target data into cell A3. Here, the "format data 1" in the target data is also written into cell A3.
[0154] Assume that the user continues to trigger the write operation for the target data "abc, format data 2" to cell A4. At this time, according to the above description, it will be impossible to match the shared data that matches the "abc" in the target data in the table. At this time, cell A4 itself forms a similar cell group, and the shared data of the currently formed similar cell group is determined according to the target data, for example, "abc", and the corresponding group identifier is assigned to the currently formed similar cell group, assuming it is "02", then the currently assigned group identifier "02" will be written in cell A4, without having to write the "abc" in the target data in cell A4. Here, the "format data 2" in the target data is also written in cell A4.
[0155] Assume that the user continues to trigger the write operation for the target data "abc, format data 3" to cell A5. At this time, according to the above description, the target shared data "abc" matching the "abc" in the target data will be matched in the table, and then cell A5 will be classified into the same cell group corresponding to the target shared data "abc", and the group identifier "02" corresponding to the target shared data "abc" will be written into cell A5, without writing "abc" in the target data into cell A5. Here, the "format data 3" in the target data is also written into cell A5.
[0156] It can be seen from this that, when the shared data is cell content, what is stored in the cell is the group identifier and format data that can reference the specific cell content.
[0157] In one embodiment, the shared data is the format data of the cell, which is the attribute data for setting the format of at least part of the cell content in the cell, such as the font, font size, font color, background color, etc.
[0158] Correspondingly, the shared data of the currently formed group of cells of the same type determined according to the target data is also the format data in the target data.
[0159] For example, the cell content of cell A1 is "123", and the format data is format data 1; the cell content of cell A2 is "123", and the format data is format data 2; the cell content of cell A3 is "abc", and the format data is format data 1. In the case where the format data is used as shared data, cells A1 and A3 are divided into a similar cell group, and the shared data of the similar cell group is "format data 1", and it is assumed that the group identifier of the similar cell group is "01"; similarly, cell A2 is divided into a similar cell group, and the shared data of the similar cell group is "format data 2", and it is assumed that the group identifier of the similar cell group is "02".
[0160] Afterwards, assume that the user triggers a write operation for the target data "123, format data 1" to cell A4. At this time, according to the above description, the target shared data "format data 1" matching the "format data 1" in the target data will be matched in the table, and then cell A4 will be classified into the same cell group corresponding to the target shared data "format data 1", and the group identifier "01" corresponding to the target shared data "format data 1" will be written into cell A4, without writing the "format data 1" in the target data into cell A4. Here, "123" in the target data is also written into cell A4.
[0161] Assume that the user continues to trigger the write operation for the target data "123, format data 3" to cell A5. At this time, according to the above description, it will be impossible to match the shared data that matches the "format data 3" in the target data in the table. Therefore, cell A5 itself forms a similar cell group, and the shared data of the currently formed similar cell group is determined according to the target data, for example, "format data 3", and the corresponding group identifier is assigned to the currently formed similar cell group, assuming it is "03", then the currently assigned group identifier "03" will be written in cell A5, without having to write the "format data 3" in the target data in cell A5. Here, "123" in the target data is also written in cell A5.
[0162] It can be seen from this that, when the shared data is format data, what is stored in the cell is a group identifier and cell content that can reference specific format data.
[0163] The following description will be made by taking the example that the target shared data may be a combination of at least two of the multiple types of cell data.
[0164] In one embodiment, the shared data is cell content and format data. This embodiment needs to be discussed in two cases:
[0165] In one case, a group identifier that can reference specific cell content and format data is stored in the cell, which means that when dividing the same type of cell groups, the cell content and format data of the cell are regarded as a whole.
[0166] For example, the cell content of cell A1 is "123", and the format data is format data 1, the cell content of cell A2 is "123", and the format data is format data 2, and the cell content of cell A3 is "abc", and the format data is format data 1. It can be seen that the cell content between cell A1 and cell A2 is the same but the format data is different, the format data between cell A1 and cell A2 is the same but the cell content is different, and the cell content and format data between cell A2 and cell A3 are different. Exemplarily, cell A1, cell A2, and cell A3 are each formed into a similar cell group, wherein the shared data corresponding to the similar cell group formed by cell A1 is: "123, format data 1", and it is assumed that the group identification corresponding to the similar cell group is "01"; the shared data corresponding to the similar cell group formed by cell A1 is: "123, format data 2", and it is assumed that the group identification corresponding to the similar cell group is "02"; the shared data corresponding to the similar cell group formed by cell A3 is: "abc, format data 1", and it is assumed that the group identification corresponding to the similar cell group is "03".
[0167] Afterwards, assume that the user triggers a write operation for the target data "123, format data 1" to cell A4. At this time, according to the above description, the target shared data "123, format data 1" matching the target data "123, format data 1" will be matched in the table, and then cell A4 will be classified into the same cell group corresponding to the target shared data "123, format data 1", and the group identifier "01" corresponding to the target shared data "123, format data 1" will be written in cell A3, without having to write the target data "123, format data 1" in cell A3.
[0168] In another case, the cell stores a group identifier that can reference specific cell content (referred to as a content group identifier for ease of description) and a group identifier that can reference format data (referred to as a format group identifier for ease of description). This means that when dividing similar cell groups, the cell content and format data of the cell are treated separately and the similar cell groups are divided separately.
[0169] For example, the cell content of cell A1 is "123", and the format data is format data 1, the cell content of cell A2 is "123", and the format data is format data 2, and the cell content of cell A3 is "abc", and the format data is format data 1. It can be seen that the cell content between cell A1 and cell A2 is the same, and the format data between cell A1 and cell A2 is the same. Based on this, when the cell content and format data are used as shared data, two division results of the same cell groups are obtained, one of which is shown in Table 1 below, and the division result is the division result of using the cell content as shared data; the division result of the other is shown in Table 2 below, and the division result is the division result of using the format data as shared data.
[0170] Table 1
[0171] Homogeneous cell groups Shared data Group ID Cell A1 and Cell A2 "123” t-01 Cell A3 "abc" t-02
[0172] Table 2
[0173] Homogeneous cell groups Shared data Group ID Cell A1 and Cell A3 "Format Data 1" s-01 Cell A2 "Format Data 2" s-02
[0174] Afterwards, assume that the user triggers a write operation for the target data "123, format data 1" to cell A4. At this time, according to the above description, the target shared data "123" matching the "123" in the target data is matched in Table 1, and the target shared data "format data 1" matching the "format data 1" in the target data is matched in Table 2, and then cell A4 is respectively classified into the same cell groups corresponding to the target shared data "123" and the target shared data "format data 1", and the group identifier "t-01" corresponding to the target shared data "123" and the group identifier "s-01" corresponding to the target shared data "format data 1" are written into cell A4.
[0175] Assume that the user triggers a write operation for the target data "edf, format data 1" to cell A5. At this time, according to the above description, the target shared data "format data 1" matching the "format data 1" in the target data will be matched in Table 2, and then cell A5 will be classified into the same cell group corresponding to the target shared data "format data 1", and the group identifier "s-01" corresponding to the target shared data "format data 1" will be written in cell A5. At the same time, no shared data matching the "edf" in the target data can be matched in Table 1. According to the above description, cell A5 itself will form a same cell group, and the shared data of the currently formed same cell group will be determined according to the "edf" in the target data, for example, "edf", and the corresponding group identifier will be assigned to the currently formed same cell group, assuming it is "t-03", then the currently assigned group identifier "t-03" will be written in cell A5. So far, "t-03" and "s-01" are written in cell A5.
[0176] Assume that the user triggers a write operation for the target data "abc, format data 3" to cell A6. At this time, according to the above description, the target shared data "abc" that matches the "abc" in the target data will be matched in Table 1, and then cell A6 will be classified into the same cell group corresponding to the target shared data "abc", and the group identifier "t-02" corresponding to the target shared data "abc" will be written in cell A6. At the same time, it is impossible to match the shared data that matches the "format data 3" in the target data in Table 2. According to the above description, cell A6 itself will form a same cell group, and the shared data of the currently formed same cell group will be determined according to the "format data 3" in the target data, for example, "format data 3", and the corresponding group identifier will be assigned to the currently formed same cell group, assuming it is "s-03", and the currently assigned group identifier "s-03" will be written in cell A6. So far, "t-02" and "s-03" are written in cell A6.
[0177] It can be seen from the above description that the technical solution provided by the embodiment of the present application, by responding to the write operation for the target data in the cell, matches the target data with the shared data of the existing similar cell group, and writes the group identifier corresponding to the target shared data in the cell when it is determined that there is target shared data matching the target data; or when it is determined that there is no shared data matching the target data, the cells are formed into a similar cell group, and the shared data of the currently formed similar cell group is determined according to the target data, and the corresponding group identifier is assigned to the currently formed similar cell group, and the currently assigned group identifier is written into the cell, thereby realizing the formation of a new format of table file different from the traditional table file. In this new format of table file, for repeated data in different cells, they are no longer stored one by one, but are stored in the form of shared data and group identifiers. This storage method cleverly realizes data sharing and reuse, thereby greatly reducing the redundancy of data in the table and significantly saving storage space.
[0178] At the same time, this storage method also has good support for more advanced data processing functions. For example, under this storage method, all duplicate data in the table can be modified by simply updating the shared data, without having to modify each cell containing the data one by one. This not only simplifies the maintenance operations of the table data, but also enhances the consistency of the table data and can avoid errors caused by missing data.
[0179] Figure 2 A flowchart of another table processing method provided in an embodiment of the present application. Figure 2 The process shown in Figure 1 Based on the process shown in the figure, the format conversion of the traditional table file is described to obtain Figure 1 The specific implementation of the new format of the table file described in the process shown. Figure 2 As shown, the following steps are included:
[0180] Step 201: Load the original table file of the table into the memory.
[0181] The original spreadsheet file is a spreadsheet file in a traditional format (such as .xls, .xlsx, etc.).
[0182] Exemplarily, in response to an instruction to open a table, an original table file of the table is loaded from a hard disk of the device into a memory of the device.
[0183] Step 202: determine a similar cell group from the table represented by the original table file, determine the shared data of the cells in the similar cell group, and assign a corresponding group identifier to the shared data.
[0184] Step 203: write the corresponding group identifier into the cells in the same cell group, and delete the specified data originally stored in the cells in the same cell group, so as to obtain a table file after format conversion.
[0185] For ease of understanding, step 202 and step 203 are described in a unified manner as follows:
[0186] Figure 1 The process shown explains the definition of the same cell group, the shared data of the cells in the same cell group, and the group identifier of the same cell group, which will not be repeated here.
[0187] In one embodiment, a specific implementation of determining a similar cell group from a table represented by an original table file includes: determining similar cell determination conditions; traversing each cell in the table represented by the original table file, and determining target type data in each cell, where the target type refers to a shared type indicated by the similar cell determination conditions; dividing the cells in the table into multiple similar cell groups according to the target type data in each cell; wherein cells in the same similar cell group have the same target type data; and cells in different similar cell groups have different target type data.
[0188] Correspondingly, the specific implementation of determining the shared data of cells in the same cell group includes: determining the data of the target type in any cell in the same cell group as the shared data of the cells in the same cell group.
[0189] The above-mentioned similar cell group determination conditions are used to indicate the standard or basis for classifying cells. The standard or basis for classification can refer to the type of shared data, and one similar cell group corresponds to one type of shared data. As mentioned above, the shared data can be one or a combination of at least two types of cell data. Then, the type of shared data can be a type corresponding to one of the multiple types of cell data, or a type corresponding to a combination of at least two of the multiple types of cell data. Among them, the type of cell data includes at least one of the following: cell content, cell format, cell style, cell comment, cell history, etc.
[0190] In this embodiment, a detailed description is given by way of example. For example, four standards or bases for classifying cells are set: same content, same format, same content and format, and same content and format.
[0191] The same content means: classifying cells according to whether the contents in the cells are the same. That is, by classifying cells according to the same content standard, cells with the same cell contents can be classified into the same same cell group, while cells in different same cells have different cell contents.
[0192] In the content homogeneous mode, the specified data originally stored in the cells in the homogeneous cell group refers to the cell content. By writing the corresponding group identifier in the cells in the homogeneous cell group and deleting the specified data originally stored in the cells in the homogeneous cell group, in the table file after format conversion, the group identifier and format data that can refer to the specific cell content are stored in the cells.
[0193] For example, the cell content in cell A1 is "123", and the format data is "Format Data 1", the cell content in cell A2 is "123", and the format data is "Format Data 1", and the cell content in cell A3 is "12a", and the format data is "Format Data 2". By executing the format conversion process of the above steps 202 and 203, cells A1 and A2 are divided into a similar cell group, and the shared data corresponding to the similar cell group is determined to be "123", and the corresponding group identifier is assigned to the similar cell group, assuming it is "01". Similarly, cell A3 is divided into a similar cell group, and the shared data corresponding to the similar cell group is determined to be "12a", and the corresponding group identifier is assigned to the similar cell group, assuming it is "02". Afterwards, "01" and "Format Data 1" are written in cell A1, "01" and "Format Data 1" are written in cell A2, and "02" and "Format Data 2" are written in cell A3 to obtain a table file after format conversion.
[0194] Format homogeneity means: classifying cells based on whether the cell formats are the same. In other words, by classifying cells according to the standard of format homogeneity, cells with the same format can be divided into the same group of homogeneous cells, while cells in different homogeneous cells have different formats.
[0195] In the format homogeneous mode, the specified data originally stored in the cells in the homogeneous cell group refers to the format data. By writing the corresponding group identifier in the cells in the homogeneous cell group and deleting the specified data originally stored in the cells in the homogeneous cell group, in the table file after the format conversion, the group identifier and cell content that can refer to the specific format data are stored in the cells.
[0196] For example, the cell content in cell A1 is "123", and the format data is "Format Data 1", the cell content in cell A2 is "123", and the format data is "Format Data 2", and the cell content in cell A3 is "12a", and the format data is "Format Data 2". By executing the format conversion process of the above steps 202 and 203, cells A2 and A3 are divided into a similar cell group, and the shared data corresponding to the similar cell group is determined to be "Format Data 2", and the corresponding group identifier is assigned to the similar cell group, assuming it is "01". Similarly, cell A1 is divided into a similar cell group, and the shared data corresponding to the similar cell group is determined to be "Format Data 1", and the corresponding group identifier is assigned to the similar cell group, assuming it is "02". Afterwards, "123" and "02" are written in cell A1, "123" and "01" are written in cell A2, and "12a" and "01" are written in cell A3 to obtain a table file after format conversion.
[0197] Content and format homogeneity means: classifying cells based on whether the content and format in the cells are the same. That is to say, by classifying cells based on the standard of content and format homogeneity, cells with the same cell content and format can be classified into the same group of cells of the same type, while cells in different groups of cells of the same type have different cell contents, or different formats, or both different cell contents and different formats.
[0198] In the content and format homogeneity mode, the specified data originally stored in the cells in the homogeneous cell group refers to the cell content and format data. By writing the corresponding group identifier in the cells in the homogeneous cell group and deleting the specified data originally stored in the cells in the homogeneous cell group, in the table file after format conversion, the group identifier that can refer to the specific cell content and format data is stored in the cells.
[0199] For example, the cell content of cell A1 is "123", and the format data is format data 1, the cell content of cell A2 is "123", and the format data is format data 2, and the cell content of cell A3 is "abc", and the format data is format data 1. It can be seen that the cell content between cell A1 and cell A2 is the same but the format data is different, the format data between cell A1 and cell A2 is the same but the cell content is different, and the cell content and format data between cell A2 and cell A3 are different. Exemplarily, cell A1, cell A2, and cell A3 are each formed into a similar cell group, wherein the shared data corresponding to the similar cell group formed by cell A1 is: "123, format data 1", and it is assumed that the group identification corresponding to the similar cell group is "01"; the shared data corresponding to the similar cell group formed by cell A1 is: "123, format data 2", and it is assumed that the group identification corresponding to the similar cell group is "02"; the shared data corresponding to the similar cell group formed by cell A3 is: "abc, format data 1", and it is assumed that the group identification corresponding to the similar cell group is "03". After that, write "01" in cell A1, write "02" in cell A2, and write "03" in cell A3 to get the table file after format conversion.
[0200] Content similarity and format similarity refer to: classifying cells based on whether the contents in the cells are the same and whether the formats are the same. In other words, cells are classified twice, one of which is classified according to the standard of content similarity, and cells with the same cell content are divided into the same cell group of the same type, while cells in different cells of the same type have different cell contents; the other time is classified according to the standard of format similarity, and cells with the same format are divided into the same cell group of the same type, while cells in different cells of the same type have different formats. In this classification mode, two sets of similar cell groups will be obtained, and the two sets of similar cell groups are not the same, and the group identifiers of the similar cells in the two sets of similar cell groups are two independent identification systems that do not affect each other.
[0201] For example, the cell content of cell A1 is "123", and the format data is format data 1; the cell content of cell A2 is "123", and the format data is format data 2; the cell content of cell A3 is "abc", and the format data is format data 1. According to the similar cell determination conditions of content sharing and format sharing, two similar cell groups are obtained, namely, the content similar cell group set {(cell A1 and cell A2), (cell A3)} and the format similar cell group set {(cell A1 and cell A3), (cell A2)}. Assume that the content group identifier assigned to the content similar cell group (cell A1 and cell A2) is "t-01", and the content group identifier assigned to the content similar cell group (cell A3) is "t-02". The format group identifier assigned to the format similar cell group (cell A1 and cell A3) is "s-01", and the content group identifier assigned to the format similar cell group (cell A2) is "s-02".
[0202] Based on the above assumptions, write the content group ID "t-01" and the format group ID "s-01" in cell A1, write the content group ID "t-01" and the format group ID "s-02" in cell A2, and write the content group ID "t-02" and the format group ID "s-01" in cell A3.
[0203] From the above description, it can be seen that different cells in the same cell group can reuse the same data, so this same data can be regarded as shared data between different cells in the same cell group. In addition, with different classification bases, the types of shared data are also different. Corresponding to the above four classification bases, the sharing types include content sharing, format sharing, content and format sharing, and content sharing and format sharing.
[0204] Based on this, when determining a group of cells of the same type from a table represented by an original table file, first determine the same cell determination condition. Once the same cell determination condition is determined, the classification standard for the cells in the table is determined. After that, traverse each cell in the table represented by the original table file to determine the target type data in each cell. Among them, in the case where the sharing type indicated by the same cell determination condition is content sharing, the cell content in each cell is determined as the data of the target type in the cell. In the case where the sharing type indicated by the same cell determination condition is format sharing, the format data of the cell content in each cell is determined as the data of the target type in the cell. In the case where the sharing type indicated by the same cell determination condition is content and format sharing, the cell content and its format data in each cell are determined as the data of the target type in the cell. In the case where the sharing type indicated by the same cell group determination condition is content sharing and format sharing, the cell content and format data in each cell are respectively determined as the data of the target type in the cell. Here, for one cell, two target types of format data will be obtained.
[0205] Then, according to the target type data in each cell, the cells in the table are divided into multiple similar cell groups, wherein cells in the same similar cell group have the same target type data, and cells in different similar cell groups have different target type data.
[0206] Figure 1 The process shown here provides corresponding examples for content sharing, format sharing, and content and format sharing, so we will not repeat the examples here. For easier understanding, here are some specific examples for content sharing and format sharing:
[0207] It can be seen from the above description that the technical solution provided in the embodiment of the present application supports various types of data sharing for tables. Different data reuse effects can be achieved under different sharing types, and data reuse requirements in different scenarios can be met. This makes the technical solution of the embodiment of the present application highly flexible and practical in data management and maintenance.
[0208] In one embodiment, the user is allowed to select or set similar cell determination conditions based on specific data reuse requirements. For example, when the user triggers an open instruction for a table, the user is prompted in the form of a pop-up window to select whether to enable the format conversion function for the table, and to set similar cell determination conditions for the table if the format conversion function is enabled. After the original table file of the table is subsequently loaded from the hard disk of the device into the device memory, the original table file will be format converted according to the similar cell determination conditions set by the user to obtain a table file after format conversion.
[0209] In addition, when writing data in the format of the table file after format conversion, the specific implementation of determining the shared data of the currently formed group of similar cells according to the target data to be written includes: obtaining the similar cell determination condition corresponding to the existing group of similar cells, and determining the data in the target data that matches the sharing type indicated by the similar cell determination condition as the shared data of the currently formed group of similar cells. Figure 1 The process shown has corresponding examples, which will not be repeated here.
[0210] Figure 2 In the illustrated embodiment, the table file after format conversion is obtained by loading the original table file of the table in the memory and converting the format of the original table file in the following manner: determining the same type of cell groups from the table represented by the original table file, determining the shared data of the cells in the same type of cell groups, and assigning corresponding group identifiers to the shared data; writing the corresponding group identifiers in the cells in the same type of cell groups, and deleting the specified data originally stored in the cells in the same type of cell groups, thereby realizing the reorganization of the data of the table file in the memory. This reorganization realizes the sharing and reuse of data, thereby greatly reducing the redundancy of data in the table and significantly saving the storage space of the memory.
[0211] After the table file in the new format is generated in the memory, the table file in the new format will be used to display the table and perform subsequent table processing operations.
[0212] Among them, the process of displaying a table in memory using a table file in a new format includes: reading the table file, and when a group identifier is written in the read cell, finding shared data corresponding to the group identifier from the table file after format conversion; and using the found shared data to display the read cell.
[0213] In the case where the table file read is a table file of a new format, the table file of the new format includes the correspondence between the same type of cell group, shared data and group identifier, and the cell has a group identifier, which can be regarded as a "reference pointer" rather than the data actually to be displayed. Therefore, in the case where a group identifier is written in the read cell, the shared data corresponding to the group identifier is found from the table file after the format conversion, and the shared data is the data actually to be displayed, so that the read cell is displayed using the found shared data. It can be seen from this that the table file of the new format provided in the embodiment of the present application supports the normal display and table processing of the table.
[0214] In addition, when the read table file is a table file in a traditional format, the table file will be read and displayed in a traditional manner, which will not be described in detail here.
[0215] In one embodiment, when displaying a table, it can also be displayed in the form of a table view. Specifically, read the table file and render the table view of the table; in the table view, merge and display at least two cells that meet the set conditions; wherein the set conditions are used to indicate that at least two cells can form a connected rectangular area and have the same group identifier. Exemplarily, when a content group identifier and a format group identifier are written in a cell at the same time, the same group identifier means that the content group identifier and the format group identifier are the same, or that the content group identifier is the same.
[0216] See also Figure 3 ,in Figure 3 (a) is a schematic diagram of the conventional table display effect. Figure 3 (b) Figure 3 (a) is a schematic diagram of the display effect of the table in the viewing mode described in the above embodiment. Figure 3 (a) and Figure 3 (b) It can be seen that by applying the technical solution provided in the embodiment of the present application, when the user needs to display the data in the table concisely and efficiently, there is no need to browse the data in the table one by one and merge them manually. The group identifier in the cell can be used to filter out cells with the same content for merging, thereby saving manpower and improving user experience.
[0217] Figure 3 In the example, the real data in the cell is displayed in the cell area that is merged and displayed in a view. In one embodiment, the user is allowed to specify the display content in the merged cell area by setting the interface or by the system selecting a cell according to rules (such as position priority, first appearance, highest frequency of appearance, etc.), or the user is allowed to manually specify a cell to specify the display content in the merged cell area. In this way, since only the display content is specified on the table view, it does not affect the real data in the cell. In addition, in order to enhance readability and distinguishability, when the display is not real data, the display content can be highlighted or special marks can be added according to user settings.
[0218] The above embodiments increase the flexibility of the technical solutions provided by the embodiments of the present application and can further enhance the user experience.
[0219] In one embodiment, when the cells with the same content in the table are merged and displayed in a view mode, the description information of at least two cells that are merged and displayed can also be displayed in the table view. Exemplarily, the description information includes information such as the total frequency of the data, the distribution (such as which columns and rows it is distributed in), etc. Through this processing method, when the user browses the table, they can not only quickly locate the key information, but also have a general understanding of the overall situation of the table through the frequency and distribution data, thereby improving the user experience.
[0220] In one embodiment, considering that users may have special requirements for the repeated display of some data items (such as maintaining the original order, retaining all duplicates, etc.), corresponding operation buttons or setting options are added to the user interface of the spreadsheet processing software so that users can easily enable or disable the automatic classification display function, adjust the display style and rules, etc. to meet the diverse needs of different users.
[0221] Accordingly, before rendering the table view of the table, it further includes: in response to a trigger operation for the automatic classification display data function of the table, performing the steps of rendering the table view of the table and subsequent steps.
[0222] In addition, for the table after format conversion, when the cells with the same content in the table are merged and displayed in a view mode, a series of problems that are prone to occur when dealing with merged cells in the prior art can also be avoided.
[0223] In an exemplary scenario, refer to Figure 4 , where Figure 4 (a) is an example of a traditional table, Figure 4 In (a), cells A2 to A4 are merged into a merged cell. In a traditional table, the display content in the merged cell, such as "Zhang San", is usually stored in the first sub-cell of the merged cell, such as cell A2, and the other sub-cells in the merged cell, such as cells A3 and A4, no longer store cell content.
[0224] In a traditional table, if the cell that actually stores data, such as cell A1, is deleted, then there will be no cell content available for display in the merged cell. The display effect of the table at this time is as shown in Figure 4 (b).
[0225] In this scenario, the technical solution provided by the embodiment of the present application is applied, and cells with the same content in the table are merged and displayed in the form of a view, and the cells are not merged at the underlying data level, so that the cells in the merged and displayed cell area still store data, including group identifiers of cell content and format data, content group identifiers and format data, and content group identifiers and format group identifiers. Then, in this way, deleting the cell data of any one of the cells will not affect the data stored in other cells, so the cell content can still be displayed normally in the merged and displayed cell area.
[0226] Exemplarily, when a user triggers a delete operation on cell data for any cell, such as cell A2, the cell data in cell A2 is deleted. The cell data of cell A2 is deleted by, for example: deleting the association between cell A2 and its group identifier in the first file, and / or deleting the association between the cell identifier of cell A2 and its group identifier in the second file.
[0227] After the cell data of cell A2 is deleted, the original data in cells A3 and A4 will not be affected. Then, when the table is displayed, when cells A3 and A4 are read, cells A3 and A4 are merged and displayed using the view mode, and "Zhang San" can still be correctly displayed in the merged display area.
[0228] In another exemplary scenario, see Figure 4 (a) In other cells, you can refer to the correct cell content by referencing cell A2 through formulas. For example, Figure 4 In (a), the formula "=A2" in cell D2 can reference the correct cell content "Zhang San" (the display effect is shown in cell E2). However, in other cells, such as cell D3, the formula cannot reference cell A3 or cell A4.
[0229] In this scenario, the technical solution provided by the embodiment of the present application is applied to merge and display cells with the same content in the table in the form of a view, without merging the cells at the underlying data level, so that the cells in the merged and displayed cell area still store data. Then, in this way, other cells can reference any cell in the merged and displayed cell area through formulas, and can reference the correct cell content.
[0230] It can be seen that the application of the technical solution provided in the embodiment of the present application does not affect the correct processing of the data in the table. In this regard, in one embodiment, in response to a data processing instruction for a target cell in the table, when it is determined that a group identifier is written in the target cell, the shared data corresponding to the group identifier is determined; and the data processing instruction is executed using the shared data.
[0231] Exemplarily, the above data processing instruction is a data reference instruction in the formula reference scenario described above. Figure 4 In the application scenario shown, assuming that the target cell is cell A3, entering the formula "=A3" in cell D3 will trigger a data reference instruction for cell A3. Then, when it is determined that a group identifier is written in cell A3, the shared data corresponding to the group identifier is determined, such as "Zhang San". The data reference instruction is executed using the shared data, and the correct cell content can be referenced in cell D3.
[0232] Exemplarily, the data processing instruction includes a filtering instruction. Accordingly, the specific implementation of executing the data processing instruction using shared data includes: determining a filtering condition corresponding to the filtering instruction; and determining cells having shared data that meet the filtering condition from target cells as filtered cells.
[0233] Under this processing method, even if the original cell content is not stored in the cell in the new format of the table file, and the adjacent cells with the same content are merged at the view level, the original cell content can be referenced through the group identifier stored in the cell, that is, shared data, and then the filtering operation can be performed based on the shared data, which will not affect the correct filtering of the data in the table.
[0234] Exemplarily, the above-mentioned data processing instructions include data modification instructions. The data type modified indicated by the data modification instruction can refer to the type of shared data, for example, modifying cell content, modifying cell format, modifying cell comments, modifying cell style, etc. In response to the data modification instruction, the cell is modified. In addition to modifying the above-mentioned types of data, it may also involve deleting, replacing or adding group identifiers corresponding to the same type of cell groups.
[0235] Among them, taking the modification of cell content as an example, when the modified cell belongs to a group of cells of the same type, after the cell content is modified, the group identifier originally corresponding to the cell is deleted synchronously, and the corresponding relationship between the group identifier and the cell is deleted in the corresponding file (such as the first file). Subsequently, the cell is re-divided into groups of cells of the same type according to the modified cell content. Please refer to the above description for the specific method of division, which will not be repeated here. If the result of the re-division is to divide the cell into an existing group of cells of the same type, then a corresponding relationship between the cell (or the identifier of the cell) and the group identifier of the existing group of cells of the same type can be newly created in the corresponding file. If the result of the re-division is that the cell forms a group of cells of the same type by itself, then it is equivalent to adding a group of cells of the same type. At this time, a group identifier will be assigned to the added group of cells of the same type, and a corresponding relationship between the cell (or the identifier of the cell) and the group identifier will be established in the corresponding file.
[0236] When modifying cells, the group identifier is deleted, replaced, or similar cell groups are added simultaneously, which can ensure that the data in the table file matches the user's operation intention, so that the user can still perform table processing operations normally in the table represented by the new format of the table file.
[0237] There are two ways to delete cells: one is to delete the cell data in the cell, that is, to set the deleted cell data in the cell to empty, but keep the cell in the spreadsheet file; the other is to delete the cell itself, such as deleting a row or a column of cells.
[0238] Since the deletion operation of deleting the cell itself also involves changes in the addresses of other cells in the table, when the address of the cell is used as the cell identifier and an association relationship between the cell identifier and the group identifier is established, in response to the deletion operation on the cell itself, the cell identifiers of other cells in the table file are updated, and an association relationship between the updated cell identifier and the corresponding group identifier is established.
[0239] Exemplarily, the above-mentioned data processing instructions may also be statistical instructions, etc., which is not limited in the embodiments of the present application.
[0240] Finally, when the user completes the operation on the table, the table after the operation is usually saved, and saving means storing it in the hard disk of the device. In this regard, in one embodiment, in response to the table storage instruction, the table file after format conversion is stored in a designated storage medium. By storing the table file after format conversion in a designated storage medium (such as a hard disk), the storage space of the designated storage medium can be significantly saved.
[0241] Figure 5This is a block diagram of an embodiment of a table processing device provided in an embodiment of the present application. Figure 5 As shown, the device comprises:
[0242] A matching module 51, configured to match the target data with the shared data of an existing similar cell group in response to a write operation on the target data in the cell, wherein the similar cell group is provided with a group identifier, and the cells in the similar cell group have the same shared data;
[0243] A group identifier writing module 52 is used to write the group identifier corresponding to the target shared data into the cell when it is determined that there is target shared data matching the target data;
[0244] A homogeneous group forming module 53, configured to form the cells into a homogeneous cell group when it is determined that there is no shared data matching the target data;
[0245] A shared data generating module 54, used to determine the shared data of the currently formed group of cells of the same type according to the target data;
[0246] A group identifier allocation module 55 is used to allocate a corresponding group identifier to the currently formed group of cells of the same type;
[0247] The group identifier writing module 56 is further configured to write the currently assigned group identifier into the cell.
[0248] In a possible implementation, the device further includes:
[0249] A format conversion module is used to load the original table file of the table in the memory before the write operation for the target data in the cell is responded to, and perform format conversion on the original table file in the following manner to obtain a table file after format conversion:
[0250] Determine a similar cell group from the table represented by the original table file, determine shared data of cells in the similar cell group, and assign a corresponding group identifier to the shared data;
[0251] The corresponding group identifier is written into the cells in the same cell group, and the designated data originally stored in the cells in the same cell group is deleted, wherein the designated data refers to data that is the same as the corresponding shared data.
[0252] In a possible implementation, the device further includes:
[0253] A storage module, configured to store the table file after format conversion to a designated storage medium in response to a table storage instruction;
[0254] The table file after format conversion includes the correspondence between the same type of cell groups, shared data and group identifiers, and the corresponding group identifiers are written into the cells in the table represented by the table file after format conversion.
[0255] In a possible implementation, the device further includes:
[0256] The table display module is used to read the table file, and when a group identifier is written in the read cell, find the shared data corresponding to the group identifier from the table file after the format conversion;
[0257] The found shared data is used to display the read cells.
[0258] In a possible implementation, the device further includes:
[0259] The view display module is used to read the table file and render the table view of the table;
[0260] In the table view, at least two cells that meet a set condition are merged and displayed;
[0261] The setting condition is used to indicate that at least two cells can form a connected rectangular area and have the same group identifier.
[0262] In a possible implementation, the device further includes:
[0263] The additional information display module is used to display the description information of at least two cells that are merged and displayed in the table view.
[0264] In a possible implementation, the device further includes:
[0265] A function triggering module is used for executing the rendering to obtain the table view of the table and subsequent steps in response to a triggering operation of the automatic classification and display data function of the table before the rendering to obtain the table view of the table.
[0266] In a possible implementation, the device further includes:
[0267] A data processing module, configured to respond to a data processing instruction for a target cell and, if it is determined that a group identifier is written in the target cell, determine shared data corresponding to the group identifier;
[0268] The data processing instructions are executed using the shared data.
[0269] In a possible implementation, the data processing instruction includes: a screening instruction, and the data processing module is specifically used to:
[0270] Determining a screening condition corresponding to the screening instruction;
[0271] Cells having shared data that meet the screening condition are determined from the target cells as screened cells.
[0272] In a possible implementation, the format conversion module includes:
[0273] A homogeneous group determination unit, used to determine homogeneous cell groups from the table represented by the original table file, comprising:
[0274] Determine the criteria for determining cells of the same type;
[0275] Traversing each cell in the table represented by the original table file, determining data of a target type in each of the cells, wherein the target type refers to a sharing type indicated by the determination condition of the same type of cells;
[0276] According to the target type of data in each of the cells, the cells in the table are divided into a plurality of similar cell groups;
[0277] The cells in the same cell group have the same target type of data; the cells in different cell groups have different target type of data;
[0278] The shared data determination unit is used to determine the shared data of cells in the same cell group, including:
[0279] The data of the target type in any cell of the same type of cells is determined as shared data of the cells in the same type of cell group.
[0280] In a possible implementation manner, the homogeneous group determination unit includes:
[0281] The target data determination subunit is used to determine the target type data in each of the cells, including:
[0282] In a case where the sharing type indicated by the determination condition of the same type of cells is content sharing, determining the cell content in each of the cells as the data of the target type in the cell;
[0283] In the case where the sharing type indicated by the determination condition of the same type of cells is format sharing, determining the format data of each of the cells as data of the target type in the cell;
[0284] In the case that the sharing type indicated by the same type cell determination condition is content and format sharing, the cell content and format data thereof in each of the cells are determined as target type data in the cell.
[0285] In a possible implementation manner, the shared data generation module is specifically used to:
[0286] Get the similar cell determination conditions corresponding to the existing similar cell groups;
[0287] The data in the target data that matches the sharing type indicated by the same type cell determination condition is determined as the shared data of the currently formed same type cell group.
[0288] like Figure 6 As shown, an embodiment of the present application provides a device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0289] Memory 113, used for storing computer programs;
[0290] In one embodiment of the present application, the processor 111 is used to implement the table processing method provided by any one of the above method embodiments when executing the program stored in the memory 113, including:
[0291] In response to a write operation for target data in a cell, matching the target data with shared data of an existing group of cells of the same type, wherein the group of cells of the same type is provided with a group identifier, and the cells in the group of cells of the same type have the same shared data;
[0292] In the case where it is determined that there is target shared data matching the target data, writing a group identifier corresponding to the target shared data into the cell; or,
[0293] When it is determined that there is no shared data matching the target data, the cells are formed into a similar cell group, and the shared data of the currently formed similar cell group is determined according to the target data, and a corresponding group identifier is assigned to the currently formed similar cell group, and the currently assigned group identifier is written in the cell.
[0294] An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the table processing method provided in any of the aforementioned method embodiments are implemented.
[0295] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0296] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0297] It should be understood that the terms used in the text are only for the purpose of describing specific example embodiments, and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0298] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A table processing method, characterized in that: The method comprises: In response to a write operation for target data in a cell, matching the target data with shared data of an existing group of cells of the same type, wherein the group of cells of the same type is provided with a group identifier, and cells in the group of cells of the same type have the same shared data; In the case where it is determined that there is target shared data matching the target data, writing a group identifier corresponding to the target shared data into the cell; or, When it is determined that there is no shared data matching the target data, the cells are formed into a similar cell group, and the shared data of the currently formed similar cell group is determined according to the target data, and a corresponding group identifier is assigned to the currently formed similar cell group, and the currently assigned group identifier is written in the cell.
2. The method according to claim 1, characterized in that Before the writing operation for the target data in the cell is responded to, the method further includes: The original table file of the table is loaded into the memory, and the format of the original table file is converted in the following manner to obtain a table file after the format conversion: Determine a similar cell group from the table represented by the original table file, determine shared data of cells in the similar cell group, and assign a corresponding group identifier to the shared data; The corresponding group identifier is written into the cells in the same cell group, and the designated data originally stored in the cells in the same cell group is deleted, wherein the designated data refers to data that is the same as the corresponding shared data.
3. The method according to claim 1 or 2, characterized in that: Also includes: In response to the table storage instruction, storing the table file after format conversion to a designated storage medium; The table file after format conversion includes the correspondence between the same type of cell groups, shared data and group identifiers, and the corresponding group identifiers are written into the cells in the table represented by the table file after format conversion.
4. The method according to claim 1, characterized in that Also includes: Reading a table file, and when a group identifier is written in a cell read, searching for shared data corresponding to the group identifier from the table file after the format conversion; The found shared data is used to display the read cells.
5. The method according to claim 1, characterized in that The method further comprises: Read the table file and render the table view of the table; In the table view, at least two cells that meet a set condition are merged and displayed; The setting condition is used to indicate that at least two cells can form a connected rectangular area and have the same group identifier.
6. The method according to claim 5, characterized in that The method further comprises: The description information of at least two cells that are merged and displayed is displayed in the table view.
7. The method according to claim 5, characterized in that Before rendering to obtain the table view of the table, the method further includes: In response to a triggering operation of the automatic classification and display data function of the table, the rendering to obtain the table view of the table and subsequent steps are performed.
8. The method according to claim 1, characterized in that Also includes: In response to a data processing instruction for a target cell, when it is determined that a group identifier is written in the target cell, determining shared data corresponding to the group identifier; The data processing instructions are executed using the shared data.
9. The method according to claim 8, characterized in that The data processing instruction includes: a screening instruction, and the using the shared data to execute the data processing instruction includes: Determining a screening condition corresponding to the screening instruction; Cells having shared data that meet the screening condition are determined from the target cells as screened cells.
10. The method according to claim 2, characterized in that Determining a group of cells of the same type from the table represented by the original table file comprises: Determine the criteria for determining cells of the same type; Traversing each cell in the table represented by the original table file, determining data of a target type in each of the cells, wherein the target type refers to a sharing type indicated by the determination condition of the same type of cells; According to the target type of data in each of the cells, the cells in the table are divided into a plurality of similar cell groups; The cells in the same cell group have the same target type of data; the cells in different cell groups have different target type of data; The determining of shared data of cells in the same cell group includes: The data of the target type in any cell of the same type of cells is determined as shared data of the cells in the same type of cell group.
11. The method according to claim 10, characterized in that The data for determining the target type in each of the cells includes: In a case where the sharing type indicated by the determination condition of the same type of cells is content sharing, determining the cell content in each of the cells as the data of the target type in the cell; In the case where the sharing type indicated by the determination condition of the same type of cells is format sharing, determining the format data of each of the cells as data of the target type in the cell; In the case that the sharing type indicated by the same type cell determination condition is content and format sharing, the cell content and format data thereof in each of the cells are determined as target type data in the cell.
12. The method according to claim 1, characterized in that The step of determining the shared data of the currently formed group of cells of the same type according to the target data includes: Get the similar cell determination conditions corresponding to the existing similar cell groups; The data in the target data that matches the sharing type indicated by the same type cell determination condition is determined as the shared data of the currently formed same type cell group.
13. A table processing device, characterized in that: The device comprises: a matching module, configured to match the target data with the shared data of an existing similar cell group in response to a write operation on the target data in the cell, wherein the similar cell group is provided with a group identifier, and the cells in the similar cell group have the same shared data; A group identifier writing module, configured to write a group identifier corresponding to the target shared data into the cell when it is determined that there is target shared data matching the target data; A homogeneous group forming module, configured to form the cells into a homogeneous cell group when it is determined that there is no shared data matching the target data; A shared data generation module, used to determine the shared data of the currently formed group of cells of the same type according to the target data; A group identification assignment module is used to assign corresponding group identifications to the currently formed groups of cells of the same type; The group identifier writing module is further used to write the currently allocated group identifier into the cell.
14. A device, characterized in that include: A processor and a memory, wherein the processor is used to execute a table processing program stored in the memory to implement the table processing method according to any one of claims 1 to 12.
15. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the table processing method according to any one of claims 1 to 12.
Citation Information
Cited By
Data processing method and device and electronic equipment
CN120973756A