Complex table information splitting method

By automatically identifying and splitting the content types of Excel spreadsheets and using hash mapping to store style information, the problem of inefficiency in copying and splitting complex spreadsheets in Excel is solved. This achieves efficient and accurate spreadsheet splitting and copying, suitable for data processing and report generation.

CN119294370APending Publication Date: 2025-01-10CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411176595.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In existing Excel operations, copying and splitting complex tables is inefficient and error-prone, especially when dealing with large amounts of data or complex styles, resulting in performance bottlenecks and accuracy issues.

Method used

This paper provides a method and system for splitting complex table information. By automatically identifying the cell content type and using hash mapping to store style information, it can automatically split multiple independent workbooks. It includes content recognition, copying and style mapping modules, supports copying of various cell content types, and improves splitting efficiency and accuracy.

Benefits of technology

It enables automated splitting without manual operation, improving the efficiency and accuracy of copying and splitting operations, reducing human error, and is suitable for fields such as data processing and report generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119294370A_ABST
    Figure CN119294370A_ABST
Patent Text Reader

Abstract

The invention provides a complex table information splitting method and system. The method comprises the steps of traversing all original workbooks, creating a target workbook and copying original table contents, including traversing and copying lines and identifying and copying contents, supporting copying of various cell content types, being capable of being applied to different workbooks, and improving applicability and flexibility; the style mapping module stores style information by using Hash mapping, so that the efficiency of copying operation is remarkably improved; the method has the advantages that the method is simple and convenient to operate, merging cells and pictures in the original worksheet can be copied, a user only needs to specify a workbook to be split and a storage path, automatic splitting can be achieved, manual operation of each worksheet is not needed, operation is easy and convenient, efficiency is high, the error rate is low, and the method can be widely applied to the fields of data processing, report generation and the like; the system provided by the invention can be integrated with other spreadsheet processing tools or software to realize wider application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer software, and more specifically, to a method for splitting complex table information. Background Art

[0002] In existing spreadsheet processing, it is often necessary to copy the contents and styles of one or more cells to other cells or different workbooks. Traditional Excel operations require users to manually copy and paste, which is inefficient and error-prone. Although existing software tools provide some automation functions, there are still performance bottlenecks and accuracy issues when processing large amounts of data or complex styles. Summary of the invention

[0003] The present invention provides a method and system for splitting complex table information, which can realize automatic splitting of an Excel workbook containing multiple worksheets into multiple independent workbooks, each of which contains only one worksheet. By automatically identifying and converting cell content types, the efficiency and accuracy of copying and splitting operations are improved, the manpower burden can be reduced, and errors caused by human operations can be avoided.

[0004] To achieve the above object, the present invention adopts the following technical solutions. In a first aspect, the present invention provides a method for splitting complex table information, comprising:

[0005] Open the original worksheet file; the original worksheet file includes multiple original workbooks, and the original workbook includes multiple original worksheets;

[0006] Traverse all original workbooks and create a target workbook; the target workbook includes multiple target worksheets;

[0007] Copy the original worksheet content to the target worksheet, including: traversing and copying rows;

[0008] Iterate through and copy rows, including:

[0009] Basic recognition and copying; Basic recognition and copying includes: traversing n rows of the original worksheet, where n is a positive integer greater than or equal to 1; creating n rows with the same format in the target worksheet;

[0010] content identification and reproduction;

[0011] Style mapping, including: determining whether there is an item in the hash map that is the same as the style hash value of the original cell; the style mapping stores the style information through the hash map;

[0012] Style copying includes: traversing target cells in a target worksheet; for the target cells, determining a corresponding style identifier; and searching for a style corresponding to the style identifier in the style information;

[0013] If a corresponding style is found, the style is applied to the target cell; if a corresponding style is not found, the default style is used, or a new style is created and the hash value of the new style is added to the hash map;

[0014] Copy the merged cells in the original worksheet;

[0015] Complete the split and save the target workbook.

[0016] The present invention provides a complex table information splitting method, comprising: traversing all original workbooks, creating a target workbook, and making the target workbook correspond to the original workbook; copying the original worksheet content comprises: traversing and copying rows, using a content recognition module and a content copying module to perform content recognition and copying, supporting the copying of multiple cell content types, and being applicable to different Excel workbooks, thereby improving applicability and flexibility; using a style copying module to perform style copying, accurately copying different content types and styles of cells, thereby avoiding errors and omissions in manual operations, and improving accuracy; a style mapping module uses hash mapping to store style information, thereby significantly improving the efficiency of the copying operation; and can also copy merged cells and pictures in the original worksheet, and the user only needs to specify the Excel workbook to be split and the saving path to realize automatic splitting, without the need for manual operation of each worksheet, and the operation is simple, efficient, and has a low error rate, and can be widely used in data processing, report generation and other fields.

[0017] In a possible implementation, all original workbooks are traversed to create a target workbook, including:

[0018] Load the original workbook and obtain the workbook to be split;

[0019] Read the workbook to be split and obtain the number of worksheets in the workbook to be split;

[0020] Create a target workbook, which includes a target worksheet.

[0021] In a possible implementation, copying the original worksheet content, while traversing and copying the rows, also includes:

[0022] Iterate over and copy the columns, including:

[0023] Determine the number of rows in the original worksheet, traverse all cells in each row, and obtain the column number of the cell;

[0024] For the column number, get the width of the column in the original worksheet and set the same width in the corresponding column of the target worksheet.

[0025] In a possible implementation, content identification and replication include:

[0026] Identify the content type of the original worksheet; content types include: string, value, Boolean, formula, and blank;

[0027] Based on the identified content type, the contents of the original worksheet are copied to the destination worksheet.

[0028] In one possible implementation, the merged cells in the original worksheet are copied, including:

[0029] Iterate through the merged cell range in the original worksheet;

[0030] For each merged cell range, create a corresponding target merged cell range on the target worksheet.

[0031] In a possible implementation, before completing the splitting and saving the target workbook, it also includes image copying, and the image copying includes the step of obtaining an image information list, wherein:

[0032] Get the picture information list, including: create an initialization list to store picture information; get and traverse the relationship in the original worksheet; determine whether the relationship is a drawing object; traverse the shapes in the drawing object; determine whether the shape is a picture; get the picture's location information, picture data and picture type and store them in a hash map; add the hash map to the initialization list.

[0033] In a possible implementation, after obtaining the picture information list, the picture copying further includes: copying the picture;

[0034] Copy the image, including: traversing the initialization list, extracting the original anchor point, byte data and type of the image; adding the image to the target workbook, including: adding the image data to the target workbook and feeding back the index of the target image in the target workbook; creating a target anchor point for the target image in the target workbook; copying the row and column information and offset of the original anchor point to the target anchor point; creating the target image in the target worksheet.

[0035] In a second aspect, the present invention provides a complex table information splitting system, which is applied to the complex table information splitting method described in any possible implementation manner in the first aspect, including:

[0036] A content identification module, used for content identification;

[0037] A content copying module, connected to the content identifying module, and used for content copying;

[0038] Style mapping module, used for style mapping;

[0039] A style copying module, connected to the style mapping module, and used for style copying;

[0040] An iterative replication module is used to iteratively call the content identification module, the content replication module, the style mapping module and the style replication module.

[0041] In the third aspect, the present invention provides a complex table information splitting system, comprising: a processor and a memory, the memory being used to store computer program code, the computer program code comprising computer instructions, and when the processor executes the computer instructions, the complex table information splitting system executes any of the complex table information splitting methods in the first aspect.

[0042] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the complex table information splitting system executes the complex table information splitting method as described in any one of the first aspects.

[0043] For the specific description of the second, third and fourth aspects of the present invention and their various implementations, reference can be made to the detailed description of the first aspect and its various implementations; and for the beneficial effects of the second aspect and its various implementations, reference can be made to the analysis of the beneficial effects of the first aspect and its various implementations, which will not be repeated here.

[0044] Of course, any product implementing the present invention does not necessarily need to achieve all of the technical effects described above at the same time.

[0045] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0047] Figure 1 This is one of the flow charts of a complex table information splitting method provided by the present invention;

[0048] Figure 2 This is the second flow chart of a complex table information splitting method provided by the present invention;

[0049] Figure 3 It is a structural diagram of a complex table information splitting system provided by the present invention;

[0050] Figure 4 This is the third flow chart of a complex table information splitting method provided by the present invention;

[0051] Figure 5 This is the fourth flow chart of a complex table information splitting method provided by the present invention;

[0052] Figure 6 This is the fifth flow chart of a complex table information splitting method provided by the present invention;

[0053] Figure 7 This is the sixth flow chart of a complex table information splitting method provided by the present invention;

[0054] Figure 8 This is the seventh flow chart of a complex table information splitting method provided by the present invention; Fig. 9 It is a structural schematic diagram of a complex table information splitting system provided by the present invention;

[0055] 1- Content identification module, 2- Content replication module, 3- Style mapping module, 4- Style replication module, 5- Iterative replication module. DETAILED DESCRIPTION

[0056] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.

[0057] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0058] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0059] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0060] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0061] The execution subject of a complex table information splitting method provided in an embodiment of the present invention is a complex table information splitting system. The complex table information splitting system can be a computer device, which can be an electronic device or a server, or a central processing unit (CPU) in the electronic device or server.

[0062] Figure 3 A schematic diagram of the composition of a complex table information splitting system provided by an embodiment of the present invention. Figure 3 As shown, a complex table information splitting system may include: at least one processor 11, a memory 12, a communication interface 13 and a communication bus 14.

[0063] The processor 11 is the control center of the complex table information splitting system, which may be a CPU, a microprocessing unit, or one or more integrated circuits for controlling the execution of the program of the embodiment of the present invention.

[0064] As an embodiment, the processor 11 may include one or more CPUs, such as Figure 3 In addition, as an embodiment, the complex table information splitting system may include multiple processors, such as Figure 3 The processor 11 and the processor 15 shown in FIG. Each of these processors can be a single-core processor (Single-CPU) or a multi-core processor (Multi-CPU).

[0065] The memory 12 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 12 may exist independently and be connected to the processor 11 via the communication bus 14. The memory 12 may also be integrated with the processor 11.

[0066] In a specific implementation, the memory 12 is used to store the data in the present invention and execute the software program of the present invention. The processor 11 can execute various functions of the pressure relief working condition identification device for a supercharger without a pressure relief valve by running or executing the software program stored in the memory 12 and calling the data stored in the memory 12.

[0067] The communication interface 13 uses any transceiver or other device for communicating with other devices or communication networks, such as radio access networks (RAN), wireless local area networks (WLAN), etc. The communication interface 13 may include a receiving unit to implement a receiving function, and a sending unit to implement a sending function.

[0068] The communication bus 14 may include a pathway for transmitting information between the above-mentioned components.

[0069] It should be pointed out that Figure 3 The structure shown in does not constitute a limitation on the complex table information splitting system, except Figure 3 In addition to the components shown, the complex table information splitting system may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0070] Example 1

[0071] Based on the above introduction to the structure of the complex table information splitting system, the embodiment of the present invention provides a complex table information splitting method. Figure 1 As shown, the complex table information splitting method may include the following steps:

[0072] S1: Open the original Excel file; the original Excel file includes multiple original workbooks; the original workbook includes multiple original worksheets;

[0073] S2: traverse all original workbooks and create a target workbook; the target workbook includes multiple target worksheets;

[0074] S3: copy the original worksheet content to the target worksheet, including: S31: traverse and copy rows;

[0075] S31: traverse and copy rows, including: S310: basic identification and copying;

[0076] S310: basic recognition and copying, including: traversing n rows of the original worksheet, where n is a positive integer greater than or equal to 1; creating n rows with the same format in the target worksheet;

[0077] S311: Content identification and replication;

[0078] S312: Style mapping, including: determining whether there is an item in the hash map that has the same style hash value as the original cell; the style mapping module uses the hash map to store the style information;

[0079] S313: Style replication, including:

[0080] S3131: Traverse the target cells in the target worksheet;

[0081] S3132: For the target cell, determine the corresponding style identifier;

[0082] S3133: searching the style information for a style corresponding to the style identifier;

[0083] S3134: If a corresponding style is found, apply the style to the target cell;

[0084] S3135: If the corresponding style is not found, choose to use the default style, or create a new style and add the hash value of the new style to the hash map;

[0085] S4: Copy the merged cells in the original worksheet;

[0086] S6: Complete the split and save the target workbook.

[0087] Specifically, a complex table information splitting method provided by the present invention may include the following steps: S1: opening the original worksheet file and inputting a command program to load the original Excel file.

[0088] S2: traverse all original workbooks and create a target workbook; the original workbook includes multiple original worksheets; create a target Excel file and a target worksheet for each worksheet, obtain the total number of original worksheets, and traverse all original worksheets. During the traversal process, first obtain the original worksheet currently traversed, create a new worksheet to store the worksheet data to be copied, that is, the target worksheet, and in the target workbook, create a target worksheet using the name of the original worksheet.

[0089] S3: copy the original worksheet content;

[0090] S31: traverse and copy rows, including: S310: basic identification and copying;

[0091] S310: Basic recognition and copying, including: traversing n rows of the original worksheet, where n is a positive integer greater than or equal to 1; and creating n rows with the same format in the target worksheet.

[0092] It should be noted that each row of the original worksheet (from the first row to the last row) is traversed; for each row, check whether it exists; if it exists, create a row in the target worksheet and set its height to the same as the original row.

[0093] S311: Content identification and replication;

[0094] It should be noted that the content recognition module is used to identify the content type of the original cell, including strings, numbers, Boolean values, and formulas, and copy the contents of the original worksheet (including data and formats) to the target workbook. If necessary, additional processing such as formulas, macros, and other special contents can be performed to ensure correctness and consistency in the new workbook.

[0095] The content copying module uses the corresponding method to copy the content of the source cell to the target cell according to the identified content type. For example, for a string type, the string value is directly copied; for a numeric type, the numeric value is copied; for a Boolean type, the Boolean value is copied; for a formula type, the formula string is copied. The system can automatically identify the content type of the source cell (such as text, numeric value, formula, etc.) and adopt different copying strategies for different types of content to ensure accurate copying of the content.

[0096] S312: Style mapping, including: determining whether there is an item in the hash map that has the same style hash value as the original cell; the style mapping stores the style information through the hash map;

[0097] The style mapping module uses hash maps to store style information; the style mapping module uses hash maps to store copied style information, so that when copying cells of the same style, the style can be directly obtained and applied from the hash map without recreating a new style object. This significantly improves the efficiency of style copying.

[0098] The above step S312: style mapping includes:

[0099] Check if there is an entry in the hash map that has the same style hash value as the original cell;

[0100] Specifically, the style mapping module uses a hash map to store the copied style information. Before copying the style, the system checks whether there is already an item in the hash map with the same style hash value as the original cell, and first obtains the style of the original cell.

[0101] S313: Style copy;

[0102] The above step S313: style copy module may specifically include:

[0103] S3131: Traverse the target cells in the target worksheet;

[0104] S3132: For the target cell, determine the corresponding style identifier;

[0105] S3133: searching the style information for a style corresponding to the style identifier;

[0106] S3134: If a corresponding style is found, apply the style to the target cell;

[0107] S3135: If the corresponding style is not found, choose to use the default style, or create a new style and add the hash value of the new style to the hash map;

[0108] It should be noted that if there is an item in the hash map with the same hash value as the original cell style, the style copying module directly obtains the style and applies it to the target cell; otherwise, a new style object is created, the style information is cloned from the original cell style, and the new style object and the corresponding hash value are added to the hash map and then applied to the target cell.

[0109] The specific steps include:

[0110] Traverse the target cell;

[0111] For each target cell, determine the style identifier it should use;

[0112] Find the style identifier object corresponding to the identifier in the hash map library;

[0113] If a corresponding style is found, it is applied to the target cell;

[0114] If no corresponding style is found (perhaps because the style has not yet been added to the hash map), you can choose to use the default style or create a new style and add it to the hash map for future reuse through this process to locate the processing, that is, create a new style identifier in the target workbook, clone the properties from the original cell style, and then add the hash value reference of the style to the hash map library for future reuse.

[0115] S4: Copy the merged cells in the original worksheet;

[0116] Complex table information splitting S6: Complete the splitting and save the target workbook.

[0117] Save the newly created target workbook to the specified path. The file name can be named as needed, for example, using the original workbook name plus the worksheet name as the new workbook file name. Users can decide based on their needs.

[0118] It should be noted that the complex table information splitting method provided by the present invention is based on the Spring Boot framework to create independent Spring applications, and based on its Maven or Gradle plug-ins, it can create executable JARs and WARs; embed Servlet containers such as Tomcat or Jetty; provide an automatically configured "starter" project object model (POMS) to simplify Maven configuration; automatically configure the Spring container as much as possible;

[0119] There are two very important strategies in the Spring Boot framework: out-of-the-box and convention over configuration. Out-of-the-box means that during the development process, by adding relevant dependency packages to the pom file of the MAVEN project, including the Apache POI package, and then using corresponding annotations instead of cumbersome XML configuration files to manage the life cycle of objects. Convention over configuration is a software design paradigm in which Spring Boot itself configures the target structure and developers add information to the structure. Although this feature reduces some flexibility and increases the complexity of bug location, it reduces the number of decisions that developers need to make, while reducing a large amount of XML configuration, and can automate code compilation, testing, and packaging.

[0120] It can be understood that the present invention provides a method for splitting complex table information, including: traversing all original workbooks, creating a target workbook, and making the target workbook correspond to the original workbook; copying the original worksheet content includes: traversing and copying rows, using a content recognition module and a content copying module to perform content recognition and copying, supporting the copying of multiple cell content types, and can be applied to workbooks of different worksheets, improving applicability and flexibility; using a style copying module to perform style copying, accurately copying different content types and styles of cells, avoiding errors and omissions in manual operations, and improving accuracy; the style mapping module uses hash mapping to store style information, significantly improving the efficiency of the copying operation; merged cells and pictures in the original worksheet can also be copied. Users only need to specify the Excel workbook to be split and the save path to achieve automatic splitting, without manual operation of each worksheet. The operation is simple, efficient, and has a low error rate. It can be widely used in data processing, report generation and other fields.

[0121] Embodiment 2,

[0122] This embodiment is based on the embodiment 1 and describes steps S2 and S3 in detail. Figure 1 , refer to Figure 4, the above step S2: traverses all original workbooks and creates a target workbook, which may specifically include:

[0123] S21: Load the original workbook and obtain the workbook to be split;

[0124] S22: Read the workbook to be split and obtain the number of worksheets in the workbook to be split; read the workbook of the worksheet file to be split and obtain the number of worksheets therein.

[0125] S23: Create a target workbook and create a new object to store the content of the current worksheet.

[0126] Example 3

[0127] This embodiment describes step S32 in detail based on Example 2. Figure 1 , refer to Figure 2 As shown, the above step S3 includes step S31 and step S32: traversing and copying the column, step S32 includes:

[0128] S321: Determine the number of rows in the original worksheet, traverse all cells in each row, and obtain the column number of the cell;

[0129] S322: For each column number, obtain the width of the column in the original worksheet. If the width is greater than 0, set the same width in the corresponding column of the target worksheet.

[0130] It should be noted that step S32: traversing and copying columns and step S31: traversing and copying rows can be performed simultaneously to increase the copying efficiency.

[0131] Step S311: content identification and replication, which may include:

[0132] Identify the content type of the original worksheet; content types include: string, value, Boolean, formula, and blank;

[0133] Specifically, first, the content recognition module selects the corresponding replication strategy according to the type of the original cell;

[0134] The content of the original worksheet is copied to the target worksheet according to the identified content type through the content copy module;

[0135] If the content of the original cell is of string type, its content is copied to the destination cell.

[0136] If the content of the original cell is a numeric type, its value is copied to the target cell;

[0137] If the content of the original cell is of Boolean type, its Boolean value is copied to the destination cell.

[0138] If the content of the original cell is a formula type, its formula is copied to the target cell; it should be noted that when setting the formula, Apache POI (a free, open source, cross-platform Java API written in Java) automatically sets the type of the target cell to FORMULA, so no additional call is required.

[0139] If the source cell is of any other type (such as blank, error, etc.), no copy operation is performed.

[0140] Example 4

[0141] This embodiment describes step S4 in detail based on embodiment 3. Figure 1 , refer to Figure 5 The above step S4 may specifically include:

[0142] S41: Traverse the merged cell area in the original worksheet;

[0143] S42: For each merged cell area, create a corresponding target merged cell area in the target worksheet.

[0144] S43: Traverse all merged cell areas in the original worksheet.

[0145] It should be noted that for each merged cell area, a corresponding merged area is created on the target worksheet using the information of the starting row, ending row, starting column, and ending column of the original worksheet.

[0146] Example 5

[0147] This embodiment describes step S5 in detail based on embodiment 4. Figure 1 , refer to Figure 6-Figure 7 , before S6: completing the splitting and saving the target workbook, it also includes step S5: image copying, S5: image copying includes:

[0148] S51: Obtain a picture information list, including:

[0149] S511: Create an initialization list to store picture information;

[0150] S512: Obtain and traverse the relationships in the original worksheet;

[0151] S513: Determine whether the relationship is a drawing object;

[0152] S514: traverse the shapes in the drawing object;

[0153] S515: Determine whether the shape is a picture;

[0154] S516: Obtain the location information, picture data and picture type of the picture and store them in a hash map;

[0155] S517: Add the hash map to the initialization list.

[0156] It should be noted that S51: obtaining a picture information list includes the following steps: S511: creating an initialization list for storing picture information: first, creating a picture information list for storing information of each picture;

[0157] S512: Obtain and traverse the relationships in the original worksheet: obtain all relationships (such as drawings, charts, etc.) in the original worksheet, and then traverse the above relationships in a for loop;

[0158] S513: Determine whether the relationship is a drawing object: for each relationship, determine whether it is an instance of a container containing a drawing object (such as a picture, a graphic, etc.);

[0159] S514: traverse all shapes in the drawing: if a shape content instance is found, traverse all shapes it contains;

[0160] S515: Determine whether the shape is a picture: for each shape, check whether it is an instance in the picture content;

[0161] S516: Get the location information, image data and image type of the image and store them in a hash map. S517: Add the hash map to the initialization list: If the shape is an image, get the location information, image data and image type of the image, store this information in a new hash map, and add the hash map to the image information list.

[0162] Combination Figure 1 , refer to Figure 6-8 The above step S5: picture copying, further includes:

[0163] S52: Copy pictures, including:

[0164] S521: traverse the initialization list to extract the original anchor point, byte data and type of the image;

[0165] S522: Add the picture to the target workbook, including:

[0166] S5221: Add the image data to the target workbook and feedback the index of the target image in the target workbook;

[0167] S5222: Create a target anchor point for the target image in the target workbook;

[0168] S5223: copy the row and column information and offset of the original anchor point to the target anchor point;

[0169] S5224: Create a target picture in the target worksheet.

[0170] It should be noted that, S521: traverse the initialization list, and extract the anchor point, byte data and type of the picture for each picture information in the list.

[0171] S522: Add the picture to the target workbook, including:

[0172] S5221: Add the image data to the target workbook and feedback the index of the target image in the target workbook: Add the image data to the target workbook and return the index of the image in the target workbook.

[0173] S5222: Create a target anchor point for the target picture in the target workbook: by creating a new miadia anchor point object to position the picture in the target worksheet.

[0174] The row and column information (col1, row1, col2, row2) and offset (dx1, dy1, dx2, dy2) of the original anchor point are directly copied to the target anchor point object in the target worksheet, which can ensure that the position of the image in the new worksheet is the same as the original position (assuming that the row height and column width of the new worksheet are the same or similar to those of the original worksheet), thereby improving the accuracy of the copy.

[0175] S5223: Create a target picture in the target worksheet: Use the drawing.create Picture method to create a picture in the drawing layer of the target worksheet, where drawing is the drawing object obtained through new Sheet.create Drawing Patriarch(), anchor New is the newly created target anchor point, and picture Idx is the index of the picture in the target workbook.

[0176] Example 5

[0177] The present invention also provides a complex table information splitting system, which is applied to the complex table information splitting method described in any possible implementation method of the first aspect above, referring to Fig. 9 ,include:

[0178] Content identification module 1, used for content identification;

[0179] A content copying module 2, connected to the content identifying module 1, and used for content copying;

[0180] A style mapping module 3, connected to the content identification module 1 and the content replication module 2, for style mapping;

[0181] A style copying module 4, connected to the content identification module 1, the content copying module 2 and the style mapping module, the style copying module is used for style copying;

[0182] The iterative replication module 5 is connected with the content recognition module 1, the content replication module 2, the style mapping module 3 and the style replication module 4 for iteratively calling the content recognition module, the content replication module, the style mapping module and the style replication module.

[0183] It should be noted that, in the case where multiple cells need to be copied, the iterative copy module iteratively calls the content recognition, content copying, style mapping and style copying modules to implement batch copy operations.

[0184] Example 6

[0185] The present invention also provides a complex table information splitting system, including: a processor 11 and a memory 12, the memory 12 is used to store computer program code, the computer program code includes computer instructions, when the processor executes the computer instructions, the complex table information splitting system executes each step executed by the complex table information splitting system in the method flow shown in the above method embodiment, the complex table information splitting system provided by the present invention can be integrated with other electronic spreadsheet processing tools or software to achieve a wider range of applications.

[0186] Example 7

[0187] The present invention provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the complex table information splitting method of any one of the above embodiments is implemented.

[0188] It can be seen from the above embodiments that the method and system for splitting complex table information provided by the present invention achieve at least the following beneficial effects:

[0189] The present invention provides a complex table information splitting method and system, comprising: traversing all original workbooks, creating a target workbook, and making the target workbook correspond to the original workbook; copying the original worksheet content comprises: traversing and copying rows, using a content recognition module and a content copying module to perform content recognition and copying, supporting the copying of multiple cell content types, and being applicable to different Excel workbooks, thereby improving applicability and flexibility; using a style copying module to perform style copying, accurately copying different content types and styles of cells, thereby avoiding errors and omissions in manual operations, and improving accuracy; a style mapping module uses hash mapping to store style information, thereby significantly improving the efficiency of copying operations; merged cells and pictures in the original worksheet can also be copied, and the user only needs to specify the Excel workbook to be split and the saving path to realize automatic splitting, without the need for manual operation of each worksheet, and the operation is simple, efficient, and has a low error rate, and can be widely used in data processing, report generation and other fields; the complex table information splitting system provided by the present invention can be integrated with other electronic spreadsheet processing tools or software to achieve a wider range of applications.

[0190] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will be appreciated by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A complex table information splitting method, characterized in that: include: Open the original table file; The original table file includes a plurality of original workbooks, and the original workbooks include a plurality of original worksheets; Traversing all original workbooks to create a target workbook, wherein the target workbook includes multiple target worksheets; Copying the original worksheet content to the target worksheet includes: traversing and copying rows, wherein traversing and copying rows includes: basic recognition and copying, creating rows in the target worksheet, content recognition and copying, style mapping and style copying, wherein: The basic identification and copying includes: traversing n rows of the original worksheet, where n is a positive integer greater than or equal to 1; The creating rows in the target worksheet includes creating n rows with the same format in the target worksheet; The style mapping includes: determining whether there is an item in the hash map that has the same style hash value as the original cell, and storing the style information through the hash map; The style copying includes: traversing the target cells in the target worksheet, determining the corresponding style identifier for the target cell; searching the style information for the style corresponding to the style identifier; if the corresponding style is found, applying the style to the target cell; if the corresponding style is not found, selecting to use the default style, or creating a new style, and adding the hash value of the new style to the hash map; Copy the merged cells in the original worksheet; Complete the split and save the target workbook.

2. The complex table information splitting method according to claim 1 is characterized in that: The traversing all original workbooks and creating a target workbook includes: loading the original workbook to obtain the workbook to be split; reading the workbook to be split to obtain the number of worksheets in the workbook to be split; and creating a target workbook, wherein the target workbook includes a target worksheet.

3. The complex table information splitting method according to claim 1 is characterized in that: The copying of the original worksheet content to the target worksheet includes traversing and copying rows and also includes: traversing and copying columns; The traversing and copying columns includes: determining the number of rows in the original worksheet, traversing all cells in each row, and obtaining the column number of the cell; for the column number, obtaining the width of the column in the original worksheet, and setting the same width in the corresponding column of the target worksheet.

4. The complex table information splitting method according to claim 1 is characterized in that: The content identification and copying includes: identifying the content type of the original worksheet; the content type includes: character string, numerical value, Boolean value, formula and blank; according to the identified content type, copying the content of the original worksheet to the target worksheet.

5. The complex table information splitting method according to claim 1 is characterized in that: The copying of the merged cells in the original worksheet includes: traversing the merged cell areas in the original worksheet; and creating a corresponding target cell merged area in the target worksheet for each of the merged cell areas.

6. The complex table information splitting method according to claim 1 is characterized in that: Before completing the splitting and saving the target workbook, it also includes picture copying, and the picture copying includes the step of obtaining a picture information list, wherein the obtaining the picture information list includes: creating an initialization list to store picture information; obtaining and traversing the relationship in the original worksheet; determining whether the relationship is a drawing object; traversing the shapes in the drawing object; determining whether the shape is a picture; obtaining the location information, picture data and picture type of the picture and storing them in a hash map; adding the hash map to the initialization list.

7. The complex table information splitting method according to claim 6 is characterized in that: After obtaining the picture information list, the picture copying further includes copying the picture; wherein the copying the picture includes: traversing the initialization list, extracting the original anchor point, byte data and type of the picture; adding the picture to the target workbook includes: adding the picture data to the target workbook, and feeding back the index of the target picture in the target workbook; creating the target anchor point of the target picture in the target workbook; The row, column and offset information of the original anchor point are copied to the target anchor point; and a target picture is created in the target worksheet.

8. A complex table information splitting system, applied to the complex table information splitting method described in claims 1-7, characterized in that: include: A content identification module, used for content identification; A content copying module, connected to the content identifying module, and used for content copying; Style mapping module, used for style mapping; A style copying module, connected to the style mapping module, and used for style copying; An iterative replication module is used to iteratively call the content identification module, the content replication module, the style mapping module and the style replication module.

9. A complex table information splitting system, characterized in that: include: A processor and a memory, wherein the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor executes the computer instructions, the complex table information splitting system executes the complex table information splitting method as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the complex table information splitting method described in any one of claims 1 to 7 is implemented.