Intelligent recognition-based structured form processing method and system, and storage medium
The structured form processing method based on intelligent recognition solves the problems of complexity and inefficiency in form processing in medical institutions, and realizes efficient and accurate form data processing and storage, thus promoting information technology upgrades.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- KANGFU ZHUSHOU
- Filing Date
- 2026-01-13
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies for form processing in medical institutions suffer from problems such as cumbersome operation, high data error rate, difficulty in adapting to complex form structures, high cost of migrating existing forms, and weak batch processing capabilities.
A structured form processing method based on intelligent recognition is adopted. Through a three-column progressive parsing algorithm, a two-level conversion algorithm, a type determination algorithm, and large language model processing, combined with a bitwise operation storage algorithm, it can accurately extract and efficiently convert the data to be recognized into structured data, break through file format limitations, and optimize the efficiency and accuracy of form processing.
It significantly improved the efficiency and accuracy of form processing, reduced data storage overhead, and promoted the informatization upgrade of form management in medical institutions.
Smart Images

Figure CN121503450B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a structured form processing method, system and storage medium based on intelligent recognition. Background Technology
[0002] In the daily management of hospitals and other healthcare institutions, form processing is a fundamental and indispensable task, widely used in various management processes, such as nursing quality control records, medical professional test questions, patient information registration, and treatment process filing. These forms carry critical management data and business information, and the efficiency and accuracy of their processing directly affect the standardization level of medical institution management and the efficiency of business operations.
[0003] The creation of existing structured forms largely relies on standard Excel templates. The specific process is as follows: users first download a pre-set standard Excel template from the system, then strictly follow the template's fixed format to fill in the relevant form information item by item. The filled-in content covers the core elements of the form, including specific question content, question types, answer choices, and score settings. After completing the content, the user uploads the Excel file to the system. The system parses the pre-set fixed format structure of the Excel file, extracts the filled-in information, converts it into structured data, and finally generates form data that can be used for subsequent management applications.
[0004] While existing methods have achieved digital form generation to some extent, they impose strict limitations on user operations and file formats. For example, for a large number of existing Word forms, since the system cannot directly parse them, staff must manually copy and paste the content from each Word form into a standard Excel template, a tedious process prone to data errors. Furthermore, for forms with multi-level nested structures and complex conditional logic, using fixed-format Excel templates is extremely difficult due to the templates' lack of flexibility, making it hard to accurately represent complex business logic. In addition, this method has weak batch processing capabilities, failing to efficiently generate multiple forms in batches. When migrating a large number of existing forms to a digital system, the process is complex, time-consuming, and costly, severely hindering the informatization upgrade of form management in medical institutions. Summary of the Invention
[0005] To improve the batch processing capability of forms, this application provides a structured form processing method, system, and storage medium based on intelligent recognition.
[0006] In a first aspect, this application provides a structured form processing method, system, and storage medium based on intelligent recognition, employing the following technical solution:
[0007] A structured form processing method based on intelligent recognition includes the following steps:
[0008] The system acquires the data to be identified and uses a pre-defined three-column progressive parsing algorithm to identify structured data from the data. The structured data includes first-level groups, second-level groups, and form sub-items.
[0009] The structured data is converted into standard data based on a preset first conversion algorithm, and the standard data is converted into form data based on a preset second conversion algorithm.
[0010] The form data is parsed based on a preset type determination algorithm to obtain type content data, which includes explicit marked content and implicit determined content.
[0011] Training data is extracted from the type content data according to a preset set quantity. The training data is used to calculate form prompt words using a preset prompt word algorithm. The type content data is then processed using a preset large language model based on the form prompt words to obtain intermediate processing data.
[0012] Identify and process Boolean fields in the intermediate data. If Boolean fields exist, compress multiple Boolean fields in the intermediate data into integers using a bitwise operation storage algorithm to obtain and store the processing result data.
[0013] By adopting the above technical solution and employing a structured form processing method, a three-column progressive parsing algorithm is used to accurately extract the data to be identified into structured data. Combined with a two-level conversion algorithm, efficient conversion between standard data and form data is achieved. With the help of training data extraction, prompt word generation, and large language model processing, intelligent optimization processing of type content data is realized. At the same time, a bitwise operation storage algorithm is used to compress and store Boolean fields. This not only breaks through the limitations of existing technologies on file formats and effectively solves the problems of difficulty in creating complex structured forms, high cost of migrating existing forms, and weak batch processing capabilities, but also significantly improves the efficiency and accuracy of form processing, reduces data storage overhead, and powerfully promotes the informatization upgrade of form management in medical institutions.
[0014] Optionally, the first conversion algorithm includes the following steps:
[0015] Obtain the format of the data to be recognized, and call the document parsing engine according to the format to convert the binary stream of the data to be recognized into a structured document object;
[0016] Identify first-level groups, second-level groups, and form sub-items in structured document objects and map them to Markdown heading levels;
[0017] Extract table data based on Markdown heading levels, and adapt the structured document object to Markdown standard table syntax in the order of cell, row and table, while retaining scores and Boolean semantic text;
[0018] Convert ordered and unordered lists in a structured document object into corresponding Markdown lists while preserving the built-in nesting relationships;
[0019] Decouple the content data and text style in the structured document object, separate the plain text content, paragraph hierarchy, table data, list structure and font style, remove redundant formatting, and obtain the structured data object;
[0020] Integrate all structured data objects in the original document order, validate the syntax, and output Markdown text as standard data;
[0021] The second conversion algorithm includes the following steps:
[0022] Standard data is loaded to obtain Markdown text, and the data is cleaned based on a preset filtered database to obtain a standardized character dataset;
[0023] Parse the Markdown heading levels, construct a tree skeleton of first-level groups, second-level groups, and form items, and generate a form hierarchy tree structure object;
[0024] Extract table syntax blocks from the form hierarchy tree structure object, perform hierarchical parsing according to the order of table, row and cell to obtain the core form data, and convert the core form data into structured table dataset and structured text dataset based on the preset encoding analysis library.
[0025] Parse the structured tabular dataset, restore the Markdown list to the form's question number, option, and sub-item structure, and output the structured list data based on the built-in nesting relationship;
[0026] Parse the content data and text styles in the structured text dataset, map them to form business attributes, extract scores and Boolean semantic text, and collect the resulting structured text data.
[0027] Aggregate list structured data and text structured data and bind hierarchical relationships to generate a form structured data object;
[0028] The form's structured data object is validated for data integrity and missing content is filled in to obtain the form data.
[0029] By adopting the above technical solution, the first and second conversion algorithms work together in a progressive manner. The first conversion algorithm calls the document parsing engine to adapt to various formats of data to be recognized, transforming it into standard Markdown data that retains core information (scores, Boolean semantic text, nesting relationships) and hierarchical structure. This effectively decouples content data from redundant text styles, breaking through the limitations of existing technologies on file formats, while accurately restoring the hierarchical grouping and nesting logic of complex forms. Then, the second conversion algorithm constructs a form hierarchical tree structure based on the Markdown text, parsing table data and list structures step by step and mapping them to form business attributes. Through data cleaning, integrity verification, and missing content completion, the core data is accurately extracted and structuredly integrated. This not only solves the problem that existing fixed-format templates are difficult to adapt to complex structure forms and that the migration of existing forms requires repetitive manual operations, but also significantly improves the standardization and integrity of form data.
[0030] Optionally, the three-column progressive analytical algorithm includes the following steps:
[0031] Remove the beautification styles from the data to be identified to obtain the original content data, and perform format normalization on the symbols and text in the original content data to obtain formatted data.
[0032] Identify hierarchical fields from formatted data based on a pre-defined reference field library;
[0033] Based on the preset three-column progressive features, feature matching and layering of the progressive level fields are performed to obtain three-level progressive skeleton data; among them, the three-column progressive features include first-level grouping, second-level grouping and form sub-items;
[0034] Structured data is obtained after verifying and correcting the three-layer progressive skeleton data.
[0035] By adopting the above technical solution, this three-column progressive parsing algorithm first removes the beautification styles of the data to be identified and performs format normalization on symbols and text, effectively eliminating format differences of data from different sources and in different formats, thus improving the compatibility and universality of data parsing. Then, it identifies progressive level fields based on a preset reference field library and completes accurate matching and layering by combining the three-column progressive features of first-level grouping, second-level grouping, and form sub-items. This can efficiently restore the multi-level nested hierarchical structure of complex forms, solving the technical pain point that existing fixed format templates are difficult to adapt to complex business logic forms. Finally, the verification and correction process further ensures the accuracy and completeness of the output structured data, greatly reducing the tedious operation and error rate of manual data processing, and significantly improving the parsing efficiency and quality of form data.
[0036] Optionally, the type determination algorithm includes the following steps:
[0037] Load and traverse structured data, extract explicit type tags inherent in the structured data, and generate explicit tag content based on the explicit type tags;
[0038] Based on preset business characteristics, construct a type determination rule base and feature dictionary;
[0039] Filter out data nodes that do not have explicit type markers and define the scope of implicit decision processing;
[0040] The rule base and feature dictionary are invoked to perform implicit judgment through text matching, rule reasoning and context association, and generate implicit judgment content.
[0041] The explicit labeled content and implicitly determined content are merged to generate type content data; among them, the ratio of the amount of explicit labeled content data to the amount of implicitly determined content data is used as the type determination ratio, and the number of business features is adjusted according to the positive correlation of the type determination ratio.
[0042] By adopting the above technical solution, explicit type markers are first extracted from structured data to generate explicit marker content, ensuring rapid and accurate determination of data with clear type identification. Then, by constructing a type determination rule base and feature dictionary, and combining text matching, rule reasoning, and context association, implicit determination is performed on data nodes without explicit markers. This effectively fills the gap in implicit type data identification and solves the technical pain points of existing technologies that rely too heavily on type markers and are difficult to accurately determine implicit type data. At the same time, by calculating the positive correlation between the data volume ratio of explicit and implicit determination content, the number of business features is adjusted to achieve adaptive optimization of the determination rules.
[0043] Optionally, the method further includes the following steps:
[0044] Obtain the preset form business requirements, and identify the target requirements, transformation rules and constraint boundaries from the form business requirements;
[0045] Based on the transformation rules, a set amount of data is extracted from the type content data as training data;
[0046] Obtain preset task instructions and output requirements, and generate form prompts based on the prompt word algorithm, combining task instructions, conversion rules, training data, and output requirements;
[0047] Input the form prompts, target requirements, and constraint boundaries into the large language model to process the content data and obtain the analysis data.
[0048] By adopting the above technical solution, the system first acquires the preset form business requirements and accurately identifies the target requirements, conversion rules, and constraint boundaries. Then, based on the conversion rules, it extracts corresponding training data from the type content data. Combining the task instructions and output requirements, it generates suitable form prompts through a prompt word algorithm. Finally, it inputs the form prompts, target requirements, and constraint boundaries into a large language model to process the type content data. This achieves a deep binding between the form data processing logic and actual business needs. It effectively solves the technical pain points of existing technology processing modes being rigid and difficult to flexibly adjust according to different medical form business scenarios, and significantly improves the relevance and accuracy of the analyzed data.
[0049] Optionally, the method further includes the following steps:
[0050] The data volume of the current batch of data to be identified is calculated as the first data volume, and the data volume of the next batch of data to be identified is calculated as the second data volume.
[0051] The ratio of the first data volume to the second data volume is calculated as the ratio to be identified.
[0052] The ratio of the number of form prompt words to the number of preset reference words is the word count ratio.
[0053] The adjustment ratio is calculated by weighting the ratio to be identified and the ratio of word count;
[0054] The set quantity is adjusted based on the negative correlation between the adjustment ratio and the adjustment quantity.
[0055] By adopting the above technical solution, the ratio of the current batch to the next batch of data to be identified, and the ratio of the number of form prompt words to the number of preset reference words are calculated. The weighted average is then used to obtain the adjustment ratio, and the set amount of training data is adjusted accordingly. This achieves dynamic adaptive adjustment of the amount of training data. It effectively solves the technical defects of fixed training data volume being difficult to adapt to different batch data scales and being prone to undertraining or redundant calculations. It ensures the sufficiency of training data for small batches to improve the accuracy of model processing, while avoiding the waste of computing resources caused by excessive training data for large batches.
[0056] Optionally, the step of compressing multiple Boolean fields in the intermediate data into integers using a bitwise operation storage algorithm further includes the following steps:
[0057] The third data quantity is calculated by counting the number of Boolean fields corresponding to the intermediate data of the current batch, and the fourth data quantity is obtained by counting the number of Boolean fields corresponding to the intermediate data of the next batch.
[0058] The ratio of the third data volume to the fourth data volume is calculated as a Boolean ratio.
[0059] The number of Boolean fields is negatively adjusted based on the set control step size according to the Boolean ratio.
[0060] By adopting the above technical solution, the ratio of the number of Boolean fields in the current batch to the number of intermediate data in the next batch is calculated. Combined with the negative correlation adjustment of the control step size, the number of Boolean fields is adjusted. Then, the bitwise operation storage algorithm is used to compress them into integers, realizing the dynamic adaptive optimization of the Boolean field compression storage strategy. This effectively solves the technical defects of fixed compression methods, which are difficult to adapt to the size of Boolean fields in different batches and are prone to compression redundancy or data distortion. It ensures the integrity and accuracy of Boolean field data and avoids the problem of waste of storage resources or low compression efficiency caused by unreasonable number of fields.
[0061] Optionally, the step of obtaining and storing the processing result data may further include the following steps:
[0062] The compression ratio of the current batch's processing result data and the intermediate processing data is calculated as the first compression ratio, and the compression ratio of the next batch's processing result data and the intermediate processing data is obtained as the second compression ratio.
[0063] The ratio of the first compression ratio to the second compression ratio is calculated as the compression ratio value;
[0064] The control step size is adjusted positively based on the calculated compression ratio.
[0065] By adopting the above technical solution, the control step size for Boolean field compression is dynamically and adaptively optimized by calculating the compression ratio of the current batch and the next batch of processed data relative to the intermediate data. This effectively solves the technical defect that a fixed control step size cannot be flexibly adjusted according to the compression effect of different batches of data. When the amount of Boolean fields in the next batch increases, the control step size decreases accordingly, ensuring the accuracy of the compression process and avoiding data distortion due to excessive step size. When the amount of Boolean fields in the next batch decreases, the control step size increases accordingly, improving the compression rate and reducing redundant computational overhead. Furthermore, the compression performance and adaptability of the bitwise operation storage algorithm are optimized.
[0066] Secondly, this application provides a structured form processing system based on intelligent recognition, which adopts the following technical solution:
[0067] A structured form processing system based on intelligent recognition includes a processor, wherein the processor executes the steps of the structured form processing method based on intelligent recognition as described in any of the preceding claims.
[0068] Thirdly, this application provides a storage medium, which adopts the following technical solution:
[0069] A storage medium storing a program, which, when executed by a processor, implements the steps of the structured form processing method based on intelligent recognition described above. Attached Figure Description
[0070] Figure 1 This is a flowchart illustrating the steps of a structured form processing method based on intelligent recognition.
[0071] Figure 2 This is a flowchart of the first conversion algorithm.
[0072] Figure 3 This is a flowchart of the second conversion algorithm. Detailed Implementation
[0073] The embodiments of this application are described in detail below, and examples of the embodiments are shown in the accompanying drawings.
[0074] In the description of this specification, the references to "certain embodiments," "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples" refer to specific features, structures, materials, or characteristics described in connection with the described embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0075] This application discloses a structured form processing method based on intelligent recognition. In this embodiment, the data to be recognized comes from various forms in the daily management of medical institutions, including but not limited to Word format "Nursing Quality Control Record Form", Excel format "Medical Professional Test Paper", PDF format "Patient Information Registration Book", TXT format "Diagnosis and Treatment Process Filing Form", etc., covering core business scenarios such as nursing management, medical assessment, and patient diagnosis and treatment.
[0076] Reference Figure 1 The method includes the following steps:
[0077] Step 1: Obtain the data to be identified. Based on a preset three-column progressive parsing algorithm, structured data is identified from the data to be identified. The structured data includes primary grouping, secondary grouping, and form sub-items. The data to be identified supports multiple access modes to meet the needs of different business scenarios: Application layer front-end upload: Medical staff select local files for upload through a visual interface, and the system automatically triggers format detection; System API integration: Receive form data pushed by core business systems such as hospital HIS and LIS through the RESTful API interface to achieve real-time data synchronization; Cloud storage synchronization: Batch pull existing form data from the hospital's private cloud storage (such as Alibaba Cloud OSS, Huawei Cloud OBS), supporting filtering by department and time dimension. After acquiring the data to be identified, preprocessing is performed: Accurate format identification: The format is determined by the header bytes of the file. Word: 0x500x4B0x030x04; Excel: 0xD00xCF0x110xE0; PDF: 0x250x500x440x46; TXT: No fixed header, determined by encoding. Initial integrity check: Check whether the file is damaged (e.g., integrity of cross-reference table in PDF, structure check of Excel file) and whether there is blank content. Abnormal data is marked and pushed to the manual review entry with an explanation of the reason for the abnormality, such as "file is damaged" or "no valid business content".
[0078] The three-column progressive analytical algorithm includes the following steps:
[0079] The process involves removing stylistic enhancements from the data to be identified to obtain the original content data. Non-core formatting elements such as font type (SimSun, Heiti, etc.), font size (10, 12, etc.), font color, background color, watermark, borders, shading, and image decorations are then removed, retaining only the plain text content and basic structure (tables, lists, paragraph separators). The symbols and text in the original content data are then normalized to obtain formatted data. This includes converting full-width characters to half-width characters, standardizing Chinese punctuation (using commas instead of semicolons for category separation), removing leading and trailing spaces, standardizing line breaks to "\n", and converting English text to lowercase to ensure format consistency across different data sources.
[0080] Based on a pre-defined reference field library, progressively hierarchical fields are identified from formatted data; the reference field library adopts a structured design of "three-level classification + weight labeling", specifically:
[0081] First-level grouping field library: contains core business category fields such as "Nursing Management", "Medical Assessment", "Patient Registration" and "Diagnosis and Treatment Filing", with weight values ranging from 0.8 to 1.0, such as "Nursing Management" with a weight of 1.0 and "Diagnosis and Treatment Filing" with a weight of 0.9;
[0082] Secondary grouping field library: includes detailed business fields such as "disinfection process", "medication guidelines", "single choice", "multiple choice", and "ward round system", with weight values ranging from 0.7 to 0.9. For example, "single choice" has a weight of 0.9 and "disinfection process" has a weight of 0.85.
[0083] Form subfield library: contains specific business data fields such as "disinfection frequency", "dosage", "question number", "option content", and "compliance status", with weight values ranging from 0.6 to 0.8, such as "question number" with a weight of 0.8 and "compliance status" with a weight of 0.75;
[0084] Field identification logic: By calculating the cosine similarity between text fragments in formatted data and fields in the reference field library (with a threshold of 0.7), fields that meet the matching criteria are filtered out. After removing duplicate fields, they are sorted according to the business logic order, such as the hierarchical order of "first-level group → second-level group → form sub-item".
[0085] Based on a pre-defined three-column progressive feature set, feature matching and layering of progressively hierarchical fields are performed to obtain three-layer progressive skeleton data. The three progressive features include first-level groups, second-level groups, and form sub-items. Feature matching rules: The principle of "proximity-based subordination + business semantic association" is adopted. That is, a second-level group defaults to the nearest parent group, and a form sub-item defaults to the nearest parent-second-level group. If there is a business semantic conflict, such as "surgical disinfection process" belonging to the first-level group "internal medicine nursing," the subordination relationship is corrected based on the business scenario tags in the reference field library, adjusting "surgical disinfection process" to the first-level group "surgical nursing."
[0086] Skeleton data construction: A three-level progressive skeleton is constructed in JSON format. Each node contains four core attributes: "Node ID", "Field Name", "Level Identifier", and "Parent Node ID". An example is shown below:
[0087] {"Node ID":"001","Field Name":"Nursing Management","Hierarchy Identifier":"Level 1 Group","Parent Node ID":"None"},{"Node ID":"001-001","Field Name":"Disinfection Process","Hierarchy Identifier":"Level 2 Group","Parent Node ID":"001"},{"Node ID":"001-001-001","Field Name":"Disinfection Frequency","Hierarchy Identifier":"Form Sub-item","Parent Node ID":"001-001"}
[0088] After verifying and correcting the three-layer progressive skeleton data, structured data is obtained: a three-dimensional verification system is executed to ensure data accuracy and integrity.
[0089] Hierarchical relationship verification: Check that each first-level group contains at least one second-level group, and each second-level group contains at least one form sub-item, with no isolated nodes; form sub-items are prohibited from directly belonging to first-level groups, and manual confirmation is required for special business scenarios;
[0090] Field integrity verification: Based on the core field list of the reference field library, check whether each secondary group contains required sub-items. For example, the secondary group "Single Choice Questions" must contain sub-items such as "Question Number", "Question Content", "Options" and "Score".
[0091] Business logic verification: Based on the business norms of medical institutions, check the rationality of the hierarchical relationship, such as the "surgical risk assessment" sub-item must not belong to the "outpatient treatment" secondary group;
[0092] Correction strategy: Simple errors (such as misaligned hierarchy or missing fields) are automatically corrected by the system; complex logical conflicts (such as confusion in business classification) are marked and pushed for manual intervention, and the final structured data is output after the correction is completed.
[0093] This three-column progressive parsing algorithm first removes the beautification styles of the data to be identified and performs format normalization on symbols and text, effectively eliminating format differences between data from different sources and in different formats, thus improving the compatibility and universality of data parsing. Then, it identifies progressive level fields based on a preset reference field library and completes accurate matching and layering by combining the three-column progressive features of first-level grouping, second-level grouping, and form sub-items. It can efficiently restore the multi-level nested hierarchical structure of complex forms, such as the four-level nesting of "nursing management → disinfection process → surgical disinfection → disinfection time", solving the technical pain point that existing fixed format templates are difficult to adapt to complex business logic forms. Finally, the verification and correction process further ensures the accuracy and integrity of the output structured data, greatly reducing the tedious operation and error rate of manual data processing.
[0094] Step 2: Convert structured data into standard data based on the preset first conversion algorithm, and convert standard data into form data based on the preset second conversion algorithm.
[0095] Reference Figure 2 Step 2.1: The first conversion algorithm includes the following steps:
[0096] Obtain the format of the data to be recognized, and call the document parsing engine according to the format to convert the binary stream of the data to be recognized into a structured document object:
[0097] Word format (.doc / .docx): The Apache POI 5.2.4 parsing engine is used. .docx files are read using the XWPFDocument class, and .doc files are processed using the HWPFDocument class for compatibility, extracting structural elements such as paragraphs, tables, and lists from the document;
[0098] Excel format (.xls / .xlsx): It uses the AlibabaEasyExcel 3.3.2 parsing engine and adopts an annotation-based reading method, such as the @ExcelProperty annotation to map cells and fields, avoiding interference from formulas and macro code in data extraction;
[0099] PDF format: The iText 7.2.3 parsing engine is used to read the text content, and the Tesseract 5.3.1 OCR tool is used to process scanned PDFs, converting the image-based text into editable text;
[0100] TXT format: Reads binary data through JavaIO stream, splits it into paragraph structure according to newline characters, and builds a basic document object.
[0101] Identify first-level groups, second-level groups, and form sub-items in structured document objects and map them to Markdown heading levels: the mapping rules are "first-level group → #group name", "second-level group → ##group name", and "form sub-item → ###sub-item name". For duplicate group names, such as "disinfection process" for different departments, automatically add a unique identifier, such as "##disinfection process-surgery" and "##disinfection process-internal medicine", to avoid hierarchy confusion.
[0102] Based on Markdown heading levels, table data is extracted. The structured document object is adapted to standard Markdown table syntax in the order of cell, row, and table, while preserving scores and Boolean semantic text. Table conversion follows the generation logic of "header → separator row → data row," and merged cells are processed according to the principle of "filling the merged area with the content of the main cell." Core data is marked using regular expressions (score: \\d+score; Boolean semantics: yes / no|meets / does not meet|qualifies / does not meet) to ensure lossless preservation during conversion. An example is shown below:
[0103]
[0104] This function converts ordered and unordered lists in a structured document object into their corresponding Markdown lists, preserving built-in nesting relationships: ordered lists (number / alphabetic numbering) are converted to 1.content / A.content format, and unordered lists (bullet marks ● / ○ / □) are uniformly converted to -content format; nesting relationships are preserved by parsing the list's indentLevel property (indentation level), with second-level nesting indented by 2 characters, as shown in the example below:
[0105] Multiple choice question:
[0106] A. Intravenous injection
[0107] B. Oral administration
[0108] Decouple the content data and text styles in the structured document object, separate the plain text content, paragraph hierarchy, table data, list structure and font styles, and remove redundant formatting to obtain the structured data object: adopt the "content-style separation model", retain only the basic styles related to business (bold → text, underline → text), and remove redundant formatting such as font color, background color, line spacing, etc.
[0109] Integrate all structured data objects in the original document order, validate the syntax, and output Markdown text as standard data: call the markdownlint 0.35.0 tool to perform syntax validation, the validation rules include "table column alignment", "heading hierarchy continuity (no breaks)" and "list item indentation consistency", and output UTF-8 encoded Markdown standard data after the validation passes.
[0110] Reference Figure 3 Step 2.2: The second conversion algorithm includes the following steps:
[0111] Standard data is loaded to obtain Markdown text. Data cleaning is then performed based on a pre-defined filtering database to obtain a standardized character dataset. The filtering database employs a three-level structure design, specifically:
[0112] Level 1 illegal character list: Contains @#¥%& Meaningless special characters such as parentheses are filtered out by using the ASCII code range (32-126);
[0113] Secondary business redundant field library: built based on the form characteristics of medical institutions, including fixed fields such as "Form filler:", "Date:", "No text on this page", and closing text;
[0114] Level 3 Sensitive Information Database: Contains privacy fields such as "ID Number," "Mobile Number," and "Home Address." Only redundant annotations, such as "ID Number:," are removed. Core data is retained and anonymized. The middle four digits of the mobile number are replaced with... ;
[0115] Cleaning process: First, match illegal character sets → then search for redundant business field sets → finally de-identify sensitive information to ensure that the standardized character dataset is free of redundancy and leaks no sensitive information.
[0116] Parse the Markdown heading hierarchy, construct a tree skeleton of first-level groups, second-level groups, and form items, and generate a form hierarchy tree structure object: use a tree structure generation algorithm, with first-level groups as root nodes, second-level groups as child nodes, and form items as leaf nodes, and assign a unique level ID to each node, in the format: root node ID-child node ID-leaf node ID, such as "001-001-001", for subsequent data binding;
[0117] The table syntax blocks are extracted from the form hierarchy tree structure object, and the core form data is obtained by hierarchical parsing according to the order of table, row and cell. Based on the preset encoding analysis library, the core form data is converted into structured table dataset and structured text dataset: using the regular expression \\|. \\|\\n\\|. Extract table syntax blocks and parse them in the order of "table → row → cell"; the encoding analysis library supports mainstream encodings such as UTF-8, GBK, GB2312, and ISO-8859-1, and automatically recognizes and converts them by detecting the matching degree between the number of text bytes and the character set to avoid Chinese character garbled characters; the structured table dataset uses a two-dimensional array format, and the structured text dataset uses a key-value pair format.
[0118] This function parses a structured tabular dataset, restoring the Markdown list to a form structure of question numbers, options, and sub-items. Based on built-in nesting relationships, it outputs structured list data: for ordered list formats, question numbers are directly extracted; for unordered list formats, question numbers are automatically generated with consecutive numbers according to the table row order. Options are split into "option identifier" and "option content," such as "A. Intravenous injection" → {Identifier: A, Content: Intravenous injection}. Nested sub-items are restored to a two-level option structure based on indentation levels.
[0119] The content data and text styles in the structured text dataset are parsed and mapped to form business attributes. Scores and Boolean semantic text are extracted, and the resulting aggregated text structured data is obtained. The mapping rules between text styles and business attributes are based on a preset rule library, specifically "bold text → required field", "italic text → remarks", and "underlined text → key indicator". Scores are extracted as integers using regular expressions (\\d+) (e.g., "5 points" → 5). Boolean semantic text is mapped to standardized Boolean values: "Yes" → true, "Meets the standard" → true, "No" → false, and "Not meets the standard" → false. The original text is preserved for front-end display.
[0120] Aggregate list structured data and text structured data and bind hierarchical relationships to generate form structured data objects: using the "hierarchical ID association method", add an "association hierarchical ID" field to the two types of data, associate them with the leaf node ID of the form hierarchical tree structure, and traverse the tree structure to integrate all data corresponding to the same node ID.
[0121] The form's structured data objects are validated for data integrity and missing content is filled in to obtain form data: Based on the core business field library (test form: question number, question type, options, score, correct answer; nursing form: inspection items, achievement status, remarks), integrity validation is performed. Missing content is handled according to the strategy of "contextual reference to fill in → default value fill in → manual review to fill in" (e.g., if the score is missing, fill in 0 points; if the achievement status is missing, fill in "not filled in") to ensure that the form data is complete and usable.
[0122] By adopting the above technical solution, the first and second conversion algorithms work together in a progressive manner. The first conversion algorithm calls the document parsing engine to adapt to various formats of data to be recognized, transforming it into standard Markdown data that retains core information (scores, Boolean semantic text, nesting relationships) and hierarchical structure. This effectively decouples content data from redundant text styles, breaking through the limitations of existing technologies on file formats, while accurately restoring the hierarchical grouping and nesting logic of complex forms. Then, the second conversion algorithm constructs a form hierarchical tree structure based on the Markdown text, parsing table data and list structures step by step and mapping them to form business attributes. Through data cleaning, integrity verification, and missing content completion, the core data is accurately extracted and structuredly integrated. This not only solves the problem that existing fixed-format templates are difficult to adapt to complex structure forms and that the migration of existing forms requires repetitive manual operations, but also significantly improves the standardization and integrity of form data.
[0123] Step 3: Parse the form data based on the preset type determination algorithm to obtain type content data, which includes explicit marked content and implicit determined content.
[0124] The type determination algorithm includes the following steps:
[0125] Load and traverse structured data, extract explicit type markers inherent in the structured data, and generate explicit type marker content based on the explicit type markers; the identification scope of explicit type markers includes three categories, specifically:
[0126] Field type markers: such as [Single Choice] "[Multiple Choice]" {Boolean} "(Score Type)";
[0127] Business attribute tags: such as [Allergy History] "[Diagnosis Result]" {Nursing Operation};
[0128] Formatting identifiers: such as "Single choice:", "Multiple choice:", "Whether it meets the standard:";
[0129] Extraction tool: Using a pre-defined regular expression library (such as \\[). ?type\\]"【. [Question] This involves precise matching, traversing all data nodes in the structured data, extracting tags, and generating explicit tag content in key-value pair format. An example is shown below: {"Node ID":"001-001-001","Field Name":"Compliance Status","Explicit Tag":"Boolean","Business Attribute":"Nursing Quality Indicator"}
[0130] Based on preset business characteristics, a type determination rule base and feature dictionary are constructed. The type determination rule base is divided into five categories according to field type: Boolean, score, multiple choice, text, and numeric. Each category of rules includes "trigger condition", "determination logic", and "confidence level (0.8-1.0)". The higher the confidence level, the higher the priority. An example is shown below:
[0131]
[0132] Feature dictionary: It adopts a "keyword-type mapping-weight (0.6-1.0)" triple structure. The keywords are derived from high-frequency business terms in medical institutions, as shown in the example below:
[0133]
[0134] Filter out data nodes that do not have explicit type markers and define the scope of implicit judgment processing; traverse all data nodes and compare whether they contain explicit type markers to filter implicit judgment candidate nodes; classify candidate nodes by secondary grouping and sort them based on business importance, such as "surgical risk assessment" secondary group having higher priority than "daily ward round records", and process high-priority units first.
[0135] The system calls upon the rule base and feature dictionary, and performs implicit judgment through text matching, rule reasoning, and context association to generate implicit judgment content. A three-dimensional judgment model is employed, and the process is as follows:
[0136] Text matching: Calculate the cosine similarity between the candidate node text and the keywords in the feature dictionary. If the similarity is ≥0.7, the type is initially determined.
[0137] Rule reasoning: Call the rule base to check whether the candidate node meets the triggering conditions; if it does, confirm the type.
[0138] Contextual association: For nodes that cannot be determined in the first two steps, refer to the type of related nodes at the same level for inference. For example, if the "disinfection method" node belongs to the second-level group of "disinfection process", and the "compliance status" in the same group is a Boolean type, then the "disinfection method" is inferred to be a text type.
[0139] Generate implicit judgment content, with the same format as the explicit marking content; nodes that cannot be judged are marked as "awaiting manual judgment" and pushed to the manual review entry.
[0140] The system integrates explicitly labeled content and implicitly determined content to generate typed content data. Integration follows the principle of "unique node ID matching + explicit priority," prioritizing explicit content over implicit content when both types exist within the same node. The ratio of the amount of explicitly labeled content to the amount of implicitly determined content is used as the type determination ratio. The number of business features is adjusted based on a positive correlation with this ratio. Thresholds T1=2.0 and T2=0.5 are set. If the ratio > T1 (sufficient explicit data), the number of business features is reduced by 20%; if the ratio < T2 (more implicit data), the number of business features is increased by 20%; if T2 ≤ ratio ≤ T1, the number of business features remains unchanged, achieving adaptive optimization of the determination rules.
[0141] By adopting the above technical solution, explicit type markers are first extracted from structured data to generate explicit marker content, ensuring rapid and accurate determination of data with clear type identification. Then, by constructing a type determination rule base and feature dictionary, and combining text matching, rule reasoning, and context association, implicit determination is performed on data nodes without explicit markers. This effectively fills the gap in implicit type data identification and solves the technical pain points of existing technologies that rely too heavily on type markers and are difficult to accurately determine implicit type data. At the same time, by calculating the positive correlation between the data volume ratio of explicit and implicit determination content, the number of business features is adjusted to achieve adaptive optimization of the determination rules.
[0142] Step 4: Extract training data from the type content data according to a preset set quantity, calculate form prompt words using a preset prompt word algorithm on the training data, and process the type content data using a preset large language model based on the form prompt words to obtain intermediate processing data.
[0143] Step 4.1: Extraction of training data:
[0144] Extraction Rules: Data that meets the criteria is filtered based on subsequent transformation rules to ensure that the training data covers different levels, field types, and business scenarios; Extraction Quantity: An initial value for the preset quantity is allowed, which can be dynamically adjusted, such as 3-8 data points for small sample scenarios and 30-80 data points for batch processing scenarios. In practical applications, it can be adaptively adjusted according to the data scale; Data Format: Converted to a pairwise example format of "raw data-target data" to facilitate the learning of mapping relationships by large language models, as shown in the example below:
[0145] Raw data: ### Compliance Status (No explicit marker) Content: Qualified Target Data: {Field Name: Compliance Status, Field Type: Boolean, Field Value: true, Business Attribute: Nursing Quality Indicator}
[0146] Step 4.2: Form Prompt Generation (Based on the Prompt Engineering Methodology)
[0147] Prompt word structure: A four-segment structured template is used to ensure accurate task understanding by the large language model.
[0148] Task instruction section: Clearly define the core task, such as "convert medical form type content data into standardized JSON format according to business rules";
[0149] Transformation rule section: List the standardization rules one by one, such as "1. Boolean field values are uniformly true / false; 2. Extract integers from score fields; 3. Text fields retain their original content";
[0150] Sample example section: Insert 2-3 training data examples to demonstrate the input-output mapping relationship;
[0151] Output requirements section: Specify the output format (e.g., JSON), required fields (e.g., field name, type, value), and constraints (e.g., no redundant fields);
[0152] Length control: Control the length of the prompt words through a token counting tool (such as GPTTokenizer) to ensure that it does not exceed the context window limit of the large language model (such as the GPT-3.5Turbo limit of 4096 tokens).
[0153] Step 4.3: Large Language Model Processing
[0154] Model adaptation: The integration layer connects to open-source models (ChatGLM-6B, Llama2) and commercial models (GPT-3.5 / 4, Wenxin Yiyan) through a unified interface, supporting switching according to business needs;
[0155] Processing mode: Small batches of data (≤50 forms) are processed synchronously with real-time results; large batches of data (>50 forms) are processed asynchronously, splitting data into blocks for parallel processing to improve efficiency.
[0156] Result validation: Check whether the output data conforms to the JSON format, whether the required fields are complete, and whether the field types are accurate. If the validation passes, generate intermediate processing data; if the validation fails, re-call the model for processing (maximum of 3 retries).
[0157] Step 5: Identify Boolean fields in the intermediate data. If Boolean fields exist, compress multiple Boolean fields in the intermediate data into integers using a bitwise operation storage algorithm to obtain and store the processing result data.
[0158] Step 5.1: Boolean field identification and dynamic quantity adjustment
[0159] Boolean field identification: Filter and process nodes in intermediate data whose field type is Boolean. The identification criteria include explicit markers (Boolean), implicit judgment results (Boolean), field values (true / false, yes / no, etc., standardized Boolean values), and count the number of independent business fields (excluding duplicate / redundant fields).
[0160] The number of Boolean fields can be dynamically adjusted.
[0161] The step of compressing multiple Boolean fields in the intermediate data into integers using a bitwise operation storage algorithm also includes the following steps:
[0162] The quantity of Boolean fields corresponding to the intermediate data of the current batch is calculated as the third data quantity M1, and the quantity of Boolean fields corresponding to the intermediate data of the next batch is obtained as the fourth data quantity M2: M1 is the real-time statistical value of the current batch, and M2 is obtained through "pre-loading sampling + proportional estimation". The number of statistical fields of 10% of the data in the next batch is extracted, and the total quantity is derived proportionally.
[0163] The ratio of the third data volume to the fourth data volume is calculated as a Boolean ratio R3 = M1 / M2: the valid range is set to [0.1, 5.0]. If the value is outside the range, it will be treated as a boundary value. For example, if R3 = 6.0, it will be calculated as 5.0.
[0164] The number of Boolean fields is negatively adjusted based on the Boolean ratio and the set control step size. The preset control step size is 0.1, and the adjustment formula is: number of fields after adjustment = number of fields after initial adjustment × (1 + (1-R3) × control step size). The preset number of fields after initial adjustment is 64 (2^6, adapted for 64-bit binary compression), with an effective range of [16,256]. After adjustment, it is corrected to the nearest power of 2. For example, if the calculation result is 70, it is corrected to 64, and if the result is 30, it is corrected to 32, ensuring byte-aligned storage.
[0165] Step 5.2: Bitwise compression execution
[0166] Mapping rule: Map Boolean field values to binary bits in sequence, true→1, false→0;
[0167] Compression process: Group the data according to the adjusted number of fields, concatenate the field values of each group into binary numbers, and then convert them into decimal integers for storage; for example, 6 Boolean field values (true, false, true, true, false, true) → binary 101101 → decimal integer 45;
[0168] Compression optimization: Using 64-bit binary numbers as the default compression unit, a single integer can store 64 boolean fields, improving storage efficiency by 87.5% compared to traditional key-value pair storage. Traditional storage requires 1 byte for 1 boolean field, so 64 fields would require 64 bytes; after compression, only 8 bytes are needed.
[0169] Step 5.3: Dynamic optimization of control step size and data storage:
[0170] Dynamic optimization of control step size:
[0171] The steps of obtaining and storing the processed data also include the following:
[0172] The compression ratio corresponding to the processing result data and intermediate processing data of the current batch is calculated as the first compression ratio C1, and the compression ratio corresponding to the processing result data and intermediate processing data of the next batch is obtained as the second compression ratio C2. The compression ratio calculation formula is: Compression ratio = (number of bytes of data after compression / number of bytes of data before compression) × 100%; C1 is the actual calculated value of the current batch, and C2 is obtained through "historical data mapping + real-time sampling calibration". The initial value is predicted based on the number of fields and the number of groups in the next batch. After the next batch is processed by 30%, the actual value is calibrated by sampling.
[0173] The ratio of the first compression ratio to the second compression ratio is calculated as the compression ratio calculation value R4 = C2 / C1: the effective range is set to [0.5, 2.0], and values outside the range are treated as boundary values;
[0174] Adjust the control step size based on the positive correlation of the compression ratio calculation value: The adjustment formula is: Adjusted control step size = Initial control step size × (1 + (R4-1) × Adjustment coefficient), Initial control step size = 0.1, Adjustment coefficient = 0.5; Effective range [0.05, 0.2], Step size change rate ≤ 50% (avoid large fluctuations); For example, if R4 = 1.5, and the compression effect of the next batch deteriorates, then the adjusted step size = 0.1 × (1 + (1.5-1) × 0.5) = 0.125, improving the accuracy of field number adjustment.
[0175] Data storage:
[0176] Dual-mode storage: Bitwise compressed integer data (used to reduce storage overhead) and original Boolean data (used for front-end display and data backtracking) are stored together;
[0177] Storage location: Compressed data and form structured data are stored together in the storage layer, supporting MySQL database (structured data), Redis cache (high-frequency access data, cache validity of 24 hours), and object storage (batch compressed files).
[0178] Search support: Create indexes for hierarchical IDs, field names, and business attributes, and support fast queries by department, business type, and time dimension, with a query response time of ≤100ms.
[0179] By adopting the above technical solution, the ratio of the number of Boolean fields in the current batch to the number of intermediate data in the next batch is calculated. Combined with the negative correlation adjustment of the control step size, the number of Boolean fields is adjusted. Then, the bitwise operation storage algorithm is used to compress them into integers, realizing the dynamic adaptive optimization of the Boolean field compression storage strategy. This effectively solves the technical defects of fixed compression methods, which are difficult to adapt to the size of Boolean fields in different batches and are prone to compression redundancy or data distortion. It ensures the integrity and accuracy of Boolean field data and avoids the problem of waste of storage resources or low compression efficiency caused by unreasonable number of fields. Meanwhile, by calculating the compression ratio of the current batch and the next batch of processed data relative to the intermediate data, the control step size for Boolean field compression is positively adjusted, achieving dynamic adaptive optimization of the control step size. This effectively solves the technical defect that a fixed control step size cannot be flexibly adjusted according to the compression effect of different batches of data. When the amount of Boolean fields in the next batch increases, the control step size decreases accordingly, ensuring the accuracy of the compression process and avoiding data distortion due to excessive step size. When the amount of Boolean fields in the next batch decreases, the control step size increases accordingly, improving the compression rate and reducing redundant computational overhead. Furthermore, the compression performance and adaptability of the bitwise operation storage algorithm are optimized.
[0180] In this embodiment, in order to address the technical pain points that need to be flexibly adjusted according to different medical form business scenarios and to improve the relevance and accuracy of the analyzed data, the method also includes the following steps:
[0181] Retrieve preset form business requirements: Supports three retrieval methods: ① Preset template call (the system has built-in high-frequency templates such as "structured test question database" and "nursing quality control compliance rate statistics"); ② Custom input (users enter personalized requirements through a visual interface, such as "statistics on surgical disinfection compliance rate in Q1 2024"); ③ API interface integration (receives requirement instructions issued by the business system).
[0182] Identifying target requirements, transformation rules, and constraint boundaries from form business requirements: This is achieved using "natural language processing + business keyword matching." ① A target keyword library (input, statistics, analysis, reports) identifies target requirements; ② A rule keyword library (retention, transformation, filtering, sorting) identifies transformation rules; ③ A constraint keyword library (privacy protection, compliance, required fields, time range) identifies constraint boundaries. The identification results are output in JSON format, as shown in the example below:
[0183] {"Objective":"Statistically calculate the surgical disinfection compliance rate in Q1 2024","Conversion Rule":"Screen the surgical data for Q1 2024 and calculate the compliance rate = number of times compliance was achieved / total number of times","Constraints":"Only statistically analyze surgical disinfection-related data to protect patient privacy"}
[0184] Based on the conversion rules, a set number of data points are extracted from the type content data as training data: data that meets the conditions is filtered according to the conversion rules, and 3-80 data points are extracted by stratified sampling to ensure coverage of core business scenarios;
[0185] The system obtains preset task instructions and output requirements, and generates form prompts based on the prompt word algorithm, which combines the task instructions, conversion rules, training data, and output requirements. The prompts use a "four-segment" template, with the task instructions clearly stating "generate statistical analysis data according to business needs," the conversion rules listed one by one, training data examples inserted, and output requirements clearly specifying the format, such as reports, JSON, and chart data.
[0186] Input the form prompts, target requirements, and constraint boundaries into the large language model to process the type content data and obtain the analysis data: After the model learns the rules and examples in the prompts, it processes the type content data and generates targeted analysis results, such as "the surgical disinfection compliance rate in Q1 2024 was 93.2%".
[0187] Output formats: Supports multiple formats such as JSON, CSV, Excel, and structured reports, which users can choose as needed; The analyzed data comes with a description of the data source, such as "based on statistics of 500 surgical nursing forms from January to March 2024", to ensure traceability.
[0188] By adopting the above technical solution, the system first obtains the preset form business requirements and accurately identifies the target requirements, conversion rules and constraint boundaries. Then, based on the conversion rules, it extracts the corresponding training data from the type content data. Combining the task instructions and output requirements, it generates suitable form prompts through the prompt word algorithm. Finally, it inputs the form prompts, target requirements and constraint boundaries into the large language model to process the type content data, thus realizing a deep binding between the form data processing logic and the actual business requirements.
[0189] In this embodiment, in order to achieve dynamic adaptive adjustment of the training data volume, the method further includes the following steps:
[0190] The data volume of the current batch of data to be identified is calculated as the first data volume N1, and the data volume of the next batch of data to be identified is obtained as the second data volume N2. The data volume statistics dimension is "number of data nodes". Each form sub-item and its associated fields are regarded as 1 node. N1 is calculated in real time, and N2 is obtained through "preloaded metadata + sampling estimation". After the next batch of preloaded metadata, 10% of the files are sampled to count the number of nodes, and the total number is derived proportionally.
[0191] The ratio of the first data volume to the second data volume is calculated as the ratio to be identified, R1 = N1 / N2: the effective range is set to [0.1, 10.0], and values outside the range are treated as boundary values;
[0192] The ratio of the number of form prompt words to the preset number of reference words is the word count ratio R2 = number of prompt word tokens / number of reference words: the number of reference words is preset according to the business scenario, 1500 tokens for the test scenario and 1200 tokens for the nursing scenario, with an effective range of [0.5, 2.0].
[0193] The adjustment ratio R = 0.6 × R1 + 0.4 × R2 is calculated by weighting the ratio of the target recognition ratio and the ratio of the number of words: weight α = 0.6 (higher weight for data volume) and β = 0.4 (weight for the complexity of prompt words), balancing the data scale and the suitability of prompt words.
[0194] Adjust the set number of data points based on the negative correlation of the adjustment ratio (3-8, 30-80): The adjustment formula is: Adjusted set number = Initial set number × (1.0 / R); The initial set number is preset according to the scenario (3-8 data points for small samples, 30-80 data points for batches); The adjustment step size is 1 data point (small sample) and 10 data points (batch) to avoid frequent small fluctuations; for example, R=0.5; If the amount of data in the next batch doubles and the complexity of the prompt words is moderate, then the adjusted set number of data points = initial 5 data points × (1.0 / 0.5) = 10 data points to ensure sufficient training data.
[0195] By adopting the above technical solution, the ratio of the current batch to the next batch of data to be identified, and the ratio of the number of form prompt words to the number of preset reference words are calculated. The weighted average is then used to obtain the adjustment ratio, and the set amount of training data is adjusted accordingly. This achieves dynamic adaptive adjustment of the amount of training data. It effectively solves the technical defects of fixed training data volume being difficult to adapt to different batch data scales and being prone to undertraining or redundant calculations. It ensures the sufficiency of training data for small batches to improve the accuracy of model processing, while avoiding the waste of computing resources caused by excessive training data for large batches.
[0196] In summary, this structured form processing method employs a three-column progressive parsing algorithm to accurately extract the data to be identified into structured data. Combined with a two-level transformation algorithm, it achieves efficient conversion between standard data and form data. Utilizing training data extraction, prompt word generation, and large language model processing, it enables intelligent optimization of typed content data. Furthermore, by using a bitwise operation storage algorithm to compress and store Boolean fields, this approach not only overcomes the limitations of existing technologies on file formats and effectively solves the problems of difficulty in creating complex form structures, high migration costs of existing forms, and weak batch processing capabilities, but also significantly improves the efficiency and accuracy of form processing, reduces data storage overhead, and powerfully promotes the informatization upgrade of form management in medical institutions.
[0197] This application also discloses a structured form processing system based on intelligent recognition, including a processor, wherein the processor executes the steps of the structured form processing method based on intelligent recognition as described in any of the above embodiments.
[0198] This application also discloses a storage medium storing a program that, when executed by a processor, implements the steps of the structured form processing method based on intelligent recognition described above.
[0199] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A structured form processing method based on intelligent recognition, characterized in that, Includes the following steps: The data to be identified is obtained, and structured data is identified from the data based on a preset three-column progressive parsing algorithm. The structured data includes first-level groups, second-level groups, and form sub-items. The first-level groups, second-level groups, and form sub-items are the core matching features of the three-column progressive parsing algorithm. The three-column progressive parsing algorithm includes the following steps: removing beautification styles from the data to be identified to obtain the original content data, and performing format normalization on the symbols and text in the original content data to obtain formatted data; Based on a preset reference field library, progressive level fields are identified from formatted data; based on a preset three-column progressive feature, the progressive level fields are feature matched and layered to obtain three-level progressive skeleton data; wherein, the three-column progressive feature is the first-level group, the second-level group, and the form sub-item; after the three-level progressive skeleton data is verified and corrected, structured data is obtained; The structured data is converted into standard data based on a preset first conversion algorithm, and the standard data is converted into form data based on a preset second conversion algorithm. The form data is parsed using a pre-defined type determination algorithm to obtain type content data, which includes explicit type markers and implicit type determination content. The type determination algorithm includes the following steps: loading and traversing structured data, extracting explicit type markers inherent in the structured data, and generating explicit type marker content based on the explicit type markers; constructing a type determination rule base and feature dictionary based on pre-defined business features; filtering out data nodes that do not have explicit type markers and defining the scope of implicit type determination processing; calling the rule base and feature dictionary, and performing implicit determination through text matching, rule reasoning, and context association to generate implicit type determination content; and fusing explicit type marker content and implicit type determination content to generate type content data. The ratio of the amount of explicit type marker content to the amount of implicit type determination content is calculated as the type determination ratio, and the number of business features is adjusted based on a positive correlation with the type determination ratio. Training data is extracted from the type content data according to a preset set quantity. The training data is used to calculate form prompt words using a preset prompt word algorithm. The type content data is then processed using a preset large language model based on the form prompt words to obtain intermediate processing data. Identify and process Boolean fields in the intermediate data. If Boolean fields exist, compress multiple Boolean fields in the intermediate data into integers using a bitwise operation storage algorithm to obtain and store the processing result data.
2. The structured form processing method based on intelligent recognition according to claim 1, characterized in that, The first conversion algorithm includes the following steps: Obtain the format of the data to be recognized, and call the document parsing engine according to the format to convert the binary stream of the data to be recognized into a structured document object; Identify first-level groups, second-level groups, and form sub-items in structured document objects and map them to Markdown heading levels; Extract table data based on Markdown heading levels, and adapt the structured document object to Markdown standard table syntax in the order of cell, row and table, while retaining scores and Boolean semantic text; Convert ordered and unordered lists in a structured document object into corresponding Markdown lists while preserving the built-in nesting relationships; Decouple the content data and text style in the structured document object, separate the plain text content, paragraph hierarchy, table data, list structure and font style, remove redundant formatting, and obtain the structured data object; Integrate all structured data objects in the original document order, validate the syntax, and output Markdown text as standard data; The second conversion algorithm includes the following steps: Standard data is loaded to obtain Markdown text, and the data is cleaned based on a preset filtered database to obtain a standardized character dataset; Parse the Markdown heading levels, construct a tree skeleton of first-level groups, second-level groups, and form items, and generate a form hierarchy tree structure object; Extract table syntax blocks from the form hierarchy tree structure object, perform hierarchical parsing according to the order of table, row and cell to obtain the core form data, and convert the core form data into structured table dataset and structured text dataset based on the preset encoding analysis library. Parse the structured tabular dataset, restore the Markdown list to the form's question number, option, and sub-item structure, and output the structured list data based on the built-in nesting relationship; Parse the content data and text styles in the structured text dataset, map them to form business attributes, extract scores and Boolean semantic text, and collect the resulting structured text data. Aggregate list structured data and text structured data and bind hierarchical relationships to generate a form structured data object; The form's structured data object is validated for data integrity and missing content is filled in to obtain the form data.
3. The structured form processing method based on intelligent recognition according to claim 1, characterized in that, The method also includes the following steps: Obtain the preset form business requirements, and identify the target requirements, transformation rules and constraint boundaries from the form business requirements; Based on the transformation rules, a set amount of data is extracted from the type content data as training data; Obtain preset task instructions and output requirements, and generate form prompts based on the prompt word algorithm, combining task instructions, conversion rules, training data, and output requirements; Input the form prompts, target requirements, and constraint boundaries into the large language model to process the content data and obtain the analysis data.
4. The structured form processing method based on intelligent recognition according to claim 3, characterized in that, The method also includes the following steps: The data volume of the current batch of data to be identified is calculated as the first data volume, and the data volume of the next batch of data to be identified is calculated as the second data volume. The ratio of the first data volume to the second data volume is calculated as the ratio to be identified. The ratio of the number of form prompt words to the number of preset reference words is the word count ratio. The adjustment ratio is calculated by weighting the ratio to be identified and the ratio of word count; The set quantity is adjusted based on the negative correlation between the adjustment ratio and the adjustment quantity.
5. The structured form processing method based on intelligent recognition according to claim 1, characterized in that, The step of compressing multiple Boolean fields in the intermediate data into integers using a bitwise storage algorithm also includes the following steps: The third data quantity is calculated by counting the number of Boolean fields corresponding to the intermediate data of the current batch, and the fourth data quantity is obtained by counting the number of Boolean fields corresponding to the intermediate data of the next batch. The ratio of the third data volume to the fourth data volume is calculated as a Boolean ratio. The number of Boolean fields is negatively adjusted based on the set control step size according to the Boolean ratio.
6. The structured form processing method based on intelligent recognition according to claim 5, characterized in that, The steps of obtaining and storing the processed data also include the following steps: The compression ratio of the current batch's processing result data and the intermediate processing data is calculated as the first compression ratio, and the compression ratio of the next batch's processing result data and the intermediate processing data is obtained as the second compression ratio. The ratio of the first compression ratio to the second compression ratio is calculated as the compression ratio value; The control step size is adjusted positively based on the calculated compression ratio.
7. A structured form processing system based on intelligent recognition, characterized in that, The system includes a processor that performs the steps of the structured form processing method based on intelligent recognition as described in any one of claims 1-6.
8. A storage medium, characterized in that, The storage medium stores a program that, when executed by a processor, implements the steps of the structured form processing method based on intelligent recognition as described in any one of claims 1-6.