Table data processing method and device, electronic equipment and storage medium

By dividing a table into multiple data blocks and storing data that is not empty with index values, the problem of large table storage space occupied is solved, and storage efficiency and cell upper limit is improved.

CN120031005APending Publication Date: 2025-05-23TENCENT TECH WUHAN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311587074.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The prior art uses a large storage space when storing data contained in cells in table documents, resulting in a reduced speed of terminal devices and even some functions cannot be used, affecting the user experience.

Method used

By dividing the pending table into multiple data blocks, each data block contains cells in the pending table. If all cells in the data block are empty, it is marked as empty; if the cell is not empty, it is mapped as an index value and at least the index value is stored.

Benefits of technology

The storage space occupied by data blocks corresponding to empty cells in the table is reduced, and the storage efficiency is improved, so that the table can support more cell caps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120031005A_ABST
    Figure CN120031005A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a table data processing method and device, electronic equipment and a storage medium, and is used for reducing storage space occupied by tables and improving storage efficiency. The method comprises the steps of obtaining data contained in each cell of a to-be-processed table; dividing the to-be-processed table according to table attributes to obtain a plurality of data blocks; determining the cells contained in each data block according to the position information of each cell in the to-be-processed table; for each data block, if each cell contained in the data block is empty, marking the data block as empty; and if at least one cell contained in the data block is not empty, for each cell of the data block, determining an index value corresponding to the cell based on the data contained in the cell, and at least storing the index value. According to the method, the table is divided into the data blocks, the data of the table is stored through the index value, and the index value occupies a small storage space, so that the storage space occupied by the table is reduced, and the table storage efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the development of office software, the use of office software is becoming more and more frequent in terminal devices such as computers and mobile phones. For example, a table in office software is composed of multiple cells, and each cell can perform operations such as data writing and deletion.

[0003] Currently, in the market, when storing data contained in cells in table documents, two-dimensional arrays are often used to carry the data contained in the cells, and then the data contained in the cells are stored in the memory. However, the data contained in the cells that can be carried in the memory is limited. When there are more cells in the table that store data, the storage space occupied by the table increases, which in turn causes the running speed of applications including tables in the terminal device to decrease, and even causes some functions to be unusable, affecting the user experience of the object.

[0004] Therefore, how to store the data contained in more cells of Sheet categories in a more storage-saving and flexible way and obtain more cell upper limit support is an urgent problem to be solved. Summary of the invention

[0005] The embodiments of the present application provide a method, device, electronic device and storage medium for processing table data, so as to reduce the storage space occupied by each cell in the table, increase the upper limit of cells that the table can support during storage, and thus improve the storage efficiency of the table.

[0006] A method for processing table data provided in an embodiment of the present application includes:

[0007] Get the data contained in each cell in the table to be processed;

[0008] Dividing the table to be processed according to table attributes to obtain multiple data blocks;

[0009] Determine the cells included in each data block according to the position information of each cell in the table to be processed;

[0010] For each of the data blocks, perform the following operations:

[0011] If all cells contained in the data block are empty, the data block is marked as empty;

[0012] If at least one cell contained in the data block is not empty, then for each cell in the data block, an index value corresponding to the cell is determined based on the data contained in the cell, and at least the index value is stored; wherein the index values ​​corresponding to the same data are the same.

[0013] An embodiment of the present application provides a table data processing device, including:

[0014] An acquisition unit is used to acquire the data contained in each cell in the table to be processed;

[0015] A partitioning unit, used for partitioning the table to be processed according to table attributes to obtain a plurality of data blocks;

[0016] A determination unit, used to determine the cells included in each data block according to the position information of each cell in the table to be processed;

[0017] The execution unit is used to perform the following operations on each of the data blocks:

[0018] If all cells contained in the data block are empty, the data block is marked as empty;

[0019] If at least one cell contained in the data block is not empty, then for each cell in the data block, an index value corresponding to the cell is determined based on the data contained in the cell, and at least the index value is stored; wherein the index values ​​corresponding to the same data are the same.

[0020] Optionally, the execution unit is specifically used for:

[0021] For each non-empty cell in the data block, mapping the data contained in the cell to an index value, and storing the index value, the data contained in the cell, and a mapping relationship between the data and the index value;

[0022] For each empty cell in the data block, a preset fixed value is used as an index value of the cell, and the index value is stored.

[0023] Optionally, the execution unit is further used for:

[0024] According to a preset reading direction, iterative reading is performed on the target data block within the preset reading range in the table to be processed; wherein each iterative reading performs the following operations:

[0025] For a target data block, if the target data block is marked as empty, skip the target data block;

[0026] If the target data block is not marked as empty, the index values ​​of the cells in the target data block are iteratively read; for a cell, if the index value corresponding to the cell is not a preset fixed value, the data corresponding to the index value is read according to the mapping relationship; if the index value corresponding to the cell is a preset fixed value, the cell is skipped.

[0027] Optionally, the execution unit is specifically used for:

[0028] The index value and the mapping relationship between the data contained in the cell and the index value are stored in the memory; wherein the index value and the mapping relationship each occupy a preset storage space;

[0029] The data contained in the cell is stored in at least one of a memory, a hard disk and a cloud according to a preset storage rule.

[0030] Optionally, there is an association relationship between the index value and the position of the cell in the table to be processed, and the device further includes:

[0031] an updating unit, configured to move cells in the table to be processed in response to a cell updating operation on the table to be processed, according to a number of updated cells determined based on the cell updating operation and an updating position in the table to be processed;

[0032] The association relationship is redetermined according to the change in the position of the moved cell in the table to be processed; and the updated data block where the moved cell is located is redetermined according to the association relationship; and the storage of the data contained in the moved cell in the updated data block is updated.

[0033] Optionally, the association relationship includes a row relationship and a column relationship, and the updating unit is specifically used for:

[0034] If the cell update operation includes a row update operation, then the row relationship in the association relationship is re-determined according to the change value of the row position of the cell being moved in the table to be processed;

[0035] If the cell update operation includes a column update operation, the column relationship in the association relationship is re-determined according to the change value of the column position of the moved cell in the table to be processed.

[0036] Optionally, the association relationship includes a row relationship and a column relationship, and the updating unit is specifically used for:

[0037] If the cell update operation includes a row update operation, determining whether the data block where the moved cell is located has changed according to the number of rows updated in the row update operation and the original row relationship in the association relationship, so as to re-determine the update data block where the moved cell is located;

[0038] If the cell update operation includes a column update operation, then based on the number of columns updated in the column update operation and the original column relationship in the association relationship, it is determined whether the data block where the moved cell is located has changed, so as to re-determine the updated data block where the moved cell is located.

[0039] Optionally, the updating unit is specifically used for:

[0040] If the cell update operation includes a cell insertion operation, then according to the number of inserted cells determined based on the cell insertion operation and the insertion position in the table to be processed, the cells after the insertion position are moved; and new cells corresponding to the number of inserted cells are added at the insertion position; wherein the index value corresponding to the new cells is the preset fixed index value;

[0041] If the cell update operation includes a cell deletion operation, the cells after the deletion position are moved according to the number of deleted cells determined based on the cell deletion operation and the deletion position in the table to be processed to replace the index value corresponding to the cell at the deletion position.

[0042] An electronic device provided by an embodiment of the present application includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the above-mentioned table data processing methods.

[0043] An embodiment of the present application provides a computer-readable storage medium, which includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any one of the above-mentioned table data processing methods.

[0044] An embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps of any one of the above-mentioned table data processing methods.

[0045] The beneficial effects of this application are as follows:

[0046] The embodiment of the present application provides a method, device, electronic device and storage medium for processing table data. In the embodiment of the present application, the intuitive two-dimensional data of the table is divided into a plurality of block-shaped small matrices, i.e., data blocks, each of which contains cells in the table to be processed. When each cell in the data block is empty, the data block is directly marked as empty. Therefore, when storing the empty data block, only the mark of the data block is stored, which occupies very little memory and improves storage efficiency.

[0047] When there is at least one non-empty cell in the data block, the non-empty cell is mapped to an index value. When storing the data in the cell, the data is not stored directly, but at least the index value corresponding to the cell is stored, and the index values ​​corresponding to the same data are the same. Since the storage space occupied by the index value is less than the real data, and the same data stores the same index value, compared with directly storing each data in the cell, when using this method to store the data in the cell, the storage space occupied by each cell will also be reduced, and thus more cells can be carried when storing the table, thereby improving the storage efficiency of the table.

[0048] To summarize, the present application divides the table to be processed into multiple data blocks, thereby reducing the storage space occupied by the data blocks corresponding to the cells with empty data in the table to be processed, and stores the cell data based on the index value, thereby reducing the storage space occupied by storing the cell data, so that more non-empty cells can be stored in the table to be processed, thereby reducing the storage space occupied by the table, increasing the upper limit of cells that the table can support, and improving storage efficiency.

[0049] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0051] Figure 1 A schematic diagram of an application scenario in an embodiment of the present application;

[0052] Figure 2 A flowchart of a method for processing table data provided in an embodiment of the present application;

[0053] Figure 3A schematic diagram of a workbook in an embodiment of the present application;

[0054] Figure 4 A schematic diagram of data block division in an embodiment of the present application;

[0055] Figure 5 This is another schematic diagram of data block division in an embodiment of the present application;

[0056] Figure 6 This is a schematic diagram of an empty data block in an embodiment of the present application;

[0057] Figure 7 A schematic diagram of data storage in an embodiment of the present application;

[0058] Figure 8 A schematic diagram of table reading in an embodiment of the present application;

[0059] Fig. 9 A schematic diagram of an association relationship in an embodiment of the present application;

[0060] Fig.10 A schematic diagram of a cell row insertion in an embodiment of the present application;

[0061] Fig.11 A schematic diagram of a cell column insertion in an embodiment of the present application;

[0062] Fig.12 This is a schematic diagram of deleting all cells in an embodiment of the present application;

[0063] Fig.13 A schematic diagram of cell row deletion in an embodiment of the present application;

[0064] Fig.14 This is another schematic diagram of cell row deletion in an embodiment of the present application;

[0065] Fig.15 This is another schematic diagram of deleting all cells in an embodiment of the present application;

[0066] Fig.16 A schematic diagram of cell column deletion in an embodiment of the present application;

[0067] Fig.17 This is another schematic diagram of cell column deletion in an embodiment of the present application;

[0068] Fig.18 An evaluation result diagram of a table data processing provided in an embodiment of the present application;

[0069] Fig.19 A schematic diagram of the structure of a table data processing device in an embodiment of the present application;

[0070] Fig. 20 A schematic diagram of a hardware structure of an electronic device to which an embodiment of the present application is applied;

[0071] Fig.21 The present invention is a schematic diagram of the hardware structure of another electronic device to which the embodiments of the present application are applied. DETAILED DESCRIPTION

[0072] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution 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 technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.

[0073] The following is an introduction to some concepts involved in the embodiments of the present application.

[0074] Sheet: It is the most important part of Excel (spreadsheet software) for storing and processing data, which contains cells arranged in rows and columns. It is part of a workbook, also known as a spreadsheet. Sheets can be used to organize and analyze data. Data can be entered and edited on multiple sheets at the same time, and data from different sheets can be summarized and calculated. After creating a chart, it can be placed on the worksheet where the source data is located, or on a separate chart worksheet.

[0075] Grid data structure: refers to dividing a plane into regular grids for easy layout and editing. In computer programs, common grids include tables, grid layouts, and pixel tables in image processing, etc. In urban planning, planned roads and buildings are also planned according to a certain network layout, etc. In the embodiment of the present application, grid refers to a two-dimensional table in a sheet, which contains two-dimensional data in the sheet. In addition to the grid, the sheet also contains non-two-dimensional data.

[0076] In the embodiment of the present application, the table to be processed may refer to a sheet in Excel, each sheet contains two-dimensional grid data and non-two-dimensional data, and the two-dimensional data refers to the data contained in the cells in the sheet, including text, numbers, formats, etc. Non-two-dimensional data refers to data such as pictures, bar charts, pie charts, and line charts inserted in the sheet; the table to be processed may also refer to a grid in a sheet, and the grid contains the two-dimensional data in the sheet.

[0077] Block: refers to a data area in the grid, which is a small matrix that contains multiple two-dimensional data in the grid. According to the properties of the table to be processed, the grid can be divided into multiple blocks, so that a complete grid is formed by multiple blocks to express the two-dimensional data belonging to the grid, that is, the cell data in the sheet.

[0078] Sparse data: refers to the fact that the cells that are not empty in the sheet are sparsely distributed in the sheet. Sheet is a table displayed in the workbook window. A sheet can consist of 1048576 rows and 2464 columns. For example, in a sheet, most cells are empty, and the proportion of cells that are not empty is small. Moreover, the cells that are not empty are distributed in various positions of the sheet, scattered, and may even be distributed far away. For example, in the sheet, only the cells in the 10*10 area in the upper left corner and the cells in the 10*10 area in the lower right corner contain data. The data distributed in the sheet is called sparse data.

[0079] The method for processing table data in the embodiment of the present application involves database technology.

[0080] In short, a database can be seen as an electronic filing cabinet - a place to store electronic files, where objects can add, query, update, delete, and other operations on the data in the files. The so-called "database" is a collection of data that is stored together in a certain way, can be shared with multiple objects, has as little redundancy as possible, and is independent of the application.

[0081] For example, in an embodiment of the present application, multiple data blocks obtained by dividing the table to be processed, cell data, index values ​​corresponding to the cells, mapping relationships between cells and index values, etc. can be stored in a database for subsequent use, etc.

[0082] The method for processing table data in the embodiment of the present application also involves cloud storage technology.

[0083] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.

[0084] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID, ID entity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.

[0085] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of independent redundant disk arrays (RAID, Redundant Array of Independent Disk), the physical storage space is divided into stripes in advance. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.

[0086] In the embodiment of the present application, cloud storage can be used to store table processing related data in the cloud.

[0087] The following is a brief introduction to the design concept of the embodiment of the present application:

[0088] With the development of office software, the use of office software is becoming more and more frequent in terminal devices such as computers and mobile phones. For example, a sheet in office software is composed of multiple cells, and each cell can perform operations such as data writing and deletion.

[0089] Currently on the market, when storing the data contained in the cells of a table document, a two-dimensional array is often used to carry it, and then the data contained in the cell is stored in the memory. For a cell, when the data contained in the cell is large, the storage space occupied by the cell also increases. However, the data contained in the cells that can be carried in the memory is limited. When the data stored in each cell is large, the number of cells that can be carried in the table will be reduced. When there are more cells in the table that store data, or the data stored in the cells that store data is large, the storage space occupied by the table will increase, resulting in a decrease in the running speed of applications including tables in the terminal device, and even causing some functions to be unusable, affecting the user experience of the object.

[0090] In view of this, an embodiment of the present application provides a method, device, electronic device and storage medium for processing table data. In an embodiment of the present application, the table to be processed is divided into multiple data blocks, each of which contains cells in the table to be processed. When each cell in the data block is empty, the data block is directly marked as empty. Therefore, when storing the empty data block, only the mark of the data block is stored, and the memory occupied is very small.

[0091] When there is at least one non-empty cell in the data block, the non-empty cell is mapped to an index value. When storing the data in the cell, the data is not stored directly, but at least the index value corresponding to the cell is stored, and the index values ​​corresponding to the same data are the same. Since the storage space occupied by the index value is less than the real data, and the same data stores the same index value, compared with directly storing each data in the cell, when using this method to store the data in the cell, the storage space occupied by each cell will also be reduced, and thus more cells can be carried when storing the table, thereby improving the storage efficiency of the table.

[0092] To summarize, the present application divides the table to be processed into multiple data blocks, thereby reducing the storage space occupied by the data blocks corresponding to the cells with empty data in the table to be processed, and stores the cell data based on the index value to reduce the storage space occupied by storing the cell data, so that more non-empty cells can be stored in the table to be processed, thereby reducing the storage space occupied by the table and increasing the upper limit of cells that the table can support.

[0093] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.

[0094] like Figure 1 As shown, it is a schematic diagram of an application scenario of an embodiment of the present application. The application scenario diagram includes two terminal devices 110 and a server 120.

[0095] In the embodiment of the present application, the terminal device 110 includes but is not limited to mobile phones, tablet computers, laptop computers, desktop computers, e-book readers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals and other devices; a client related to the processing of table data can be installed on the terminal device, and the client can be software (such as a browser, office software, etc.), or a web page, a small program, etc. The server 120 is a background server corresponding to the software or web page, small program, etc., or a server specifically used for processing table data, which is not specifically limited in the present application. The server 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms.

[0096] It should be noted that the method for processing table data in each embodiment of the present application can be executed by an electronic device, which may be a terminal device 110 or a server 120, that is, the method can be executed by the terminal device 110 or the server 120 alone, or can be executed jointly by the terminal device 110 and the server 120.

[0097] For example, when the terminal device 110 and the server 120 jointly execute, the terminal device 110 is installed with a table processing-related client (such as Excel), and the subject can enter data in the sheet in Excel through the terminal device 110. The terminal device 110 sends the table containing the data to the server 120. The server 120 divides the table into multiple data blocks according to the attributes of the table, maps the cells in each data block to index values, and stores the index values. When the subject inserts, deletes, and other operations on cells in the table in the terminal device 110, the terminal device 110 performs corresponding insertion and deletion operations on the cells and the index values ​​corresponding to the cells in response to the above operations, and sends the table after the operation or the data to be updated to the server 120, so that the server 120 updates the storage of the cell data in the table after the insertion and deletion operations.

[0098] In an optional implementation, the terminal device 110 and the server 120 may communicate with each other via a communication network.

[0099] In an optional implementation, the communication network is a wired network or a wireless network.

[0100] It should be noted that Figure 1The figure is only an example. In fact, the number of terminal devices and servers is not limited and is not specifically limited in the embodiments of the present application.

[0101] In an embodiment of the present application, when there are multiple servers, the multiple servers can form a blockchain, and the servers are nodes on the blockchain; as in the method for processing table data disclosed in the embodiment of the present application, the table data involved can be saved on the blockchain, for example, multiple data blocks obtained by dividing the table to be processed, cell data, index values ​​corresponding to the cells, mapping relationships between cells and index values, etc.

[0102] In addition, the embodiments of the present application can be applied to various scenarios, including not only spreadsheet application scenarios, but also including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving and other scenarios.

[0103] The following describes the method for processing tabular data provided by the exemplary embodiment of the present application in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation methods of the present application are not limited in this regard.

[0104] See also Figure 2 As shown, it is an implementation flow chart of a method for processing table data provided in an embodiment of the present application. Taking the server as the execution subject as an example, the specific implementation process of the method is as follows S21-S24:

[0105] S21: The server obtains the data contained in each cell in the table to be processed.

[0106] In an embodiment of the present application, the object can insert or create a table to be processed in any client (such as office software such as Excel), web page, or mini-program that can insert or create a table, and enter some data in the table to be processed. Then, the two-dimensional data of each cell in the table needs to be stored.

[0107] For example, when the object uses Excel software, the object opens Excel and a workbook is displayed by default. The workbook contains at least one sheet, and each sheet contains multiple cells storing two-dimensional data.

[0108] In actual applications, in addition to storing two-dimensional data in cells in a table, you can also insert non-two-dimensional data such as pictures, bar charts, pie charts, line charts, videos, etc. into the table.

[0109] In the embodiment of the present application, the table to be processed may refer to a sheet in Excel, each sheet contains two-dimensional grid data and non-two-dimensional data, and the two-dimensional data refers to the data contained in the cells in the sheet, including text, numbers, formats, etc. Among them, the format refers to the format setting of the cell, such as background fill, etc. The non-two-dimensional data refers to the data such as pictures, bar charts, pie charts, line charts, etc. inserted in the sheet; the table to be processed may also refer to the grid in the sheet, and the grid contains the two-dimensional data in the sheet, that is, the data contained in the cells.

[0110] Specifically, the two-dimensional data may include text, numbers, and cell formats, etc. For example, the data may be text such as "number", "number 1", or numbers such as "1", "11", or cell formats such as "set cell to yellow fill format", which is not specifically limited in this application.

[0111] The following uses Excel as an example to explain workbook, sheet, grid and cell. Figure 3 The workbook diagram shown.

[0112] like Figure 3 As shown, it is a schematic diagram of a workbook in an embodiment of the present application. Figure 3 It is a workbook containing 3 grids, each grid contains 81 cells.

[0113] For the sake of simple example, Figure 3 The example in the figure is an empty grid where the object has not yet entered cell data, that is, Figure 3 The grid contained in each sheet in the listed workbook is an empty grid and does not include any two-dimensional data.

[0114] In actual applications, the object can input two-dimensional data and store the two-dimensional data in the grid, including but not limited to the texts and numbers listed above, which will not be described one by one here.

[0115] S22: The server divides the table to be processed according to table attributes to obtain multiple data blocks.

[0116] In an embodiment of the present application, in order to reduce the storage space occupied by large continuous empty cells, the intuitive two-dimensional array of the original sheet is split into multiple blocks, each block contains cells of a partial area, and a complete grid is formed by multiple blocks to express the two-dimensional array data originally belonging to the grid.

[0117] In the embodiments of the present application, the essence of a block can be understood as a two-dimensional array of a fixed length, for example, a two-dimensional array of 32 bytes or 64 bytes, and the present application does not make any specific limitation on this.

[0118] The table attributes include but are not limited to some or all of the following: the size of the grid, and the density distribution of non-empty cells in the grid.

[0119] Specifically, the size of the grid, that is, the number of cells contained in the grid, may result in more or larger blocks for a grid containing more data blocks than for a grid containing fewer data blocks.

[0120] The density distribution of non-empty cells in the grid refers to the situation that when dividing the grid, consecutive non-empty cells are divided into one block and consecutive empty cells are divided into one block.

[0121] In addition, in order to facilitate data reading and data storage, the shape of the block must also be considered when dividing the grid. When dividing the grid, the shape of each block should be a square with equal length and width.

[0122] For details on the division of data blocks, please refer to Figure 4 and Figure 5 The data block division diagram is shown.

[0123] like Figure 4 As shown, it is a schematic diagram of data block division in an embodiment of the present application. Figure 4 It means that a grid with 81 cells in a sheet is divided into 9 3*3 data blocks. You, me, him, it, big, small, ?, 8, 9, 0 in the cells are two-dimensional data in non-empty cells. Since the distribution of non-empty cells in the grid is concentrated in the upper left and upper right corners of the table, the grid can be divided into 3*3 blocks, or 4*4 blocks or other sizes. Since the size of the grid is 9*9, the 4*4 block is not applicable, and the grid can be divided into 9 3*3 blocks.

[0124] like Figure 4 At S401, S402, S403, S404 and S405, the data block at S401 contains cells with data of you, me, him and 6 empty cells, the data block at S402 contains cells with data of big, small, ?, 8, 9, 0 and 3 empty cells, the data block at S403 contains cells with data of it and 8 empty cells, and both S404 and S405 contain 9 empty cells.

[0125] like Figure 5 As shown, it is another data block division schematic diagram in an embodiment of the present application. Figure 5 This is a diagram of dividing a sheet, a grid containing 16 empty cells, into four 2*2 data blocks. Figure 5 The table contains fewer cells, so when the table is divided, the number of data blocks obtained is smaller and the size is smaller. Since the grid size is 4*4, the grid is divided into 4 data blocks of 2*2.

[0126] It should be noted that the above Figure 4 , Figure 5 The table division rules listed are just simple examples. In addition, other rules for table division are also applicable to the embodiments of the present application and will not be described in detail here.

[0127] S23: The server determines the cells included in each data block according to the position information of each cell in the table to be processed.

[0128] In an embodiment of the present application, the position information refers to the row number and column number of the cell in the grid. The coordinates of the cell can be constructed based on the row number and column number. For example, the position information of a cell in the grid can be (0,0), indicating that the cell is at the 0th row and 0th column in the grid.

[0129] According to the coordinates of the cell in the grid, the data block where the cell is located can be determined; according to the coordinates of all the cells in the grid, the cells contained in each data block in the grid can be determined.

[0130] Continue to use Figure 4 The assumption is that Figure 4 The grid containing 81 cells is divided into 9 data blocks of 3*3. For the cell with coordinate (0,0) containing the data "you", it is located in the data block at S401 in the grid; the corresponding cell with coordinate (0,3) containing the data "it" is located in the data block at S402 in the grid because it is located in the 0th row and the 3rd column, and the size of each data block is 3*3. Similarly, since the size of the data block is 3*3, the data block at S401 contains 9 cells with coordinates (0,0), (0,1), (0,2), (1,0), (1,1), (1,2), (2,0), (2,1) and (2,2).

[0131] Similarly, the data block at S402 includes 9 cells with coordinates (6,6), (6,7), (6,8), (7,6), (7,7), (7,8), (8,6), (8,7), and (8,8).

[0132] The data block at S403 includes 9 cells with coordinates (0,3), (0,4), (0,5), (1,3), (1,4), (1,5), (2,3), (2,4), (2,5); and so on.

[0133] S24: For each data block, the server performs the following operations S241-S242:

[0134] S241: If all cells contained in the data block are empty, the server marks the data block as empty.

[0135] In the embodiment of the present application, considering that not every data block necessarily contains data, when all cells in a data block are empty, the entire data block can be marked as empty, such as by a null pointer. In this way, when storing the data block, a two-dimensional array is not stored, but a null pointer that can determine the position of the empty data block is stored.

[0136] Still Figure 4 The figure shows an example, which is a schematic diagram of an empty data block in an embodiment of the present application. Figure 4 The schematic diagram of dividing a grid containing 81 cells into 9 3*3 data blocks. The data blocks shown in S404 and S405 are both empty data blocks, and the data blocks shown in S401, S402 and S403 all contain non-empty cells. Therefore, when storing S404, a null pointer connected to the previous data block S403 and the next data block S405 will be stored to determine that the cells contained in S404 are all empty and to determine the position of S601. The storage space occupied by the null pointer does not exceed 8 bytes.

[0137] In the above implementation, the storage of each empty cell in the data block is achieved by storing a null pointer of the empty data block. Since the storage space occupied by the null pointer is small, the storage space occupied by the empty cell is reduced.

[0138] S242: If at least one cell contained in the data block is not empty, then for each cell in the data block, the server determines an index value corresponding to the cell based on the data contained in the cell, and stores at least the index value.

[0139] The index value corresponds to the data in the cell one by one. Different data corresponds to different index values, and the same data corresponds to the same index value. Figure 6 Schematic diagram of a non-empty data block shown.

[0140] like Figure 6 As shown, it is a schematic diagram of a non-empty data block in an embodiment of the present application. Figure 6The following is a schematic diagram of dividing a grid consisting of 81 cells into 9 3*3 data blocks. Figure 6 As shown in S601, the 9 cells in the data block are all non-empty cells, and the data contained in each cell are you, me, him, 11, 22, him, 5, 6, me. For the cells in which both data in the data block are me, the data of the two cells are the same, so the two data blocks will correspond to the same index value, such as the index value 2; for the cells in which both data in the data block are him, the data of the two cells are the same, so the two data blocks will correspond to the same index value, such as the index value 3.

[0141] like Figure 6 As shown in S602, there are 2 cells in the data block that are not empty cells, and the data corresponding to each cell is it and him. For the two cells with his data in data block S601 and the one cell with his data in S602, the data of these three cells are the same, so these three data blocks will correspond to the same index value, such as index value 3.

[0142] like Figure 6 As shown in S603, there are 6 cells in the data block that are not empty, wherein the data corresponding to each cell is large, small,?, 8, 9, 0, and the data of the cells that are not empty in S603 are all different and are not the same as the cell data in S601 and S602, so there is no same index value in S603.

[0143] In the embodiment of the present application, when storing cell data, the cell data is not directly stored but is stored in a manner of storing the index value corresponding to the cell.

[0144] Specifically, the index value can be a number, letter, symbol, etc., which is not specifically limited in this document.

[0145] In the embodiment of the present application, considering that not every cell in the same data block necessarily contains data, different methods can be used to determine the index value corresponding to the cell according to whether the cell of the data block is empty. An optional implementation is as follows:

[0146] For each non-empty cell in the data block, the data contained in the cell is mapped to an index value, and the index value, the data contained in the cell, and the mapping relationship between the data and the index value are stored.

[0147] Specifically, for a data block containing at least one non-empty cell, the non-empty cell data in the data block can be mapped to an index value through a memory, and the index value corresponds one-to-one to the data. When storing the data, the data, the index value mapped to the data, and the mapping relationship between the data and its index value can be stored.

[0148] Continue to use Figure 4 The assumption is that Figure 4 Taking S401 as an example, if the cell with data "you" in S401 is mapped to index value "1" through the memory, then when storing the data block, the data "you", index value "1", and the mapping relationship between "you" and "1" can be stored.

[0149] For each empty cell in the data block, a preset fixed value is used as the index value of the cell, and the index value is stored.

[0150] Specifically, for an empty cell in a data block, the cell is not mapped, and a fixed preset value is directly used as its index value. When storing the empty cell, the corresponding preset fixed value is stored.

[0151] The preset fixed value may be 0 or a negative value, such as -1, to distinguish it from other non-empty cell index values. For example, when the preset fixed value is 0, the index value mapped to other non-empty cells cannot be 0, and when the preset fixed value is -1, the index value mapped to other non-empty cells can be specified not to be -1, or directly specified not to be a negative value.

[0152] In addition, the preset fixed value may also be other numbers, letters, symbols, etc. The preset fixed value can be used to distinguish it from other non-empty cells. This application does not make any specific limitations on this.

[0153] In an optional implementation, for cells that are not empty, the index value corresponding to the cell and the mapping relationship between the data contained in the cell and the index value can be stored in the memory; the data contained in the cell can be stored in at least one of the memory, hard disk and cloud according to preset storage rules.

[0154] For an empty cell, it is only necessary to store the index value corresponding to the cell, that is, to store the index value in the memory.

[0155] Among them, the index value and the mapping relationship each occupy a preset storage space. For example, the index value and the mapping relationship can each occupy one byte in the storage space. Compared with the traditional data structure that needs to be written to a two-dimensional array, the storage method of this data structure is to directly store the data in the cell. In the traditional storage method, even if the cell is empty, it will occupy one byte of storage space. Therefore, when the cell is not empty, the storage space occupied by the cell will be greater than one byte. The larger the data stored in the cell, the larger the storage space occupied. Therefore, when storing the same number of cells, the storage space occupied by the grig data structure and the index value storage method adopted in this application will be less than the storage space occupied by the traditional data structure.

[0156] The data in the cell may be stored in at least one of a memory, a hard disk, and a cloud.

[0157] Specifically, the data in the cell may be stored in the memory first, followed by the hard disk, and finally in the cloud. For example, when storing data, if there is still enough storage space in the memory, the data may be stored in the memory; if there is not enough storage space in the memory and there is enough storage space in the hard disk, the data may be stored in the hard disk; if there is not enough storage space in both the memory and the hard disk, the data may be stored in the cloud.

[0158] Alternatively, the storage order of the cell data may be ignored and the data may be directly stored in a hard disk or a cloud, etc. Any method of storing data in memory, hard disk, and cloud is applicable to the embodiments of the present application and will not be described in detail here.

[0159] In addition, it should be noted that if the data is stored on a hard disk or in the cloud, when reading the data, the data is first loaded from the hard disk or in the cloud into the memory, and then loaded from the memory for data reading, thereby realizing dynamic loading and saving runtime memory.

[0160] like Figure 7 As shown in , it is a schematic diagram of data storage in an embodiment of the present application. Figure 7 The diagram in the figure is a schematic diagram of storing cell data in a non-empty data block in a table. Figure 7 The data input by "you", "me", and "he" as the object, taking "he" in S701 as an example, the data is text, not numbers, and has the format: bold font; Figure 7 In the table, "1", "2", and "3" are the index values ​​mapped to the cells, where "1" is mapped to "you", "2" is mapped to "me", and "3" is mapped to "him". Figure 7When storing S701 "he", its index value S702 "3" and the mapping relationship between "he" and "3" are stored in the memory, and the text "he" of S701 is stored in the bold font in at least one of the memory, hard disk, and cloud. Assume that there is not enough storage space in the memory, so the text and format of S701 are stored in the hard disk. Figure 7 For empty cells, assuming that their preset fixed value is 0, when storing the empty cells, just store their preset fixed value 0.

[0161] In the above implementation, since the data in the table is discrete, most of the data in the actual application scenario exists in a discrete form, and the data is scattered in various corners of the grid, resulting in the positions of non-empty cells being scattered and may even be far apart. For example, the cells in the 10*10 area in the upper left corner of the grid and the cells in the 10*10 area in the lower right corner of the grid contain data, and the cells in other positions are all empty.

[0162] Based on the above situation, this application adopts a structure that divides the grid into multiple blocks, and divides consecutive empty cells into the same block as much as possible. In addition, since empty pointers are stored for empty data blocks, only preset fixed values ​​are stored for empty cells in non-empty data blocks, the memory occupied by large continuous empty cells can be greatly reduced.

[0163] Moreover, by means of index value plus external storage, the two-dimensional data that originally needs to be stored in the memory is stored in at least one of the memory, hard disk and cloud, which effectively reduces the storage space occupied by the cells in the sheet and increases the upper limit of the cells that the sheet can carry.

[0164] The above is an explanation from the aspect of cell data storage. The table processing method in the embodiment of the present application is explained below from the aspect of cell data reading:

[0165] In the embodiment of the present application, after the two-dimensional data in the sheet is stored in the above manner, when the sheet is read, the two-dimensional data in the sheet is read by reading each data block. Specifically, reading rules such as the reading method and the reading range need to be pre-set.

[0166] An optional implementation is as follows:

[0167] According to the preset reading direction, the target data block within the preset reading range in the table to be processed is iteratively read; wherein each iterative reading performs the following operations:

[0168] For a target data block, if the target data block is marked as empty, the target data block is skipped;

[0169] If the target data block is not marked as empty, the index values ​​of the cells in the target data block are iteratively read.

[0170] Considering that when determining the index value corresponding to the cell, the empty cell is mapped to a preset fixed value, the data in the corresponding cell can be obtained according to the index value:

[0171] For a cell, if the index value corresponding to the cell is not a preset fixed value, the data corresponding to the index value is read according to the mapping relationship; if the index value corresponding to the cell is a preset fixed value, the cell is skipped.

[0172] The preset reading direction refers to the order in which the data blocks in the grid are read during iterative reading, including the starting position of the reading and the row and column order of the reading. The starting position of the reading can be the upper left corner data block, the lower left corner data block, etc. of the grid, and the row and column order of the reading can be reading by row or by column.

[0173] For example, the data block may be read iteratively by row starting from the upper left corner of the grid in the sheet, the data block may be read iteratively by column starting from the upper left corner of the grid in the sheet, or the data block may be read iteratively by row starting from the lower right corner of the grid in the sheet, etc. This application does not make any specific limitation.

[0174] The read range refers to which data blocks in the grid need to be read during iterative reading. If the object does not select a read range, the default read range is the entire grid. If the object selects a read range, the range selected by the object is used as the preset read range. For example, if the object selects the range from the first row and the first column to the fifth row and the fifth column in the grid, the preset read range is the range selected by the object.

[0175] In the embodiment of the present application, the iterator for iterative reading operation on the grid can be a grid view (GridView) control, or a data table (DataGrid) control, etc., and the present application does not make specific limitations.

[0176] When reading two-dimensional data in a sheet, the data blocks are iteratively read according to the reading range selected by the object or the entire grid and the preset reading direction. If a data block in the reading range is marked as empty (that is, stored as a null pointer), when the null pointer is read, the data block is considered to be an invalid data block, and the data block and the cells in the data block are not read. The data block is directly skipped to read the next data block.

[0177] If a data block is not empty, iteratively read each cell in the data block. If the cell is not empty, read the index value corresponding to the cell, and map the index value through the memory to determine the corresponding data. If the cell is empty, that is, the index value of the cell is a preset fixed value, such as 0, -1, etc., skip the cell and do not read it.

[0178] When iteratively reading cells in a data block, the iteration direction of the above data block can be referred to, that is, when reading cells in a data block, the cells are read according to the preset reading start position and the reading row and column order. The reading start position can be the upper left corner cell, the lower left corner cell, etc. in the data block, and the reading row and column order can be reading by row or by column.

[0179] For details, please refer to Figure 8 Schematic diagram of table reading shown.

[0180] like Figure 8 As shown, it is a schematic diagram of table reading in an embodiment of the present application. Figure 8 When reading two-dimensional data in a sheet, the two-dimensional data is read by reading the grid of the sheet. The grid contains 8 data blocks, and each data block contains multiple cells. Assuming that the reading direction starts from S801 in the upper left corner and reads iteratively by row, S801 is read first. S801 is a non-empty data block, and the index value corresponding to the cell in its upper left corner is 1. Assuming that the data corresponding to the index value is "you". When the grid is iteratively read through GridView, when S801 is read, it is not empty, so the cells in S801 are iteratively read. Assuming that it starts from the upper left cell in the data block, iterative reading is performed by row. When the cell with an index value of 1 is read, the index value 1 of the memory is mapped to the data "you", thereby obtaining the data in the cell. Except for this cell, all other cells are empty cells, and the index values ​​are all preset fixed values ​​0. Therefore, when iteratively reading S801, only the cell with an index value of 1 is iterated, and the rest of the cells are skipped. Then, the data is read row by row to S802, which is an empty data block. When the grid is iteratively read through GridView, a null pointer of S802 is read, and it is determined that S802 is an invalid data block. S802 is directly skipped to read the next data block.

[0181] It should be noted that the iterator can only perform read operations on the grid. If you need to write operations to the grid, you need a mutation function to perform the write operation.

[0182] In the above implementation, when reading the grid divided into multiple blocks, empty data blocks and empty cells in non-empty data blocks are skipped; compared to the traditional two-dimensional array data structure, when reading cells, iterative reading is required regardless of whether the cells are empty or not; the present application directly skips the data blocks where large continuous empty cells are located, greatly reducing the time spent on iterative reading and improving the user experience of the object.

[0183] It should be noted that the above is a brief description of iterative reading of cell data blocks. The table processing method in the embodiment of the present application is further described below from the perspective of row and column operations of cells:

[0184] When performing row and column operations on the cell data contained in the grid in the sheet, it is often achieved by moving the cells. Since the index value is associated with the position of the cell in the table to be processed, the movement of the cell will cause the association to change, and the change of the cell contained in the data block in the grid is determined based on the changed association.

[0185] In the embodiment of the present application, row and column operations performed on data blocks included in the grid are referred to as cell update operations.

[0186] In an optional embodiment, in response to a cell update operation on a table to be processed, the cells in the table to be processed are moved according to the number of updated cells determined based on the cell update operation and the update position in the table to be processed; then, the association relationship is redetermined according to the change in the position of the moved cells in the table to be processed; and, based on the association relationship, the update data block in which the moved cells are located is redetermined; and the storage of the data contained in the moved cells in the update data block is updated.

[0187] The association relationship can be represented by the location information of the cell in the grid. For example, (0,0,1) can be used to represent that the cell at row 0 and column 0 in the grid contains data, and the index value obtained by mapping the data is 1. (0,0) is the association relationship, and 1 is the index value. For details, please refer to Fig. 9 The diagram of the association relationship is shown.

[0188] like Fig. 9 As shown, it is a schematic diagram of an association relationship in an embodiment of the present application. Fig. 9 Data is entered in a cell for the object, so when the data block where the cell is located is initialized, the index value corresponding to the data is filled in the corresponding position in the data block according to the association relationship. Fig. 9The data block is an empty data block as shown in S91 before the object is input. The object inputs data into the cell at row 0 and column 0 in the grid, and the index value obtained by mapping the data is 1. The cell is in the data block, and after the object inputs the data, the data block is initialized, as shown in S92, and the cell at the upper left corner of the data block is filled with index value 1. As shown in S93, other empty cells in the data block that have not been input with data by the object are filled with a fixed index value of 0. Assuming that the data block is a data block with n rows and m columns, the two-dimensional array stored in the data block is (0,0,1)(0,1,0)(0,2,0)…(0,m-1,0)…(n-1,m-1,0). That is, by storing index values ​​in the form of this two-dimensional array, the association relationship can represent the position of the cell and data block corresponding to the index value in the grid.

[0189] When the cell update operation of the corresponding object updates the cells contained in the grid in the sheet, the position of the cell to be moved and the distance to be moved are determined based on the cell update position and the number of cell updates. Since there is an association between the index value in the cell and the position of the cell in the grid, the association will change after the cell is moved. The update data block where the cell is located after the move is re-determined based on the updated association, so that the cells contained in each update data block after the cell update operation can be determined, and the storage of the data in the moved cell can be adjusted.

[0190] Specifically, since the data in each of the cells being moved has not changed, the index value corresponding to the data in the cells being moved will not change, but the association relationship of the cells being moved has changed. For example, for a cell that needs to be moved, its original position in the grid is (5, 1), and it is located in the data block of the 2nd row and 1st column in the grid. In response to the cell update operation, the cell needs to move up by the length of a cell, so the position of the cell in the grid after moving is (4, 1). At this time, since the cell at position (4, 1) is located in the data block of the 1st row and 1st column, the cell is in the data block of the 1st row and 1st column after moving. Assuming that the index value corresponding to the cell is "1", the original index value and association relationship of the cell are (5, 1, 1), and the index value and association relationship after moving are (4, 1, 1).

[0191] Since the association relationship includes row relationship and column relationship, if the cell update operation is performed on one or several rows of cells, only the row relationship corresponding to the moved cells needs to be updated; then the data block where the moved cells are located needs to be updated based on the original row relationship and the updated number of rows. If the cell update operation is performed on one or several columns of cells, only the column relationship corresponding to the moved cells needs to be updated; then the data block where the moved cells are located needs to be updated based on the original column relationship and the updated number of columns.

[0192] Specifically, if the cell update operation includes a row update operation, the row relationship in the association relationship is re-determined according to the change value of the row position of the cell being moved in the table to be processed.

[0193] In addition, it is also possible to determine whether the data block where the moved cell is located has changed based on the number of rows updated in the row update operation and the original row relationship in the association relationship, so as to re-determine the update data block where the moved cell is located.

[0194] For example, if the cell update operation is an update row operation, such as deleting the 2 rows of cells after the 8th row of cells in the grid, in this update row operation, the original position of a cell is (10, 5), that is, the row relationship is 10. The cell needs to move up two rows, so the row relationship needs to be reduced by 2, that is, the row relationship changes from 10 to 8, that is, it moves from (10, 5) in the grid to (8, 5). Since the block size in the grid is 3*3, the cell at the position (10, 5) belongs to the data block of the 4th row and the 2nd column in the grid, and the cell at the position (8, 5) belongs to the data block of the 3rd row and the 2nd column in the grid, so the moved cell is in the data block of the 3rd row and the 2nd column in the grid.

[0195] For example, in an update row operation, the original position of a cell in the row after deleting the cell in the 9th row of the grid is (11, 5), that is, the row relationship is 11. The cell needs to be moved up one row, so the row relationship needs to be reduced by 1, that is, the row relationship changes from 11 to 10, that is, it moves from (11, 5) to (10, 5) in the grid. Since the block size in the grid is 3*3, the cell at position (11, 5) belongs to the data block of the 4th row and 2nd column in the grid, and the cell at position (10, 5) also belongs to the data block of the 4th row and 2nd column in the grid, so the data block where the moved cell is located does not change.

[0196] If the cell update operation includes a column update operation, the column relationship in the association relationship is re-determined according to the change value of the column position of the cell being moved in the table to be processed.

[0197] In addition, it is also possible to determine whether the data block where the moved cell is located has changed according to the number of columns updated in the column update operation and the original column relationship in the association relationship, so as to re-determine the updated data block where the moved cell is located.

[0198] For example, in an update column operation, the original position of a cell is (10, 5), that is, the column relationship is 5. The cell needs to be moved two columns to the left, so the column relationship needs to be reduced by 2, that is, the column relationship changes from 5 to 3, that is, it moves from (10, 5) to (10, 3) in the grid. Since the cell at the position (10, 5) belongs to the data block of the 4th row and 2nd column in the grid, and the cell at the position (10, 3) belongs to the data block of the 4th row and 1st column in the grid, the moved cell is in the data block of the 3rd column and 1st column in the grid.

[0199] For another example, in an update column operation, the original position of a cell is (10, 5), that is, the column relationship is 5. The cell needs to be moved to the left by one column, so the column relationship needs to be reduced by 1, that is, the column relationship changes from 5 to 4, that is, it moves from (10, 5) to (10, 4) in the grid. Since the cell at the position (10, 5) belongs to the data block of the 4th row and 2nd column in the grid, and the cell at the position (10, 4) also belongs to the data block of the 4th row and 2nd column in the grid, the data block where the moved cell is located does not change.

[0200] It should be noted that the above mainly describes the cell update operation from the perspective of row and column changes. Specifically, the row and column changes are also divided into two operations: insertion and deletion. That is, the cell update operation can be divided into: cell insertion operation and cell deletion operation.

[0201] In an optional embodiment, if the cell update operation includes a cell insertion operation, the cells after the insertion position are moved according to the number of inserted cells determined based on the cell insertion operation and the insertion position in the table to be processed; and new cells equal to the number of inserted cells are added at the corresponding insertion position.

[0202] Among them, the index value corresponding to the newly added cell is a preset fixed index value.

[0203] In the cell insertion operation, it is divided into the insertion row operation and the insertion column operation.

[0204] Specifically, in response to an insert row operation on the table to be processed, based on the number of inserted rows of the insert row operation and the insert row position set by the insert row operation in the table to be processed, the cells below the insert row position in the table to be processed are moved downward by the number of inserted rows; based on the change value of the row position of the moved cell in the table to be processed, the row relationship in the association relationship is re-determined, and the number of data blocks that need to be moved downward for the moved cell is determined.

[0205] Furthermore, newly added cells of the same number as the insertion number are added to the data block corresponding to the insertion position; and the association relationship of the newly added cells is determined according to the insertion position of the newly added cells.

[0206] When moving the cells below the insertion position, the non-empty cells and empty cells below the insertion position can be directly moved down by the number of inserted rows, or the position of the last row of non-empty cells below the insertion position can be first found, and all cells between the insertion position and the last row of non-empty cells can be moved down by the number of inserted rows, etc. This application does not make specific limitations.

[0207] For details, please refer to Fig.10 The cell row shown is inserted into the schematic.

[0208] like Fig.10 As shown, it is a schematic diagram of cell row insertion in an embodiment of the present application. Fig.10 In the example, a row of cells is inserted before the first row of cells in the grid. Before the insertion operation, the grid contains two rows and three columns, a total of 6 data blocks, where each data block includes 4 cells. Except for the data block at row 0 and column 0 and the data block at row 1 and column 1, which each contain 4 cells with index value 1, the other data blocks are empty.

[0209] Among them, the first row of cells contains two non-empty cells, both of which are located in the data block of row 0 and column 0. When performing a row insertion operation, you can first find the position of the non-empty cells in the last row, move the cells between the insertion position and the position of the non-empty cells in the last row down by one row at the same time, and add a new row of cells at the insertion position. There are a total of 4 new row cells, and their association relationships in the grid are (1, 0), (1, 1), (1, 2), and (1, 3), respectively. Therefore, it can be determined that the newly added cells at positions (1, 0) and (1, 1) are located in the data block of row 0 and column 0, and the newly added cells at positions (1, 2) and (1, 3) are located in the data block of row 0 and column 1. The index values ​​of the 4 newly added cells are all the preset fixed value 0. Since the cells in the data block of row 0 and column 1 are all empty, Fig.10 In the update data block at row 0 and column 1 after the move, the index value is not displayed and is the preset fixed value 0.

[0210] Since the number of inserted rows is 1, the cells whose original positions in the grid are (1, 0), (1, 1), (3, 2), and (3, 3) have their data blocks changed after being moved. The cells whose original positions are (1, 0) and (1, 1) have their row relationship changed from 1 to 2, so they are moved from the data block at row 0 and column 0 to the data block at row 1 and column 0, and their positions after being moved are (2, 0) and (2, 1); the cells (3, 2) and (3, 3) have their row relationship changed from 3 to 3, so they are moved from the data block at row 1 and column 1 to the data block at row 2 and column 1, and their positions after being moved are (4, 2) and (4, 3).

[0211] In the grid, the cells whose original positions are (2, 2) and (2, 3) have their row relationship changed from 2 to 3. Therefore, these two cells are in the data block of the 1st row and 1st column before and after the move, and their positions after the move are (3, 2) and (3, 3).

[0212] Similarly, the cell column insertion operation is similar to the cell row insertion operation.

[0213] Specifically, in response to an insert column operation on the table to be processed, based on the number of inserted columns of the insert column operation and the insert column position set by the insert column operation in the table to be processed, the cells below the insert column position in the table to be processed are moved downward by the number of inserted columns; according to the change value of the column position of the moved cell in the table to be processed, the column relationship in the association relationship is re-determined, and the number of data blocks that need to be moved downward for the moved cell is determined.

[0214] Furthermore, newly added cells of the same number as the insertion number are added to the data block corresponding to the insertion position; and the association relationship of the newly added cells is determined according to the insertion position of the newly added cells.

[0215] When moving the cells below the insertion position, the non-empty cells and empty cells below the insertion position can be directly moved down by the number of inserted columns, or the position of the last column of non-empty cells below the insertion position can be first found, and all cells between the insertion position and the last column of non-empty cells can be moved down by the number of inserted columns, etc. This application does not make specific limitations.

[0216] For details, please refer to Fig.11 The cell row shown is inserted into the schematic.

[0217] like Fig.11 As shown, it is a schematic diagram of cell column insertion in an embodiment of the present application. Fig.11In the example, a column of cells is inserted before the first column of cells in the grid. Before the insertion operation, the grid contains two rows and three columns, a total of 6 data blocks, where each data block includes 4 cells. Except for the data block at row 0 and column 0, which contains 4 cells with index value 1, and the data block at row 1 and column 1, which contains 2 cells with index value 1, the other data blocks are empty.

[0218] Among them, the first row of cells contains two non-empty cells, both of which are located in the data block of row 0 and column 0. When performing a column insertion operation, the position of the non-empty cells in the last column can be found first, and the cells between the insertion position and the position of the non-empty cells in the last column can be moved to the right by one row at the same time, and a column of cells can be added at the insertion position. There are a total of 6 newly added row cells, and their association relationships in the grid are (0, 1), (1, 1), (2, 1), (3, 1), (4, 1), and (5, 1). Therefore, it can be determined that the newly added cells at positions (0, 1) and (1, 1) are located in the data block of row 0 and column 0, the newly added cells at positions (2, 1) and (3, 1) are located in the data block of row 1 and column 0, and the newly added cells at positions (4, 1) and (5, 1) are located in the data block of row 2 and column 0. The index values ​​of the 6 newly added cells are all the preset fixed value 0. Since the cells in the data block of row 1 and column 0 and the data block of row 2 and column 0 are empty, Fig.11 In the figure, after the move, the index value is not displayed in the updated data block at the 1st row and the 0th column and the updated data block at the 2nd row and the 0th column, and both are preset fixed values ​​of 0.

[0219] Since the number of inserted columns is 1, the cells whose original positions in the grid are (0, 1) and (1, 1) have their data blocks changed after the move, and their column relationship changes from 1 to 2. Therefore, the data block at row 0 and column 0 is moved to the data block at row 0 and column 1, and the positions after the move are (0, 2) and (1, 2).

[0220] In the grid, the cells whose original positions are (2, 2) and (3, 2) have their column relationship changed from 2 to 3. Therefore, these two cells are in the 1st row and 1st column data block before and after the move, and their positions after the move are (2, 3) and (3, 3).

[0221] In the above implementation, in response to the object's insertion operation on the cell data, the index value corresponding to each cell is updated in the storage space accordingly.

[0222] In addition, the cell update operation also includes the cell deletion operation.

[0223] In an optional embodiment, if the cell update operation includes a cell deletion operation, the cells after the deletion position are moved according to the number of deleted cells determined based on the cell deletion operation and the deletion position in the table to be processed to replace the index value corresponding to the cell at the deletion position.

[0224] In the cell deletion operation, it is divided into the row deletion operation and the column deletion operation.

[0225] Specifically, in response to a delete row operation on the table to be processed, based on the number of deleted rows in the delete row operation and the deleted row position set by the delete row operation in the table to be processed, the cells below the deleted row position in the table to be processed are moved upward to cover the cells at the deleted position; according to the change value of the row position of the moved cell in the table to be processed, the row relationship in the association relationship is re-determined, and the data block where the moved cell is located is determined according to the row relationship.

[0226] There are two types of cell row deletion operations: full deletion and partial deletion. When deleting all cells, the preset fixed value of the empty cell after the deletion position can be directly used to replace the index value of the deleted cell. For details, please refer to Fig.12 Schematic diagram of deleting all cells in .

[0227] like Fig.12 As shown, it is a schematic diagram of deleting all cells in an embodiment of the present application. Fig.12 The grid contains 1 row and 4 columns of data blocks, where the 0th row and 4th column data block and the 3rd row and 0th column data block are both empty, and the 1st row and 0th column data block and the 2nd row and 0th column data block each contain 4 cells with index values ​​of 1. Fig.12 It is necessary to delete all 8 cells in the data block of row 1, column 0 and the data block of row 2, column 0. Therefore, the cells below the deletion position can be moved up by 4 rows, so that the index values ​​of the 4 rows of cells at the deletion position are replaced with the preset fixed values ​​of the cells in the 4 rows after the deletion position. After the replacement, the index values ​​of the 4 rows of cells at the deletion position are the preset fixed values. Therefore, after the deletion operation, all cells in the grid are empty cells.

[0228] When partially deleting a row of cells, if the cell after the deletion position is empty, the preset fixed value of the empty cell directly replaces the index value of the deleted cell. For details, see Fig.13 Schematic diagram of cell row deletion.

[0229] like Fig.13 As shown, it is a schematic diagram of cell row deletion in an embodiment of the present application. Fig.13The grid contains 1 row and 4 columns of data blocks, where the 0th row and 0th column data block and the 3rd row and 0th column data block are both empty, and the 1st row and 0th column data block and the 2nd row and 0th column data block each contain 4 cells with index values ​​of 1. Fig.13 It is necessary to delete the cells with the association relationship (3,0) and (3,1) in the data block of row 1 and column 0, and the 4 cells with index value 1 in the data block of row 2 and column 0. The cell index values ​​of the deleted cells, i.e., the 3rd, 4th, and 5th rows, can be directly replaced with the 3 rows of empty cells after the last row of cells in the deleted position, i.e., the cells in row 5. After the replacement, the index values ​​of the deleted cells are all the preset fixed value 0. Then, in the replaced grid, the cell index values ​​of the cells with the association relationship (3,0) and (3,1) in the data block of row 1 and column 0, are replaced from 1 to 0, and the 4 cell index values ​​of the cells with the association relationship (4,0), (4,1), (5,0), and (5,1) in the data block of row 2 and column 0, are replaced from 1 to 0. Therefore, the data block of row 2 and column 0 is an empty data block after the row deletion operation.

[0230] When deleting a part of a row of cells, if the cell after the deletion position is not empty, the index value of the deleted cell is directly replaced by the index value of the non-empty cell after the deletion position. Fig.14 Schematic diagram of cell row deletion.

[0231] like Fig.14 As shown, it is another schematic diagram of cell row deletion in an embodiment of the present application. Fig.14 The grid contains 1 row and 4 columns of data blocks, where the 0th row and 0th column data block and the 3rd row and 0th column data block are both empty. The cell index values ​​of the 1st row and 0th column data block with the associated relationship (2,0) and (2,1) are both 1, and the cell index values ​​of the associated relationship (3,0) and (3,1) are both 2; the cell index values ​​of the 2nd row and 0th column data block with the associated relationship (4,0) and (4,1) are both 3, and the cell index values ​​of the associated relationship (5,0) and (5,1) are both 4. Fig.14 In the data block of row 1 and column 0, the cells with the association relationship of (3,0) and (3,1) and the cells with the association relationship of (4,0) and (4,1) in the data block of row 2 and column 0 need to be deleted. The cell index values ​​of the cells in the deletion position, i.e., the 3rd and 4th rows, can be directly replaced by the cells in the last row of the deletion position, i.e., the 2 rows of cells after the 4th row of cells.

[0232] After the replacement, the index value of the cell with the association relationship (3,0) and (3,1) in the data block of row 1 and column 0 is replaced from 2 to 4, and the index value of the cell with the association relationship (4,0) and (4,1) in the data block of row 2 and column 0 is replaced from 3 to the preset fixed value 0. Therefore, after the replacement, the original association relationship in the data block of row 2 and column 0 is (5,0) and (5,1), and the row relationship of the cell with index value 4 is changed from 5 to 3, so the cell with index value 4 is moved from the data block of row 2 and column 0 to the data block of row 1 and column 0.

[0233] After replacement, the cells in the data block at row 1, column 0 include two cells with an associated relationship of (2,0) and (2,1) and an index value of 1, and two cells with an associated relationship of (3,0) and (3,1) and an index value of 4. All four cells in the data block at row 2, column 0 are empty, so the data block is directly marked as empty.

[0234] Similarly, the cell column deletion operation is similar to the cell row deletion operation.

[0235] Specifically, in response to a delete column operation on the table to be processed, based on the number of deleted columns of the delete column operation and the deleted column position set by the delete column operation in the table to be processed, the cells to the right of the deleted column position in the table to be processed are moved to the left to cover the cells at the deleted position; according to the change value of the column position of the moved cell in the table to be processed, the column relationship in the association relationship is re-determined, and the data block where the moved cell is located is determined according to the column relationship.

[0236] There are two types of cell column deletion operations: full deletion and partial deletion. When deleting all cells, the preset fixed value of the empty cell to the right of the deletion position can be used to replace the index value of the deleted cell. For details, please refer to Fig.15 Schematic diagram of deleting all cells in .

[0237] like Fig.15 As shown, it is another schematic diagram of cell column deletion in an embodiment of the present application. Fig.15 The grid contains 4 rows and 1 column of data blocks, where the 0th row and 0th column data block and the 0th row and 3rd column data block are both empty, and the 0th row and 1st column data block and the 0th row and 2nd column data block each contain 4 cells with index values ​​of 1. Fig.15 It is necessary to delete all 8 cells in the data block of row 0 and column 1 and the data block of row 0 and column 2. Therefore, the cells to the right of the deletion position can be moved 4 rows to the left, so that the index values ​​of the 4 rows of cells to the right of the deletion position are replaced with the preset fixed values ​​of the cells in the 4 rows to the right of the deletion position. After the replacement, the index values ​​of the 4 columns of cells in the deletion position are the preset fixed values. Therefore, after the deletion operation, all cells in the grid are empty cells.

[0238] When deleting a cell in a column, if the cell after the deletion position is empty, the preset fixed value of the empty cell directly replaces the index value of the deleted cell. For details, please refer to Fig.16 Schematic diagram of cell column deletion.

[0239] like Fig.16 As shown, it is a schematic diagram of cell column deletion in an embodiment of the present application. Fig.16 The grid contains 2 rows and 4 columns of data blocks, among which the data blocks at row 0 and column 0, row 0 and column 1, row 1 and column 1, row 2 and column 1, row 3 and column 0, and row 3 and column 1 are all empty. The data blocks at row 1 and column 0 and row 2 and column 0 each contain 4 cells with index value 1. Fig.16 It is necessary to delete the cells with the association relationship (2,1) and (3,1) in the data block of row 1 and column 0, and the cells with the association relationship (4,1) and (5,1) in the data block of row 2 and column 0. The last column of cells in the deletion position, that is, the 3 empty columns of cells after the cells in the first column of the grid, can be directly replaced with the cell index value of the deletion position, that is, the first column. After the replacement, the index values ​​of the deleted cells are all the preset fixed value 0. Then, in the replaced grid, in the data block of row 1 and column 0, the cell index values ​​with the association relationship (2,1) and (3,1) are replaced from 1 to 0, and in the data block of row 2 and column 0, the cell index values ​​with the association relationship (4,1) and (5,1) are replaced from 1 to 0.

[0240] When partially deleting cells, if the cell after the deletion position is not empty, the index value of the deleted cell is directly replaced by the index value of the non-empty cell after the deletion position. Fig.17 Schematic diagram of cell column deletion.

[0241] like Fig.17 As shown, it is another schematic diagram of cell column deletion in an embodiment of the present application. Fig.17The grid contains 2 rows and 4 columns of data blocks, among which the data blocks in row 0 and column 0, row 0 and column 1, row 3 and column 0, and row 3 and column 1 are all empty. The cell index values ​​of the associated relationships (2,0) and (2,1) in the data block in row 1 and column 0 are both 1, and the cell index values ​​of the associated relationships (3,0) and (3,1) are both 2; the cell index values ​​of the associated relationships (4,0) and (4,1) in the data block in row 2 and column 0 are both 3, and the cell index values ​​of the associated relationships (5,0) and (5,1) are both 4; the cell index value of the associated relationship (2,2) in the data block in row 1 and column 1 is 5, and the cell index value of the associated relationship (3,2) is 6; the cell index value of the associated relationship (4,2) in the data block in row 2 and column 1 is 7, and the cell index value of the associated relationship (5,2) is 8. Fig.17 In the data block of row 1, column 0, the cells with the association relationship of (2,1) and (3,1) and the cells with the association relationship of (4,0) and (5,1) in the data block of row 2, column 0 need to be deleted. The last column of cells in the deletion position, that is, the column of cells after the cells in column 1, can be directly replaced with the cell index value of the deletion position cell, that is, the cell index value of column 1.

[0242] After the replacement, the index value of the cell with the association relationship (2,1) in the data block at row 1 and column 0 is replaced from 1 to 5, the index value of the cell with the association relationship (3,1) is replaced from 2 to 6, the index value of the cell with the association relationship (4,1) in the data block at row 2 and column 0 is replaced from 3 to 7, and the index value of the cell with the association relationship (5,1) is replaced from 4 to 8.

[0243] Therefore, after the replacement, the column relationship of the cells with the original association relationship of (2,2) and (3,2) in the data block of row 1 and column 1 changes from 2 to 1. Therefore, the cells with the original association relationship of (2,2) and (3,2) are moved from the data block of row 1 and column 1 to the data block of row 1 and column 0. The column relationship of the cells with the original association relationship of (4,2) and (5,2) in the data block of row 2 and column 1 changes from 2 to 1. Therefore, the cells with the original association relationship of (4,2) and (5,2) are moved from the data block of row 2 and column 1 to the data block of row 2 and column 0.

[0244] After replacement, the four cells in the data block of row 1, column 1, and the four cells in the data block of row 2, column 1 are all empty, so these two data blocks are directly marked as empty. After the cell column is deleted, the cell data corresponding to index values ​​1, 2, 3, 4, 5, 6, 7, and 8 do not change, but the column relationship of the cells changes.

[0245] In the above implementation, in response to the object's cell update operation on the cell data, a corresponding update operation is performed on the index value corresponding to each cell in the storage space.

[0246] See also Fig.18 As shown, it is an evaluation result diagram of a table data processing provided in an embodiment of the present application. Fig.18 The table data processing method invented by the present application is demonstrated. In the processing of 1 million cells at random positions as the core indicator, the memory space occupied by the 1 million cells, the performance of random insertion and deletion of rows and columns, the time taken for random modification of data, and the iterative reading of the full amount of data are evaluated respectively. Fig.18 It can be seen that this application only occupies 30M when processed by the grid structure, while it occupies 80M when directly processed by the two-dimensional array structure; in the performance of random insertion and deletion of rows and columns, this application takes 80us, and the two-dimensional array structure takes 100ms; in random modification of data, this application takes 10us, and the two-dimensional array structure takes 50ms; in iterative reading of the full amount of data, this application takes 10ms, and the two-dimensional array structure takes 2000ms. It can be seen that for the same number of cells, the storage space occupied by this application to store these data is much smaller than that of the two-dimensional array structure; when performing insertion and deletion of rows and columns, modification of data, and iterative reading operations on the same number of cells, the time spent by this application is also much less than that spent by the two-dimensional array structure.

[0247] Obviously, the above investigation further shows that the method for processing table data in the embodiment of the present application has better effect.

[0248] In the embodiment of the present application, the table to be processed is divided into multiple data blocks, each of which contains cells in the table to be processed. When each cell in a data block is empty, the data block is directly marked as empty. Therefore, when storing an empty data block, only the mark of the data block is stored, and the memory occupied is very small.

[0249] When there is at least one non-empty cell in the data block, the non-empty cell is mapped to an index value. When storing the data in the cell, the data is not stored directly, but at least the index value corresponding to the cell is stored. Since the index value occupies less storage space than the real data, compared with directly storing the data in the cell, the storage space occupied when using this method to store the data in the cell will also be reduced.

[0250] In summary, the present application divides the table to be processed into multiple data blocks, thereby reducing the storage space occupied by the data blocks corresponding to the cells with empty data in the table to be processed, and stores the cell data based on the index value to reduce the storage space occupied by storing the cell data, so that more non-empty cells can be stored in the table to be processed, thereby reducing the storage space occupied by the table and increasing the upper limit of cells that the table can support.

[0251] Based on the same inventive concept, the present application embodiment also provides a device for processing table data. Fig.19 As shown, it is a schematic diagram of the structure of a table data processing device 1900, which may include:

[0252] The acquisition unit 1901 is used to acquire the data contained in each cell in the table to be processed;

[0253] A division unit 1902 is used to divide the table to be processed according to table attributes to obtain multiple data blocks;

[0254] A determination unit 1903, configured to determine the cells included in each data block according to the position information of each cell in the table to be processed;

[0255] The execution unit 1904 is used to perform the following operations on each data block:

[0256] If all cells contained in the data block are empty, the data block is marked as empty;

[0257] If at least one cell contained in the data block is not empty, then for each cell in the data block, an index value corresponding to the cell is determined based on the data contained in the cell, and at least the index value is stored; wherein the index values ​​corresponding to the same data are the same.

[0258] Optionally, the execution unit 1904 is specifically configured to:

[0259] For each non-empty cell in the data block, the data contained in the cell is mapped to an index value, and the index value, the data contained in the cell, and the mapping relationship between the data and the index value are stored;

[0260] For each empty cell in the data block, a preset fixed value is used as the index value of the cell, and the index value is stored.

[0261] Optionally, the execution unit 1904 is further configured to:

[0262] According to the preset reading direction, the target data block within the preset reading range in the table to be processed is iteratively read; wherein each iterative reading performs the following operations:

[0263] For a target data block, if the target data block is marked as empty, the target data block is skipped;

[0264] If the target data block is not marked as empty, the index values ​​of the cells in the target data block are iteratively read; for a cell, if the index value corresponding to the cell is not a preset fixed value, the data corresponding to the index value is read according to the mapping relationship; if the index value corresponding to the cell is a preset fixed value, the cell is skipped.

[0265] Optionally, the execution unit 1904 is specifically configured to:

[0266] The index value and the mapping relationship between the data contained in the cell and the index value are stored in the memory; wherein the index value and the mapping relationship each occupy a preset storage space;

[0267] The data contained in the cell is stored in at least one of the memory, the hard disk and the cloud according to a preset storage rule.

[0268] Optionally, the index value is associated with the position of the cell in the table to be processed, and the device further includes:

[0269] An updating unit 1905, configured to move cells in the table to be processed in response to a cell updating operation on the table to be processed, according to the number of updated cells determined based on the cell updating operation and the updating position in the table to be processed;

[0270] Re-determining the association relationship according to the change in the position of the moved cell in the table to be processed; and re-determining the update data block where the moved cell is located according to the association relationship;

[0271] Update updates the storage of data contained in the cell being moved in the data block.

[0272] Optionally, the association relationship includes a row relationship and a column relationship, and the updating unit 1905 is specifically used for:

[0273] If the cell update operation includes a row update operation, the row relationship in the association relationship is re-determined according to the change value of the row position of the cell being moved in the table to be processed;

[0274] If the cell update operation includes a column update operation, the column relationship in the association relationship is re-determined according to the change value of the column position of the cell being moved in the table to be processed.

[0275] Optionally, the association relationship includes a row relationship and a column relationship, and the updating unit 1905 is specifically used for:

[0276] If the cell update operation includes a row update operation, then according to the number of rows updated in the row update operation and the original row relationship in the association relationship, it is determined whether the data block where the moved cell is located has changed, so as to re-determine the update data block where the moved cell is located;

[0277] If the cell update operation includes a column update operation, then based on the number of columns updated in the column update operation and the original column relationship in the association relationship, it is determined whether the data block where the moved cell is located has changed, so as to re-determine the update data block where the moved cell is located.

[0278] Optionally, the updating unit 1905 is specifically configured to:

[0279] If the cell update operation includes a cell insertion operation, the cells after the insertion position are moved according to the number of inserted cells determined based on the cell insertion operation and the insertion position in the table to be processed; and new cells corresponding to the number of inserted cells are added at the corresponding insertion position; wherein the index value corresponding to the new cell is a preset fixed index value;

[0280] If the cell update operation includes a cell deletion operation, the cells after the deletion position are moved according to the number of deleted cells determined based on the cell deletion operation and the deletion position in the table to be processed to replace the index value corresponding to the cell at the deletion position.

[0281] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

[0282] After introducing the table data processing method and device according to the exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.

[0283] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.

[0284] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present application. In one embodiment, the electronic device may be a server, such as Figure 1 In this embodiment, the structure of the electronic device can be as follows: Fig. 20As shown, it includes a memory 2001 , a communication module 2003 and one or more processors 2002 .

[0285] The memory 2001 is used to store computer programs executed by the processor 2002. The memory 2001 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0286] The memory 2001 may be a volatile memory, such as a random-access memory (RAM); the memory 2001 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 2001 may be any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2001 may be a combination of the above memories.

[0287] The processor 2002 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 2002 is used to implement the above table data processing method when calling the computer program stored in the memory 2001.

[0288] The communication module 2003 is used to communicate with terminal devices and other servers.

[0289] The specific connection medium between the memory 2001, the communication module 2003 and the processor 2002 is not limited in the embodiment of the present application. Fig. 20 In the embodiment, the memory 2001 and the processor 2002 are connected via a bus 2004. The bus 2004 is Fig. 20 The connections between the other components are only for illustration and are not intended to be limiting. The bus 2004 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Fig. 20 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or only one type of bus.

[0290] The memory 2001 stores a computer storage medium, and the computer storage medium stores computer executable instructions, and the computer executable instructions are used to implement the table data processing method of the embodiment of the present application. The processor 2002 is used to execute the above-mentioned table data processing method, such as Figure 2 shown.

[0291] In another embodiment, the electronic device may also be other electronic devices, such as Figure 1 The terminal device 110 shown in FIG. 1 is a terminal device 110 shown in FIG. 1 . In this embodiment, the structure of the electronic device can be as follows: Fig.21 As shown, it includes: a communication component 2110, a memory 2120, a display unit 2130, a camera 2140, a sensor 2150, an audio circuit 2160, a Bluetooth module 2170, a processor 2180 and other components.

[0292] The communication component 2110 is used to communicate with the server. In some embodiments, a wireless fidelity (WiFi) module may be included. The WiFi module belongs to a short-range wireless transmission technology. The electronic device can help the user to send and receive information through the WiFi module.

[0293] The memory 2120 can be used to store software programs and data. The processor 2180 executes various functions and data processing of the terminal device 110 by running the software programs or data stored in the memory 2120. The memory 2120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The memory 2120 stores an operating system that enables the terminal device 110 to run. In the present application, the memory 2120 can store an operating system and various application programs, and can also store a computer program for executing the processing method of the table data of the embodiment of the present application.

[0294] The display unit 2130 can also be used to display information input by the user or information provided to the user and a graphical user interface (GUI) of various menus of the terminal device 110. Specifically, the display unit 2130 may include a display screen 2132 disposed on the front of the terminal device 110. The display screen 2132 may be configured in the form of a liquid crystal display, a light emitting diode, etc. The display unit 2130 can be used to display the cell data input user interface in the embodiment of the present application, etc.

[0295] The display unit 2130 can also be used to receive input digital or character information, and generate signal input related to user settings and function control of the terminal device 110. Specifically, the display unit 2130 may include a touch screen 2131 arranged on the front of the terminal device 110, which can collect user touch operations on or near it, such as clicking a button, dragging a scroll box, etc.

[0296] The touch screen 2131 can be covered on the display screen 2132, or the touch screen 2131 and the display screen 2132 can be integrated to realize the input and output functions of the terminal device 110. The integrated touch screen can be referred to as a touch display screen. In this application, the display unit 2130 can display the application and the corresponding operation steps.

[0297] The camera 2140 can be used to capture static images, and the user can publish the images taken by the camera 2140 through the application. The camera 2140 can be one or more. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the processor 2180 to convert it into a digital image signal.

[0298] The terminal device may further include at least one sensor 2150, such as an acceleration sensor 2151, a distance sensor 2152, a fingerprint sensor 2153, and a temperature sensor 2154. The terminal device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.

[0299] The audio circuit 2160, the speaker 2161, and the microphone 2162 can provide an audio interface between the user and the terminal device 110. The audio circuit 2160 can transmit the electrical signal converted from the received audio data to the speaker 2161, which is converted into a sound signal for output. The terminal device 110 can also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 2162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 2160 and converted into audio data, and then the audio data is output to the communication component 2110 to be sent to, for example, another terminal device 110, or the audio data is output to the memory 2120 for further processing.

[0300] The Bluetooth module 2170 is used to exchange information with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 2170 to exchange data.

[0301] The processor 2180 is the control center of the terminal device. It uses various interfaces and lines to connect various parts of the entire terminal. It executes various functions of the terminal device and processes data by running or executing software programs stored in the memory 2120 and calling data stored in the memory 2120. In some embodiments, the processor 2180 may include one or more processing units; the processor 2180 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 2180. In the present application, the processor 2180 can run the operating system, application programs, user interface display and touch response, as well as the table data processing method of the embodiment of the present application. In addition, the processor 2180 is coupled to the display unit 2130.

[0302] In some possible implementations, various aspects of the method for processing tabular data provided in the present application may also be implemented in the form of a program product, which includes a computer program. When the program product is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the method for processing tabular data according to various exemplary implementations of the present application described above in this specification. For example, the electronic device may execute the following steps: Figure 2 Follow the steps shown in .

[0303] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0304] The program product of the embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can be run on an electronic device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, apparatus, or device.

[0305] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.

[0306] The computer program embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0307] The computer program for performing the operation of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and also conventional procedural programming languages ​​such as "C" language or similar programming languages. The computer program can be executed entirely on the user electronic device, partially on the user electronic device, as a separate software package, partially on the user electronic device and partially on a remote electronic device, or entirely on a remote electronic device or server. In the case of a remote electronic device, the remote electronic device can be connected to the user electronic device through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using an Internet service provider to connect through the Internet).

[0308] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0309] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0310] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain a computer-usable computer program.

[0311] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program commands. These computer program commands can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the commands executed by the processor of the computer or other programmable data processing device generate commands for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0312] These computer program commands may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the commands stored in the computer readable memory produce an article of manufacture comprising a command device, the command device implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0313] These computer program commands can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the commands executed on the computer or other programmable device provide the instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0314] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0315] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for processing tabular data, It is characterized in that The method comprises: Get the data contained in each cell in the table to be processed; Dividing the table to be processed according to table attributes to obtain multiple data blocks; Determine the cells included in each data block according to the position information of each cell in the table to be processed; For each of the data blocks, perform the following operations: If all cells contained in the data block are empty, the data block is marked as empty; If at least one cell contained in the data block is not empty, then for each cell in the data block, an index value corresponding to the cell is determined based on the data contained in the cell, and at least the index value is stored; wherein the index values ​​corresponding to the same data are the same.

2. The method according to claim 1, It is characterized in that The step of determining, for each cell in the data block, an index value corresponding to the cell based on data contained in the cell, and storing at least the index value, comprises: For each non-empty cell in the data block, mapping the data contained in the cell to an index value, and storing the index value, the data contained in the cell, and a mapping relationship between the data and the index value; For each empty cell in the data block, a preset fixed value is used as an index value of the cell, and the index value is stored.

3. The method according to claim 2, It is characterized in that The method further comprises: According to a preset reading direction, iterative reading is performed on the target data block within the preset reading range in the table to be processed; wherein each iterative reading performs the following operations: For a target data block, if the target data block is marked as empty, skip the target data block; If the target data block is not marked as empty, the index values ​​of the cells in the target data block are iteratively read; for a cell, if the index value corresponding to the cell is not a preset fixed value, the data corresponding to the index value is read according to the mapping relationship; if the index value corresponding to the cell is a preset fixed value, the cell is skipped.

4. The method according to claim 2, It is characterized in that The index value, the data contained in the cell, and the mapping relationship between the data and the index value are stored, including: The index value and the mapping relationship between the data contained in the cell and the index value are stored in the memory; wherein the index value and the mapping relationship each occupy a preset storage space; The data contained in the cell is stored in at least one of a memory, a hard disk and a cloud according to a preset storage rule.

5. The method according to any one of claims 1 to 4, It is characterized in that The index value is associated with the position of the cell in the table to be processed, and the method further includes: In response to a cell update operation on the table to be processed, according to the number of updated cells determined based on the cell update operation and the update position in the table to be processed, the cells in the table to be processed are moved; The association relationship is redetermined according to the change in the position of the moved cell in the table to be processed; and the updated data block where the moved cell is located is redetermined according to the association relationship; and the storage of the data contained in the moved cell in the updated data block is updated.

6. The method according to claim 5, It is characterized in that The association relationship includes a row relationship and a column relationship, and the re-determining of the association relationship according to the change of the position of the moved cell in the table to be processed includes: If the cell update operation includes a row update operation, then the row relationship in the association relationship is re-determined according to the change value of the row position of the cell being moved in the table to be processed; If the cell update operation includes a column update operation, the column relationship in the association relationship is re-determined according to the change value of the column position of the moved cell in the table to be processed.

7. The method according to claim 5, It is characterized in that The association relationship includes a row relationship and a column relationship, and the step of re-determining the update data block where the moved cell is located according to the association relationship includes: If the cell update operation includes a row update operation, determining whether the data block where the moved cell is located has changed according to the number of rows updated in the row update operation and the original row relationship in the association relationship, so as to re-determine the update data block where the moved cell is located; If the cell update operation includes a column update operation, then based on the number of columns updated in the column update operation and the original column relationship in the association relationship, it is determined whether the data block where the moved cell is located has changed, so as to re-determine the updated data block where the moved cell is located.

8. The method according to claim 5, It is characterized in that The moving of cells in the table to be processed according to the number of updated cells determined based on the cell update operation and the update position in the table to be processed includes: If the cell update operation includes a cell insertion operation, then according to the number of inserted cells determined based on the cell insertion operation and the insertion position in the table to be processed, the cells after the insertion position are moved; and new cells corresponding to the number of inserted cells are added at the insertion position; wherein the index value corresponding to the new cells is the preset fixed index value; If the cell update operation includes a cell deletion operation, the cells after the deletion position are moved according to the number of deleted cells determined based on the cell deletion operation and the deletion position in the table to be processed to replace the index value corresponding to the cell at the deletion position.

9. A device for processing tabular data, It is characterized in that include: An acquisition unit is used to acquire the data contained in each cell in the table to be processed; A partitioning unit, used for partitioning the table to be processed according to table attributes to obtain a plurality of data blocks; A determination unit, used to determine the cells included in each data block according to the position information of each cell in the table to be processed; The execution unit is used to perform the following operations on each of the data blocks: If all cells contained in the data block are empty, the data block is marked as empty; If at least one cell contained in the data block is not empty, then for each cell in the data block, an index value corresponding to the cell is determined based on the data contained in the cell, and at least the index value is stored; wherein the index values ​​corresponding to the same data are the same.

10. The device according to claim 9, It is characterized in that The execution unit is specifically used for: For each non-empty cell in the data block, mapping the data contained in the cell to an index value, and storing the index value, the data contained in the cell, and a mapping relationship between the data and the index value; For each empty cell in the data block, a preset fixed value is used as an index value of the cell, and the index value is stored.

11. The device according to claim 10, It is characterized in that The execution unit is also used for: According to a preset reading direction, iterative reading is performed on the target data block within the preset reading range in the table to be processed; wherein each iterative reading performs the following operations: For a target data block, if the target data block is marked as empty, skip the target data block; If the target data block is not marked as empty, the index values ​​of the cells in the target data block are iteratively read; for a cell, if the index value corresponding to the cell is not a preset fixed value, the data corresponding to the index value is read according to the mapping relationship; if the index value corresponding to the cell is a preset fixed value, the cell is skipped.

12. The device according to claim 10, It is characterized in that The execution unit is specifically used for: The index value and the mapping relationship between the data contained in the cell and the index value are stored in the memory; wherein the index value and the mapping relationship each occupy a preset storage space; The data contained in the cell is stored in at least one of a memory, a hard disk and a cloud according to a preset storage rule.

13. An electronic device, It is characterized in that It comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the methods of claims 1 to 8.

14. A computer-readable storage medium, It is characterized in that It includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any method described in claims 1 to 8.

15. A computer program product, It is characterized in that The method comprises a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device executes the steps of any one of the methods described in claims 1 to 8.