Data exporting method, terminal equipment and storage medium

By dividing the data into multiple ContentPart shards and gradually adding them to the table file, the problem of excessive memory consumption in traditional export methods when processing large-scale data is solved, and more efficient data export is achieved, avoiding OOM errors, and Improved performance.

CN119494330AInactive Publication Date: 2025-02-21SHENZHEN GUANMAI NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510072928.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-02-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional export methods consume a lot of memory when processing large-scale data, resulting in performance degradation and even OOM errors, which are inefficient.

Method used

Avoid loading the entire dataset into memory at once by dividing the data into multiple ContentPart shards and gradually adding it to the table file. At the same time, cell merging operations are supported to adapt to different datasets and export requirements.

Benefits of technology

It reduces memory usage, avoids OOM errors, improves the smoothness and performance of the program, and can adjust the size and number of shards as needed when processing large data sets, further improving the efficiency of data export.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119494330A_ABST
    Figure CN119494330A_ABST
Patent Text Reader

Abstract

The invention is suitable for the field of data processing, and discloses a data exporting method, terminal equipment and a storage medium. The data exporting method comprises the steps of selecting a target fragment in a ContentPart set according to fragment numbers of all content fragments in the ContentPart set; adding a row data set in the target fragment to a table file; if the table file needs to execute the cell merging operation, executing the cell merging operation on the table file to obtain a target table file; and if the to-be-processed fragment does not exist in the ContentPart set, exporting the target table file. The data is processed in the form of fragments and is gradually added into the form file, so that the whole data set does not need to be loaded into a memory at one time, the use of the memory is reduced, and the occurrence of OOM errors is effectively avoided. When a big data set is processed, the size and the number of the fragments can be adjusted according to needs so as to adapt to different data sets and export requirements, and the data export efficiency is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data processing, and in particular relates to a data export method, terminal equipment and storage medium. Background Art

[0002] Spreadsheet files have become the most common format for software systems to export data to users. In actual development, developers need to deal with tedious format conversion between system data and Excel. When the number of exported data rows reaches hundreds of thousands or even millions, developers need to invest a lot of effort.

[0003] The traditional export method is to load the data completely into the memory and then generate a table file. When the amount of data is very large, this method will consume a lot of memory to generate a table file, resulting in a decrease in program performance and even OOM (memory overflow) errors. It can be seen that the traditional export method is inefficient in exporting table files. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a data export method, a terminal device and a storage medium, which can solve the problem of low efficiency in exporting table files in the related art.

[0005] A first aspect of the present invention provides a method for exporting data, comprising:

[0006] According to the fragment number of each content fragment in the ContentPart collection, select the target fragment in the ContentPart collection:

[0007] Add the row data set in the target shard to the table file;

[0008] If the table file needs to perform a cell merge operation, perform the cell merge operation on the table file to obtain the target table file;

[0009] If there are no fragments to be processed in the ContentPart collection, the target table file is exported.

[0010] Optionally, in a first implementation of the first aspect of the present invention, the step of performing a cell merging operation on a table file to obtain a target table file includes:

[0011] According to the cell group information of the row data imported into the table file, a cell merge operation is performed on the table file to obtain a target table file, and the cell group information includes row groups and column groups.

[0012] Optionally, in a second implementation of the first aspect of the present invention, if a cell merge operation needs to be performed on the table file, the cell merge operation is performed on the table file, and before the step of obtaining the target table file, the method further includes:

[0013] Determine whether there are duplicate groups in the cell group information of the imported row data in the table file;

[0014] If there are repeated groups, it is determined that the table file needs to perform a cell merge operation.

[0015] Optionally, in a third implementation of the first aspect of the present invention, after the step of adding the row data set in the target shard to the table file, the method further includes:

[0016] If the table file does not need to perform cell merging operations, the table file will be used as the target table file.

[0017] Optionally, in a fourth implementation of the first aspect of the present invention, after the step of obtaining the target table file, the method further includes:

[0018] If there are fragments to be processed in the ContentPart collection, the process returns to execute the step of selecting a target fragment in the ContentPart collection according to the fragment numbers of each content fragment in the ContentPart collection.

[0019] Optionally, in a fifth implementation of the first aspect of the present invention, when the data to be processed is detected, the step of performing a slicing operation on the data to be processed to obtain multiple ContentParts includes:

[0020] When data to be exported is detected, the data to be exported is read in pages to obtain multiple pages of data;

[0021] A plurality of page data are converted into a plurality of ContentParts and stored to obtain a ContentPart collection.

[0022] Optionally, in a sixth implementation of the first aspect of the present invention, the step of converting a plurality of page data into a plurality of ContentParts and storing the same includes:

[0023] Convert multiple pages of data into multiple ContentParts;

[0024] According to a preset sorting method, a sorting operation is performed on multiple ContentParts and stored.

[0025] Optionally, in a seventh implementation of the first aspect of the present invention, after the step of converting the plurality of page data into a plurality of ContentParts and storing them to obtain a ContentPart set, the method further includes:

[0026] If a sort adjustment instruction is detected, the fragment to be sorted and adjusted is determined in the ContentPart collection according to the sort adjustment instruction;

[0027] According to the sort adjustment instruction, a sort adjustment operation is performed on the row data set in the shard to be sorted to respond to the sort adjustment instruction.

[0028] In a second aspect, an embodiment of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned data export method when executing the computer program.

[0029] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the above-mentioned data export method are implemented.

[0030] In a fourth aspect, an embodiment of the present invention provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the above-mentioned data export method.

[0031] The beneficial effects of the embodiments of the present invention compared with the prior art are: according to the slice number of each content slice in the ContentPart collection, the target slice is selected in the ContentPart collection: the row data set in the target slice is added to the table file; if the table file needs to perform a cell merge operation, the cell merge operation is performed on the table file to obtain the target table file; if the slice to be processed does not exist in the ContentPart collection, the target table file is exported. Since the data is processed in the form of slices and gradually added to the table file, it is not necessary to load the entire data set into the memory at one time, which reduces the use of memory and effectively avoids the occurrence of OOM errors. Due to the reduction in memory consumption, the program runs more smoothly and the performance is improved. When processing large data sets, the size and number of slices can be adjusted as needed to adapt to different data sets and export requirements, further improving the efficiency of data export. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0033] Figure 1 A schematic diagram of an embodiment of a method for exporting data in an embodiment of the present invention;

[0034] Figure 2This is a schematic diagram of a specific embodiment before step S101 of the method for exporting data in an embodiment of the present invention;

[0035] Figure 3 This is a schematic diagram of a specific embodiment of step S202 of the method for exporting data in an embodiment of the present invention;

[0036] Figure 4 This is a schematic diagram of a specific embodiment after step S202 of the method for exporting data in an embodiment of the present invention;

[0037] Figure 5 The figure is a schematic diagram of an embodiment of a terminal device in an embodiment of the present invention. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are protected by the present invention.

[0039] It should be noted that the terms "include", "comprises" and "have" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, terminal, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. In the claims, specifications and drawings of the present invention, relational terms such as "first" and "second" are merely used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such real-time relationship or order between these entities / operations / objects.

[0040] Reference to an "embodiment" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0041] Spreadsheet files have become the most common format for software systems to export data to users. In actual development, developers need to deal with tedious format conversion between system data and Excel. When the number of exported data rows reaches hundreds of thousands or even millions, developers need to invest a lot of effort.

[0042] The traditional export method is to load the data completely into the memory and then generate a table file. When the amount of data is very large, this method will consume a lot of memory to generate a table file, resulting in a decrease in program performance and even OOM (memory overflow) errors. It can be seen that the traditional export method is inefficient in exporting table files.

[0043] In view of this, the embodiment of the present invention provides a data export method, terminal device and storage medium. Since the data is processed in the form of slices and gradually added to the table file, it is not necessary to load the entire data set into the memory at one time, which reduces the use of memory and effectively avoids the occurrence of OOM errors. Due to the reduction in memory consumption, the program runs more smoothly and the performance is also improved. When processing large data sets, the size and number of slices can be adjusted as needed to adapt to different data sets and export requirements, further improving the efficiency of data export.

[0044] In order to illustrate the technical solution of the present invention, specific embodiments are provided below for illustration.

[0045] The professional terms involved in the embodiments of the present invention include but are not limited to:

[0046] ContentPart: represents a collection of multiple rows in a table and is a basic unit in the data export process. Developers convert data into ContentParts in batches and submit them to the server through the client. Each ContentPart has a unique code to ensure the uniqueness and idempotence of the data.

[0047] Table file: refers to the Excel file. The table file is the target file for data export.

[0048] Cell merging: In an Excel spreadsheet, adjacent cells with the same attributes or contents are merged into one cell. The present invention supports cell merging based on row groups (RowGroup) and column groups (ColGroup).

[0049] RowGroup and ColGroup: Group information used to define which adjacent row or column cells should be merged. Adjacent row cells with the same RowGroup will be merged, and adjacent column cells with the same ColGroup will also be merged.

[0050] Data paging: When processing a large amount of data, the data is divided into multiple pages (or batches) for reading and processing. In the present invention, the developer reads the data in the database in pages and converts it into ContentPart.

[0051] Idempotence: In computer science, idempotence means that no matter how many times an operation is performed, its result is the same. In the present invention, the unique encoding of ContentPart is used to ensure the idempotence of data submission, that is, submitting the same content segment multiple times will not produce different results.

[0052] Serialization: The process of converting an object into a format that can be stored or transmitted (such as JSON, XML, etc.). In the present invention, the terminal device serializes the received ContentPart and saves it to the storage service.

[0053] Storage service: a service that provides data storage function, which may be a database, a file system, a cloud storage, etc. In the present invention, the storage service is used to save the serialized ContentPart.

[0054] Sorting adjustment instruction: an instruction for adjusting the sorting of data in a ContentPart set. In the present invention, if a sorting adjustment instruction is detected, the sorting of the row data set in the ContentPart is adjusted according to the instruction.

[0055] Terminal device: a device or server used by a user to access and operate a computer system, such as a computer, a mobile phone, a tablet, etc. In the present invention, the terminal device runs a computer program that implements the data export method.

[0056] Figure 1 The present invention provides a data export method according to an embodiment of the present invention, which can be applied to a terminal device, such as a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, etc.

[0057] Specifically, the above data export method may include the following steps S101 to S103.

[0058] Step S101 : selecting a target fragment in the ContentPart set according to the fragment number of each content fragment in the ContentPart set.

[0059] In the embodiment of the present invention, an export task is started by calling the CreateExcel interface by the Client. This call will initialize an export task and create an empty Excel file (or table Sheet) as the target table file on the server (the terminal device of the present invention, i.e., the data export device).

[0060] Developers read data from the database in pages and convert the data into the row data format of ContentPart. Each ContentPart contains a unique code for subsequent data verification and deduplication.

[0061] The developer calls the corresponding interface through the Client and submits the converted ContentPart to the Server (terminal device).

[0062] The server will serialize the ContentPart and save it to a storage service (such as Redis). The storage service can be an abstract interface, and different storage backends can be implemented as needed.

[0063] The developer continues to read data in pages and repeats the above steps until all data is converted into ContentPart and submitted to the Server.

[0064] After the developer confirms that all data has been submitted, the BuildExcel interface is called through the Client to start generating the Excel file.

[0065] After receiving the BuildExcel request, the server traverses the previously saved ContentPart collection. For each ContentPart (content fragment) in the collection, according to the fragment number of the ContentPart, the ContentPart currently to be processed is selected in the collection as the target fragment.

[0066] Step S102: adding the row data set in the target shard to the table file.

[0067] In an embodiment of the present invention, the row data set in the target slice is added to the target table file, for example, the data is actually written into an Excel file.

[0068] Step S103: If the table file needs to perform a cell merge operation, the cell merge operation is performed on the table file to obtain a target table file.

[0069] In the embodiment of the present invention, if the target table file needs to perform a cell merging operation (according to the definition of RowGroup and ColGroup), the corresponding cell merging operation is performed on the table file, so that the Excel file finally generated meets the developer's merging requirements.

[0070] Step S104: if there is no fragment to be processed in the ContentPart collection, the target table file is exported.

[0071] In the embodiment of the present invention, after processing a ContentPart, the Server checks whether there are any fragments to be processed in the ContentPart collection. If there are, the next target fragment is selected and the above steps are repeated; if not, the next step is performed.

[0072] When all ContentParts have been processed and the target table file has been completely generated, the Server will export the target table file to a specified location or return it to the Client for download.

[0073] The beneficial effects of the embodiments of the present invention compared with the prior art are: according to the slice number of each content slice in the ContentPart collection, the target slice is selected in the ContentPart collection: the row data set in the target slice is added to the table file; if the table file needs to perform a cell merge operation, the cell merge operation is performed on the table file to obtain the target table file; if the slice to be processed does not exist in the ContentPart collection, the target table file is exported. Since the data is processed in the form of slices and gradually added to the table file, it is not necessary to load the entire data set into the memory at one time, which reduces the use of memory and effectively avoids the occurrence of OOM errors. Due to the reduction in memory consumption, the program runs more smoothly and the performance is improved. When processing large data sets, the size and number of slices can be adjusted as needed to adapt to different data sets and export requirements, further improving the efficiency of data export.

[0074] In practical applications, the formats of data export are often complex and diverse, and different users or application scenarios have different requirements for the format of exported data. Traditional data export methods are often difficult to meet these diverse needs. When processing a large amount of data, traditional data export methods often require additional format adjustments or data processing operations after the data export is completed, which not only increases the export time, but also may introduce additional errors. To this end, the present invention proposes an optional embodiment.

[0075] Step S103 also includes the following specific implementation methods.

[0076] Step S1031, performing a cell merge operation on the table file according to the cell group information of the row data imported into the table file to obtain a target table file, wherein the cell group information includes a row group and a column group.

[0077] In an embodiment of the present invention, after adding the row data set in the target slice to the table file, the cell group information of the imported row data is detected. The cell group information includes row group (RowGroup) and column group (ColGroup), which are used to indicate which cells should be merged.

[0078] Based on the detected cell group information, determine whether there are cells that need to be merged.

[0079] If there are adjacent cells with the same row group or column group, it is determined that a cell merging operation is required.

[0080] Based on the judgment result, perform the merge operation on the cells that need to be merged.

[0081] The merging operation includes adjusting cell borders, merging cell contents, etc.

[0082] After completing all necessary cell merging operations, the final target table file is generated.

[0083] In the embodiment of the present invention, by supporting the merge operation based on the cell group information, the data export process can be made more flexible and can meet more diverse export requirements. In addition, the cell merge operation is performed immediately during the data import process, avoiding the need for additional processing after the data export is completed, thereby improving the overall export efficiency.

[0084] Traditional data export methods often require loading and processing all data at once, resulting in problems such as long processing time or insufficient memory, which affects the efficiency of data export. There may also be a lack of flexible data processing mechanisms, and the processing strategy cannot be adjusted according to the size and type of data, which limits the application scenarios and scope of data export. To this end, the present invention proposes an optional embodiment.

[0085] Reference Figure 2 , Figure 2 This is a schematic diagram of a specific embodiment before step S101 of the data export method in an embodiment of the present invention. Before step S101, the following specific implementation methods are also included.

[0086] Step S201 , when data to be exported is detected, the data to be exported is read in pages to obtain multiple pages of data.

[0087] In an embodiment of the present invention, it is detected that there is data to be exported. According to a preset paging size or condition, data is read from the data to be exported in pages, and a portion of the data is read each time to form a page of data. The data to be exported may come from a database, a file or other data source.

[0088] For each page data, convert it into ContentPart, including formatting the data into row data suitable for Excel table and giving each ContentPart a unique code for deduplication.

[0089] Step S202: convert multiple page data into multiple ContentParts and store them to obtain a ContentPart set.

[0090] In the embodiment of the present invention, the converted ContentPart is stored for subsequent processing. The storage method can be memory storage, database storage or file storage, etc., which depends on the design and requirements and is not limited here.

[0091] Repeat the above steps until all the data to be exported are read in pages and converted into ContentParts for storage, forming a complete ContentPart collection.

[0092] In the embodiment of the present invention, by reading and converting data in pages, a large amount of data can be processed step by step, avoiding the problem of insufficient memory or excessive processing time that may be caused by loading all data at once. In addition, reading and converting data in pages enables the terminal device to flexibly adjust the paging size or condition as needed to adapt to data export requirements of different scales and types.

[0093] In traditional data export methods, developers often need to manually adjust the order of data to meet user needs, which increases the complexity of data processing. In addition, there is a lack of flexible data processing mechanism, and it is impossible to sort the data according to the characteristics of the data and export requirements. To this end, the present invention proposes an optional embodiment.

[0094] Reference Figure 3 , Figure 3 Schematic diagram of a specific implementation of step S202 of the method for exporting data in an embodiment of the present invention. Step S202 also includes the following specific implementation methods.

[0095] Step S2021, converting multiple page data into multiple ContentParts.

[0096] In an embodiment of the present invention, when data to be exported is detected, data is read from a data source (such as a database) in pages according to a preset page size or condition. Each read data forms a page of data.

[0097] For each page data, it is converted into ContentPart, including formatting the data into row data suitable for Excel table, and giving each ContentPart a unique code for subsequent data processing and deduplication.

[0098] All converted ContentParts are collected to form a ContentPart collection. The ContentPart collection contains all the data to be exported, arranged in the order of paging reading.

[0099] Step S2021, performing a sorting operation on multiple ContentParts and storing them according to a preset sorting method.

[0100] In the embodiment of the present invention, the elements in the ContentPart collection are sorted according to a preset sorting method (such as sorting according to fields such as timestamp and ID of the data), so that the order of the data meets the needs of the user when generating an Excel file.

[0101] The sorted ContentPart is stored for subsequent data processing and export operations.

[0102] In the embodiment of the present invention, by sorting the ContentPart in the data preparation stage, the order of the data can meet the needs of the user when the Excel file is generated. And it supports sorting the data according to the preset sorting method, and the developer can flexibly adjust the order of the data according to the needs to meet different export requirements.

[0103] Traditional data export methods usually lack a flexible data processing mechanism and cannot sort and adjust the exported data according to the personalized needs of users. As a result, the data order in the final generated Excel file does not meet the user's expectations. To this end, the present invention proposes an optional embodiment.

[0104] Reference Figure 4 , Figure 4 This is a schematic diagram of a specific implementation after step S202 of the data export method in an embodiment of the present invention. After step S202, the following specific implementation methods are also included.

[0105] Step S203: If a sort adjustment instruction is detected, the fragments to be sorted and adjusted are determined in the ContentPart collection according to the sort adjustment instruction.

[0106] In the embodiment of the present invention, it is continuously monitored or checked whether there is a sort adjustment instruction from a developer or a user. The sort adjustment instruction is issued at any time after the data is read and converted into ContentPart by paging, but before the Excel file is generated.

[0107] The sort adjustment instruction is detected, the instruction content is parsed, and the ContentPart that needs to be sorted is determined (i.e., the fragment to be sorted and adjusted). The instruction carries the specified sorting condition and the unique code or identifier of the ContentPart.

[0108] Step S204: According to the sort adjustment instruction, a sort adjustment operation is performed on the row data set in the shard to be sorted and adjusted, in response to the sort adjustment instruction.

[0109] In an embodiment of the present invention, a sorting adjustment operation is performed on the row data set in the slice to be sorted and adjusted according to the sorting condition specified in the sorting adjustment instruction, which may include operations such as rearranging, grouping or filtering the row data so as to present them in the specified order in the finally generated Excel file.

[0110] After the sort adjustment operation is completed, the ContentPart collection is updated to respond to the sort adjustment instruction.

[0111] In the embodiment of the present invention, by allowing the sorting and adjustment of ContentPart in the data preparation stage, it can more flexibly adapt to different export requirements and data characteristics. The data order in the final generated Excel file can meet the user's expectations. After the data is read in pages and converted into ContentPart, if the sorting and adjustment operation is performed immediately, complex data reorganization can be avoided in the subsequent file generation stage.

[0112] In the traditional Excel file export method, the cell merging operation is often performed without clearly determining the merging requirement, which may lead to unnecessary merging operations and even damage the file format due to merging errors. To this end, the present invention provides an optional embodiment.

[0113] Before step S103, the following specific implementation is also included.

[0114] Step S205 , determining whether there is a duplicate group in the cell group information of the row data imported into the table file.

[0115] In the embodiment of the present invention, the cell group information of the imported row data is read, including the row group (RowGroup) and the column group (ColGroup).

[0116] Traverse the read cell group information and check whether there are duplicate row groups or column groups.

[0117] Duplicate groups are determined based on the exact same group identifier, that is, two or more cells have the same RowGroup or ColGroup value.

[0118] Step S204: if there are duplicate groups, it is determined that the table file needs to perform a cell merge operation.

[0119] In an embodiment of the present invention, if the presence of repeated groups is detected, it is determined that the table file needs to perform a cell merging operation.

[0120] If no duplicate groups are detected, it is considered that there is no need to merge cells in the current spreadsheet file.

[0121] According to the judgment result, the corresponding subsequent operation is performed. If merging is required, the process of cell merging operation is entered; if merging is not required, the file may be directly exported or other processing may be performed.

[0122] Optionally, if the table file does not need to perform a cell merge operation, the table file is used as the target table file.

[0123] In the embodiment of the present invention, by checking the duplicate groups before merging, it is possible to more accurately determine which cells need to be merged, thereby avoiding unnecessary merge operations and improving the accuracy of the merge. In addition, the merge operation is usually time-consuming when processing a large amount of data. By determining in advance whether a merge is required, unnecessary merge operations can be avoided, thereby saving processing time.

[0124] In traditional data export methods, manual intervention is often required to check and process the remaining data, resulting in low processing efficiency of data export. To this end, the present invention proposes an optional embodiment.

[0125] After step S103, the following specific implementation is also included.

[0126] Step S206: If the table file does not need to perform a cell merging operation, the table file is used as a target table file.

[0127] In the embodiment of the present invention, the ContentPart collection is checked to determine whether there are any unprocessed fragments.

[0128] If it is detected that there are still fragments to be processed in the ContentPart collection, return to the previous processing flow, and select the next target fragment in the collection for processing according to the fragment number of each content fragment in the ContentPart collection.

[0129] Process the selected target shard, including adding the row data set in the shard to the table file and performing cell merging operations as needed.

[0130] Repeat the above steps until all fragments in the ContentPart collection have been processed.

[0131] When all fragments in the ContentPart collection have been processed, the system will export the final target table file.

[0132] In the embodiment of the present invention, by checking whether there are fragments to be processed in the ContentPart collection after obtaining the target table file, all data to be exported can be correctly processed without manual intervention, thereby further improving the processing efficiency of data export.

[0133] like Figure 5 , which is a schematic diagram of a terminal device provided in an embodiment of the present invention. The terminal device 5 may include: a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501, such as a data export program. When the processor 501 executes the computer program 503, the steps in the above-mentioned data export embodiments are implemented.

[0134] The computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 502 and executed by the processor 501 to complete the present invention. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.

[0135] The terminal device may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will appreciate that Figure 5 It is only an example of a terminal device and does not constitute a limitation of the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.

[0136] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0137] The memory 502 may be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device. The memory 502 may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. Further, the memory 502 may also include both an internal storage unit of the terminal device and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the terminal device. The memory 502 may also be used to temporarily store data that has been output or is to be output.

[0138] It should be noted that, for the convenience and brevity of description, the structure of the above-mentioned terminal device can also refer to the specific description of the structure in the method embodiment, which will not be repeated here.

[0139] An embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned data export method can be implemented.

[0140] An embodiment of the present invention provides a computer program product. When the computer program product runs on a mobile terminal, the steps in the above-mentioned data export method can be implemented when the mobile terminal executes the computer program product.

[0141] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0142] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0143] In the embodiments provided by the present invention, it should be understood that the disclosed terminal devices and methods can be implemented in other ways. For example, the terminal device embodiments described above are only exemplary. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0145] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0146] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0147] The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above-described embodiments, a person skilled in the art should understand that the technical solutions described in the above-described embodiments can still be modified, or some of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.

Claims

1. A method for exporting data, characterized in that: include: According to the fragment number of each content fragment in the ContentPart collection, select the target fragment in the ContentPart collection: Adding the row data set in the target shard to the table file; If the table file needs to perform a cell merging operation, then the cell merging operation is performed on the table file to obtain a target table file; If there is no fragment to be processed in the ContentPart collection, the target table file is exported.

2. The data export method according to claim 1, characterized in that: The step of performing a cell merging operation on the table file to obtain a target table file comprises: According to the cell group information of the row data imported into the table file, a cell merging operation is performed on the table file to obtain a target table file, wherein the cell group information includes a row group and a column group.

3. The data export method according to claim 1, characterized in that: If the table file needs to perform a cell merging operation, the cell merging operation is performed on the table file to obtain a target table file, before the step, the method further includes: Determine whether there are duplicate groups in the cell group information of the imported row data in the table file; If the repeated group exists, it is determined that the table file needs to perform the cell merging operation.

4. The data export method according to claim 1, characterized in that: After the step of adding the row data set in the target shard to the table file, the method further includes: If the table file does not need to perform a cell merging operation, the table file is used as the target table file.

5. The data export method according to claim 1, characterized in that: After the step of obtaining the target table file, the method further includes: If the to-be-processed fragment exists in the ContentPart set, the process returns to the step of selecting a target fragment in the ContentPart set according to the fragment numbers of the content fragments in the ContentPart set.

6. The data export method according to claim 1, characterized in that: Before the step of selecting a target fragment in the ContentPart set according to the fragment numbers of each content fragment in the ContentPart set, the method further includes: When data to be exported is detected, the data to be exported is read in pages to obtain multiple pages of data; The plurality of page data are converted into a plurality of ContentParts and stored to obtain the ContentPart set.

7. The data export method according to claim 6, characterized in that: The step of converting the plurality of page data into a plurality of ContentParts and storing the same comprises: Convert the plurality of page data into a plurality of ContentParts; According to a preset sorting method, a sorting operation is performed on the plurality of ContentParts and the content is stored.

8. The data export method according to claim 6, characterized in that: After the step of converting the plurality of page data into a plurality of ContentParts and storing them to obtain the ContentPart set, the method further comprises: If a sort adjustment instruction is detected, determining the fragments to be sorted and adjusted in the ContentPart set according to the sort adjustment instruction; According to the sort adjustment instruction, a sort adjustment operation is performed on the row data set in the to-be-sorted-adjusted slice to respond to the sort adjustment instruction.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the data export method according to any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the data export method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Data processing method and device based on EasyExcel and storage medium

    CN116956850A

  • Excel exporting method for large data volume and paging query and cloud storage method

    CN117573748A