Intelligent matching and rapid switching method for multi-dimensional document templates

By using semantic segmentation networks and multimodal feature fusion technology, combined with multi-core central processing units and knowledge graphs, intelligent matching and rapid switching of document templates are achieved, solving the problems of insufficient semantic understanding of documents and system isolation in traditional methods, and improving the accuracy and efficiency of document processing.

CN121354136AActive Publication Date: 2026-01-16SHENZHEN TEWEI KECHUANG INFORMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511909408.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-01-16
Estimated Expiration
2045-12-17

AI Technical Summary

Technical Problem

Traditional document template matching methods can only recognize fixed templates, lack the ability to understand the semantics of documents, cannot automatically switch to the most appropriate processing flow, and the system is isolated from the database, lacking intelligent interaction methods, making it difficult to meet high-performance requirements.

Method used

Semantic segmentation networks and multimodal feature fusion technology are used to segment document regions and associate text information. Combined with multi-core CPU parallel processing and knowledge graph query, document templates are automatically matched and switched, and database and version management are optimized based on user feedback.

Benefits of technology

It improved the accuracy of document information filling and processing speed, enhanced the system's flexibility and adaptability, enabled the rapid processing of high-priority documents, adapted to changes in business rules, and solved the problem of historical data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121354136A_ABST
    Figure CN121354136A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent matching and rapid switching method for a multi-dimensional document template, and belongs to the technical field of intelligent office. The method solves the problems that in the prior art, document semantics cannot be understood, and the recognition rate is low during format change; template switching needs manual intervention, and a proper process cannot be automatically recommended; in order to solve the problems that document information is isolated from an enterprise database and big data resources, and intelligent interaction means are lacked, text information is accurately associated to a corresponding semantic region through a semantic segmentation network and a multi-modal feature fusion technology, and correct filling of document information is ensured; a large number of receipts are efficiently processed through the multi-core central processing unit, and rapid processing of high-priority receipts is ensured in combination with a task priority evaluation mechanism; the response speed of the processing method is effectively improved through hot spot template prediction, it is ensured that historical documents can be accurately matched with a current template version based on a timeliness matching mechanism and template versioning management, and the historical data processing problem caused by policy or format change is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent office, in particular to a method for intelligent matching and rapid switching of multi-dimensional bill templates. BACKGROUND

[0002] In the operation of modern enterprises, bill processing is an important part of daily business, such as invoices, orders, bills of lading, contracts, etc.

[0003] The traditional bill template matching and switching method can usually only recognize fixed template bills, lacks the ability to understand the semantics of the bill, and the recognition rate drops sharply once the format changes. Secondly, manual intervention is required to switch between different bill templates, and the most suitable processing flow cannot be automatically recommended or switched according to the bill content. Moreover, the bill processing system is isolated from the enterprise's internal database and big data resource services, and cannot utilize existing business knowledge to assist in bill understanding and decision-making. In addition, there is a lack of intelligent interaction means such as natural language query and machine question answering, and users cannot query bill information or issue orders in a flexible manner, making it difficult to meet high performance requirements.

[0004] Therefore, the present application provides a method for intelligent matching and rapid switching of multi-dimensional bill templates. SUMMARY

[0005] The present application provides a method for intelligent matching and rapid switching of multi-dimensional bill templates, which accurately associates text information to the corresponding semantic region through a semantic segmentation network and multi-modal feature fusion technology, ensuring the correct filling of bill information. Through the efficient processing of a large number of bills by a multi-core central processing unit, combined with a task priority evaluation mechanism to ensure the rapid processing of high-priority bills, the response speed of the processing method is effectively improved through hot template prediction, and based on a time-sensitive matching mechanism and template version management, historical bills can be accurately matched to the template version at the time, solving the problem of historical data processing caused by policy or format changes, and solving the problems raised in the above background technology.

[0006] To achieve the above-mentioned purpose, the present application provides the following technical solutions: The method for intelligent matching and rapid switching of multi-dimensional bill templates comprises the following steps: Collect various bill samples using big data resources, and perform character recognition, word segmentation, and syntax analysis on the text content in the bill through character recognition technology to extract the original text information; Use a semantic segmentation network to segment the input bill image by region, and set a corresponding semantic label for each pixel region to identify different logical regions; According to the segmentation result, the position and contour of each semantic region are extracted, and the recognized original text information is associated to the corresponding semantic region. Semantic analysis models are used to perform semantic recognition and classification on raw text information to generate structured semantic data; Structured semantic data is semantically fused with a pre-built knowledge graph. Based on the fused semantic information, multiple candidate document templates are matched from a pre-set template database using a decision tree model. When a new document is input, the template matching task is decomposed into feature extraction, decision tree screening, deep semantic matching, knowledge graph association query, and result fusion and sorting based on a multi-core central processing unit; and then distributed to different core clusters for parallel processing to determine the corresponding document template. Based on the matching results, automatically switch to the corresponding document template and fill the key information from the document into the corresponding positions in the template; Obtain feedback information on matching results, introduce timestamps to manage the matching accuracy of each template, and optimize the knowledge graph and template database based on the feedback information and matching accuracy.

[0007] Furthermore, a semantic segmentation network is used to segment the input document image into regions, and a corresponding semantic label is assigned to each pixel region, including: The document image is input into the visual encoder of the semantic segmentation network to generate a multi-scale visual feature map; Character recognition is performed on the same document image, and the recognized text sequence is input into a text encoder to generate text features; At each spatial location of the visual feature map, calculate its co-attention weight with the text features; Based on the common attention weights, the semantic information of the text is fused into the visual features to generate a text-enhanced visual feature map; Multiple feature layers of different depths and resolutions are preserved in the visual feature map of text enhancement. The top feature map is subjected to dilated convolution with different dilation rates in parallel. The high-level semantic features are fused with the low-level high-resolution features layer by layer to capture contextual information from local details to global layout. The features that integrate multimodal and multiscale information are upsampled and refined to output the final pixel-level semantic segmentation map; Based on the segmentation results, the location and outline of each semantic region are extracted; the spatial topological relationship between regions is analyzed, and a layout logic tree is constructed. The identified raw text information is associated with the corresponding semantic region based on its spatial coordinates, so that each pixel region is matched with the corresponding semantic tag; The prior rules for this type of document are retrieved from the knowledge graph. The prior rules are then used to perform logical verification on the associated results to verify whether the segmented regions of the document image match the corresponding semantic tags.

[0008] Furthermore, at each spatial location of the visual feature map, its co-attention weights with the text features are calculated, including: Retrieve each spatial location corresponding to the visual feature map; Using spatial location p as the center, extract the window containing spatial location p in the visual feature map according to the 3*3 local window method; Extract the feature vectors corresponding to all spatial locations within the window; The spatial aggregation factor corresponding to spatial location p is obtained by using the feature vectors of all locations within the window corresponding to spatial location p. The co-attention weights of each spatial location and text feature in the visual feature map are obtained by using the text features corresponding to the same document image to which the visual feature map belongs and the spatial clustering factor corresponding to the spatial location p.

[0009] Further, by utilizing the text features corresponding to the same document image to which the visual feature map belongs and the spatial clustering factor corresponding to the spatial location p, the co-attention weights of each spatial location and text feature in the visual feature map are obtained, including: Retrieve the text features corresponding to the same document image belonging to the same visual feature map; Obtain the Euclidean norm of the text feature corresponding to the text feature vector; Retrieve the feature vector corresponding to spatial location p, and obtain its corresponding Euclidean norm based on the feature vector corresponding to spatial location p; The basic correlation parameters between the text features and the spatial location p are obtained by performing correlation processing using the Euclidean norm corresponding to the text features and the Euclidean norm of the feature vector corresponding to the spatial location p. Retrieve the spatial aggregation factor corresponding to spatial location p; The co-attention weights of each spatial location and text feature in the visual feature map are obtained by combining the spatial clustering factor corresponding to the spatial location p with the basic correlation parameters between the text feature and the spatial location p.

[0010] Furthermore, based on a multi-core central processing unit, the template matching task is decomposed into feature extraction, decision tree initial screening, deep semantic matching, knowledge graph association query, and result fusion and ranking, including: Preload new document data into the pending processing path and retrieve the running status of all core clusters in the multi-core central processing unit; By using predictive models, the execution time of tasks can be predicted based on the type and complexity of documents, allowing for advance task allocation and resource scheduling. The preloaded document data is divided into micro-batches, and tasks are dynamically allocated according to the current load of each core cluster, assigning corresponding tasks to each core cluster. Collect the results of completed tasks from each core cluster, perform weighted semantic fusion and sorting on the results of all parallel tasks for the same document, and generate the final candidate template list. Output the final matching results and record the processing timestamp, cache hit rate, and core load for each document for subsequent analysis and optimization.

[0011] Furthermore, based on feedback and matching accuracy, the knowledge graph and template database are optimized, including: Continuously collect user feedback information. If a user manually corrects or rejects the template matching result, the correction content and correction timestamp will be automatically recorded, and the original template will be classified as a negative sample or a positive sample. The matching accuracy of each version of the template is calculated periodically. If the accuracy is lower than the threshold or a change in business rules is detected, a new version is automatically created. The new version learns and optimizes from the knowledge graph through knowledge fusion technology to adapt to new business rules or format changes.

[0012] Furthermore, if the accuracy rate falls below a threshold or a change in business rules is detected, a new version creation will be automatically triggered, including: Establish a template version evolution map to record the validity period, changes, and performance indicators of each version of the template. When a major change to business rules is detected, a new version of the template is automatically created, while maintaining historical compatibility with the old version; During the matching process, the date range of the documents to be processed is obtained, and the corresponding time period template version is automatically associated with the date range to avoid errors caused by policy retrospective. Based on user feedback, a template quality assessment system was established to automatically downgrade or archive low-quality templates. Through a continuous learning mechanism, the verified matching results are used as new samples and fed back into the training process.

[0013] Furthermore, it also includes the following steps: Establish a task priority assessment mechanism to set processing priorities based on the urgency of documents and customer level; Allocate dedicated computing resources to high-priority documents to ensure that their processing latency is minimized; Real-time monitoring of task queue depth and response time in each core cluster; when task backlog is detected, automatic elastic scaling is initiated to dynamically migrate tasks to idle cores. Establish a timeout warning mechanism to isolate and recover abnormal tasks.

[0014] Furthermore, it also includes the following steps: Establish a hotspot template prediction model, based on historical processing records with timestamps, to identify high-frequency matching templates in a specific time period or for a specific customer, and use them as hotspot templates. The vectorized representations of the identified hotspot templates, along with the relevant knowledge graph subgraphs, are preloaded into the shared cache of the multi-core CPU. When performing deep semantic matching and knowledge graph association queries, priority is given to searching and matching in the shared cache; If a cache hit occurs, the corresponding task will be routed to a dedicated core for accelerated processing. If a cache miss occurs, the process switches to the regular processing flow and the miss information is recorded for model optimization.

[0015] Furthermore, it also includes the following steps: Construct a cross-language semantic mapping layer to perform unified semantic encoding on the content of multilingual documents; When non-native language text is detected, an intelligent translation mechanism is activated to prioritize rule-based translation for specialized terms and deep learning translation for general text. The translation results are semantically fused with the original text to generate a semantic vector representation; Based on this semantic vector, cross-language entity linking and relationship mapping are performed in the knowledge graph, supporting template matching for multilingual documents.

[0016] Compared with the prior art, the beneficial effects of the present invention are: 1. In this invention, by using semantic segmentation networks and multimodal feature fusion technology, different logical regions in a document can be accurately identified, and text information can be accurately associated with the corresponding semantic regions. Based on deep semantic matching and knowledge graph association query, the accuracy of template matching is further improved, ensuring the correct filling of document information. Through the parallel processing mechanism of a multi-core central processing unit, a large number of documents can be processed efficiently, significantly improving processing speed and efficiency. Combined with a task priority evaluation mechanism and elastic expansion function, the rapid processing of high-priority documents is further ensured.

[0017] 2. In this invention, through user feedback and matching accuracy optimization mechanisms, the knowledge graph and template database can be dynamically adjusted, and new version templates can be automatically created to adapt to changes in business rules; combined with hotspot template prediction, the response speed and processing efficiency of the method are further improved; based on the timeliness matching mechanism and template version management, it is ensured that historical documents can accurately match the template version at that time, solving the problem of historical data processing caused by policy or format changes, and improving the flexibility and practicality of the method. Attached Figure Description

[0018] Figure 1 This is a flowchart of the intelligent matching and fast switching method for multi-dimensional document templates according to the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] To address the limitations of traditional document template matching and switching methods, which typically only recognize documents with fixed templates and lack semantic understanding, the recognition rate drops drastically once the format changes. Secondly, switching between different document templates requires manual intervention and cannot automatically recommend or switch to the most suitable processing flow based on document content. Furthermore, the document processing system is isolated from the enterprise's internal database and big data resource services, lacking intelligent interaction methods such as natural language querying and machine question answering. For technical issues preventing users from flexibly querying document information or issuing instructions, please refer to [link / reference needed]. Figure 1 This embodiment provides the following technical solution: The intelligent matching and quick switching method for multi-dimensional document templates includes the following steps: We utilize big data resource services to collect various document samples, and then use character recognition technology to perform character recognition, word segmentation, and grammatical analysis on the text content in the documents to extract the original text information.

[0021] A semantic segmentation network is used to segment the input document image into regions, and a corresponding semantic label is assigned to each pixel region to identify different logical regions; for example: title region, supplier information region, product list region, amount summary region, etc.; including: The document image is input into the visual encoder of the semantic segmentation network to generate a multi-scale visual feature map; character recognition is performed on the same document image, and the recognized text sequence is input into the text encoder to generate text features; at each spatial location of the visual feature map, the co-attention weight between the visual feature map and the text feature is calculated; based on the co-attention weight, the text semantic information is fused into the visual features to generate a text-enhanced visual feature map; multiple feature layers of different depths and resolutions are retained in the text-enhanced visual feature map, and dilated convolutions with different dilation rates are performed on the top-level feature map in parallel, and high-level semantic features are fused with low-level high-resolution features layer by layer to capture contextual information from local details to global layout; Features from multimodal and multi-scale information are upsampled and refined to output the final pixel-level semantic segmentation map. Based on the segmentation results, the position and contour of each semantic region are extracted. The spatial topological relationships between regions are analyzed to construct a layout logic tree. The identified original text information is associated with the corresponding semantic regions according to its spatial coordinates, so that each pixel region is matched with the corresponding semantic label. Prior rules for this type of document are queried from the knowledge graph, and the prior rules are used to perform logical verification on the associated results to verify whether the segmented regions of the document image are compatible with the corresponding semantic labels. For example, if non-numeric text is identified in the unit price column of the product list area, it is marked that there may be a feature recognition error or segmentation error.

[0022] Specifically, at each spatial location of the visual feature map, its co-attention weight with the text features is calculated, including: Retrieve each spatial location corresponding to the visual feature map; Using spatial location p as the center, extract the window containing spatial location p in the visual feature map according to the 3*3 local window method; Extract the feature vectors corresponding to all spatial locations within the window; The spatial aggregation factor corresponding to spatial location p is obtained by using the feature vectors of all locations within the window corresponding to spatial location p. The spatial clustering factor corresponding to the spatial location p is obtained by the following formula: Where S represents the spatial aggregation factor corresponding to spatial location p; n represents the number of all location points within the window corresponding to spatial location p; v p The feature vector corresponding to spatial location p; v pi This represents the feature vector corresponding to the i-th spatial location point within the window corresponding to spatial location p; The co-attention weights of each spatial location and text feature in the visual feature map are obtained by using the text features corresponding to the same document image to which the visual feature map belongs and the spatial clustering factor corresponding to the spatial location p.

[0023] The above technical solution effectively addresses the technical pain points of insufficient local contextual information of visual features and inaccurate semantic association between visual and text in traditional co-attention computation through the innovative design of "3×3 local window spatial feature aggregation + visual-text semantic fusion". It achieves multi-dimensional performance optimization: on the one hand, by fusing target location and neighborhood features through spatial aggregation factors, the local structural semantics and anti-interference ability of visual features are strengthened, making up for the information defects of single-location features and making the visual expression richer and more stable; on the other hand, by accurately fusing enhanced visual features and text features, the cross-modal semantic gap is narrowed, and a refined weight allocation that takes into account both the rationality of spatial structure and semantic relevance is achieved, which is more in line with the structural characteristics of document image table layout, field association, etc. Ultimately, it significantly improves the accuracy and anti-interference ability of core tasks such as document information extraction and table structure recognition, while enhancing the model's generalization adaptability to different types of documents, providing key technical support for the performance upgrade of document intelligent processing systems, and comprehensively optimizing the quality and efficiency of cross-modal attention guidance.

[0024] Specifically, the co-attention weights between each spatial location and the text feature of the visual feature map are obtained by using the text feature corresponding to the same document image to which the visual feature map belongs and the spatial clustering factor corresponding to the spatial location p. This includes: Retrieve the text features corresponding to the same document image belonging to the same visual feature map; Obtain the Euclidean norm of the text feature corresponding to the text feature vector; Retrieve the feature vector corresponding to spatial location p, and obtain its corresponding Euclidean norm based on the feature vector corresponding to spatial location p; The basic correlation parameters between the text features and the spatial location p are obtained by performing correlation processing using the Euclidean norm corresponding to the text features and the Euclidean norm of the feature vector corresponding to the spatial location p. The basic correlation parameter between the text features and the spatial location p is obtained by the following formula: Where R represents the basic correlation parameter between text features and spatial location p; The Euclidean norm corresponding to the eigenvector of spatial location p; The Euclidean norm representing the text feature; Retrieve the spatial aggregation factor corresponding to spatial location p; The co-attention weights of each spatial location and text feature in the visual feature map are obtained by combining the spatial clustering factor corresponding to the spatial location p with the basic correlation parameters between the text feature and the spatial location p.

[0025] The co-attention weights between each spatial location of the visual feature map and the text features are obtained using the following formula: Where W represents the co-attention weight between each spatial location of the visual feature map and the text feature; R represents the basic correlation parameter between the text feature and the spatial location p; and S represents the spatial clustering factor corresponding to the spatial location p.

[0026] The aforementioned technical solution addresses the shortcomings of traditional methods in calculating cross-modal co-attention weights for document images, which are susceptible to interference from feature scale differences and lack consideration for both semantic relevance and spatial structure rationality. Through an innovative design combining "Euclidean norm correlation modeling + spatial aggregation factor fusion," it achieves multi-dimensional performance optimization: Firstly, by calculating the Euclidean norm of both the text feature vector and the visual spatial location feature vector p, and obtaining the basic correlation parameter R based on this norm, it effectively normalizes the scale differences in amplitude and dimension of different modal features, avoiding misjudgments of correlation caused by inconsistent feature numerical ranges. This makes the semantic association measurement between text and visual location more fair and accurate, laying a reliable foundation for weight calculation. Secondly, by combining the spatial aggregation factor S, which characterizes the integrity and anti-interference ability of the local visual structure, with the basic correlation parameter R, and through weight... Formula W integrates to form the final co-attention weights, ensuring that the weight allocation fully reflects the semantic relevance between text and visual location, while also deeply integrating structural association information from the local visual neighborhood. This addresses the shortcomings of traditional weight calculations that only consider semantic similarity and ignore the rationality of visual spatial structure. It is more in line with the scenario characteristics of strong binding between text fields and corresponding visual regions (such as table cells and numerical regions) in document images. Ultimately, it significantly improves the accuracy and reliability of cross-modal co-attention weights for document images, effectively enhancing robustness to interference factors such as scanning noise, feature scale differences, and local distortion. This enables the model to more accurately focus on key related information and weaken interference from irrelevant regions in core tasks such as document information extraction, table structure recognition, and field-visual region matching. At the same time, it enhances the generalization and adaptation capabilities to different types of documents, comprehensively optimizing the cross-modal fusion quality and core task performance of the intelligent document processing system.

[0027] Based on the segmentation results, the location and outline of each semantic region are extracted, and the identified original text information is associated with the corresponding semantic region; for example, if the text located in the product list area is identified, it can be determined to be product information. Semantic analysis models are used to perform semantic recognition and classification on the original text information to generate structured semantic data.

[0028] Structured semantic data is semantically fused with a pre-built knowledge graph, whose data sources include big data resource services and enterprise internal databases. Based on the fused semantic information, multiple candidate document templates are matched from a pre-set template database using a decision tree model.

[0029] The beneficial effects achieved by the above are as follows: Through semantic segmentation networks and multimodal feature fusion technology, different logical regions in documents can be accurately identified, and textual information can be accurately associated with the corresponding semantic regions; based on deep semantic matching and knowledge graph association query, the accuracy of template matching is further improved, ensuring the correct filling of document information; through the parallel processing mechanism of multi-core central processing units, a large number of documents can be processed efficiently, significantly improving processing speed and efficiency; combined with task priority evaluation mechanism and elastic expansion function, the rapid processing of high-priority documents is further ensured.

[0030] When a new document is input, the template matching task is decomposed into feature extraction, decision tree initial screening, deep semantic matching, knowledge graph association query, and result fusion and sorting based on a multi-core CPU. This process is then distributed across different core clusters for parallel processing to determine the corresponding document template. This includes: New document data is preloaded into the processing path, and the running status of all core clusters in the multi-core CPU is retrieved. Using a predictive model, the execution time of tasks is predicted based on the document type and complexity, allowing for advance task allocation and resource scheduling to further optimize the processing flow. The preloaded document data is divided into micro-batches, and tasks are dynamically allocated based on the current load of each core cluster, ensuring load balancing across core clusters and improving overall system efficiency. Completed task results are collected from each core cluster, and weighted semantic fusion and sorting are performed on all parallel task results for the same document to generate a final candidate template list. The final matching result is output, and the processing timestamp, cache hit rate, and core load of each document are recorded for subsequent analysis and optimization. For example, while one document is undergoing deep semantic matching, another document can simultaneously undergo decision tree initial screening, with core A responsible for feature extraction, core B for deep semantic matching, and core C for knowledge graph association query.

[0031] Based on the matching results, the system automatically switches to the corresponding document template and fills the key information from the document into the appropriate positions in the template; it obtains feedback information on the matching results, introduces timestamps to manage the matching accuracy of each template, and optimizes the knowledge graph and template database based on the feedback information and matching accuracy; including: Continuously collect user feedback. If a user manually corrects or rejects the template matching result, the system automatically records the correction details, such as field mapping adjustments, template replacements, and correction timestamps. The original template is categorized as a negative sample (e.g., incorrect match) or a positive sample (e.g., a correct match requiring fine-tuning). The system periodically calculates the matching accuracy of each template version, such as the correction rate of the most recent 100 matches. If the accuracy falls below a threshold (e.g., 85%), or if a business rule change is detected (e.g., a tax policy update), a new version is automatically created. This includes: A template version evolution graph is established, recording the validity period, changes, and performance metrics of each version. When a significant change in business rules is detected, a new template version is automatically created while maintaining historical compatibility with older versions. During the matching process, the date range of the documents to be processed is obtained, and the corresponding template version for that time period is automatically associated based on the date range, avoiding errors caused by policy retrospectives. For example, when processing a historical document from 2022, the system will automatically match the old template that was valid in 2022, rather than the current latest template, to address compatibility issues in historical data processing and ensure that historical documents can accurately match the templates used at that time, improving the system's flexibility and usability. Based on user feedback, a template quality evaluation system is established, automatically downgrading or archiving low-quality templates. Through a continuous learning mechanism, verified matching results are used as new samples and fed back into the training process. New versions learn and optimize from the knowledge graph using knowledge fusion technology, adapting to new business rules or format changes.

[0032] Establish a task priority assessment mechanism to set processing priorities based on the urgency of documents and customer level; allocate dedicated computing resources to high-priority documents to ensure that their processing latency is minimized; monitor the task queue depth and response time of each core cluster in real time, and automatically initiate elastic expansion when task backlog is detected to dynamically migrate tasks to idle cores; establish a processing timeout warning mechanism to isolate and recover abnormal tasks.

[0033] A hotspot template prediction model is established. Based on historical processing records with timestamps, high-frequency matching templates in specific time periods or for specific customers are identified as hotspot templates. The vectorized representations of the identified hotspot templates and related knowledge graph subgraphs are preloaded into the shared cache of a multi-core CPU. When performing deep semantic matching and knowledge graph association queries, the search and matching are prioritized in the shared cache. If the cache is hit, the corresponding task is routed to a dedicated core for accelerated processing. If the cache is not hit, the process returns to the normal processing flow, and the miss information is recorded for model optimization.

[0034] A cross-language semantic mapping layer is constructed to perform unified semantic encoding on the content of multilingual documents. When non-subject language text is identified, an intelligent translation mechanism is activated to prioritize rule-based translation for professional terms and deep learning translation for general text. The translation results are semantically fused with the original text to generate a semantic vector representation. Based on this semantic vector, cross-language entity linking and relationship mapping are performed in the knowledge graph to support template matching for multilingual documents.

[0035] In one embodiment, assuming the background is: processing an electronic invoice from a top-tier hospital that contains mixed Chinese and English terminology, such as "CT Examination Fee," the implementation steps include: Using a multimodal semantic segmentation network, the invoice is segmented into areas such as patient information, chargeable items, and medical insurance code, and associated with feature recognition text. A cross-language semantic mapping layer is activated to map CTExaminationFee to the standard field of image examination fee in the knowledge graph. The medical industry knowledge graph is combined to match the new version of the medical invoice template in 20XX, such as version 4.1, and the item code, unit price, and medical insurance settlement ratio are automatically filled in. However, if a logical conflict is detected between examination fee and drug fee, such as both being selected but without an associated medical order, manual review is triggered, and the correction is recorded and updated to version 4.2.

[0036] The beneficial effects achieved by the above content are as follows: Through user feedback and matching accuracy optimization mechanisms, the knowledge graph and template database can be dynamically adjusted, and new version templates can be automatically created to adapt to changes in business rules; combined with hotspot template prediction, the response speed and processing efficiency of the method are further improved; based on the timeliness matching mechanism and template version management, it is ensured that historical documents can accurately match the template version at that time, solving the problem of historical data processing caused by policy or format changes, and improving the flexibility and practicality of the method.

[0037] Working principle: This system collects document samples through big data, uses a semantic segmentation network for region segmentation and logical region identification, generates structured semantic data using a semantic analysis model, and integrates it with a knowledge graph. It then processes template matching tasks in parallel using a multi-core CPU, automatically switching templates and populating key information. Based on feedback, it optimizes the knowledge graph and template database, managing template versions to maintain historical compatibility. Real-time monitoring and optimization of task scheduling, along with preloading of frequently used templates, improves processing speed. This not only enhances the efficiency and accuracy of document processing but also strengthens the adaptability and flexibility of the method, meeting the needs of enterprises for high-performance document processing systems.

[0038] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0039] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for intelligent matching and quick switching of multi-dimensional document templates, characterized in that, The method comprises the following steps: Collecting various types of document samples using big data resources, and performing character recognition, word segmentation and syntax analysis on the text content in the documents through character recognition technology to extract original text information; Using a semantic segmentation network to perform region segmentation on the input document image, and setting a corresponding semantic label for each pixel region to identify different logical regions; According to the segmentation result, the position and contour of each semantic region are extracted, and the recognized original text information is associated with the corresponding semantic region; Using a semantic analysis model to perform semantic recognition and semantic classification on the original text information to generate structured semantic data; Performing semantic fusion of the structured semantic data with a pre-constructed knowledge graph, and based on the fused semantic information, combining a decision tree model to match multiple candidate document templates from a pre-set template database; When a new document is input, the template matching task is decomposed into feature extraction, decision tree preliminary screening, deep semantic matching, knowledge graph association query and result fusion and sorting based on a multi-core central processing unit, and is allocated to different core clusters for parallel processing to determine the corresponding document template; According to the matching result, automatically switching to the corresponding document template, and filling the key information in the document into the corresponding position of the template; Obtaining feedback information of the matching result, introducing a time stamp to manage the matching accuracy of each template, and optimizing the knowledge graph and the template database according to the feedback information and the matching accuracy.

2. The method for intelligent matching and quick switching of multi-dimensional bill templates according to claim 1, characterized in that, Using a semantic segmentation network to perform region segmentation on the input document image, and setting a corresponding semantic label for each pixel region, comprising: Inputting the document image into the visual encoder of the semantic segmentation network to generate multi-scale visual feature maps; Performing character recognition on the same document image, inputting the recognized text sequence into the text encoder to generate text features; At each spatial position of the visual feature map, the co-attention weight of the visual feature map and the text feature is calculated; According to the co-attention weight, the text semantic information is fused into the visual feature to generate a text-enhanced visual feature map; Reserving multiple feature layers of different depths and different resolutions in the text-enhanced visual feature map, performing dilated convolution on the topmost feature map in a parallel manner with different expansion rates, and layer by layer fusing high-level semantic features with low-resolution features to capture context information from local details to global layout; Up-sampling and refining the features of the multi-modal and multi-scale information to output the final pixel-level semantic segmentation map; According to the segmentation result, the position and contour of each semantic region are extracted, and the spatial topological relationship between regions is analyzed to construct a layout logical tree; According to the spatial coordinates of the recognized original text information, the original text information is associated with the corresponding semantic region, so that each pixel region is matched to the corresponding semantic label; Querying the prior rules of this type of document from the knowledge graph, and using the prior rules to logically verify the associated results to verify whether the regions segmented from the document image are adapted to the corresponding semantic labels.

3. The method for intelligent matching and quick switching of multi-dimensional bill templates according to claim 1, characterized in that, At each spatial position of the visual feature map, the co-attention weight of the visual feature map and the text feature is calculated, comprising: Retrieving each spatial position corresponding to the visual feature map; Extracting a window containing the spatial position p in a visual feature map according to a 3*3 local window centered at the spatial position p; Extracting feature vectors corresponding to all spatial positions in the window; Obtaining a spatial aggregation factor corresponding to the spatial position p by using the feature vectors of all positions in the window corresponding to the spatial position p; Obtaining a co-attention weight between each spatial position of the visual feature map and the text feature by using the text feature corresponding to the same invoice image to which the visual feature map belongs and the spatial aggregation factor corresponding to the spatial position p.

4. The method for intelligent matching and quick switching of multi-dimensional bill templates according to claim 3, characterized in that, Obtaining a co-attention weight between each spatial position of the visual feature map and the text feature by using the text feature corresponding to the same invoice image to which the visual feature map belongs and the spatial aggregation factor corresponding to the spatial position p, comprising: Retrieving the text feature corresponding to the same invoice image to which the visual feature map belongs; Obtaining a Euclidean norm corresponding to the text feature by using a text feature vector corresponding to the text feature; Retrieving the feature vector corresponding to the spatial position p and obtaining a Euclidean norm corresponding to the spatial position p according to the feature vector corresponding to the spatial position p; Obtaining a basic correlation parameter between the text feature and the spatial position p by using the Euclidean norm corresponding to the text feature and the Euclidean norm of the feature vector corresponding to the spatial position p for correlation processing; Retrieving the spatial aggregation factor corresponding to the spatial position p; Obtaining a co-attention weight between each spatial position of the visual feature map and the text feature by using the spatial aggregation factor corresponding to the spatial position p and the basic correlation parameter between the text feature and the spatial position p.

5. The method for intelligent matching and quick switching of multi-dimensional bill templates according to claim 1, characterized in that, Based on a multi-core central processing unit, a template matching task is decomposed into feature extraction, decision tree preliminary screening, deep semantic matching, knowledge graph association query, and result fusion and sorting, comprising: Preloading new invoice data into a to-be-processed path and retrieving the running state of all core clusters in the multi-core central processing unit; According to the type and complexity of the invoice, predicting the execution time of the task by using a prediction model, and performing task allocation and resource scheduling in advance; Dividing the preloaded invoice data into micro-batches, dynamically allocating tasks according to the current load of each core cluster, and allocating corresponding tasks to each core cluster; Collecting completed task results from each core cluster, performing weighted semantic fusion and sorting on all parallel task results of the same invoice, and generating a final candidate template list; Outputting the final matching result and recording the processing timestamp, cache hit rate, and core load of each invoice for subsequent analysis and optimization.

6. The method for intelligent matching and quick switching of multi-dimensional bill templates according to claim 1, characterized in that, According to the feedback information and the matching accuracy, optimizing the knowledge graph and the template database, comprising: Continuously collecting user feedback information, and if the user manually corrects or rejects the template matching result, automatically recording the correction content and the correction timestamp, and classifying the original template as a negative sample or a positive sample; Periodically calculating the matching accuracy of each version of the template, and if the accuracy is lower than a threshold or a business rule change is detected, automatically triggering the creation of a new version; The new version learns and optimizes from the knowledge graph through knowledge fusion technology to adapt to new business rules or format changes.

7. The method for intelligent matching and quick switching of multi-dimensional bill templates according to claim 6, characterized in that, If the accuracy is lower than a threshold or a business rule change is detected, automatically triggering the creation of a new version, comprising: Establish a template version evolution map to record the effective period, change content, and performance indicators of each version of the template; When a major change in business rules is detected, a new version of the template is automatically created, and the old version is kept for historical compatibility; During the matching process, the date range of the document to be processed is obtained, and the corresponding template version for the time period is automatically associated based on the date range, avoiding errors caused by policy backtracking; Based on user feedback, a template quality evaluation system is established to automatically reduce the weight or archive low-quality templates; Through a continuous learning mechanism, correct matching results are used as new samples and fed back to the training process.

8. The method for intelligent matching and quick switching of multi-dimensional bill templates according to claim 1, characterized in that, Further comprising the following steps: Establish a task priority evaluation mechanism to set processing priorities based on the urgency of the document and the level of the customer; Allocate exclusive computing resources to high-priority documents to minimize processing delays; Real-time monitoring of the task queue depth and response time of each core cluster, automatic elastic expansion when detecting task accumulation, and dynamic migration of tasks to idle cores; Establish a processing timeout warning mechanism to isolate and recover abnormal tasks.

9. The method for intelligent matching and quick switching of multi-dimensional bill templates according to claim 1, characterized in that, Further comprising the following steps: Establish a hot template prediction model based on historical processing records with timestamps to identify high-frequency matching templates in a specific time period or for a specific customer as hot templates; Vectorize the identified hot templates and related knowledge graph subgraphs and preload them into the shared cache of the multi-core central processing unit; When performing deep semantic matching and knowledge graph association queries, preferentially search and match in the shared cache; If the cache hits, route the corresponding task to a dedicated core for accelerated processing; If the cache misses, enter the regular processing flow and record the miss information for model optimization.

10. The method for intelligent matching and quick switching of multi-dimensional bill templates according to claim 9, characterized in that, Further comprising the following steps: Build a cross-language semantic mapping layer to uniformly encode the content of multi-language documents; When non-main language text is identified, an intelligent translation mechanism is started to preferentially use rule-based translation for professional terms and deep learning translation for general text; Perform semantic fusion on the translation results and the original text to generate a semantic vector representation; Based on the semantic vector, perform cross-language entity linking and relationship mapping in the knowledge graph to support template matching for multi-language documents.

Citation Information

Patent Citations

  • Document text recognition method and device, equipment and medium

    CN113902031A

  • Image report generation method, system and equipment based on multi-granularity knowledge fusion

    CN119851852A

  • Semi-structured file processing method based on LLMs large language model

    CN120218236A

  • Processor for database analytics processing

    US9830369B1

  • Image character structured output method and apparatus, and electronic device and storage medium

    WO2023246912A1