A data processing method of an unstructured table document
By converting unstructured table documents into configuration files containing hierarchical grouping information and control configurations, and generating navigation components and grouping containers, the efficiency and accuracy issues of filling in complex engineering table documents on small-screen devices are solved, and efficient and accurate data entry and verification functions are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- POWERCHINA ZHONGNAN ENG
- Filing Date
- 2026-04-22
- Publication Date
- 2026-05-26
AI Technical Summary
When filling out complex engineering forms on small mobile devices, users need to frequently zoom and drag the document, making it difficult to ensure filling efficiency and accuracy. Existing technologies are also unable to adapt to mobile devices for display and mode switching.
The system parses unstructured table documents into configuration files containing hierarchical grouping information and control configurations, generates navigation components and grouping containers, renders form filling controls on mobile devices, supports navigation switching and data entry, provides a structured form filling interface, and supports displaying original format documents.
It significantly improves the efficiency and accuracy of filling out unstructured form documents on small screen devices, reduces errors and omissions, and allows users to check the document content at any time during the filling process to ensure the standardization and accuracy of the filling.
Smart Images

Figure CN122088480A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically to a method for processing unstructured tabular documents. Background Technology
[0002] In the construction of large-scale projects such as hydropower engineering, civil engineering, building engineering, rail transit and highway engineering, engineering forms and documents are often used in various occasions such as quality inspection and evaluation, work liaison forms, etc. These forms and documents usually appear in A4 size table format and are often used to assist project participants in communicating, confirming and requesting instructions on certain matters. These documents will later be used for archives and data structuring.
[0003] In the early days of digitization, engineering documents were entered into computer browsers or desktop software. As digitization has become more advanced, project participants often need to input engineering document data in real time at construction sites, laboratories, testing centers, and other locations. Therefore, mobile devices have become an inevitable choice for entering engineering documents.
[0004] However, compared to ordinary two-dimensional tables, engineering form documents are usually presented in A4 format, with complex structures such as spanning multiple pages, mixed multiple tables, paragraphs and tables, merged cells / numbered rows / repeating blocks, etc. The various filling elements are often scattered and interdependent and refer to each other. However, ordinary mobile phone screens are relatively small, making it difficult to operate the document and fill it out while clearly seeing the whole document. Therefore, relying solely on the existing technology of adaptive display and mode switching of documents on mobile devices requires users to frequently zoom up, down, left and right and drag the document to compare the background information and constraint information on the same page or across pages. This results in long filling time and is prone to errors due to misreading, missing information or reading the wrong line, making it difficult to guarantee filling efficiency and accuracy. Summary of the Invention
[0005] In view of one or more shortcomings of the prior art, the present invention provides a data processing method for unstructured tabular documents, which can overcome the above-mentioned defects of the prior art, effectively improve the efficiency of users filling in unstructured tabular documents such as engineering tables on small-screen mobile devices, and ensure the accuracy of the filled data.
[0006] To achieve the above objectives, the present invention adopts one or more of the following technical solutions: Firstly, a data processing method for unstructured tabular documents is provided, including: S1. Obtain the configuration file. The configuration file is generated from the first unstructured table document and contains hierarchical grouping information and configuration information of multiple control tags. The grouping information contains at least multi-level grouping nodes, and the control tags are obtained from the area to be filled in. The format of the configuration file can reflect the structured hierarchical relationship. S2. Based on the grouping information and configuration information, determine the correspondence between each configuration information and the grouping nodes in the grouping information; S3. Generate at least two corresponding navigation components based on the first-level group node in the multi-level group node, and display the navigation components in a specified area of the mobile screen; S4. In response to receiving a switching instruction for any navigation component, display an interactive interface under the first-level group node corresponding to the navigation component in the content area of the mobile screen. The interactive interface includes at least one group container, and each group container corresponds to a second-level or lower group node in a multi-level group node. Based on the configuration information of multiple control tags, render at least one data entry control corresponding to the group container in each group container. Each data entry control includes a field name and a corresponding data entry component. The interactive interface supports data input operations. S5. In response to receiving the data entered by the user at the data entry component, associate the entered data with the corresponding fill control; S6. Based on the entered data and configuration files and / or the first unstructured table document, generate a second unstructured table document containing the entered data.
[0007] Preferably, the method further includes: In response to receiving a mode switching command, the system switches between the interactive interface and the document display interface, which is used to display unstructured table documents in their original format.
[0008] Preferably, hierarchical grouping information is organized using a tree structure.
[0009] Preferably, before step S1, a step of generating a configuration file is also included, specifically including: Retrieve the first unstructured table document; The structure of the first unstructured table document is parsed, the area to be filled is identified and marked as a control tag, and the document structure data is obtained based on the control tag; the document structure data includes at least document segmentation information, cell position, cell merging status, text content and control tag; Traverse the first unstructured table document, bind form item metadata to each control tag, and form configuration information for each control tag. The configuration information includes at least the control type, field code, data constraint information, and form item metadata. Based on the document structure data, a grouping algorithm is executed according to preset grouping rules to generate grouping information with hierarchical relationships; the grouping information contains multi-level grouping nodes, and there are parent-child hierarchical relationships between the multi-level grouping nodes; Assign each control tag and its corresponding configuration information to the corresponding group node, and add the identifier of the corresponding group node to the configuration information; Serialize the grouping information and the configuration information of each control tag into a configuration file.
[0010] Preferably, based on document structure data, a grouping algorithm is executed according to preset grouping rules to generate grouping information with hierarchical relationships, specifically including: Divide the first unstructured table document into content before the table, content within the table, and content after the table; For the table content, traverse the cells in order from left to right and from top to bottom, skipping blank cells; When vertically merged cells or cross-column merged cells are detected, the merged cells are used as candidate cells for group headers, and the text content of the candidate cells for group headers is used as the group header. When the first cell of the first row has no merge and contains valid text, a default group node is created; The control markers located within the area covered by the candidate cell of the group title or its subsequent adjacent area are assigned to the group node corresponding to the group title; Based on the inclusion relationship between each group node, group information with a parent-child hierarchical relationship is generated, where the first-level group node corresponds to the navigation component of the mobile terminal, and the child group nodes below the first-level group node correspond to the group container of the mobile terminal.
[0011] Preferably, the grouping information and the configuration information of each control tag are serialized into a configuration file, specifically including: The configuration file uses JSON format; grouping information and configuration information of each control tag are combined and stored in the same JSON file, or stored in two separate JSON files and associated with identifiers.
[0012] Preferably, step S6 specifically includes: Send the entered data to the server; The server performs one of the following operations based on the original type of the unstructured table document: If the unstructured table document is a Word document or an Excel document, the document processing library will be used to write the entered data into the corresponding position in the unstructured table document and generate the original format document after filling in the data. If the unstructured table document is an HTML document, the entered data is parsed and stored in the database in a structured manner, while the filled-in HTML document is generated.
[0013] Preferably, based on the configuration information of the control tags, at least one data entry control corresponding to each group container is rendered within each group container. Each data entry control includes a field name and a corresponding data entry component, specifically including: Based on the control type in the configuration information, the data entry control is mapped to the corresponding data entry component; the data entry component includes one or more of the following: text input box, date picker, drop-down selection box, radio button group, checkbox group, and pop-up selector.
[0014] Preferably, the method further includes: Based on the data constraint information in the configuration information, input validation rules are added to the data entry control; when the data entered by the user in the data entry component does not conform to the input validation rules, an error message is displayed.
[0015] Preferably, the navigation component is a top tab bar, each tab in the top tab bar corresponds to a first-level group node, and the top tab bar supports switching by clicking and switching by swiping; And / or, the grouping container is a FieldSet container, each FieldSet container contains a group title and border, used to visually group and display the fill-in controls belonging to the same subgroup node.
[0016] Preferably, after rendering is completed in step S4, the method further includes: Check each navigation component and its corresponding group container. If there are no group containers under a certain navigation component, and / or if there are no fill controls in any group containers under a certain navigation component, then hide the navigation component. If a group container does not contain any data entry controls, then the group container is hidden.
[0017] By adopting the above technical solution, the beneficial effects of the present invention are as follows: 1. In this invention, unstructured table documents are parsed into configuration files containing hierarchical grouping information and control configurations. Then, on the mobile device, navigation components are generated based on the first-level grouping nodes, and group containers are generated based on the sub-grouping nodes under the first-level grouping nodes. Within each group container, filling controls are rendered and generated according to the configuration information marked by the controls. Through this multi-level hierarchical presentation method, unstructured table documents are decomposed into navigation structures that conform to mobile device interaction habits. This allows users to complete the filling task by switching navigation components and filling in the group containers in sequence, without having to repeatedly zoom, drag, and position in the document. This significantly reduces the operational complexity of filling in documents on mobile devices, improves document filling efficiency and user experience, and allows small-screen devices such as smartphones to be efficiently adapted to the scenario of filling in documents on the engineering site.
[0018] 2. In this invention, navigation components, group containers, and form filling controls are presented on the interactive interface, allowing users to directly view the reference information corresponding to each form filling control when filling it out. Users do not need to drag and flip through a lengthy document to find the position to be filled and the form filling requirements, which further improves the efficiency of document filling.
[0019] 3. While providing a structured form filling interface, this invention also supports one-click switching to a document display interface, displaying the original document in its original format. This allows users to switch to document mode at any time to view the complete layout and contextual content for verification if they are unsure about the background information, constraints, or relationships between certain fields and other fields during the filling process. After verification, they can switch back to the form filling mode to continue filling, avoiding problems such as incorrect or missing information, and significantly improving the accuracy and standardization of document filling. Attached Figure Description
[0020] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0021] Figure 1 This is a flowchart of a data processing method for unstructured tabular documents in an embodiment of the present invention; Figure 2 This is a schematic diagram of an unstructured table document in an embodiment of the present invention; Figure 3 for Figure 2 A schematic diagram of the configuration file generated from the structured table document between China and Africa; Figure 4 This is a schematic diagram of the interactive interface rendered on a mobile device in an embodiment of the present invention. Figure 5 This is a schematic diagram of the document display interface rendered on a mobile device in an embodiment of the present invention. Detailed Implementation
[0022] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0023] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the present invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0024] Example 1 In one typical embodiment of this application, a data processing method for unstructured tabular documents is provided, such as... Figures 1-5 As shown, the specific steps are as follows: First, the unstructured table document is preprocessed on the server side to obtain a configuration file for mobile devices to receive and process. Specifically, this includes: S001. Obtain an unstructured table document.
[0025] In this embodiment, the unstructured table document to be processed is an A4-sized engineering table document, such as quality inspection and evaluation forms and work contact sheets commonly used in the construction of large-scale projects such as hydropower engineering, civil engineering, building engineering, rail transit or highway engineering. These documents are usually in the form of Word documents (.doc or .docx), Excel documents (.xls or .xlsx) or HTML documents.
[0026] Specifically, the system can obtain unstructured table documents in the following ways: users can upload documents via mobile apps or web applications; or retrieve pre-stored documents from the server's document library; or users can open the documents in professional editors such as Spire.Cloud, Yongzhong Office Online, and Low-Code Form Designer for further processing.
[0027] S002. Parse the structure of the unstructured table document, identify the area to be filled and mark the area to be filled as a control mark, and obtain the document structure data based on the control mark; the document structure data includes at least document segmentation information, cell position, cell merging status, text content and control mark.
[0028] Specifically, the system first performs structured parsing on the acquired unstructured table documents. For Word documents, the system can parse their XML structure and identify elements such as paragraphs, tables, and code snippets; for Excel documents, the system parses their worksheets, rows, and cells; and for HTML documents, the system parses their DOM tree structure and identifies... 、 、 Table elements, etc.
[0029] During the parsing process, the system identifies the locations in the document that should be filled in by the user and marks these locations in the document using a special data structure. The marking methods include, but are not limited to: In Word documents, use ContentControls or Bookmarks with custom attributes to identify areas to be filled; in Excel documents, use NamedRange or FormControls to identify areas to be filled; in HTML documents, use custom attributes such as data-fillable="true" to mark cells or table elements that contain fillable content.
[0030] In this embodiment, the system identifies the areas to be filled in as control markers, and each control marker corresponds to a data item that will be filled in by the user in the future. For example... Figure 2 As shown, in a construction quality grade evaluation table, cells such as "Project Name", "Unit Project Name and Code", and "Inspection Date" are marked as control tags.
[0031] After the above parsing process, the system obtains the document structure data of the project table document, including at least: document segmentation information, such as the division between the content before the table, the content of the table and the content after the table, the cell positions including row numbers and column numbers, cell merging status, text content, and the marked control labels and their position information.
[0032] This embodiment transforms unstructured engineering table documents into structured data that can be recognized and processed by computers through the above-described structured parsing and control tagging of unstructured table documents, laying the foundation for subsequent automatic grouping, mobile rendering, and data backfilling.
[0033] S003. Traverse the unstructured table document, bind form item metadata to each control tag, and form configuration information for each control tag. The configuration information includes at least the control type, field code, data constraint information, and form item metadata.
[0034] Specifically, based on the control mark position information in the document structure data, each control mark in the document is traversed. During the traversal, form item metadata is bound to each control mark. The form item metadata includes, but is not limited to, control type, field code, field name, and data constraint information.
[0035] The control type specifies how the control should be rendered as an input component on mobile devices, such as a text input box, date picker, select dropdown, radio button group, checkbox group, popup, etc. The field code assigns a unique identifier to the control for subsequent data association and storage, such as "meta.code". The field name is a user-visible field label, such as "Project Name" or "Inspection Date". Data constraint information includes whether it is required, visible, editable, precision, date format, range, default value, placeholder information, and data source linkage rules.
[0036] Through the above operations, the system generates corresponding configuration information for each control tag. In addition to control type, field code and data constraint information, the configuration information can also optionally include metadata such as field name, prompt information and default value.
[0037] It should be noted that in some other embodiments, the binding of form item metadata can be completed synchronously during document parsing. That is, metadata is immediately bound to each control mark parsed, without the need for a separate traversal step. Furthermore, form item metadata can also be entered manually by the user, automatically generated by the system recognizing annotation information in the document, or batch-set by importing pre-configured template files. This invention does not impose any limitations on these methods.
[0038] S004. Based on the document structure data, execute the grouping algorithm according to the preset grouping rules to generate grouping information with hierarchical relationships; the grouping information contains multiple grouping nodes, and there is a parent-child hierarchical relationship between the grouping nodes.
[0039] Specifically, this embodiment uses an automatic grouping algorithm to organize the control tags in the document into a tree structure based on the structural and content features in the document structure data. The tree structure contains multiple grouping nodes, and each grouping node includes at least a node identifier, a node name, a parent node identifier, and a list of configuration information for the control tags belonging to that grouping node.
[0040] The specific steps for generating hierarchical grouping information using an automatic grouping algorithm include: S0041. Divide the document structure data into content before the table, content within the table, and content after the table.
[0041] In an engineering form document, there may be a title, number, preparation instructions, etc. above the table, which belong to the content before the table; the table itself belongs to the table content; there may be a signature column, approval comments, remarks, etc. below the table, which belong to the content after the table. This step completes the document segmentation.
[0042] S0042. For table content, traverse the cells in a left-to-right, top-to-bottom reading order, skipping blank cells; during the traversal, check the merged state of the cells: When vertically merged cells or cross-column merged cells are detected, the merged cells are used as candidate group header cells, and the text content of the merged cells is used as the group header. For example... Figure 2 As shown, a cell with five vertically merged rows contains the text "Main Control Project". After recognition, "Main Control Project" is used as a group title.
[0043] When the first cell of the first row is empty and contains valid text (not just blank), a default group node is created. Its name can be preset to "Basic Information" or dynamically generated according to the document type.
[0044] In this embodiment, in the automatic grouping algorithm, when traversing to the first cell of the first row of the table, if the cell does not contain any valid text, the algorithm automatically creates a default grouping node, whose name is preset to "Basic Information". Figure 3 As shown. The default group node is completely identical in data structure to the group node generated by title recognition. Both contain attributes such as node identifier, node name, and parent node identifier, and participate in all subsequent processing flows such as control attribution, configuration file generation, and mobile rendering.
[0045] S0043. Assign the control markers located within the area covered by the candidate cell of the group title or its subsequent adjacent area to the group node corresponding to the group title.
[0046] Combination Figure 2 and Figure 3 As shown, the vertically merged cell containing "2. Structural Edges and Design Edges" covers the area from row 2, column 3 to row 3, column 3 within the "Main Control Project" scope, which is the table area belonging to "Outer Template" and "Inner Template". Therefore, all control labels in this area and all cells in row 2 to row 3 to the right of this area belong to the group node corresponding to the group title "2. Structural Edges and Design Edges".
[0047] S0044. Based on the inclusion relationship between each group node, generate group information with a parent-child hierarchical relationship, where the first-level group node corresponds to the navigation component of the mobile terminal, and the second-level and lower-level group nodes correspond to the group container of the mobile terminal.
[0048] In this embodiment, a three-level tree-like grouping structure is generated based on the engineering table document, such as... Figure 3 As shown, the first-level grouping nodes include "Main Control Items", "General Items", and "Inspection Results". Taking "Main Control Items" as an example, it includes four second-level grouping nodes: "1. Stability, Stiffness and Strength", "2. Structural Edge Line and Design Edge Line", "3. Internal Dimensions of Horizontal Section of Structure", and "4. Elevation of Load-bearing Formwork". Taking "2. Structural Edge Line and Design Edge Line" as an example, it includes two third-level grouping nodes: "External Formwork" and "Internal Formwork".
[0049] S005. Assign each control label and its corresponding configuration information to the corresponding group node, and add the identifier of the corresponding group node to the configuration information.
[0050] Specifically, based on the affiliation relationship between control tags and group nodes established in the preceding steps, each control tag is assigned to its corresponding group node. During the assignment process, the system adds a "corresponding group node identifier" (such as groupId or outlineId) to the control tag's configuration information to identify which group node the control tag belongs to.
[0051] S006. Serialize the grouping information and the configuration information of each control tag into a configuration file.
[0052] Specifically, the configuration file format must reflect a structured hierarchical relationship. In this embodiment, the system serializes the grouping information and control tag configuration information into a JSON format configuration file. JSON format has good readability and cross-platform compatibility, facilitating parsing and rendering on mobile devices. The grouping information and the configuration information of each control tag can be stored together in the same JSON file, or they can be stored separately in two JSON files and associated with identifiers. After serialization, the JSON configuration file is stored on the server for the mobile app to access and use.
[0053] In other embodiments, the configuration file may also be in other formats, such as XML, ini, yaml, toml, etc. The configuration file may also be stored encrypted to protect the security of the document data.
[0054] After the preprocessing stage, the mobile device can obtain the configuration file for processing and perform the following S1-S5 operation steps.
[0055] S1. Obtain the configuration file. The configuration file is generated from an unstructured table document and contains hierarchical grouping information and configuration information for multiple control tags. The grouping information contains at least multi-level grouping nodes, and the control tags are obtained from the area to be filled.
[0056] Specifically, users can log in to the system via a mobile app on their smartphones, tablets, or other devices, and select the engineering form document they need to fill out. The mobile app then sends a request to the server to retrieve the corresponding JSON configuration file.
[0057] S2. Based on the grouping information and configuration information, determine the correspondence between each configuration information and the grouping nodes in the grouping information.
[0058] Specifically, after the mobile app loads the configuration file, it parses the grouping information and control tag configuration information in the configuration file. Based on the "corresponding group node identifier" (groupId) in the configuration information of each control tag, it associates the configuration information with the group nodes in the grouping information to establish a mapping relationship, which facilitates quick location of control positions by group during subsequent rendering.
[0059] S3. Based on the first-level group node in the multi-level grouping node in the grouping information, generate at least two corresponding navigation components and display the navigation components in a specified area of the mobile screen.
[0060] Specifically, all first-level group nodes are extracted from the grouping information of the three-level tree structure, and a navigation component is generated for each first-level group node.
[0061] In this embodiment, as Figure 4 As shown, the navigation component for the primary group nodes uses top tabs to display primary categories at the top of the mobile screen, allowing users to switch between different primary group nodes. Each top tab corresponds to one primary group node, and the top tab bar supports both click-to-swipe and swipe-to-swipe interaction methods. When a user clicks on a top tab, the system switches to the corresponding content area; When a user swipes left or right in the content area, the system automatically switches to the content corresponding to the previous or next top tab.
[0062] Through the above steps, this implementation effectively organizes and divides the different modules that were originally scattered throughout the A4 document on the small screen of a mobile device by converting the first-level group nodes into a top tab bar. Users do not need to scroll up, down, left, or right in the document to find the information when filling in the form. They can quickly switch between different modules by simply clicking or swiping, which significantly improves the efficiency of operation and user experience.
[0063] It should be noted that in some other embodiments, the navigation component of the first-level group node can also take the form of a side navigation bar, a bottom navigation bar, a drop-down menu selector, etc., depending on actual needs.
[0064] S4. In response to receiving a switching instruction for any navigation component, display an interactive interface under the first-level group node corresponding to the navigation component in the content area of the mobile screen. The interactive interface includes at least one group container, and each group container corresponds to a second-level or lower group node in a multi-level group node. Based on the configuration information of the control tag, render at least one data entry control corresponding to the group container in each group container. Each data entry control includes a field name and a corresponding data entry component. The interactive interface supports data input operations.
[0065] Specifically, when a user clicks or swipes to switch to a top tab, the system responds to the switching command by displaying the interactive interface under the corresponding first-level group node in the content area of the mobile screen.
[0066] First, the system obtains all sub-group nodes under the current first-level group node, including second-level and third-level group nodes, and generates a group container for each sub-group node. In this embodiment, as shown... Figure 4 As shown, the grouping container uses a FieldSet container. Each FieldSet container contains a group title and border, which is used to visually group and display the fill-in controls belonging to the same sub-group node.
[0067] Within each FieldSet container, based on the configuration information of the control tags belonging to that group node, a corresponding data entry control is rendered and generated. Each data entry control contains a field name and a corresponding data entry component. The data entry component type includes at least one of the following: text input box, date picker, drop-down selection box, radio button group, checkbox group, and pop-up selector.
[0068] Specifically, based on the control type in the configuration information, the data entry control is mapped to the corresponding data entry component, including but not limited to: if the control type is "text", it is rendered as a text input box; if the control type is "date", it is rendered as a date picker; if the control type is "select", it is rendered as a drop-down selection box; if the control type is "radio", it is rendered as a group of radio buttons; if the control type is "checkbox", it is rendered as a group of checkboxes; if the control type is "popup", it is rendered as a pop-up selector.
[0069] In addition, the system can also display corresponding information during rendering based on field names, prompts, and default values in the configuration information. For example, if the configuration information includes the "placeholder" prompt, gray placeholder text will be displayed in the data entry component.
[0070] The process of rendering the data entry control also includes adding input validation rules to the data entry control based on the data constraint information in the configuration information. For example, if "required" in the configuration information is true, the validation rule is "cannot be empty"; if the configuration information contains "yyyy-MM-dd" as the "date format", the validation rule is "must conform to the date format", etc.
[0071] When the data entered by the user at the data entry component does not conform to the input validation rules, an error message will be displayed.
[0072] Finally, after rendering is complete, the system checks whether there are blank groups under each top tab and its corresponding FieldSet container: if there are no FieldSet containers under a top tab, or if there are no field control controls in any FieldSet containers, the system hides that top tab; if there are no field control controls in a FieldSet container, the system hides that FieldSet container. This prevents users from seeing blank top tabs or FieldSet containers, keeping the interface clean.
[0073] In this embodiment, layered rendering based on grouping information enables a clear and orderly organization of numerous data entry elements in an engineering form document on a small mobile screen. Users can quickly find the fields to fill in and the information to refer to by locating them level by level in the layered structure without having to frequently zoom and drag in the document. This greatly improves the efficiency of users filling in unstructured form documents on mobile devices, shortens the filling time, and improves the accuracy of the data, reducing data deviations caused by users misreading, missing, or misreading information.
[0074] It should be noted that in some other embodiments, the grouping container may also adopt card-type container, fold / expand grouping, or other forms to display second-level and lower grouping nodes.
[0075] S5. In response to receiving the data entered by the user at the data entry component, associate the entered data with the corresponding fill control.
[0076] Specifically, when a user completes input, the system responds by receiving the entered data and associating the data with the corresponding data entry control. The association methods include, but are not limited to: A data model is maintained in memory, with field codes as keys and entered data as values, forming a key-value pair mapping; the system saves the entered data on the control instance for easy collection during subsequent submissions.
[0077] S6. Based on the entered data and configuration files and / or unstructured table documents, generate a document in its original format containing the entered data.
[0078] Specifically, in response to receiving a user's submission, the mobile device submits the entered data to the server in JSON format, and the server generates the original format document after completion, which is an unstructured table document containing the entered data.
[0079] After receiving the entered data, the server performs corresponding processing based on the original type of the unstructured table document, specifically including: When the unstructured table document is a Word document or an Excel document, the original unstructured table document is opened using document processing libraries such as ApachePOI, Spire.doc, or Aspose.Cells. Based on the position information of the control markers in the configuration file, the corresponding filling position in the document is located, the entered data is written into the corresponding filling position, the original format and layout of the document are kept unchanged, the filled Word document or Excel document is generated, saved to the server storage space, and can be provided to users for download.
[0080] Alternatively, when the unstructured table document is an HTML document, the received input data is parsed and stored in the database in a structured manner for easy subsequent querying and statistical analysis. At the same time, based on the grouping structure and control information in the configuration file, the input data is filled into the corresponding table cells or form elements to generate the filled HTML document.
[0081] It should be noted that in some other embodiments, the document generation operation can also be completed on a mobile device to reduce interaction with the server and is more suitable for offline form filling scenarios.
[0082] In addition, considering that users may need to check the format and context of the original document during the form filling process, the data processing method for unstructured tabular documents in this embodiment also includes the following steps to achieve dual-mode switching functionality: In response to receiving a mode switching command, the system switches between the interactive interface and the document display interface, which is used to display unstructured table documents in their original format.
[0083] This mode switching step can occur at any point during the user's data entry process.
[0084] Specifically, the mode switching command can be triggered in one or more ways: clicking the mode switching button on the interface, swiping with a gesture, or shaking the mobile device.
[0085] When a user triggers a mode switching command, the system switches between data entry mode (interactive interface) and document mode (document display interface). In data entry mode, the interactive interface generated in steps S3-S4 is displayed, including top tabs, FieldSet group containers, and data entry controls. The user enters data on this interface. In this embodiment, refer to... Figure 4 and Figure 5 The trigger method uses a mode switching button. In document mode, the unstructured table document is displayed in its original format. The document display interface supports zooming, scrolling and other operations. Users can view the complete layout and context of the document, check the position and background information of the fields to be filled in. After checking, users can switch back to the filling mode to continue filling in the form or check whether the content they have filled in is correct.
[0086] Through the above, the dual-mode switching function of this embodiment allows users to efficiently fill in forms in structured form mode and check the layout and content in document mode. This ensures filling efficiency and avoids filling errors caused by losing context, effectively solving the problem that users have difficulty comparing the original document context information during the filling process.
[0087] It should be noted that in some other embodiments, mode switching can also be achieved in other ways, such as using a split-screen mode to display the form filling interface and the document interface at the same time, or displaying a document preview in the form filling interface as a floating window, all of which are within the protection scope of this invention.
[0088] Furthermore, regarding the organization of hierarchical grouped information, this embodiment adopts a tree structure for organization. However, those skilled in the art should understand that other data structures that can express hierarchical relationships, such as a flat structure combined with parent node ID, or a hierarchical encoding form, can also implement this invention and fall within the protection scope of this invention.
[0089] This embodiment uses Word, Excel, and HTML documents as examples to illustrate the types of unstructured table documents, but the technical solution of the present invention is also applicable to other unstructured table documents, such as PDF documents and WPS documents.
[0090] This embodiment provides a data processing method for unstructured tabular documents. By converting the unstructured tabular document into a configuration file containing hierarchical grouping information and control configuration, navigation components, grouping containers, and filling controls are generated on the mobile device according to the hierarchical relationship. This allows users to quickly complete the form filling on small-screen mobile devices and switch to document mode to check the context during the filling process. Finally, the original format document containing the entered data is generated, thus effectively solving the problems of frequent scaling and dragging, and poor operation experience in the existing technology of filling engineering form documents on mobile devices. It has the beneficial effects of strong practicality, user-friendly experience, and standardized filling.
[0091] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Those skilled in the art should understand that the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A data processing method for unstructured tabular documents, characterized in that, include: S1. Obtain the configuration file, which is generated from a first unstructured table document and contains hierarchical grouping information and configuration information of multiple control tags. The grouping information contains multi-level grouping nodes, and the control tags are obtained by marking the area to be filled in. The format of the configuration file can reflect the structured hierarchical relationship. S2. Based on the grouping information and the configuration information, determine the correspondence between each configuration information and the grouping node in the grouping information; S3. Generate at least two corresponding navigation components based on the first-level group node in the multi-level group node, and display the navigation components in a designated area of the mobile terminal screen; S4. In response to receiving a switching instruction for any of the navigation components, an interactive interface under the first-level group node corresponding to the navigation component is displayed in the content area of the mobile screen. The interactive interface includes at least one group container, and each group container corresponds to a second-level or lower group node in the multi-level group node. Based on the configuration information of the multiple control tags, at least one data entry control corresponding to the group container is rendered in each group container. Each data entry control includes a field name and a corresponding data entry component. The interactive interface supports data input operations. S5. In response to receiving the data entered by the user at the data entry component, associate the data with the corresponding data entry control; S6. Based on the entered data and the configuration file and / or the first unstructured table document, generate a second unstructured table document containing the entered data.
2. The data processing method for unstructured tabular documents as described in claim 1, characterized in that, The method further includes: In response to receiving a mode switching command, the system switches between the interactive interface and the document display interface, wherein the document display interface is used to display the unstructured table document in its original format.
3. The data processing method for unstructured tabular documents as described in claim 1, characterized in that, The hierarchical grouping information is organized using a tree structure.
4. The data processing method for unstructured tabular documents as described in claim 1, characterized in that, Before step S1, the method further includes a step of generating the configuration file, specifically including: Obtain the first unstructured table document; The structure of the first unstructured table document is parsed, the area to be filled is identified and marked as a control mark, and the document structure data is obtained based on the control mark; the document structure data includes at least document segmentation information, cell position, cell merging status, text content and the control mark; Traverse the first unstructured table document, bind form item metadata to each control tag, and form configuration information for each control tag. The configuration information includes at least the control type, field code, data constraint information, and form item metadata. Based on the document structure data, a grouping algorithm is executed according to preset grouping rules to generate grouping information with hierarchical relationships; the grouping information contains multi-level grouping nodes, and the multi-level grouping nodes have parent-child hierarchical relationships. Assign each control tag and its corresponding configuration information to the corresponding group node, and add the identifier of the corresponding group node to the configuration information; The grouping information and the configuration information of each control tag are serialized into the configuration file.
5. The data processing method for unstructured tabular documents as described in claim 4, characterized in that, The step of generating hierarchical grouping information based on the document structure data and executing a grouping algorithm according to preset grouping rules specifically includes: The first unstructured table document is divided into content before the table, content within the table, and content after the table. For the table content, traverse the cells in order from left to right and from top to bottom, skipping blank cells; When vertically merged cells or cross-column merged cells are detected, the merged cells are used as candidate cells for group headers, and the text content of the candidate cells for group headers is used as the group header. If the first cell of the first row has no substring and contains valid text, then a default group node is created; The control markers located within the area covered by the candidate cell of the group title or its subsequent adjacent area are assigned to the group node corresponding to the group title; Based on the inclusion relationship between the grouping nodes, the grouping information with parent-child hierarchical relationship is generated, wherein the first-level grouping node corresponds to the navigation component of the mobile terminal, and the child grouping nodes below the first-level grouping node correspond to the grouping container of the mobile terminal.
6. The data processing method for unstructured tabular documents as described in claim 4, characterized in that, The step of serializing the grouping information and the configuration information of each control tag into the configuration file specifically includes: The configuration file adopts JSON format; the grouping information and the configuration information of each control tag are merged and stored in the same JSON file, or stored in two separate JSON files and associated with an identifier.
7. The data processing method for unstructured tabular documents as described in claim 1, characterized in that, Step S6 specifically includes: The entered data is sent to the server; The server performs one of the following operations based on the original type of the first unstructured table document: If the unstructured table document is a Word document or an Excel document, then the document processing library is used to write the entered data into the corresponding position of the unstructured table document to generate the original format document after filling in the data. If the unstructured table document is an HTML document, the entered data is parsed and stored in a structured manner in the database, and a filled-in HTML document is generated at the same time.
8. The data processing method for unstructured tabular documents as described in claim 1, characterized in that, Based on the configuration information marked by the control, at least one data entry control corresponding to each group container is rendered within each group container. Each data entry control includes a field name and a corresponding data entry component, specifically including: Based on the control type in the configuration information, the data entry control is mapped to the corresponding data entry component; the data entry component includes one or more of the following: text input box, date picker, drop-down selection box, radio button group, checkbox group, and pop-up selector.
9. The data processing method for unstructured tabular documents as described in claim 8, characterized in that, Also includes: Based on the data constraint information in the configuration information, input validation rules are added to the data entry control; When the data entered by the user at the data entry component does not conform to the input validation rules, an error message is displayed.
10. The data processing method for unstructured tabular documents as described in claim 1, characterized in that, The navigation component is a top tab bar, each tab in the top tab bar corresponds to a first-level group node, and the top tab bar supports click switching and swipe switching; And / or, the grouping container is a FieldSet container, each of which contains a group title and a border, used to visually group and display the fill-in controls belonging to the same sub-group node.