Table processing method and apparatus, and computer program product
By automatically analyzing the matching degree of the table project title and content, determining the target data type and applying reference format information, the problem of inconsistent format of the table content is solved, and simplifying operations and improving the accuracy of format uniformity is achieved.
Patent Information
- Application Number
- CN202510408507.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-08-29
AI Technical Summary
In the prior art, the format of the table content is not uniform, resulting in reduced readability, and adjustment operations are cumbersome and prone to errors, especially when operating on the mobile terminal, the accuracy is low.
By responding to user operations, automatically analyze the project title and content in the table, determine the target data type based on the matching degree, and use reference format information to adjust the format to achieve one-click format uniformity.
The format adjustment steps are simplified, the accuracy and efficiency of format uniformity are improved, and the format consistency of table content is ensured.
Smart Images

Figure CN120562380A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to, but is not limited to, the field of information technology, and in particular to a table processing method, apparatus, and computer program product. Background Art
[0002] As electronic devices become increasingly versatile, more and more electronic devices have table processing capabilities to process different data in various usage scenarios. For example, they can classify and compile statistics on various types of content.
[0003] In related technologies, there will be situations where users export the contents of a table or import data into a table from other channels, which leads to confusion in the data format. For example, after the user copies and pastes or exports the contents of a table from other tables or business systems, the content format of the table is not uniform, or the row height and column width styles of the table will be chaotic, and readability will be greatly reduced. For another example, the contents of the user's table (for example, the text content in the table) are filled in by other users, the style attributes of the text content are different, and the number format is not uniform. The above situations all require manual adjustment, and the current operation of adjusting the content of the table is relatively cumbersome. It is necessary to select the content to be adjusted and then set the format. If it is adjusted on the mobile terminal, the operation will be more complicated, and errors may occur, and the accuracy rate is low. Summary of the Invention
[0004] To overcome the problems existing in the related art, the present disclosure provides a table processing method, device and computer program product, which can not only complete the format unification of the initial table with one click, simplify the format adjustment steps, but also improve the accuracy of format unification.
[0005] According to a first aspect of an embodiment of the present disclosure, a table processing method is provided, including:
[0006] In response to a first operation on an initial table, determining an item title and a first content under the item title from the initial table;
[0007] determining a target data type of the first content under the item title based on a matching degree between the item title and the second content under the item title, wherein the second content is at least a portion of the first content;
[0008] determining reference format information corresponding to the target data type;
[0009] A format adjustment operation is performed on the first content under the item title based on the reference format information to obtain a target table after the format of the initial table is adjusted.
[0010] According to a second aspect of an embodiment of the present disclosure, there is provided a table processing apparatus, comprising:
[0011] A first determining module is configured to determine an item title and a first content under the item title from the initial table in response to a first operation on the initial table;
[0012] a second determining module configured to determine a target data type of the first content under the project title based on a matching degree between the project title and the second content under the project title, wherein the second content is at least a portion of the first content;
[0013] a third determining module, configured to determine reference format information corresponding to the target data type;
[0014] The adjustment module is configured to perform a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the format of the initial table is adjusted.
[0015] According to a third aspect of the present disclosure, an electronic device is provided, including:
[0016] processor;
[0017] a memory for storing processor-executable instructions;
[0018] The processor executes the computer program or instructions to implement the steps of any one of the methods in the first aspect above.
[0019] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, wherein the storage medium stores a computer program or instructions. When the computer program or instructions in the storage medium are executed by a processor, the steps of the method described in any one of the above-mentioned first aspects are implemented.
[0020] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, including a computer program or instructions. When the computer program or instructions are executed by a processor, the steps of the method described in any one of the first aspects are implemented. The technical solutions provided by the embodiments of the present disclosure may have the following beneficial effects:
[0021] After detecting the first operation on the initial table, the present disclosure can automatically analyze the initial table, determine the item title and the first content under the item title in the initial table, determine the target data type of the first content under the item title based on the matching degree between the item title and the second content under the item title, and perform a format adjustment operation on the first content under the item title based on reference format information corresponding to the target data type to obtain the target table after the format of the initial table is adjusted.
[0022] On the one hand, the format unification of the initial table is completed with one click through the first operation, simplifying the format adjustment steps; on the other hand, the project title and the content under the project title are analyzed separately, that is, the header and the table body are split and processed, and the matching degree of the header and the table body is determined, which can further improve the accuracy of the determined reference format information, and thus improve the accuracy of the format unification of the initial table.
[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0025] Figure 1 This is a flow chart of a table processing method according to an exemplary embodiment. Figure 1 .
[0026] Figure 2A A schematic diagram of a setting page in a table format according to an exemplary embodiment is shown. Figure 1 .
[0027] Figure 2B Schematic diagram 2 of a setting page in a table format according to an exemplary embodiment.
[0028] Figure 2C A schematic diagram of a setting page in a table format according to an exemplary embodiment is shown. Figure 3 .
[0029] Figure 2D A schematic diagram of a setting page in a table format according to an exemplary embodiment is shown. Figure 4 .
[0030] Figure 2E The figure is a schematic diagram of a table according to an exemplary embodiment.
[0031] Figure 2F A schematic diagram of a setting page in a table format according to an exemplary embodiment is shown. Figure 5 .
[0032] Figure 3 FIG2 is a second flowchart of a table processing method according to an exemplary embodiment.
[0033] Figure 4 The figure is a block diagram of a table processing device according to an exemplary embodiment.
[0034] Figure 5The figure is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0035] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0036] Figure 1 This is a flow chart of a table processing method according to an exemplary embodiment. Figure 1 .like Figure 1 As shown, the method mainly includes the following steps:
[0037] In step 101, in response to a first operation on an initial table, an item title and a first content under the item title are determined from the initial table;
[0038] In step 102, a target data type of the first content under the project title is determined based on a matching degree between the project title and the second content under the project title, wherein the second content is at least a portion of the first content;
[0039] In step 103, reference format information corresponding to the target data type is determined;
[0040] In step 104 , a format adjustment operation is performed on the first content under the item title based on the reference format information to obtain a target table after the format adjustment of the initial table.
[0041] It should be noted that the table processing method proposed in the present disclosure can be applied to electronic devices as well as servers. Here, electronic devices may include: terminal devices, such as mobile terminals or fixed terminals. Mobile terminals may include: mobile phones, tablet computers, laptop computers, etc. Fixed terminals may include: desktop computers, smart TVs, etc. As a type of computer, a server can provide computing or application services to other clients (such as computers, smartphones, and other terminal devices, or even large devices such as train systems) in a network.
[0042] The table processing method in the embodiment of the present disclosure may be configured in a table processing device, which may be provided in a server or in an electronic device, and the embodiment of the present disclosure does not impose any limitation thereto.
[0043] It should be noted that the executing entity of the embodiment of the present disclosure may be, for example, a central processing unit (CPU) in a server or electronic device in terms of hardware, or may be, for example, a related background service in a server or electronic device in terms of software, without limitation.
[0044] The initial table can be a table stored in an electronic device, and can also be called a to-be-processed table. In some embodiments, data obtained from other channels can be imported into a preset table to obtain an initial table. Exemplarily, data in a first table can be imported into a second table to obtain an initial table. Another exemplary embodiment is that data in a business system can be imported into a preset table to obtain an initial table. It should be noted that the format of the data imported into the preset table and the format of the original data in the preset table can be the same or different.
[0045] For example, when the styles of the first table and the second table are different, if the data in the first table is imported into the second table, the resulting initial table includes both data with the style of the first table and data with the style of the second table. In this case, the initial table contains content with inconsistent styles. Among them, the table style may include a set of table formats and / or value types, which are used to quickly and uniformly set the appearance and layout of the table. Through the table style, multiple format settings (such as the font, color, border, alignment of the content in the table, etc.) and / or value types (such as value types may include but are not limited to: date, time, currency, progress, percentage, decimal, integer, etc.) can be combined to form a reusable template. Users can quickly apply the formatting in the table style to the entire table or a specific part of the table by selecting a table style.
[0046] As another example, the initial table may be a table file or a table in a table file, or a table in other files, such as a table in a text document, a presentation, or a web page.
[0047] In the embodiment of the present disclosure, after the initial table is obtained, a first operation may be performed on the initial table. When the first operation is detected, the item title and the first content under the item title may be determined from the initial table.
[0048] It should be noted that the first operation may be an operation initiated based on the initial table. For example, upon receiving a first operation from a user on the initial table, such as a user clicking on a column or row in the initial table, the electronic device, in response to the first operation, extracts from the initial table the item title of the column or row in the initial table, as well as the first content under the item title.
[0049] In some embodiments, to achieve one-click beautification, a preset control may be displayed on the page displaying the initial table. When an operation acting on the preset control is detected, it is determined that a first operation has been detected. The operation acting on the preset control may be a click operation, a long press operation, a sliding operation, etc. The first operation enables one-click beautification of the initial table.
[0050] In an embodiment of the present disclosure, when an initial first operation is detected, the content in the initial table can be analyzed to determine the item title and the first content under the item title from the initial table. Here, the item title can be arranged in the header of the table, and the first content can be the table body data under the header. Exemplarily, the item title refers to the name used to identify the column or row data in the table, and the first content is the corresponding data record under the item title, that is, the column or row data. For example, in a commodity information table, the item title can be "Commodity Name", and the corresponding first content can include "Apple", "Orange", "Banana", etc.
[0051] In one embodiment, the first content can be metadata stored in a cell, or it can be content after the metadata has been formatted. For example, if the metadata of the first content is the number "81880" (Arabic numerals), after the format "March 4, 2122" is applied, "81880" will be displayed as "March 5, 2124" which conforms to the format "March 4, 2122". In some embodiments, the metadata after formatting can be used as the first content and input into a pre-trained target model for recognition, thereby improving semantic recognition.
[0052] In one embodiment, a table kernel can obtain user input, determine the data type of the user input, convert the user input into metadata corresponding to the data type, and store it in a table. For example, if a user enters "May 10, 2024," and the table kernel determines that "May 10, 2024" is a date type, it will convert "May 10, 2024" into metadata corresponding to the date, "45422," and store it in the table, for example, in the XML file corresponding to the table page in the table data (e.g., sheet1.xml). Because the metadata "45422" is a number, the formatting information for the date type can be applied and take effect. For another example, if a user enters "2024.05.10," and the table kernel cannot recognize "2024.05.10" as a date type, it will determine that "2024.05.10" is a string and store the string "2024.05.10" in the table, for example, in the XML file corresponding to the shared string in the table data (e.g., sharedStrings.xml). Since "2024.05.10" stored in the table is a string, not a number, even if the date format information is applied, it will not take effect.
[0053] In one embodiment, the content displayed in the cell may be metadata or metadata after the application of format information. When the content after the application of format information is displayed, the content in the specified format of the metadata application data type corresponding to the content may be displayed in the formula bar or the cell where the content is located when the cell where the content is located is in the editing state or the selected state. For example, if the cell content is displayed as "May 10, 2024", then when the cell is in the editing state, the specified format "2024 / 05 / 10" corresponding to the date may be displayed in the cell. When the cell is in the selected state or the editing state, the specified format "2024 / 05 / 10" corresponding to the date may be displayed in the formula bar.
[0054] In some embodiments, the content in the initial table can be input into a pre-trained target model to determine the project title and the first content under the project title. The target model can be a pre-trained analysis model. The target model can be used to analyze different types of content. For example, at least one of the following content can be analyzed: content in text format, content in file format, content in picture format, content in video format, content in graphic format, etc. The analysis model may include: Artificial Intelligence Generated Content (AIGC) model, pre-trained language based on Transformer architecture (Generative Pre-trained Transformer, GPT) model or neural network model, such as recurrent neural network (RNN), long short-term memory network (LSTM), etc. Specifically, the target model is used to analyze the table structure of the initial table to obtain the project title in the initial table and the first content under the project title.
[0055] In some embodiments, the second content can be determined from the first content under the project title. Exemplarily, a preset number of first contents can be determined as the second content. In the embodiment of the present disclosure, a preset number of first contents can be determined as the second content, by screening out the second content from the first content, and determining the target data type of the first content under the project title based on the matching degree between the project title and the second content. Since the second content is part of the first content, it can characterize the characteristics of all the first contents. Compared with analyzing all the first contents, performing matching analysis on part of the first content (second content) can improve the efficiency and speed of data processing while ensuring the accuracy of the determined target data type.
[0056] The preset number can be determined as needed, that is, the second content can be at least part of the first content. In some embodiments, the first content before the preset number under the project title can be determined as the second content, the content after the preset number under the project title can be determined as the second content, or the first content randomly determined by the preset number under the project title can be determined as the second content. For example, if there are 100 lines of first content under the project title, the second content can be the first 5 lines of first content under the project title, the last 5 lines of first content under the project title, or the 5 random lines of first content under the project title.
[0057] For example, the first content may include "apple", "orange", and "banana", and the second content may be the first two lines of the first content, that is, the second content may be "apple" and "orange".
[0058] In the embodiment of the present disclosure, when the second content is determined, the matching degree between the project title and the second content under the project title may be determined.
[0059] In some embodiments, the degree of matching between the project title and the second content can be calculated by natural language processing technology. For example, the degree of matching between the project title and the second content can be determined based on semantic similarity, keyword matching, etc. Among them, the degree of matching between the project title and the second content is positively correlated with the correlation between the project title and the second content, that is, the higher the degree of matching, the greater the correlation. Taking the determination of the degree of matching between the project title and the second content based on semantic similarity as an example, after determining the semantic similarity, the semantic similarity can be directly determined as the matching degree, or the semantic similarity can be weighted to obtain the matching degree, as long as the semantic similarity is positively correlated with the matching degree.
[0060] After determining the degree of match between the project title and the second content under the project title, the target data type of the first content under the project title can be determined based on the degree of match between the project title and the second content under the project title. Exemplarily, the target data type of the first content under the project title can be determined based on the degree of match between the project title and the second content. For example, if the project title is "Product Name" and the degree of match between the second content and the project title is high, the target data type can be determined to be "Text Type"; if the project title is "Product Price" and the degree of match between the second content and the project title is high, the target data type can be determined to be "Currency Type"; if the project title is "Product Storage Time" and the degree of match between the second content and the project title is high, the target data type can be determined to be "Date Type".
[0061] In some embodiments, based on the degree of match between the project title and the second content under the project title, the target data type of the first content under the project title is determined, including: determining a preset data type whose degree of match with the project title is greater than a first threshold as the first data type; determining a preset data type whose degree of match with the second content is greater than a second threshold as the second data type; and determining the target data type of the first content based on the first data type and the second data type.
[0062] In some embodiments, the degree of matching between the project title and a preset data type, as well as the degree of matching between the second content and the preset data type, can be calculated using natural language processing technology. The preset data type can be a predefined possible data type or a user-selected data type. The preset data type can include text type, numeric type, etc.
[0063] In the disclosed embodiment, a preset data type whose degree of match with the project title is greater than a first threshold value can be determined as the first data type; and a preset data type whose degree of match with the second content is greater than a second threshold value can be determined as the second data type. For example, if the first threshold value is 0.8 and the second threshold value is 0.7, and the project title is "Product Name," the degree of match between the project title and the text type is 0.9, which is greater than the first threshold value, and therefore the text type can be determined as the first data type; at the same time, if the second content is "Apple," the system calculates its degree of match with the text type to be 0.8, which is greater than the second threshold value, and therefore the text type is determined as the second data type.
[0064] After determining the first data type and the second data type, a target data type for the first content can be comprehensively determined based on the first data type and the second data type. For example, the data type with a higher degree of match between the first data type and the second data type can be selected as the target data type. In another example, the target data type can be determined from the first data type and the second data type based on a preset priority, where the priority can be set by the user as needed or determined based on historical usage data.
[0065] In other embodiments, after the first data type and the second data type are determined, the first data type and the second data type may be compared to determine whether the first data type and the second data type are the same.
[0066] In some embodiments, determining a target data type of the first content based on the first data type and the second data type includes: if the first data type is the same as the second data type, using the first data type or the second data type as the target data type.
[0067] Here, if the first data type and the second data type are consistent, that data type can be directly determined as the target data type for the first content. For example, if both the first data type and the second data type are text, the target data type for the first content is text. If the first data type and the second data type are inconsistent, further determination can be made based on preset rules. For example, the data type with a higher degree of match between the first and second data types can be prioritized, or the selection can be made based on the semantic priority of the item title.
[0068] In the disclosed embodiment, a dual judgment can be performed on the matching degree between the project title and the preset data type, and the matching degree between the second content and the preset data type. By introducing a matching judgment mechanism, the accuracy of the determined target data type can be improved.
[0069] In some embodiments, determining the target data type of the first content based on the first data type and the second data type includes: when the first data type is different from the second data type, reselecting the second content from the first content under the project title, and continuing to perform the step of determining the preset data type that has a matching degree with the second content greater than a second threshold as the second data type based on the reselected second content. It should be noted that when the first data type is the same as the second data type, the first data type or the second data type can be directly used as the target data type. However, when the first data type is different from the second data type, the second content will be reselected from the first content under the project title, wherein the reselected second content can be another part of the first content, or a part of the content extracted from the first content by other logical rules, such as random selection, selection in a specific order, etc.
[0070] Because the second content is part of the first content, the target data type is determined based on the matching degree between the project title and the second content. Only a portion of the data in the table data under the project title is considered, but this portion of data (the second content) may not fully represent all the data (the first content). In the embodiment of the present disclosure, if the target data type cannot be accurately determined based on the selected second content, the next batch of second content can be reselected from the first content under the project title. By setting up a reselection process, the credibility of the determined target data type can be improved.
[0071] After the second content is reselected, the step of determining the preset data type whose matching degree with the second content is greater than the second threshold as the second data type may be continued based on the reselected second content. This process may be repeated multiple times until a preset data type whose matching degree with the second content is greater than the second threshold is found, or until a preset number of times is reached. Each time the second content is reselected, the matching degree between the second content and the preset data type is recalculated, and the second data type is updated based on the re-determined matching degree.
[0072] In some embodiments, if a preset data type having a matching degree with the second content greater than a second threshold is still not found after a preset number of times, a prompt message may be output, wherein the prompt message may be used to prompt the user that there is no data type that can be optimized.
[0073] In other embodiments, an exception handling mechanism may be triggered, such as prompting the user to manually set the target data type, or selecting the data type with the highest matching degree from the multiple determined data types according to a preset rule as the second data type. The multiple determined data types may be data types determined during the multiple reselections of the second content and the continued execution of the step of determining as the second data type the preset data type with a matching degree greater than a second threshold with the second content.
[0074] In other embodiments, when there are multiple second contents selected from the same batch, the preset data types whose matching degree with each second content is greater than the second threshold value can be determined separately, that is, each second content corresponds to a preset data type. After determining the preset data types corresponding to each second content, if there is a second content corresponding to a preset data type that is different from the preset data types corresponding to other second contents, the proportion of second contents with the same preset data type in all selected second contents can be determined, and the preset data types of second contents with a proportion greater than the preset proportion can be determined as the second data type. For example, in the case of three different second contents, two second contents point to the same preset data type, and one second content points to another preset data type, then the same preset data type pointed to by the two second contents can be determined as the second data type.
[0075] In other embodiments, the preset data types corresponding to the second content in multiple batches are determined, the proportion of the number of times the preset data type appears relative to the total number of batches is determined, and the preset data type whose proportion exceeds the preset proportion is determined as the second data type. For example, if there are three batches of second content, and two batches point to the same preset data type and one batch points to a different preset data type, the same preset data type pointed to by the two batches can be determined as the second data type.
[0076] In the disclosed embodiment, after determining the second data type based on the above steps, the target data type of the first content can be comprehensively determined based on the first data type and the ultimately determined second data type. If the first data type and the second data type are consistent, the data type is directly used as the target data type; if they are inconsistent, the target data type is determined based on preset rules (e.g., prioritizing the data type with a higher degree of matching, or selecting based on the semantic priority of the item title).
[0077] In an embodiment of the present disclosure, when the first data type is inconsistent with the second data type, by dynamically adjusting the selection of the second content, that is, reselecting the second content, and continuing to execute the step of determining the preset data type having a degree of match with the second content greater than a second threshold as the second data type based on the reselected second content, a second data type with a higher degree of match with the second content can be determined, thereby increasing the randomness of the selected second content, so that the second content can more accurately represent the first content, thereby improving the accuracy of the target data type determined based on the first data type and the second data type.
[0078] In some embodiments, the method further comprises:
[0079] When the reselection condition is met, performing the step of reselecting the second content from the first content under the item title;
[0080] The re-election conditions include at least one of the following:
[0081] The proportion of the selected second content to the first content is less than a preset proportion, wherein the selected second content includes all previously selected second contents;
[0082] The number of times the second content is reselected is less than a preset number.
[0083] In the case where there are multiple reselection conditions, the multiple reselection conditions are in an AND relationship, or an OR relationship.
[0084] In the embodiment of the present disclosure, when the first data type and the second data type are different, it is determined whether a reselection condition is satisfied to determine whether to reselect the second content from the first content under the item title.
[0085] It should be noted that the reselection condition includes at least one of the following: the proportion of the selected second content to the first content is less than a preset proportion; the number of times the second content is reselected is less than a preset number, wherein the preset number is the number of times that reselection is supported.
[0086] In the case where there are multiple reselection conditions, the multiple reselection conditions are in an OR relationship. If any of the above reselection conditions is met, the step of reselecting the second content from the first content under the item title will be automatically executed.
[0087] In the case where there are multiple reselection conditions, and the multiple reselection conditions are in an and relationship, if all the above reselection conditions are met, the step of reselecting the second content from the first content under the item title will be automatically executed.
[0088] Exemplarily, multiple reselection conditions are taken as and relationship as an example for explanation. Assume that the reselection condition is: the preset ratio is 50%, and the preset number of times is 3 times. Assume again that there are 100 first contents and 30 second contents selected previously. If the second data type is not determined, or the determined second data type is different from the first data type, the second content needs to be reselected. Reselecting the second content requires judging whether the reselection condition is met. If it is determined that the number of times the second content is reselected is 0, which is less than the preset number of times 3, and the proportion of the selected second content to the first content is 30%, which is less than the preset proportion of 50%, then at this time, the reselection condition is met, and the second content will continue to be reselected from the first content, that is, the first reselection is performed. If the second data type is still not determined, or the determined second data type is different from the first data type, it is necessary to reselect 30 second contents, and select a total of 60 second contents; determine again whether the reselection conditions are met, and determine that the number of times the second content is reselected is 1, which is less than the preset number of times 3, but the proportion of the selected second content to the first content is 60%, which is greater than the preset proportion of 50%, then the reselection conditions are not met and further reselection of the second content is not supported.
[0089] Based on the reselected second content, the step of determining the preset data type whose degree of match with the second content is greater than the second threshold as the second data type can be continued. This process can be repeated multiple times until a preset data type whose degree of match with the second content is greater than the second threshold is found, or the reselection condition is no longer met. Each time the second content is reselected, its degree of match with the preset data type is recalculated, and the second data type is updated based on the matching result.
[0090] If, after multiple attempts, no preset data type with a matching degree greater than a second threshold for the second content is found, or the proportion of the selected second content to the first content reaches a preset proportion, or the number of times the second content has been reselected reaches a preset number, a prompt message may be output, wherein the prompt message may be used to inform the user that there are no more data types that can be optimized. In other embodiments, an exception handling mechanism may be triggered, such as prompting the user to manually set the target data type, or selecting the data type with the highest matching degree from previously determined data types according to preset rules as the second data type.
[0091] In the embodiment of the present disclosure, when the first data type and the second data type are inconsistent, the selection of the second content can be dynamically adjusted according to the reselection condition. By setting the reselection condition, the reselection phase of the second content is automatically entered. Compared with manually performing the reselection operation, the reliability and flexibility of the table data processing can be improved. Moreover, by limiting the reselection condition, it is possible to avoid unlimited reselection (if multiple selections and judgment results cannot determine the second data type, there is no need to reselect again) or meaningless reselection (if the proportion of the selected second content to the first content is greater than the preset proportion, it means that the selected second content can already represent the first content. Moreover, if the majority of the second content cannot determine the second data type, or is determined to be unable to match the first data type, it means that continuing to reselect the second content is meaningless even if it can match the first data type), resulting in waste of resources or inaccurate judgment results. In addition, based on the reselected second content, continuing to perform the step of determining the preset data type with a matching degree greater than the second threshold as the second data type can determine the second data type with a higher matching degree with the second content, thereby improving the accuracy of the target data type determined based on the first data type and the second data type.
[0092] In the disclosed embodiment, after determining the target data type, reference format information corresponding to the target data type can be determined based on the target data type, and a format adjustment operation can be performed on the first content under the item title based on the reference format information to obtain a target table after the initial table has been formatted. The reference format information refers to standard format specifications set for different data types.
[0093] For example, if the first content under the project title is a number, the data type of the number (also referred to as a numeric type) can include at least one of the following: a numerical type, a currency type, a date type, a time type, a percentage type, a fraction type, a text type, etc. It can be understood that the number of the first content can be set to different data types. The determined target data type can be any of the above data types. When the determined target data type is different, the corresponding determined reference format information will also be different. The present disclosure can assign reference format information corresponding to the target data type to the number of the first content.
[0094] For example, Figure 2A As shown, for a cell set to text type, the number in the cell is processed as text, and the reference format information may include the font size, font style, alignment, etc. of the text type number; Figure 2BAs shown, for a cell set to a numeric type, the number in the cell is treated as a numeric value, and the reference format information may include the number of decimal places, thousands separator, etc. Exemplarily, the reference format information is used to determine the format of the number in the first content. In some embodiments, reference format information that matches the target data type can be extracted from a preset format information library. The preset format information library can store various data types and format information that matches each data type.
[0095] It should be noted that, in the process of performing a format adjustment operation on the first content under the project title based on the reference format information, the format adjustment operation will take effect on numbers in the first content; and will not take effect on non-numbers in the first content. For example, when the content in a cell (metadata stored in the cell) is pure numbers, when the cell format is set to correspond to any type of value, currency, date, or time, the format adjustment operation will take effect because the content in the cell is a number; when the content in the cell is non-number (such as text in addition to numbers), even if the cell format is set to correspond to any type of value, currency, date, or time, the format adjustment operation will not take effect because there are no numbers in the cell.
[0096] It should be noted that the content (metadata) in a cell may or may not be the same as the final displayed content. The final displayed content of a cell is the content (metadata) in the cell after formatting is applied and takes effect.
[0097] For example, if a user enters "2124 March 5th" in a cell, the table's kernel will default the cell's content to text because the first character is "two." The cell's content (metadata) will be "2124 March 5th," which doesn't store a number (Arabic numerals) but a string. Even if the cell is subsequently set to a date and formatted as "YYYY-MM-DD," the "YYYY-MM-DD" format will not take effect, as the cell's content (metadata) is "2124 March 5th," which isn't a number (Arabic numerals). Consequently, "2124-03-05" will not be displayed as the "YYYY-MM-DD" format.
[0098] For example, if a cell doesn't have a data type set, and a user enters "2124.03.05" in the cell, although "2124.03.05" complies with date notation, some spreadsheet kernels will determine that the numeric combination "2124.03.05" includes more than one decimal point and will default the cell's content to a text string. Therefore, even if the cell is subsequently set to a date format with "YYYY-MM-DD", the "YYYY-MM-DD" format will not take effect because the cell's content (metadata) is a string, not a valid number (Arabic numerals). Therefore, "2124.03.05" will not be displayed as "2124-03-05", which complies with the "YYYY-MM-DD" format.
[0099] For another example, if the data type of a cell is not set, and the user enters "March 5, 2124" in the cell, and "March 5, 2124" conforms to the way of writing a date, some table kernels will default the content entered in the cell to a date, and automatically convert the user-entered "March 5, 2124" into the number "81880" corresponding to the date, save it as the content in the cell (metadata), and set the format of the cell to "YYYY-MM-DD-DD" by default, that is, the content (metadata) "81880" in the cell will be displayed as "March 5, 2124" which conforms to the format of "YYYY-MM-DD-DD". Step 1: If the cell format is changed to "March 4, 2122", then because the cell content (metadata) is actually the number "81880" (Arabic numerals), "81880" will be displayed as "March 5, 2124", which conforms to the format of "March 4, 2122". In other words, the display will change from "March 5, 2124" to "March 5, 2124". Step 2: If the cell format is changed to "YYYY-MM-DD" at this time, then because the cell content (metadata) is actually the number "81880" (Arabic numerals), then "81880" will be displayed as "2124-03-05", which conforms to the format of "YYYY-MM-DD". In other words, the display will change from "March 5, 2124" to "2124-03-05".
[0100] Therefore, even if the final displayed content of the cell is the same, the different stored cell content (metadata) will result in different application of the data type. For example, the final displayed content of the same cell is "March 5, 2124", but the content (metadata) in the cell may be "81880" or "March 5, 2124". If the content (metadata) in the cell is "81880", the data type can be applied and take effect; if the content (metadata) in the cell is "March 5, 2124", the data type can also be applied, but it will not take effect. Moreover, in some cases, when the stored cell content (metadata) is a legal number, the format information of the applied data type takes effect.
[0101] What's more complicated is that due to the copy or import operation, it is possible that the cell content (metadata) is used, or it is possible that the final displayed content of the cell is used, which may lead to the problem that the data type may not take effect after application.
[0102] In other embodiments, since the formatting operation will not take effect if there is no number in the cell, if the first content includes a text-type number, the text-type number can be converted to a corresponding non-text-type number. For example, if the text-type number is "March 5, 2124", the text-type number can be converted to "81880" and displayed as date-type content, such as "2124-03-05". After the conversion, the reference format information corresponding to the date type is applied, and the formatting operation takes effect.
[0103] In other embodiments, there are two cases for the content in the cell:
[0104] The first case is that the content entered by the user into the cell is a number (Arabic numeral). Since the content is stored as a number (Arabic numeral), the user can set the data type of the content through the cell format setting interface. For example, the content can be set to any data type related to numbers. Since the content is essentially stored as numbers, any data type related to numbers applied in the setting interface can achieve format conversion of the content, but the digital nature of the content will not be changed after the format conversion. In the first case, no matter what format the number is converted to, it will not affect the application of the reference format information to the content, that is, it will not affect the effectiveness of the format adjustment operation.
[0105] For the first case, for example, the user enters the cell content as "2024-03-05", some table kernels can recognize it as a date type, and will convert it into a number and store it. For example, if the content (metadata) stores the number "45356", the user will set the data type of the content to a date type, and set it as follows: Figure 2C If the data type is shown, the table kernel will automatically convert "2024-03-05" to "March 5, 2024", but in essence, it still stores the number "2024-03-05" or the value "45356" corresponding to "2024-03-05".
[0106] The second case is when the user enters non-numeric content into a cell, and the content is stored as a non-numeric value. When the user sets the data type of the content in the cell formatting interface, if the table kernel determines that the content is non-numeric, for example, it is identified as a text string type, then no matter how the user subsequently sets the content to any data type, the reference format information cannot be applied, and the format adjustment operation will not take effect.
[0107] For the second case, for example, the user enters "March 5, 2024". Since the table kernel considers the first character to be non-numeric, it will consider the content to be non-numeric. If the user sets the content as Figure 2D The data type shown is invalid, that is, "March 5, 2024" cannot be applied to the data type corresponding to the number and cannot be converted to "2024-03-05".
[0108] In other embodiments, the content of the cell input by the user is a number, but the input format does not conform to the expression of the data type corresponding to the number, and the format of the number also needs to be converted. For example, the content input by the user is "12.12". If the context of the content is a date, then "12.12" is more likely to mean "December 12". Since the input content is a number, the date type can act on the number, but since the number is expressed as a floating point number (a certain value), the table kernel can convert the number into a format corresponding to the date type based on a preset algorithm. However, after conversion, 12.12 is not the corresponding December 12, but "January 12, 1900 2:52:48", which will cause a conversion error because the format of the number input by the user does not conform to the expression of the data type corresponding to the number.
[0109] In other embodiments, when the user inputs the cell content as "2024-12-23", the table kernel may convert it into a floating point number (a certain value, such as 45649) for storage, or it may retain its original format and store it, that is, directly store "2024-12-23". When the content needs to be identified, the table kernel may identify and convert it.
[0110] For example, the user enters "2024-12-23" in a cell, the table kernel recognizes "2024-12-23" as a date, and determines "2024-12-23" as a number rather than text. It then converts "2024-12-23" and the preset conversion rules into "45649", and stores the content (metadata) in the cell as a floating point number (e.g., 45649).
[0111] It should be noted that the content in the cell mentioned in the above embodiment includes: the first content or the second content under the item title.
[0112] In some embodiments, determining reference format information corresponding to the target data type includes at least one of the following:
[0113] determining reference format information of the target data type based at least on the format information of the second content;
[0114] The format information preset for the target data type is determined as the reference format information of the target data type.
[0115] In the disclosed embodiment, after determining the target data type of the first content, it is necessary to determine reference format information corresponding to the target data type. Determining the reference format information includes at least one of the following: determining the reference format information for the target data type based on at least the format information of the second content; or determining pre-set format information for the target data type as the reference format information for the target data type.
[0116] It should be noted that since the second content is part of the first content, the format information of the second content can serve as basic data for determining the target data type. Therefore, the reference format information of the target data type can be determined based at least on the format information of the second content. For example, if the second content is purely numeric (such as "123"), it can be determined that the target data type is likely a numeric type, and the reference format information can be determined based on the reference format of the numeric type (such as the number of decimal places, thousands separator, etc.). For example, the format information of the second content can be directly determined as the reference format information of the target data type. Compared to analyzing all the first content to determine the reference format information, the present disclosure can determine the reference format information based on the format information of the second content, which can reduce the amount of data processing and improve data processing efficiency. The format information is used to indicate the format of the content in the cell (e.g., the first content and the second content) under the corresponding data type. For example, if the content in the cell is a number, and the number corresponds to a numeric type, then the format information of the cell content under the numeric type is the format information of the content. For example, the format information of the content under the numeric type can be the number of decimal places.
[0117] In some embodiments, the second content can be input into the target model, and reference format information can be output based on the target model. For example, the second content that does not carry format information can be input into the target model (e.g., the second content is the content of a cell (metadata), or the final display content of the cell (the display content after the cell metadata is applied with the data type)). The target model performs semantic analysis on the second content to determine the data type of the second content and the format information of the second content under the data type. Then, based on the format information of the second content under the data type, the reference format information of the target data type is determined.
[0118] It should be noted that when the second content that does not carry format information is input into the target model, on the one hand, since the target model can perform semantic analysis on the second content and then determine the data type of the second content, as well as the format information of the second content under the data type, if the second content input into the target model carries format information that does not match the second content, it will cause the target model to misrecognize it; on the other hand, since the target model does not have corresponding corpus training, it may not be able to recognize the format information carried by the second content, thereby reducing the accuracy of the target model in determining the reference format information.
[0119] In addition, the second content input into the target type is the final display content of the cell, which can ensure that the second content is not pure numbers, but content after formatting information is applied. This can facilitate the target model to identify the data type and format information of the second content from the expression of the second content.
[0120] It's important to note that carrying format information and applying format information are different. Applying format information refers to the display content after format information is applied to the metadata corresponding to the second content, which is then sent to the target model. Carrying format information refers to the metadata corresponding to the second content and the format information indicating that metadata, which are combined and sent to the target model.
[0121] The impact of format information on accuracy can be analyzed from the following examples:
[0122] For example, the data type of the text "This is a paragraph of text" is set to a date type. However, since "This is a paragraph of text" is not a number, the date type format will not take effect and it will still be displayed as "This is a paragraph of text". However, if both "This is a paragraph of text" and the format information "date type" are provided to the big model at the same time, the big model will obtain two unrelated or even confusing contents, and will be unable to finally determine the data type of "This is a paragraph of text".
[0123] For example, the second content input is the pure Chinese "2124 March 5th". As far as the table kernel is concerned, since the first character input is of text type, the pure Chinese format of "2124 March 5th" will be defaulted to text type, and the target model can identify "2124 March 5th" as a date type through semantic analysis. If the data type (text type) identified by the table kernel is transferred to the target model, since there is both text type information and date type information, the target model will be unable to recognize or misrecognize it because the information provided to the target model is irrelevant or contradictory.
[0124] As another example, with respect to the table kernel, when the second content input is text, the second content will be assumed to be of text type, and the second content also carries format information indicating the text type. If the second content and the format information of the data type (text type) determined by the table kernel are both input into the target model, since the target model does not have corresponding corpus training, the target model may not be able to recognize the format information of the text type, making the target model unable to understand the format information, which will reduce the accuracy of the target model in identifying the type and determining the reference format information.
[0125] The second content input into the target model of the present disclosure does not carry format information. Exemplarily, the second content input into the target model does not carry the data type and format information of the second content. Since the second content input into the target model does not carry the data type and format information of the second content, the target model can perform semantic analysis on the second content, and then determine the data type of the second content, as well as the format information of the second content under the data type, thereby improving the accuracy of the determined reference format information. Exemplarily, it can be determined that "March 5, 2124" is a date type, and based on the format information of the second content under the date type, the reference format information is determined. In other embodiments, while inputting the second content, the corresponding prompt word can also be input, that is, the second content and the prompt word set for the second content are jointly input into the target model, so that the target model outputs reference format information based on the second content and the prompt word. Exemplarily, the prompt words set for the second content may be: Please analyze the data type and format information of each data in the second content based on the data involved in {the second content}, where the data type is one of time, date, and currency; based on the proportion of data with different format information in the second content and / or the degree of matching between data with different format information and the second content, determine the target data type and target format information that can represent all data, and determine the target data type as the data type of the second content, and determine the target format information as the format information of the second content, and then determine the reference format information based on the format information of the second content.
[0126] In other embodiments, the format information can also be used as training corpus to train a target model. In this way, the target model can understand the format information, and after the second content and the data type determined by the table kernel are input into the target model, the target model can directly recognize the format information of the second content.
[0127] In this embodiment, the target data type and / or reference format information of the second content can be directly determined based on the semantic recognition capability of the target model, thereby avoiding the situation where some non-numeric second content that does not conform to the preset expression of the target data type but actually belongs to the target data type is missed, thereby improving the recognition capability of the target data type.
[0128] In the embodiment of the present disclosure, in addition to the format information based on the second content, the pre-set format information of the target data type can also be directly called as reference format information. These preset format information are pre-defined according to the general specifications of the data type. For example, for text type, the preset format information may include font size, font style, alignment, etc.; for date type, the preset format information may include date format (such as "YYYY / MM / DD"), etc. By combining the format information of the second content and the preset format information, the reference format information of the target data type can be determined more accurately.
[0129] Through the above two methods, the actual format of the second content and the preset general format can be comprehensively considered, thereby providing more accurate reference format information for the target data type of the first content. This not only improves the accuracy of format adjustment and enhances the adaptability and flexibility of the system, but also further optimizes the process of determining the reference format information, ensuring that appropriate format information can be flexibly selected according to the actual needs of the target data type, thereby improving the efficiency and accuracy of table data processing.
[0130] In an embodiment of the present disclosure, after the reference format information is determined, a format adjustment operation can be performed on the first content under the project title based on the reference format information. For example, if the target data type is a text type, and the reference format information specifies that the font size is 12, the font style is Songti, and the alignment is centered, then the first content can be adjusted according to the above format requirements. After the adjustment is completed, the target table after the format adjustment of the initial table is obtained. The target table is more standardized and unified in data format, which is convenient for users to view and subsequently process. The present disclosure can automatically identify the type of table data and adjust the format according to the type, thereby improving the efficiency and accuracy of table data processing and providing users with a convenient and efficient data processing method.
[0131] In some embodiments, in response to a first operation on the initial form, determining an item title and first content under the item title from the initial form includes:
[0132] In response to a first operation, analyzing the table structure of the initial table and identifying a subtable from the initial table;
[0133] The item titles in each subtable are determined respectively, and the first content under the item title belonging to the subtable is determined from the content under the item title. The first content is a cell belonging to the same row or column as the item title and does not belong to other subtables.
[0134] It should be noted that the initial table may include at least one sub-table. In response to the user's first operation on the initial table, the present disclosure can analyze the table structure of the initial table and identify the sub-table from the initial table. The initial table may contain multiple sub-tables, and the sub-tables may be nested, parallel, or combined in other forms in terms of layout. In some embodiments, the sub-tables can be identified from the initial table by identifying the boundaries, header rows or columns, and other structural features of the initial table.
[0135] After identifying each subtable, the item title in each subtable can be determined. The item title in the subtable can be used to identify the name of the column or row data in the subtable, and is usually located in the first row or first column of the subtable. By analyzing the structure of the subtable, the item title in the subtable can be identified.
[0136] After determining the subtable's item title, the first content under that subtable's item title can be determined from the content under that subtable's item title. The first content refers to the cell content in the same row or column as the item title, and that cell content does not belong to another subtable. For example, in an initial table containing multiple subtables, if an item title is in the first row of subtable A, the first content is the cell content in that row belonging to subtable A, and does not span into subtable B or other subtables.
[0137] The present disclosure can effectively process a complex table structure containing multiple sub-tables, accurately extract the item title of each sub-table and its corresponding first content from the complex table structure, and provide a basis for subsequent data type matching and format adjustment; on the basis of identifying the sub-table, accurately extract the item title of each sub-table and its corresponding first content, and ensure that subsequent data type judgment and format adjustment operations can be performed independently for each sub-table, thereby improving the accuracy and flexibility of table data processing.
[0138] In some embodiments, determining reference format information corresponding to the target data type includes:
[0139] For each subtable, determine the reference format information separately;
[0140] Performing a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the initial table is formatted, including:
[0141] Based on the reference format information of each sub-table, a format adjustment operation is performed on the first content in each sub-table respectively. When the format adjustment operation is completed on all sub-tables, a target table after the initial table has been formatted is obtained.
[0142] In the disclosed embodiments, after identifying the item titles and corresponding first contents of each subtable, reference format information corresponding to the target data type can be determined for each subtable. Because the content and data type of each subtable may differ, reference format information must be determined separately for each subtable. The method for determining the reference format information can refer to the above embodiments.
[0143] In the embodiment of the present disclosure, independent reference format information may be generated for each sub-table, ensuring that the format adjustment can adapt to the specific requirements of each sub-table.
[0144] After determining the reference format information of each subtable, you can perform format adjustment operations on the first content in each subtable based on the reference format information of each subtable. The specific steps are as follows: For each subtable, adjust the format of the first content under the item title according to the reference format information corresponding to the subtable. For example, if the first content of a subtable is a numeric type and the reference format information requires two decimal places, you can adjust the first content of the subtable to a number that conforms to the format. By adjusting the format of the first content in each subtable in turn, it is ensured that the content format of each subtable is unified and conforms to the preset specifications.
[0145] In the disclosed embodiment, after completing the formatting operations on all sub-tables, a target table can be formed after the initial table has been formatted. In this way, it is possible to ensure that the content format of each sub-table is adjusted independently, avoiding the situation where the formatting of other sub-tables is also set due to applying a certain reference format information to the same column or row of the entire initial table to set the sub-table format, while maintaining the structure and logical relationship of the entire initial table unchanged. The resulting target table is more standardized and unified in format, making it easier for users to view and subsequently process it.
[0146] In the disclosed embodiment, it is possible to perform refined processing on a complex table structure containing multiple sub-tables, independently determine reference format information for each sub-table, and perform format adjustment operations separately, ultimately generating a target table with a standardized format, thereby improving the accuracy and flexibility of table data processing.
[0147] In some embodiments, performing a format adjustment operation on the second content in each sub-table based on the reference format information of each sub-table includes:
[0148] When there are at least two sub-tables, determining distribution information of each sub-table in the initial table;
[0149] Based on the distribution information, application areas of the reference format information of each sub-table are determined respectively, and a format adjustment operation is performed on the first content within the application area.
[0150] It should be noted that if the initial table contains at least two subtables, the distribution information of each subtable in the initial table can be obtained. This distribution information includes the subtable's location, range, and relative relationship to other subtables. For example, the starting row number, ending row number, starting column number, and ending column number of each subtable can be recorded to clearly identify the specific location of each subtable in the initial table.
[0151] Based on the distribution information, the application area of the reference formatting information for each subtable can be determined. The application area refers to the specific range of cells within the subtable to which the reference formatting information should be applied. For example, if the item headers of a subtable are located in the first row, the application area may include all cells below that row, up to the end of the subtable. By analyzing the distribution information, formatting operations on each subtable can be limited to the subtable's own scope without affecting the content of other subtables.
[0152] After determining the application area of each subtable, formatting adjustments can be performed on the first content within the application area for each subtable based on the reference format information of the subtable. For example, for each subtable, the corresponding application area is located based on the subtable's distribution information. Within the application area, formatting adjustments are performed on the first content under the item title based on the reference format information of the subtable. For example, if the reference format information of the subtable requires center alignment of text content, the content of all relevant cells in the subtable can be center aligned.
[0153] In the embodiments of the present disclosure, on the one hand, the format of the first content in the application area of each sub-table can be adjusted in sequence to ensure that the content format of each sub-table is unified and complies with preset specifications, thereby ensuring that the format adjustment operation is accurately applied to the specified area of each sub-table, avoiding affecting other sub-tables or other parts of the initial table.
[0154] Secondly, when processing complex tables containing multiple sub-tables, the scope and effect of format adjustments can be controlled more finely; by analyzing the distribution information of the sub-tables, the application area of each sub-table is clarified, and targeted format adjustment operations are performed to form the target table after the initial table is formatted, thereby ensuring that the target table is more standardized and unified in format, while maintaining the integrity of the table structure and the clarity of the logical relationship.
[0155] In some embodiments, determining the application area of the reference format information of each sub-table based on the distribution information includes:
[0156] In a case where it is determined that at least two sub-tables share a target cell, determining an application area of each sub-table based on distribution information of contents in the at least two sub-tables in the target cell;
[0157] The target cell includes: a target row and / or a target column.
[0158] It should be noted that, in the case of determining that at least two sub-tables share a target cell, the distribution information of the contents in the at least two sub-tables in the target cell can be analyzed. It should be noted that the target cell can be the target row and / or target column in the initial table. For example, in the case where at least one cell in one of the at least two sub-tables and at least one cell in the other sub-table are in the same row or column, the cells in the same row or column can be determined as the target cell shared by the at least two sub-tables. Exemplarily, if the contents in the at least two sub-tables are distributed in different cells located in the same row (target row), then the different cells in the same row can be the above-mentioned target cells. And / or, if the contents in the at least two sub-tables are distributed in different cells located in the same column (target column), then the different cells in the same column can be the above-mentioned target cells.
[0159] After determining the target cell, the range of the target cell can be determined. For example, the specific location of the target cell, i.e., the range of the target row and / or target column, can be determined. For example, if the target cell is a column, the column number of the column can be determined. After determining the target cell, the content distribution of each subtable in the target cell can be analyzed, including the content type, format, and relationship with other cells.
[0160] Taking at least two subtables including a first subtable and a second subtable as an example, if at least one cell in the first subtable and at least one cell in the second subtable are in the same row or column, then the cells in the same row or column are the target cells. Figure 2E As shown, some cells of the first subtable 201 and some cells of the second subtable 202 are located in the third and fourth columns of the initial table, the content of the first subtable is distributed in rows 1 to 8 of the third and fourth columns of the initial table, and the content of the second subtable is distributed in rows 10 to 18 of the third and fourth columns of the initial table. In this case, the third and fourth columns of the initial table can be determined as the target cells 203 shared by the first and second subtables.
[0161] In the disclosed embodiment, an independent application area can be determined for each subtable based on the distribution information of the content. The application area refers to the cell range belonging to the subtable within the target cell range. For example, if the target cell is a shared column, but different subtables use different data types or formats in the column, an independent application area can be divided for each subtable. This can ensure that in the target cell, the content format adjustment operation of each subtable is limited to its own application area, avoiding format conflicts or data confusion.
[0162] Based on the distribution of the target cell's content, the application area of each subtable is located. Within each subtable's application area, the first content corresponding to that subtable is formatted according to the subtable's corresponding reference format information. For example, if the target cell is a shared column, and a subtable has some content located in that shared column, and the subtable's reference format information requires center alignment of the text content, the content of all related cells of the subtable within the target cell can be center-aligned.
[0163] The present disclosure can effectively handle the complex situation where multiple subtables share a target cell. By analyzing the content distribution information in the target cell, an independent application area is divided for each subtable, and targeted format adjustment operations are performed, thereby ensuring that the target table is more standardized and unified in format while maintaining the integrity of the table structure and the clarity of the logical relationship.
[0164] In some embodiments, performing a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the initial table has been formatted includes:
[0165] Determining a first matching degree between the attribute information of the cell where the first content is located and the target data type, and / or a second matching degree between each sub-content included in the first content and the target data type;
[0166] When the first matching degree is greater than the third threshold and / or the second matching degree is greater than the fourth threshold, a format adjustment operation is performed on the first content based on the reference format information to obtain a target table after the initial table is formatted.
[0167] In some embodiments, after completing the analysis of the sub-table distribution information and the application area division, a first degree of match between the attribute information of the cell containing the first content and the target data type, and / or a second degree of match between each sub-content included in the first content and the target data type can be determined. The first degree of match indicates the degree of match between the original attribute information of the cell containing the first content and the target data type, and the second degree of match indicates the degree of match between each sub-content and the target data type. That is, if at least one of the first degree of match is greater than a third threshold and the second degree of match is greater than a fourth threshold is satisfied, a format adjustment operation can be performed on the first content based on the reference format information, resulting in a target table after the initial table has been formatted.
[0168] For example, Figure 2F As shown, when the cell where the first content is located has no attribute information set, the second matching degree and the fourth threshold can be directly compared, and when the second matching degree is greater than the fourth threshold, a format adjustment operation is performed on the first content based on the reference format information to obtain a target table after the initial table is formatted.
[0169] In some embodiments, before applying the reference format information, it may be determined whether the metadata of the first content in the cell is the same as the displayed first content. It should be noted that the first content ultimately displayed in the cell is the displayed content after the metadata of the first content in the cell is formatted and effective.
[0170] In the case where the metadata of the first content in the cell cannot apply the reference format information, the format adjustment operation cannot be successfully performed. At this time, the metadata of the first content needs to be converted so that the metadata of the converted first content can apply the reference format information. For example, the first content in the cell is "March 5, 2124". Since the first character is "two", the table kernel will default the first content to text, and the metadata of the first content is "March 5, 2124", which is not a number (Arabic numerals). Even if the cell is subsequently set to a date and the format is "YYYY-MM-DD", since the metadata of the first content in the cell is "March 5, 2124", which is not a number (Arabic numerals), the format "YYYY-MM-DD" will not take effect, and "March 5, 2124" will not be displayed as "2124-03-05" which conforms to the format "YYYY-MM-DD".
[0171] At this time, the metadata of the first content in the cell needs to be converted, for example, to "2124 / 03 / 05", or to the pure number "81880", and then the format "YYYY-MM-DD" is applied to the converted data, so that "March 5, 2124" will be displayed as "2124-03-05" in the format "YYYY-MM-DD".
[0172] As another example, the attribute information of the cell where the first content is located (such as whether it is a number, data type, format, etc.) can be analyzed, and the matching degree between the attribute information of the cell where the first content is located and the target data type can be calculated.
[0173] As another example, the storage location of the file data corresponding to the table file of the first content can be analyzed, and the type of the first content can be determined based on the storage location. For example, if the metadata of the first content is a string, it is uniformly stored in an XML file corresponding to the shared string in the table data (such as sharedStrings.xml). For example, if the metadata of the first content is a number, it is uniformly stored in an XML file corresponding to the table page in the table data (such as sheet1.xml).
[0174] In one case, when it is determined that the first content is a number, it can be determined that the first content can apply the data type and format information and be valid, and then it can be determined that the first matching degree is greater than the third threshold.
[0175] At the same time, in some software or applications, the metadata of the first content is not purely numerical. In this case, the first content can also be analyzed for each sub-content (such as text fragments, numbers, etc.) and the second matching degree of each sub-content with the target data type can be calculated. The matching degree calculation can be achieved through semantic analysis, format consistency detection, etc.
[0176] If the first degree of match is greater than a third threshold, and / or the second degree of match is greater than a fourth threshold, a format adjustment operation is performed on the first content based on the reference format information. The third and fourth thresholds can be set as needed and can be the same or different. For example, if the third threshold is 90% and the fourth threshold is 80%, and the first degree of match is 91% and the second degree of match is 88%, the format adjustment operation can be performed directly on the first content based on the reference format information.
[0177] In the disclosed embodiment, the first content that meets the matching condition can be formatted according to the reference format information. For example, if the target data type is text and the reference format information requires a font size of 12, a font style of Songti, and a center alignment, the first content can be adjusted according to these format requirements.
[0178] After formatting all first-order content that meets the conditions, a target table is created after the initial table has been formatted. By accurately calculating the degree of match between cell properties and the target data type and performing formatting based on the matching results, format consistency of the table data is ensured, while errors caused by format inconsistencies are avoided.
[0179] In some embodiments, performing a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the initial table has been formatted, further includes:
[0180] When the first matching degree is less than a third threshold and / or the attribute of the first content is a preset reference attribute, performing content conversion on the first content based on the target data type;
[0181] A format adjustment operation is performed on the converted first content to obtain a target table.
[0182] It should be noted that, when the first matching degree is less than the third threshold value and / or the attribute of the first content is a preset reference attribute, the first content can be converted based on the target data type. Among them, the preset reference attribute may include predefined attribute information, and the preset reference attribute will affect the format adjustment operation performed on the first content. For example, the first content "March 5, 2124" can be semantically recognized by the target model as a date, but the cell where the first content is located is a text attribute, and it will also be considered as a text type attribute in the table kernel, and the stored metadata is "March 5, 2124", not a certain value. The first matching degree determined in this case will be less than the third threshold value. For another example, the first content "March 5, 2124" will be a text type by default by the table, and the attribute of "March 5, 2124" is the preset reference attribute (text type).
[0183] Since the first matching degree is used to indicate the matching degree between the original attribute information of the cell where the first content is located and the target data type, and the target data type is determined based on the first data type and the second data type, and the first data type and the second data type are both determined based on preset data types, when the first matching degree is greater than the third threshold, it is determined that the original attribute information of the cell where the first content is located and the target data type have a high matching degree. At this time, it can be determined that the target data type is determined from multiple preset data types. In this case, the format adjustment operation can be performed directly on the first content based on the reference format information.
[0184] When the first matching degree is less than the third threshold value, it is determined that the original attribute information of the cell where the first content is located has a low matching degree with the target data type. At this time, it is determined that the target data type does not belong to the preset data type. In this case, the first content can be converted based on the target data type to obtain the converted first content, and a format adjustment operation is performed on the converted first content to obtain the target table.
[0185] In other embodiments, when the cell containing the first content itself does not have attribute information set, it can be directly determined whether the attribute of the first content is a preset reference attribute. If the attribute of the first content is the preset reference attribute, the first content is converted based on the target data type. The preset reference attribute can be pre-set attribute information, such as attribute information set for text-type content.
[0186] In some other embodiments, there are two cases for the first content:
[0187] The first case is that the first content entered by the user into the cell is a number. Since the first content is stored as a number, the user can set the data type of the first content and the format information of the first content under the data type through the cell format setting interface. For example, the first content can be set to any data type related to numbers. Since the first content is essentially stored as a number, any data type related to numbers applied in the setting interface can achieve format conversion of the first content, but the digital nature of the first content will not be changed after the format conversion. For the first case, no matter what format the number is converted to, the first content does not need to be converted. Among them, the number is a legal Arabic numeral, which refers to an expression that conforms to the number, including decimals, integers, fractions, etc. For example, 12.12 is a legal Arabic numeral, and 2005.12.12 is not a legal Arabic numeral.
[0188] The second case is that the first content entered by the user into the cell is non-numeric, and the first content is stored as non-numeric. When the user sets the data type of the first content through the cell format setting interface, the table kernel will consider the first content to be non-numeric because the first character is non-numeric. No matter what data type the user sets the first content to later, it will not take effect. For the second case, the first content needs to be converted. Among them, non-numeric characters are characters other than legal Arabic numerals.
[0189] In an embodiment of the present disclosure, if one of the above conditions is met, the first content can be converted based on the target data type. Exemplarily, the first content is converted into a corresponding format according to the target data type. For example, if the target data type is a date, the date that the table kernel defaults to as text (such as "March 5, 2124") can be converted into a number corresponding to the date type (such as "2124-03-05" or "81880"). In other embodiments, specific content conversion operations can be performed on content whose attributes are preset reference attributes. For example, if the first content contains numbers but needs to be converted to text format, the conversion can be completed by setting the cell format.
[0190] It should be noted that the data conversion of the cell content in any embodiment of the present disclosure can be performed by the table kernel. That is, when any conversion conditions are met, the table kernel can automatically convert the data of the table content. The data conversion of the cell content includes, but is not limited to, converting the metadata of the first content in the cell; the conversion conditions may include, but are not limited to, failure to apply reference table information to the metadata of the first content.
[0191] In some embodiments, whether the first content has a preset reference attribute can be determined by reading the format information corresponding to the first content; or by applying a data type to the first content and adjusting the effectiveness of the format information. For example, if the format information cannot be effective, the attribute of the first content is determined to be a preset reference attribute; if the format information can be effective, the attribute of the first content is determined not to be a preset reference attribute. The aforementioned preset reference attribute can be an attribute corresponding to the text type, or other attributes.
[0192] In the disclosed embodiment, after the content conversion is completed, a format adjustment operation can be performed on the converted first content based on the reference format information, that is, the metadata in the cells of the first content are converted into numbers (Arabic numerals) so that the first content can apply the data type and take effect. For example, if the target data type is text, and the reference format information requires a font size of 12, a font style of Songti, and a center alignment, the converted first content can be adjusted according to these format requirements to form a target table after the initial table has been formatted.
[0193] In the embodiment of the present disclosure, it is possible to effectively process content with a low first matching degree or attributes that are preset reference attributes. Through content conversion and format adjustment, it is possible to ensure that the format information of the applied data type can take effect, thereby ensuring the format consistency of the table data, while avoiding errors caused by format inconsistency, and further improving the accuracy and flexibility of table data processing.
[0194] In some embodiments, performing a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the initial table has been formatted, further includes:
[0195] If the first content includes a first subcontent whose second degree of match with the target data type is less than or equal to a fourth threshold, performing content conversion on the first subcontent, deleting the first subcontent from the first content, or replacing the first subcontent with a preset second subcontent to obtain adjusted first content; wherein the degree of match between the second subcontent and the target data type is greater than or equal to the fourth threshold;
[0196] A format adjustment operation is performed on the adjusted first content to obtain a target table.
[0197] It should be noted that, when it is determined that the first content includes a first subcontent whose second matching degree with the target data type is less than or equal to the fourth threshold, the first subcontent may be processed to ensure consistency between the overall content and the target data type.
[0198] After the first sub-content is determined, at least one of the following may be performed: performing content conversion on the first sub-content; deleting the first sub-content from the first content; or replacing the first sub-content with a preset second sub-content.
[0199] Exemplarily, the first sub-content can be converted so that the converted first sub-content meets the requirements of the target data type. For example, if the target data type is a date, a date is a number or a combination of numbers, and the first sub-content is in text format, the first sub-content can be converted to a number. For example, if the first sub-content is "March 5, 2024" in text format and cannot be applied with the date type and take effect, the first sub-content can be converted to a number or a combination of numbers such as "2024-03-05" or "45356". For another example, although the first sub-content is "12.12" in a number format and meets the requirements of the target data type being a date as a whole, the user should want to express more December 12, but after applying the date type based on "12.12", the date becomes "1900 / 1 / 12 2:52:48", which does not meet the user's actual needs. Therefore, "12.12" can be converted to "12-12" (the table kernel can automatically recognize "12-12" or "12 / 12" as a date, i.e., not text) or "46003" (a numerical value indicating December 12, 2025), so that after applying the date type, it can be correctly displayed as "December 12". For another example, if the first sub-content is "2024.03.05", some table contents will automatically be recognized as text format and cannot be applied with the date type and take effect. In this case, the first sub-content "2024.03.05" can be converted to a number or combination of numbers such as "2024-03-05" or "45356".
[0200] For example, if the first sub-content cannot be converted into the target data type, the first sub-content may be deleted from the first content.
[0201] Exemplarily, the first sub-content may be replaced with a preset second sub-content, wherein the degree of match between the second sub-content and the target data type is greater than or equal to a fourth threshold. If the degree of match between the second sub-content and the target data type is greater than or equal to the fourth threshold, this indicates that the table kernel is able to identify the second sub-content as the target data type and is able to apply the target data type to the second sub-content, and the result is effective. Alternatively, if the table kernel is able to identify the second sub-content as the target data type and is able to apply the target data type to the second sub-content, the result is determined to be greater than or equal to the fourth threshold.
[0202] The adjusted first content obtained in the above manner is more compatible with the target data type, so that the first content can take effect after the target data type is applied, that is, the first content is displayed according to the format information corresponding to the target data type. In the embodiment of the present disclosure, after obtaining the adjusted first content, a format adjustment operation can be performed on the adjusted first content, thereby avoiding the format adjustment operation from being ineffective on the first content. For example, according to the reference format information, the font, alignment, number format, etc. are adjusted. After completing the processing of all the first contents, a target table can be formed. The target table is more standardized and unified in format, which is convenient for users to view and subsequently process.
[0203] The present disclosure can effectively process low-matching first sub-content, ensuring the overall consistency and accuracy of the table data. Through content conversion, deletion, or replacement operations, the adjusted first content can be effective after applying the target data type, making the format adjustment effective, further improving the flexibility and reliability of table data processing.
[0204] In some embodiments, when the reference format information is used to determine the digital format of the first content, performing a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the initial table is formatted includes:
[0205] When it is determined that the first content includes Arabic numerals and conforms to a preset expression of the target data type, a format adjustment operation is performed on the first content based on the reference format information to obtain a target table after the initial table is formatted.
[0206] It should be noted that, when the reference format information is used to determine the digital format of the first content, it can be determined whether the first content contains Arabic numerals, and whether the first content conforms to the preset expression of the target data type. Exemplarily, by analyzing the first content, it is determined whether the first content contains Arabic numerals. For example, the first content can be a string containing numbers, such as "2025" or "10". When it is determined that Arabic numerals exist, it is determined whether the Arabic numerals conform to the preset expression of the target data type. The preset expression refers to the specific requirements of the target data type for the digital format, for example, the preset expression of the date type is: YYYY-MM-DD, March 20, 2025, etc., or the converted value corresponding to the date, such as "March 20, 2025" corresponds to "45736"; the preset expression of the currency type is: ¥100.00, etc.
[0207] If it is determined that the first content includes Arabic numerals and conforms to the preset expression of the target data type, a format adjustment operation can be performed on the first content based on the reference format information. For example, if the target data type is a date type and the first content includes "2025-02-19", then it is determined that the first content includes Arabic numerals and conforms to the preset expression of the date type. In this case, the format adjustment operation can be directly performed on the first content based on the reference format information, and the format adjustment operation can be guaranteed to be effective.
[0208] In the embodiment of the present disclosure, the first content containing Arabic numerals can be processed. By identifying the digital content and determining whether it conforms to the preset expression, the format adjustment operation is performed in a targeted manner. This can ensure that all first contents that conform to the preset expression of the target data type can apply the target data type and the corresponding reference format information, and take effect, thereby ensuring the consistency of the format and content of the table data, and further improving the accuracy and reliability of the table data processing.
[0209] In some embodiments, performing a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the initial table has been formatted, further includes:
[0210] If it is determined that the first content includes Arabic numerals but the first content does not conform to a preset expression of the target data type, performing content conversion on the first content based on the target data type to obtain converted first content, wherein the converted first content conforms to the preset expression of the target data type;
[0211] A format adjustment operation is performed on the converted first content based on the reference format information to obtain a target table after the format of the initial table is adjusted.
[0212] Here, if it is determined that the first content includes Arabic numerals, but the first content does not conform to the preset expression of the target data type, the first content can be converted to conform to the preset expression of the target data type. For example, the target data type is a date type, and the preset expression of the date type is "YYYY-MM-DD", but the first content is "12.12". In this case, although "12.12" is an Arabic numeral and can be applied to the date type and is valid, it does not conform to the complete expression of the date, that is, it does not conform to the preset expression of the date type and is likely to be displayed as the date "1900-1-12" after the date type is applied. In this case, "12.12" can be converted to "2025-12-12" or "12-12", or "46003". After applying the reference format information "YYYY-MM-DD", it is displayed as "2025-12-12", which better meets the user's need to express December 12 as 12.12.
[0213] In other embodiments, when the first content is of other data types, corresponding conversion operations may be performed according to the rules of the target data type to ensure that the converted first content conforms to the preset expression of the target data type.
[0214] After completing the content conversion of the first content, a format adjustment operation can be performed on the converted first content based on the reference format information to obtain a target table. For example, format attributes such as font size, alignment, and decimal places of the first content can be adjusted based on the reference format information.
[0215] The present disclosure can effectively process Arabic numeral content that does not conform to the preset expression, ensure that the first content conforms to the preset expression of the target data type through content conversion, and further perform format adjustment operations to make the application of the target data type and format adjustment operations effective, thereby improving the accuracy and consistency of table data processing.
[0216] In some embodiments, performing a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the initial table has been formatted, further includes:
[0217] If it is determined that the first content does not include Arabic numerals but the first content semantically conforms to the target data type, performing content conversion on the first content based on the target data type to obtain converted first content, wherein the converted first content includes Arabic numerals and conforms to a preset expression of the target data type;
[0218] A format adjustment operation is performed on the converted first content based on the reference format information to obtain a target table after the format of the initial table is adjusted.
[0219] Here, when it is determined that the first content does not include Arabic numerals, but the first content semantically conforms to the target data type, the first content can be converted so that the converted first content contains Arabic numerals and conforms to the preset expression of the target data type.
[0220] For example, the target data type is a date type, and the first content is "March 5, 2024". Since the first character is non-numeric, the content will be considered non-numeric and cannot be recognized as a date. In this case, even if the date type is applied to the first content and the reference format information is set to "YYYY-MM-DD", it will not be effective. Then, the first content can be converted based on the target data type, and the converted first content can be "2024-03-05" or "2024-03-05" or "2024 / 03 / 05" or "45356", etc. The table kernel can recognize that the converted content is a date and can apply the format information of the data type to the converted content and make it effective. Then, by applying the date type format information to the first content and setting the reference format information to "YYYY-MM-DD", the first content can be displayed as "2024-03-05".
[0221] In other embodiments, when the first content is of other data types, semantic parsing and format conversion can be performed according to the rules of the target data type, so that the converted first content contains Arabic numerals and conforms to the preset expression of the target data type.
[0222] After completing the content conversion of the first content, a format adjustment operation can be performed on the converted first content based on the reference format information to obtain a target table. For example, format attributes such as font size, alignment, and decimal places of the first content can be adjusted based on the reference format information.
[0223] The present disclosure can effectively process content that does not contain Arabic numerals but semantically conforms to the target data type. Through semantic parsing and content conversion, the first content is converted into a format that contains Arabic numerals and conforms to a preset expression, ensuring that the first content of the preset expression can normally apply the target data type and its corresponding reference format information, and further perform format adjustment operations, thereby improving the accuracy and consistency of table data processing.
[0224] In some embodiments, the method further comprises:
[0225] When the reference format information is obtained, the reference format information is displayed through a display interface;
[0226] Performing a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the initial table is formatted, including:
[0227] In response to the second operation on the reference format information, a format adjustment operation is performed on the first content based on the reference format information to obtain a target table after the initial table has been formatted.
[0228] Here, if reference format information is obtained, the reference format information can be displayed on a display interface so that the user can understand the format specifications that will be applied to the first content. For example, the reference format information can be displayed on the display interface, including font size, alignment, date format, number format, etc. For example, if the target data type is a date type, the display interface may display information such as "Date format: YYYY-MM-DD; Font: Songti; Font size: 12; Alignment: Centered." The user can intuitively view the format specifications through the display interface.
[0229] In an embodiment of the present disclosure, a user may input a second operation through a display interface. For example, by clicking an "Apply Format" button or selecting a preset format option to confirm that a format adjustment operation is to be performed on the first content, the electronic device responds to the user's second operation and performs format adjustment on the first content based on the reference format information. For example, based on the reference format information confirmed by the user, the format adjustment operation is performed on the first content under the project title. For example, if the target data type is a date type, the date data in the first content may be converted and formatted to conform to the format specification.
[0230] The present disclosure displays reference format information through a display interface, allowing users to intuitively understand the specific content of the format adjustment, and ensures that the format adjustment meets the user's actual needs by responding to the user's second operation, which not only improves the accuracy of data processing but also enhances the user experience.
[0231] Figure 3 FIG2 is a flowchart of a table processing method according to an exemplary embodiment. Figure 3 As shown, the method mainly includes the following steps:
[0232] In step 301, the initial table is analyzed.
[0233] Here, the table content and table structure of the initial table can be identified, and the table content (for example, the first 10 rows in the initial table) can be uploaded according to the table structure. When there are multiple sub-tables, the table content in each sub-table can be uploaded separately.
[0234] In step 302 , a large language model (LLM) identifies an item title and the first content under the item title from the initial table.
[0235] Here, the project title may include header information, and the first content under the project title may include header data. After identifying the project title and the first content under the project title, the meaning of the project title may be determined to determine whether the project title belongs to the following data types: date type, basic numeric type, currency type, or percentage type. Simultaneously, the style of the first content may be determined to determine whether the style of the first content corresponds to the data type of the project title.
[0236] In some embodiments, when determining the data type of the project title, the semantics of the keywords in the project title may be identified to determine the data type of the project title, that is, the data type of the project title may be determined by keyword identification.
[0237] For example, for the date type, keywords may include "year," "month," "day," etc. If the project title includes the above keywords, it can be determined that the project title is of the date type. For example, the project title is "2024 Q1 Sales Data," which contains keywords for time units, indicating that the project title is of the date type.
[0238] For basic numeric types, keywords include "quantity," "number of people," "number," and "value." If the project title contains these keywords, the project title is considered a basic numeric type. For example, if the project title is "Employee Headcount Summary," which contains keywords that include specific numerical values but not monetary units or percentages, then the project title is a basic numeric type.
[0239] For currency, keywords can include "amount," "price," "yuan," and "dollars." If the item title contains these keywords, it can be determined that the item title is currency. For example, if the item title is "Price of a Mobile Phone," which contains keywords related to monetary value, it indicates that the item title is currency.
[0240] For percentage-type items, keywords can include "proportion" and "percentage." If the project title contains these keywords, it can be determined that the project title is a percentage-type item. For example, if the project title is "Percentage of Passing the Exam," it contains keywords in the form of percentages, indicating that the project title is a percentage-type item.
[0241] In some embodiments, reference format information corresponding to the target data type can also be output based on the large language model. The reference format information may include the index location that requires format adjustment and the corresponding format modification suggestions. After obtaining the reference format information, the format information can be sent to the kernel.
[0242] In step 303, the front end receives a second operation on the reference format information.
[0243] Here, the user can input a second operation through the front-end display interface, for example, by clicking an "Apply Format" button or selecting a preset format option to confirm performing the format adjustment operation on the first content.
[0244] In step 304 , the kernel performs a format adjustment operation on the first content.
[0245] Here, the core of the electronic device responds to the user's second operation and formats the first content based on the reference format information. For example, the formatting operation is performed on the first content under the item title based on the reference format information confirmed by the user. For example, if the target data type is a date type, the date data in the first content may be converted and formatted to conform to the specified format specification.
[0246] In step 305, a target table is obtained after the format of the initial table is adjusted.
[0247] After detecting the first operation on the initial table, the present disclosure can automatically analyze the initial table, determine the item title and the first content under the item title in the initial table, determine the target data type of the first content under the item title based on the matching degree between the item title and the second content under the item title, and perform a format adjustment operation on the first content under the item title based on reference format information corresponding to the target data type to obtain a target table after the initial table is formatted.
[0248] On the one hand, the format unification of the initial table is completed with one click through the first operation, simplifying the format adjustment steps; on the other hand, the project title and the content under the project title are analyzed separately, that is, the table header and the table body are split, which can improve the accuracy of the determined reference format information, and thus improve the accuracy of the format unification of the initial table.
[0249] Figure 4 FIG. 1 is a block diagram of a table processing device according to an exemplary embodiment. Figure 4 As shown, the table processing device 400 mainly includes:
[0250] A first determining module 401 is configured to determine an item title and a first content under the item title from the initial table in response to a first operation on the initial table;
[0251] A second determining module 402 is configured to determine a target data type of a first content under the project title based on a matching degree between the project title and a second content under the project title, wherein the second content is at least a portion of the first content;
[0252] A third determining module 403 is configured to determine reference format information corresponding to the target data type;
[0253] The adjustment module 404 is configured to perform a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the format of the initial table is adjusted.
[0254] In some embodiments, the second determining module 402 is configured to:
[0255] Determine a preset data type whose matching degree with the project title is greater than a first threshold as a first data type;
[0256] Determining a preset data type having a matching degree with the second content greater than a second threshold as a second data type;
[0257] A target data type of the first content is determined based on the first data type and the second data type.
[0258] In some embodiments, the second determining module 402 is configured to:
[0259] In the case where the first data type is the same as the second data type, the first data type or the second data type is used as the target data type.
[0260] In some embodiments, the second determining module 402 is configured to:
[0261] When the first data type is different from the second data type, the second content is reselected from the first content under the project title, and based on the reselected second content, the step of determining the preset data type whose matching degree with the second content is greater than a second threshold as the second data type is continued.
[0262] In some embodiments, the apparatus 400 further includes:
[0263] a reselection module configured to, when a reselection condition is met, execute the step of reselecting the second content from the first content under the item title;
[0264] The reselection condition includes at least one of the following:
[0265] The proportion of the selected second content to the first content is less than a preset proportion, wherein the selected second content includes all previously selected second contents;
[0266] The number of times the second content is reselected is less than a preset number.
[0267] In some embodiments, the third determining module 403 is configured to perform at least one of the following:
[0268] determining reference format information of the target data type based at least on the format information of the second content;
[0269] The format information preset for the target data type is determined as reference format information for the target data type.
[0270] In some embodiments, the first determining module 401 is configured to:
[0271] In response to the first operation, analyzing the table structure of the initial table and identifying a subtable from the initial table;
[0272] Determine the item titles in each of the subtables respectively, and determine the first content under the item title of the subtable from the content under the item title, wherein the first content is a cell belonging to the same row or column as the item title and does not belong to other subtables.
[0273] In some embodiments, the third determining module 403 is configured to:
[0274] For each of the sub-tables, respectively determining the reference format information;
[0275] The adjustment module 404 is configured to:
[0276] Based on the reference format information of each sub-table, the format adjustment operation is performed on the first content in each sub-table respectively. When the format adjustment operation is completed on all the sub-tables, the target table after the format adjustment of the initial table is obtained.
[0277] In some embodiments, the adjustment module 404 is configured to:
[0278] Determining a first matching degree between the attribute information of the cell where the first content is located and the target data type, and / or a second matching degree between each sub-content included in the first content and the target data type;
[0279] When the first matching degree is greater than a third threshold and / or the second matching degree is greater than a fourth threshold, the format adjustment operation is performed on the first content based on the reference format information to obtain a target table after the initial table is formatted.
[0280] In some embodiments, the adjustment module 404 is configured to:
[0281] When the first matching degree is less than the third threshold and / or the attribute of the first content is a preset reference attribute, performing content conversion on the first content based on the target data type;
[0282] The format adjustment operation is performed on the converted first content to obtain the target table.
[0283] In some embodiments, the adjustment module 404 is configured to:
[0284] If the first content includes a first subcontent whose second degree of matching with the target data type is less than or equal to the fourth threshold, performing content conversion on the first subcontent, deleting the first subcontent from the first content, or replacing the first subcontent with a preset second subcontent to obtain an adjusted first content; wherein the degree of matching between the second subcontent and the target data type is greater than or equal to the fourth threshold;
[0285] The format adjustment operation is performed on the adjusted first content to obtain the target table.
[0286] In some embodiments, when the reference format information is used to determine the digital format of the first content, the adjustment module 404 is configured to:
[0287] When it is determined that the first content includes Arabic numerals and conforms to a preset expression of the target data type, the format adjustment operation is performed on the first content based on the reference format information to obtain a target table after the initial table is formatted.
[0288] In some embodiments, the adjustment module 404 is configured to:
[0289] If it is determined that the first content includes Arabic numerals but the first content does not conform to a preset expression of the target data type, performing content conversion on the first content based on the target data type to obtain converted first content, wherein the converted first content conforms to the preset expression of the target data type;
[0290] The format adjustment operation is performed on the converted first content based on the reference format information to obtain the target table after the format of the initial table is adjusted.
[0291] In some embodiments, the adjustment module 404 is configured to:
[0292] If it is determined that the first content does not include Arabic numerals but the first content semantically conforms to the target data type, performing content conversion on the first content based on the target data type to obtain converted first content, wherein the converted first content includes Arabic numerals and conforms to a preset expression of the target data type;
[0293] The format adjustment operation is performed on the converted first content based on the reference format information to obtain the target table after the format of the initial table is adjusted.
[0294] In some embodiments, the apparatus 400 further includes:
[0295] a display module configured to display the reference format information through a display interface when the reference format information is obtained;
[0296] The adjustment module 404 is configured to:
[0297] In response to a second operation on the reference format information, the format adjustment operation is performed on the first content based on the reference format information to obtain the target table after the format of the initial table is adjusted.
[0298] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0299] Based on the same inventive concept, an embodiment of the present disclosure provides an electronic device, which may be a computer or a terminal in one or more of the above embodiments. Figure 5 FIG. 1 is a schematic diagram showing the structure of an electronic device according to an exemplary embodiment. Figure 5 As shown, the electronic device 500 adopts general computer hardware and includes a processor 501 , a memory 502 , a bus 503 , an input device 504 , and an output device 505 .
[0300] In some possible implementations, the memory 502 may include computer storage media in the form of volatile and / or non-volatile memory, such as read-only memory and / or random access memory. The memory 502 may store an operating system, application programs, other program modules, executable code, program data, user data, etc.
[0301] Input device 504 can be used to input commands and information to the electronic device, such as a keyboard or pointing device, such as a mouse, trackball, touchpad, microphone, joystick, game pad, satellite TV antenna, scanner, or similar device. Input device 504 can be connected to processor 501 via bus 503.
[0302] The output device 505 can be used to output information to the electronic device 500. In addition to the monitor, the output device 505 can also be other peripheral output devices, such as speakers and / or printing devices. The output device 505 can also be connected to the processor 501 through the bus 503.
[0303] The electronic device 500 may be connected to a network, such as a local area network (LAN), via the antenna 506. In a networked environment, executable instructions may be stored in a remote storage device, rather than being limited to local storage.
[0304] When the processor 501 in the electronic device 500 executes the executable code or application stored in the memory 502, the electronic device 500 can implement the table processing method in the above embodiment. The specific execution process can be found in the above embodiment and will not be repeated here.
[0305] The memory 502 may store information for implementing Figure 4 Executable instructions for the functions of the first determination module 401, the second determination module 402, the third determination module 403 and the adjustment module 404. Figure 4 The functions / implementation processes of the first determination module 401, the second determination module 402, the third determination module 403 and the adjustment module 404 can be realized by Figure 5 The processor 501 in the embodiment calls the executable instructions stored in the memory 502 to implement the above-mentioned embodiment. For specific implementation process and functions, please refer to the above-mentioned related embodiments.
[0306] Based on the same inventive concept, an embodiment of the present disclosure further provides a storage medium having instructions stored therein. When the instructions are executed on a computer, the instructions are used to execute the table processing method in one or more of the above embodiments.
[0307] Based on the same inventive concept, the embodiments of the present disclosure further provide a computer program or a computer program product. When the computer program product is executed on a computer, the computer implements the table processing method in one or more of the above embodiments.
[0308] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.
[0309] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A table processing method, characterized in that: include: In response to a first operation on an initial table, determining an item title and a first content under the item title from the initial table; determining a target data type of the first content under the item title based on a matching degree between the item title and the second content under the item title, wherein the second content is at least a portion of the first content; determining reference format information corresponding to the target data type; A format adjustment operation is performed on the first content under the item title based on the reference format information to obtain a target table after the format of the initial table is adjusted.
2. The method according to claim 1, characterized in that The determining the target data type of the first content under the item title based on the matching degree between the item title and the second content under the item title includes: Determine a preset data type whose matching degree with the project title is greater than a first threshold as a first data type; Determining a preset data type having a matching degree with the second content greater than a second threshold as a second data type; A target data type of the first content is determined based on the first data type and the second data type.
3. The method according to claim 2, characterized in that The determining a target data type of the first content based on the first data type and the second data type includes: In the case where the first data type is the same as the second data type, the first data type or the second data type is used as the target data type.
4. The method according to claim 2, characterized in that The determining a target data type of the first content based on the first data type and the second data type includes: When the first data type is different from the second data type, the second content is reselected from the first content under the project title, and based on the reselected second content, the step of determining the preset data type whose matching degree with the second content is greater than a second threshold as the second data type is continued.
5. The method according to claim 1, wherein The method further comprises: If a reselection condition is met, executing the step of reselecting the second content from the first content under the item title; The reselection condition includes at least one of the following: The proportion of the selected second content to the first content is less than a preset proportion, wherein the selected second content includes all previously selected second contents; The number of times the second content is reselected is less than a preset number.
6. The method according to claim 1, characterized in that The determining of the reference format information corresponding to the target data type includes at least one of the following: determining reference format information of the target data type based at least on the format information of the second content; The format information preset for the target data type is determined as reference format information for the target data type.
7. The method according to claim 1, characterized in that In response to the first operation on the initial table, determining the item title and the first content under the item title from the initial table includes: In response to the first operation, analyzing the table structure of the initial table and identifying a subtable from the initial table; Determine the item titles in each of the subtables respectively, and determine the first content under the item title of the subtable from the content under the item title, wherein the first content is a cell belonging to the same row or column as the item title and does not belong to other subtables.
8. The method according to claim 7, characterized in that The determining of reference format information corresponding to the target data type includes: For each of the sub-tables, respectively determining the reference format information; The performing a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the format of the initial table is adjusted includes: Based on the reference format information of each sub-table, the format adjustment operation is performed on the first content in each sub-table respectively. When the format adjustment operation is completed on all the sub-tables, the target table after the format adjustment of the initial table is obtained.
9. The method according to claim 1, characterized in that The performing a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the format of the initial table is adjusted includes: Determining a first matching degree between the attribute information of the cell where the first content is located and the target data type, and / or a second matching degree between each sub-content included in the first content and the target data type; When the first matching degree is greater than a third threshold and / or the second matching degree is greater than a fourth threshold, the format adjustment operation is performed on the first content based on the reference format information to obtain a target table after the initial table is formatted.
10. The method according to claim 9, characterized in that The performing of a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the format of the initial table is adjusted further includes: When the first matching degree is less than the third threshold and / or the attribute of the first content is a preset reference attribute, performing content conversion on the first content based on the target data type; The format adjustment operation is performed on the converted first content to obtain the target table.
11. The method according to claim 9, characterized in that The performing of a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the format of the initial table is adjusted further includes: If the first content includes a first subcontent whose second degree of matching with the target data type is less than or equal to the fourth threshold, performing content conversion on the first subcontent, deleting the first subcontent from the first content, or replacing the first subcontent with a preset second subcontent to obtain an adjusted first content; wherein the degree of matching between the second subcontent and the target data type is greater than or equal to the fourth threshold; The format adjustment operation is performed on the adjusted first content to obtain the target table.
12. The method according to claim 1, characterized in that In a case where the reference format information is used to determine the digital format of the first content, performing a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the format adjustment of the initial table includes: When it is determined that the first content includes Arabic numerals and conforms to a preset expression of the target data type, the format adjustment operation is performed on the first content based on the reference format information to obtain a target table after the initial table is formatted.
13. The method according to claim 12, characterized in that The performing of a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the format of the initial table is adjusted further includes: If it is determined that the first content includes Arabic numerals but the first content does not conform to a preset expression of the target data type, performing content conversion on the first content based on the target data type to obtain converted first content, wherein the converted first content conforms to the preset expression of the target data type; The format adjustment operation is performed on the converted first content based on the reference format information to obtain the target table after the format of the initial table is adjusted.
14. The method according to claim 12, characterized in that The performing of a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the format of the initial table is adjusted further includes: If it is determined that the first content does not include Arabic numerals but the first content semantically conforms to the target data type, performing content conversion on the first content based on the target data type to obtain converted first content, wherein the converted first content includes Arabic numerals and conforms to a preset expression of the target data type; The format adjustment operation is performed on the converted first content based on the reference format information to obtain the target table after the format of the initial table is adjusted.
15. The method according to any one of claims 1 to 14, characterized in that The method further comprises: When the reference format information is obtained, displaying the reference format information through a display interface; The performing a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the format of the initial table is adjusted includes: In response to a second operation on the reference format information, the format adjustment operation is performed on the first content based on the reference format information to obtain the target table after the format of the initial table is adjusted.
16. A form processing device, characterized in that: include: A first determining module is configured to determine an item title and a first content under the item title from the initial table in response to a first operation on the initial table; a second determining module configured to determine a target data type of the first content under the project title based on a matching degree between the project title and the second content under the project title, wherein the second content is at least a portion of the first content; a third determining module, configured to determine reference format information corresponding to the target data type; The adjustment module is configured to perform a format adjustment operation on the first content under the item title based on the reference format information to obtain a target table after the format of the initial table is adjusted.
17. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 15 are implemented.