A medicine label intelligent auxiliary quality inspection method and system

CN122551375APending Publication Date: 2026-08-11GAOTENG PHARMACEUTICAL TECHNOLOGY (SHANGHAI) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-16
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

纯人工核对一份数十页且字号极小的多语言标签,通常需要资深质检人员高度用眼核对30分钟以上,极易因视觉疲劳发生漏看

Benefits of technology

[0018]综上所述,相较于纯人工离线比对以及仅依赖传统OCR或常规大模型实体提取的技术方案,本申请在实际应用中展现出如下技术优势与显著效果:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122551375A_ABST
    Figure CN122551375A_ABST
Patent Text Reader

Abstract

This application relates to the field of pharmaceutical quality control technology, and provides an intelligent assisted quality inspection method and system for pharmaceutical labels. The method includes: performing multilingual OCR recognition on the original pharmaceutical label image file, simultaneously obtaining structured coordinate data with geometric bounding box coordinates and plain text data; mechanically segmenting the plain text data into text blocks by a local program; using the full quality inspection requirement file as a unified reference background, forcibly binding it to each text block to form a full background association verification task exempt from prior semantic alignment; using multi-threaded concurrent calls to a large language model to perform semantic comparison and output a difference sub-report; determining the character positions of the differing original text fragments through a fuzzy matching algorithm, reversely retrieving the geometric bounding box coordinates and obtaining the absolute page number and pixel position through coordinate fusion, and generating a highlighted positioning mark at the corresponding position in the original image. This application reduces the risk of missed inconsistencies due to model alignment errors, thereby improving quality inspection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of pharmaceutical quality control technology, specifically to an intelligent assisted quality inspection method and system for pharmaceutical labels. Background Technology

[0002] In pharmaceutical manufacturing and clinical trial settings, the quality control and verification of pharmaceutical booklets / labels and packaging instructions is an extremely critical and error-free task. The variable information and fixed text contained on the labels, such as drug ingredients, dosage specifications, batch number, expiration date, and storage conditions, must be consistent with the clinical protocol, the customer's original packaging confirmation form (PCS), or quality control specifications—the so-called "requirements."

[0003] However, traditional pharmaceutical label verification and quality inspection processes face the following problems in practical applications: 1. Multilingual and highly non-standard layout, resulting in lengthy manual processing time: Pharmaceutical labels are often designed for multiple global markets, including Chinese, English, French, German, Malay, and other languages. The layout formats vary widely, often existing as images, PDFs, or unstructured scanned documents. Manually checking a multilingual label of dozens of pages with extremely small font size typically requires experienced quality inspectors to scrutinize it for over 30 minutes, making it highly susceptible to overlooking details due to eye strain.

[0004] 2. The cost of errors is extremely high, and mistakes cannot be tolerated: The unique nature of the pharmaceutical industry means that even the slightest error (such as missing a decimal point in the dosage, misspelling the country name, or incorrect expiration month) can lead to serious compliance issues, returns and claims, and even endanger patients' lives. Therefore, the quality control process cannot be entirely replaced by machines and must be finalized manually.

[0005] 3. Traditional segmented alignment verification mechanisms are highly susceptible to failure: Existing document comparison schemes based on large language models often employ a preprocessing step of "entity extraction" or "semantic alignment," where the model first determines "which requirement specification this line of tag text corresponds to," and then performs a targeted comparison. However, when faced with extremely messy and unstructured long medical documents, this "LLM alignment" pre-processing step is highly unstable. Once the alignment judgment is flawed, segment mismatches and missed inconsistencies (generating empty difference reports) will occur, leading to the penetration of the quality inspection network.

[0006] 4. Lack of intuitive original image mapping for comparison, making user positioning difficult: General large-scale model comparisons can only generate "text-level" difference analyses, such as "10mg in the label should be 20mg in the requirement." However, for dozens of pages of original non-standard labels filled with dense small print, quality inspectors still cannot quickly find "which page and specific location of this erroneous text" on the original image after receiving this text prompt, which greatly reduces the system's auxiliary value. Summary of the Invention

[0007] To help solve the above-mentioned technical problems, this application provides a method and system for intelligent auxiliary quality inspection of pharmaceutical labels.

[0008] Firstly, this application provides an intelligent assisted quality inspection method for pharmaceutical labels, comprising: Multilingual optical character recognition is performed on the original image file of the medical label, and structured coordinate data with geometric bounding box coordinates and plain text data that retains physical line breaks and layout structure are obtained simultaneously. A mapping index relationship is established between the offset position of characters or words in the plain text data and the geometric bounding box coordinates in the structured coordinate data. The token density and total number of tokens of the plain text data are calculated by the local program, and the plain text data is mechanically divided into one or more text blocks by finding empty lines, table edges or physical dividing lines as cutting anchors, with a preset token budget as the upper limit. Flatten the full quality inspection requirement document, combine each text block with the flattened full quality inspection requirement text into the same model input task, so that each model input task includes the text block and the reference background covering the full quality inspection requirement document, and does not filter the reference background based on the pre-matching results between the tag block and the requirement clause, thus forming a full background association verification task set. By using multi-threaded concurrent calls to the large language model, the semantic comparison of each full-scale background association verification task is performed in parallel, and the difference sub-report is output. For the difference in the original text segment pointed out in the difference sub-report, the character position of the difference in the original text segment in the plain text data is determined by the fuzzy matching algorithm based on the plain text data. The corresponding geometric bounding box coordinates are then retrieved from the structured coordinate data based on the character position. After coordinate fusion, the absolute page number and pixel position of the difference on the original image file of the medical label are obtained, and a highlighted positioning mark is generated at the corresponding position in the original image.

[0009] The structured coordinate data stores a unique identifier, page number, line number, and two-dimensional spatial coordinate parameter pair for each identified text line or word; the mapping index relationship is recorded in the coordinate-text mapping index table.

[0010] The mechanical cutting process includes: Calculate the token density of each line in the plain text data and the total number of tokens in the entire text; If the total number of tokens does not exceed the preset token budget, the entire text will be preserved as a single text block. If the total number of tokens exceeds the preset token budget, then when the accumulated tokens approach the upper limit of the preset token budget, empty lines, table edges, or physical separators are preferentially selected as cutting anchors to truncate the text and generate multiple text blocks with consecutive start and end line numbers.

[0011] After flattening the full-volume quality inspection requirement document, it also includes: Verify whether the total number of tokens after flattening exceeds the preset demand packaging budget window; If the required package budget window is exceeded, the full quality inspection requirement file is divided into multiple background groups according to physical boundaries, and each text block is combined with each background group to form the same model input task, so that each model input task includes the text block and the reference background covering the corresponding background group, thus constructing a cross-linked full background association verification task.

[0012] When using multi-threaded concurrent calls to the large language model, a preset system comparison instruction containing inconsistency audit rules and user-input auxiliary task description information are injected into the large language model.

[0013] The fuzzy matching algorithm is either the longest common subsequence algorithm or a sliding window algorithm based on edit distance; the step of determining the character position of the differing original text fragment in the plain text data using the fuzzy matching algorithm, and retrieving the corresponding geometric bounding box coordinates from the structured coordinate data based on the character position, specifically includes: Locate the matching region in the plain text data that has the smallest edit distance to the original text fragment with a similarity greater than a preset threshold, and obtain the character start and end offset range of the matching region. Retrieve the geometric bounding box coordinates of all characters or words located within the character start and end offset range in the structured coordinate data; The retrieved geometric bounding box coordinates are merged into polygon pixels, and the absolute page number and pixel position of the difference are output.

[0014] After outputting the difference sub-reports and before performing the reverse retrieval, the process further includes: fusing the difference sub-reports, deduplicating and assembling the difference sub-reports returned by multiple concurrent threads according to the physical page order of the tags, fusing them to generate a unified master quality inspection report, and extracting the difference original text fragments from it.

[0015] The highlighted positioning mark is a rectangular mark frame dynamically drawn at the corresponding position in the original image file of the medical label based on the absolute page number and pixel position; when the quality inspector clicks the difference card on the front-end interactive interface, the page is automatically redirected and the drawing of the highlighted positioning mark is completed.

[0016] Secondly, this application provides an intelligent auxiliary quality inspection system for pharmaceutical labels, used to perform the method as described in any one of the first aspects, comprising: The front-end interaction layer integrates a tag image upload interface, a reference document input interface, a red-boxed highlight difference visualization panel, an interactive positioning navigator, and a quality inspection report download module. The OCR recognition engine layer includes a multimodal OCR recognition engine and a mechanical physical slicing module. The multimodal OCR recognition engine performs image preprocessing pipeline processing on the original medical label image file, performs text detection through a multilingual text detection network, performs automatic label region segmentation, and records physical coordinates line by line or block by block. It outputs structured coordinate data with geometric bounding box coordinates and plain text data that retains the physical layout structure, and establishes a coordinate-text mapping index table to record the mapping index relationship between the offset position of characters or words in the plain text data and the geometric bounding box coordinates in the structured coordinate data. The mechanical physical slicing module is used by a local program to calculate the token density and total token amount of the plain text data, and with a preset token budget as the upper limit, it mechanically slices the plain text data into text blocks by finding empty lines, table edges, or physical dividing lines as cutting anchor points. The semantic association layer includes a full-text background association module, which includes a reference specification parser, a semantic segmentation and alignment engine, a full-text context injection and comparison task orchestrator. The full-text background association module is used to take the flattened full-text quality inspection requirement document as a reference background, and combine each text block with the reference background into the same model input task. This ensures that each model input task includes the text block and the reference background that covers the full-text quality inspection requirement document, and does not filter the reference background based on the pre-matching results between the tag blocks and the requirement clauses, thus forming a full-text background association verification task. The comparison engine layer includes a multi-threaded parallel semantic comparison engine and a reverse coordinate localization engine. The multi-threaded parallel semantic comparison engine is equipped with a thread pool scheduler, a large model semantic inference unit, a difference classifier, and confidence scoring and aggregation, which are used to perform parallel semantic comparison on each of the full-scale background association verification tasks and output difference sub-reports. The reverse coordinate localization engine is used to map the difference original text fragments pointed out in the difference sub-reports to physical coordinates and calculate the coordinates marked in red boxes. The data and communication layer includes a unified data bus, a task queue manager, and result caching and persistent storage, providing data scheduling, caching, and persistence support for modules in each layer.

[0017] The reverse coordinate positioning engine is specifically used to: use the plain text data as a reference, determine the character positions of the difference original text fragments through a fuzzy matching algorithm, and thereby retrieve the geometric bounding box coordinates from the structured coordinate data in reverse, and obtain the absolute page number and pixel position of the difference on the original image file of the medical label after coordinate fusion; the front-end interaction layer dynamically draws a highlighted positioning mark on the red-framed highlight difference visualization panel according to the absolute page number and pixel position, and realizes automatic page jump when the difference card is clicked through the interactive positioning navigator.

[0018] In summary, compared with purely manual offline comparison and technical solutions that rely solely on traditional OCR or conventional large-scale model entity extraction, this application demonstrates the following technical advantages and significant effects in practical applications: 1. For complex, multilingual, and non-standard pharmaceutical labels and packaging confirmation forms (PCS), traditional human-based inspection methods are often time-consuming and prone to causing visual fatigue. The multi-threaded parallel semantic comparison pipeline constructed in this application enables the system to quickly complete full verification, automatically identify all suspected discrepancies, and significantly reduce the verification cycle.

[0019] 2. This application abandons the unstable pre-alignment large model step and adopts a memory-level ultra-large context full-background alignment-free verification mechanism. By placing each tag physical slice under the global view of the entire requirement document for penetrating comparison, the risk of false negatives and illusions caused by semantic alignment deviations is reduced from the underlying physical logic.

[0020] 3. Relying on local fuzzy text alignment and reverse original text physical coordinate positioning mechanisms, discrete text-level differences are mapped to the original image pixel coordinate system in real time. Quality inspectors can trigger the canvas's "second-level positioning and red-box guidance" through difference cards, practicing the "intelligent co-pilot" assisted quality inspection concept and optimizing the human-machine collaboration process. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of the intelligent auxiliary quality inspection method for pharmaceutical labels based on multimodal OCR localization and full semantic comparison according to this application; Figure 2 This is a diagram illustrating the architecture of the intelligent auxiliary quality inspection system for pharmaceutical labels based on multimodal OCR localization and full semantic comparison, as described in this application.

[0022] Figure labeling: 101-Front-end input module; 102-Quality inspection requirement document / reference specification; 201-Local multilingual OCR high-precision recognition engine; 201a-Image preprocessing and enhancement; 201b-Multilingual text detection and recognition; 201c-Character-level physical coordinate extraction; 301-Full reference background verification task construction module; 301a-Semantic segmentation engine; 301b-Reference specification knowledge loading; 301c-Comparison task queue generation; 401-Multi-threaded parallel semantic comparison engine; 401a-Large model semantic reasoning core; 401b-Difference classification and confidence assessment ; 501 - Reverse Original Text Physical Coordinate Positioning Mechanism; 501a - Difference Text → Original Coordinate Inverse Mapping; 501b - Generation of Two-Dimensional Spatial Illuminated Red-Frame Annotations; 601 - Front-End Quality Inspection Result Visualization Feedback; 601a - Interactive Difference Navigation; 601b - Quality Inspection Report Generation; A100 - Front-End Interaction Layer; A101 - Front-End Interactive Quality Inspection Cabin; A101a - Tag Image Upload Interface; A101b - Reference Document Input Interface; A101c - Red-Frame Highlighted Difference Visualization Panel; A101d - Interactive Positioning Navigator; A101e - Quality Inspection Report Download Module; A200 - OCR Recognition Engine Layer; A201 - Multimodal OCR Recognition Engine; A201a - Image Preprocessing Pipeline; A201b - Multilingual Character Detection Network; A201c - Character Recognition and Confidence Output; A202 - Mechanical Physical Slicing Module; A202a - Automatic Label Region Segmentation; A202b - Line-by-Line / Block-by-Block Physical Coordinate Recording; A202c - Coordinate-Text Mapping Index Table; A300 - Semantic Association Layer; A301 - Full Background Association Module; A301a - Reference Specification Parser; A301b - Semantic Slicing and Alignment Engine; A301c - Full Context Background... Scene Injection; A301d - Comparison Task Orchestrator; A400 - Comparison Engine Layer; A401 - Multi-threaded Concurrent Semantic Comparison Engine; A401a - Thread Pool Scheduler; A401b - Large Model Semantic Inference Unit; A401c - Difference Classifier; A401d - Confidence Scoring and Convergence; A402 - Inverse Coordinate Positioning Engine; A402a - Difference Text → Physical Coordinate Inverse Mapping; A402b - Coordinate Calculation (marked in red); A500 - Data and Communication Layer; A501 - Unified Data Bus; A502 - Task Queue Manager; A503 - Result Caching and Persistent Storage. Detailed Implementation

[0023] The present application will be further described below with reference to the accompanying drawings. The principles of the present application are very clear to those skilled in the art. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

[0024] The following is a standardized translation of the technical terms, foreign abbreviations, and multilingual tags used in this article for your reference: Booklet / Label - Instructions / Labels; PCS (Packaging Confirmation Sheet) - Packaging Confirmation Form; Requirement - Requirements document; Token; LCS (Longest Common Subsequence) Edit Distance; bounding box - the area surrounding the object. Box Fusion - Pixel merging; diff_items - Validation items; fail - Inconsistent item; target_match - bidirectional coordinate matching; poly_norm - Normalized polygon coordinates; Lot No. - Batch number; Pour essais uniquement - For testing purposes only; For clinical trials only; Store between 2℃ and 8℃. Store below 25°C. EXP DATE: 2028-11 - Valid until November 2028; The expiry date shall be November 2029.

[0025] Figure 1This is a flowchart illustrating the intelligent auxiliary quality inspection method for pharmaceutical labels based on multimodal OCR localization and full semantic comparison. The overall process is as follows: First, the original drug label image and quality inspection requirement document / reference specification 102 are received by the front-end input module 101 at the input layer. Then, the data is sent to the local multilingual OCR high-precision recognition engine 201, where it undergoes image preprocessing and enhancement 201a, multilingual text detection and recognition 201b, and character-level physical coordinate extraction 201c. Simultaneously, two types of data are output: a text content sequence and a coordinate mapping table. Next, the full reference background verification task construction module 301 receives the above data and completes the process through the semantic segmentation engine 301a, reference specification knowledge loading 301b, and comparison task queue generation 301c. The system constructs a full-scale background association verification task without prior alignment. The verification task is then distributed to a multi-threaded parallel semantic comparison engine 401. Through multiple concurrent threads, relying on the large-model semantic reasoning core 401a, a full-scale semantic comparison is completed, followed by difference classification and confidence assessment 401b to output a difference sub-report. Then, the reverse original text physical coordinate positioning mechanism 501 performs the difference text → original coordinate inverse mapping 501a, generating the annotation parameters required for two-dimensional spatial glowing red box annotation generation 501b. Finally, the front-end quality inspection result visualization feedback 601 outputs the quality inspection results, providing interactive difference navigation 601a and quality inspection report generation 601b functions. It also supports the return of manual review results to the input layer for iterative review, forming a complete intelligent assisted quality inspection closed loop.

[0026] Step S1: Receive the file.

[0027] The task control unit receives the original image files of pharmaceutical labels to be inspected and the full-scale quality inspection requirement document. The original pharmaceutical label images are typically multilingual label images or PDF files, containing key information such as drug ingredients, dosage specifications, batch number, expiration date, and storage conditions. The full-scale quality inspection requirement document is the benchmark document required during the quality inspection process; it can be a clinical protocol, the customer's original packaging confirmation form, quality inspection specifications, etc., and the format may include, but is not limited to, text files, Word documents, and PDF files. Simultaneously, users can input auxiliary task description information through the front end to guide the focus of subsequent semantic comparison.

[0028] Step S2: Multilingual OCR recognition and coordinate extraction.

[0029] The multimodal OCR recognition engine A201 performs high-precision optical character recognition on the received original image file of the medical label. The core extraction process includes two parts: First, it outputs structured coordinate data with physical geometric bounding boxes and coordinate positions, where each recognized text line or word stores a unique identifier, page number, line number, and two-dimensional spatial coordinate parameter pair [(x1,y1),(x2,y2),(x3,y3),(x4,y4)]; Second, it outputs plain text data without redundant formatting, containing only line breaks and text, which preserves the physical line breaks and layout structure of the original label. Simultaneously, a mapping index relationship is established between the offset positions of characters or words in the plain text data and the geometric bounding box coordinates in the structured coordinate data. This mapping index relationship is recorded in the coordinate-text mapping index table A202c; wherein the structured coordinate data stores a unique identifier, page number, line number, and two-dimensional spatial coordinate parameter pair for each recognized text line or word. The row-by-row / block-by-block physical coordinate records A202b and the coordinate-text mapping index table A202c in the mechanical physical slicing module A202 jointly support the establishment of this mapping relationship and subsequent retrieval.

[0030] Step S3: Mechanical physics slicing with zero large model consumption.

[0031] The mechanical physical slicing module A202 receives plain text data and performs mechanical segmentation by a local program without invoking any large language model. This module automatically divides the label regions using the label region segmentation module A202a. Its core algorithm logic can be described by the following pseudocode: def build_mechanical_chunks(label_lines,token_per_line,chunk_limit): chunks=[] current_chunk=[] current_tokens=0 chunk_id=1 for line_idx,lineinenumerate(label_lines): line_tokens=token_per_line[line_idx] if current_tokens+line_tokens>chunk_limitandcurrent_chunk: Find the optimal truncation line (prioritize blank lines and physical page breaks separated by horizontal lines). cut_idx=find_optimal_break_line(current_chunk) Physically cut and output a physical chunk chunks.append(emit_chunk(current_chunk[:cut_idx],chunk_id)) chunk_id+=1 current_chunk=current_chunk[cut_idx:] current_tokens=sum(token_per_line[line_idx-len(current_chunk):line_idx]) current_chunk.append(line) current_tokens += line_tokens if current_chunk: chunks.append(emit_chunk(current_chunk,chunk_id)) return chunks The specific process of the mechanical cutting is as follows: Calculate the token density of each line in the plain text data and the total number of tokens in the entire text; If the total number of tokens does not exceed the preset token budget, the entire text will be preserved as a single text block. If the total number of tokens exceeds the preset token budget, then when the accumulated tokens approach the upper limit of the preset token budget, empty lines, table edges, or physical separators are preferentially selected as cutting anchors to truncate the text and generate multiple text blocks with consecutive start and end line numbers.

[0032] The segmentation process is executed by local logic, with zero calls to the large model. This mechanical segmentation preserves the original typesetting logic and page number delimiters, providing regular input for subsequent high-density semantic comparison.

[0033] Step S4: Package all requirements files and build a complete background verification task without cross-checking.

[0034] The full-text background packer reads all quality inspection requirement files and flattens them into continuous text. If the total number of tokens after flattening is within the preset requirement packing budget window, the entire quality inspection requirement file is directly used as a unified reference background; if it exceeds the window, a greedy packing algorithm is executed, dividing the requirement files into multiple background groups according to physical file boundaries, so that the number of tokens in each group is controlled. Subsequently, the full-text background association module A301 combines each text block with the flattened full-text quality inspection requirement text into the same model input task, so that each model input task includes the text block and the reference background covering the entire quality inspection requirement file, and does not filter the reference background based on the pre-matching results between the tag block and the requirement clause, thus forming a set of full-text background association verification tasks.

[0035] If the total number of tokens in the flattened full-volume quality inspection requirement document exceeds the preset requirement packaging budget window, the full-volume quality inspection requirement document is divided into multiple background groups according to physical boundaries, and each text block is combined with each background group to form the same model input task, so that each model input task includes the text block and the reference background covering the corresponding background group, thus constructing a cross-linked full-volume background association verification task.

[0036] This design ensures that in each comparison, the tag blocks can undergo a complete and saturated semantic comparison within the entire set of the requirements document, eliminating the risk of missed inconsistencies caused by alignment errors in the preceding large language model from a physical structure perspective.

[0037] Step S5: Multi-threaded concurrent full semantic comparison.

[0038] The multi-threaded concurrent semantic comparison engine A401 starts the thread pool scheduler A401a, which uses concurrent multi-threading technology to concurrently capture all full-scale background association verification tasks. Each thread independently calls the large model semantic inference unit A401b, injecting the large language model with preset system comparison instructions containing inconsistency audit rules and user-input auxiliary task description information. In a single call session, the large language model autonomously completes the association matching between the current tag block and the full set of requirement backgrounds. Based on the attention mechanism, it identifies differences or omissions in spelling, grammar, dosage specifications, date batches, indications, and other dimensions across the entire context, and outputs a structured difference sub-report, including difference type, tag original text fragment, requirement corresponding fragment, difference description, and confidence score. The difference classifier A401c and the confidence score and aggregation A401d are responsible for classifying the difference type and scoring and aggregating the confidence scores of the results from each thread, respectively. Multi-threaded parallelism significantly shortens the full-scale verification time.

[0039] Step S6: Difference sub-report fusion and reverse physical coordinate positioning.

[0040] After outputting the difference sub-reports and before performing reverse coordinate retrieval, the difference sub-reports are first fused: Multiple difference sub-reports returned by concurrent threads are deduplicated in terms of time sequence and content according to the tag physical page order, fused to generate a unified master quality inspection report, and the difference original text fragments are extracted from it. Then, for the extracted difference original text fragments, a reverse original text physical coordinate positioning mechanism is initiated: The fuzzy matching algorithm is either the longest common subsequence algorithm or a sliding window algorithm based on edit distance; the process of determining the character position and retrieving the coordinates in reverse includes: (1) Locate the matching region in the plain text data that has the smallest editing distance from the difference original text fragment and a similarity greater than a preset threshold (which can be 95% in this embodiment of the application) and obtain the character start and end offset range of the matching region. (2) Retrieve the geometric bounding box coordinates of all characters or words located within the character start and end offset range in the structured coordinate data; (3) Perform polygon pixel merging on the retrieved geometric bounding box coordinates, and output the absolute page number and pixel position where the difference is located.

[0041] This mechanism successfully breaks down the barrier between the semantic space of a large language model and the physical space of the original image, enabling end-to-end tracing from textual differences to the coordinates of the original image.

[0042] Step S7: Visual interaction and highlighting of positioning markers.

[0043] The front-end interaction layer receives the main quality inspection report and coordinate mapping, providing an immersive quality inspection dashboard: the left side displays a two-column comparison of the requirement clauses and label content, with discrepancies highlighted in different colors; the right side displays the original label image. The highlighted positioning marker is a dynamically drawn rectangular frame based on the absolute page number and pixel position in the corresponding location of the original pharmaceutical label image file. When the quality inspector clicks on a discrepancy card in the front-end interaction interface, the page automatically redirects and the highlighted positioning marker is drawn, accurately locating the discrepancy text. The system also provides one-click export of the quality inspection report and a manual correction feedback area, completing the auxiliary quality inspection loop.

[0044] Combination Figure 2 This application also provides an intelligent auxiliary quality inspection system for pharmaceutical labels, which adopts a five-layer hierarchical structure. Each layer can be deployed on independent or shared hardware resources, and data can be exchanged between layers through standardized interfaces.

[0045] Layer 1: Front-end Interaction Layer A100. The core is the front-end interactive quality inspection cabin A101, which integrates a label image upload interface A101a, a reference document input interface A101b, a red-framed highlighted difference visualization panel A101c, an interactive positioning navigator A101d, and a quality inspection report download module A101e. The front-end interaction layer dynamically draws highlighted positioning markers on the red-framed highlighted difference visualization panel based on the absolute page number and pixel position, and automatically redirects the page when a difference card is clicked through the interactive positioning navigator. Quality inspectors upload the original label files and requirement documents through a browser or client, view the two-column difference comparison view, and trigger automatic positioning and highlighting of the original image by clicking on the difference card.

[0046] The second layer: OCR recognition engine layer A200. It includes a multimodal OCR recognition engine A201 and a mechanical physical slicing module A202. The multimodal OCR recognition engine A201 performs image preprocessing pipeline processing on the original medical label image file, performs text detection through a multilingual text detection network, performs automatic label region segmentation, and records physical coordinates line by line or block by block. It outputs structured coordinate data with geometric bounding box coordinates and plain text data that retains the physical layout structure. It also establishes a coordinate-text mapping index table A202c to record the mapping index relationship between the offset positions of characters or words in the plain text data and the geometric bounding box coordinates in the structured coordinate data. The structured coordinate data stores a unique identifier, page number, line number, and two-dimensional spatial coordinate parameter pair for each recognized text line or word.

[0047] The mechanical physical slicing module A202 uses the local algorithm shown in the pseudocode above to complete text segmentation without consuming a large amount of model computing power. It is used by the local program to calculate the token density and total token amount of the plain text data, and with a preset token budget as the upper limit, it mechanically segments the plain text data into text blocks by finding empty lines, table edges or physical separators as cutting anchor points. The module also includes a line-by-line / block-by-block physical coordinate record A202b, which is used to accurately record the physical coordinates of each text block, providing support for subsequent reverse positioning.

[0048] The third layer: Semantic association layer A300. Its core is the full-scale background association module A301, which includes a reference specification parser A301a, a semantic segmentation and alignment engine A301b, a full-scale contextual background injection A301c, and a comparison task orchestrator A301d. The full-scale background association module uses the flattened full-scale quality inspection requirement document as a reference background. It combines each text block with this reference background into the same model input task, ensuring that each model input task includes the text block and a reference background covering the full-scale quality inspection requirement document. The reference background is not filtered based on pre-matching results between tag blocks and requirement clauses, thus forming a full-scale background association verification task. If the full-scale quality inspection requirement document exceeds the requirement packaging budget window, it is divided into multiple background groups according to physical boundaries. Each text block is then combined with each background group to form the same model input task, constructing cross-functional full-scale background association verification tasks. It should be noted that the "alignment" in the "semantic segmentation and alignment engine" here refers only to the semantic connection and format normalization of the segmentation of the requirement text itself, and does not involve the pre-matching alignment between the tag text and the requirement clauses; the core innovation of this solution is to eliminate the pre-matching step of tag-requirement clauses, which belong to different technical levels.

[0049] The fourth layer: Comparison Engine Layer A400. This includes a multi-threaded concurrent semantic comparison engine A401 and a reverse coordinate positioning engine A402. The multi-threaded concurrent semantic comparison engine A401 has a thread pool scheduler A401a, a large-model semantic inference unit A401b, a difference classifier A401c, and a confidence score and aggregation unit A401d, used to perform semantic comparisons in parallel and output difference sub-reports. The reverse coordinate positioning engine is specifically used to: use the plain text data as a reference, determine the character positions of the differing original text fragments through a fuzzy matching algorithm, and accordingly retrieve the geometric bounding box coordinates from the structured coordinate data. After coordinate fusion, the absolute page number and pixel position of the difference on the original image file of the medical label are obtained.

[0050] Layer 5: Data and Communication Layer A500. Composed of a unified data bus A501, a task queue manager A502, and a result cache and persistent storage A503, it provides asynchronous task scheduling, high-concurrency request buffering, result caching, and persistent storage support for all upper-layer modules, ensuring system stability and response speed under heavy loads.

[0051] Combination Figure 1 and Figure 2 It can be seen that, Figure 1 The methods and steps shown are as follows Figure 2 The system architecture shown is not two independent solutions, but rather a unified expression of the same self-evolving quality inspection system across different dimensions. Figure 1 It focuses on a dynamic perspective of process sequence. Figure 2Focusing on the static perspective of module deployment, the two are deeply coupled through the following correspondence, together forming a complete intelligent auxiliary quality inspection solution for pharmaceutical labels.

[0052] Specifically, Figure 1 The front-end input module 101 and the received original drug label image and quality inspection requirement document / reference specification 102 correspond to... Figure 2 The label image upload interface A101a and the reference document input interface A101b of the front-end interactive quality inspection cabin A101 in the front-end interaction layer A100 undertake the system input function.

[0053] Figure 1 The local multilingual OCR high-precision recognition engine 201 and its subunits image preprocessing and enhancement 201a, multilingual text detection and recognition 201b, and character-level physical coordinate extraction 201c correspond to... Figure 2 The multimodal OCR recognition engine A201 is located in the OCR recognition engine layer A200. Specifically, image preprocessing and enhancement 201a corresponds to the image preprocessing pipeline A201a; multilingual text detection and recognition 201b corresponds to the multilingual text detection network A201b and character recognition and confidence output A201c; and character-level physical coordinate extraction 201c corresponds to line-by-line / block-by-block physical coordinate recording A202b and coordinate-text mapping index table A202c. Furthermore... Figure 1 The implicit mechanical physical slicing step in the methodology, after OCR and before task construction, corresponds to... Figure 2 The A202 module of the mechanical physical slicing module completes text segmentation with zero large model consumption using a local algorithm.

[0054] Figure 1 The full reference background verification task construction module 301 and its sub-units semantic sharding engine 301a, reference specification knowledge loading 301b, and comparison task queue generation 301c correspond to... Figure 2 The semantic association layer A300 contains the full context association module A301. Specifically, semantic sharding engine 301a corresponds to semantic sharding and alignment engine A301b, reference specification knowledge loading 301b corresponds to reference specification parser A301a and full context background injection A301c, and comparison task queue generation 301c corresponds to comparison task orchestrator A301d.

[0055] Figure 1 The multi-threaded parallel semantic comparison engine 401 and its multi-path concurrent threads T1 to Tn, the large model semantic inference core 401a, and the difference classification and confidence evaluation 401b are included. Figure 2The comparison engine layer A400 contains a multi-threaded concurrent semantic comparison engine A401. Among them, T1 to Tn correspond to the thread pool scheduler A401a, the large model semantic reasoning core 401a corresponds to the large model semantic reasoning unit A401b, and the difference classification and confidence evaluation 401b corresponds to the difference classifier A401c and the confidence score and convergence A401d.

[0056] Figure 1 The reverse original text physical coordinate positioning mechanism 501 and its sub-unit difference text → original coordinate inverse mapping 501a, and the generation of two-dimensional space glowing red box annotations 501b, correspond to Figure 2 Compare the inverse coordinate positioning engine A402 in engine layer A400. Among them, the difference text → original coordinate inverse mapping 501a corresponds to the difference text → physical coordinate inverse mapping A402a, and the two-dimensional space luminous red box annotation generation 501b corresponds to the red box annotation coordinate calculation A402b.

[0057] Figure 1 The front-end quality inspection result visualization feedback 601 and its sub-units interactive difference navigation 601a, quality inspection report generation 601b, and iterative re-inspection closed loop are included. Figure 2 The output interactive components in the front-end interaction layer A100. Among them, interactive difference navigation 601a corresponds to the red-boxed difference visualization panel A101c and interactive positioning navigator A101d; quality inspection report generation 601b corresponds to the quality inspection report download module A101e; iterative re-inspection closed loop corresponds to... Figure 2 The manual re-inspection results are fed back to the system via the control flow, and the verification feedback link is re-initiated.

[0058] also, Figure 1 Data flow transmission, task scheduling, and data storage between modules are all handled by... Figure 2 The lowest-level data and communication layer, A500, provides unified support: cross-module data interaction is carried by the unified data bus A501, task queue management and scheduling are handled by the task queue manager A502, and the caching and persistence of original files, recognition results and difference reports are completed by the result caching and persistent storage A503.

[0059] The key technical features of this application are hereby specifically highlighted: Feature 1: Full-scale correlation validation design for ultra-large context background without alignment.

[0060] Traditional text comparison typically involves first using a large language model to perform alignment algorithms, mapping tag chunks to specific clauses in the requirements document before comparison. If an alignment error occurs, the chunk is skipped, leading to deadlock and missed detections. This application directly abandons the pre-alignment step, loading the entire requirements document as an indivisible common background all at once. Benefiting from the high-capacity input limit of the large model (e.g., a single call input budget of up to 500K tokens), while the entire requirements document in the pharmaceutical industry is typically less than 350K tokens after expansion, the system packages the entire requirements as a constant background. Each tag chunk is then assigned an independent verification task with this constant background and sent accordingly. In the model's attention weights, the model automatically identifies which clauses in the full requirements best match the current tag chunk within the overall context, and what conflicts exist. This physical binding mechanism eliminates any possibility of missed detections or skipped detections due to pre-alignment errors at the source, ensuring a high comparison pass rate.

[0061] In this embodiment of the application, the measured data of 230 quality inspection operations in the production environment verified that the physical binding mechanism can achieve 100% coverage of all requirements, reduce the risk of missed detection caused by pre-alignment errors at the link level, and achieve full recall of all 768 real differences, with no missed detection due to alignment issues.

[0062] Feature 2: Zero-scale model call overhead and layout that preserves mechanical physical slicing.

[0063] While large models are intelligent, using them for text segmentation easily leads to the loss of original margins, blank lines, and table layouts, and increases unnecessary token consumption and network latency. This application proposes a lightweight local algorithm for mechanical segmentation with zero large model consumption. As shown in the pseudocode in step S3, based on token density calculation, greedy truncation, and physical anchor selection, it ensures that the segmented tag blocks maintain a very high token padding density and completely preserves the original PDF's line break logic and page number segmentation marks. The entire process does not consume the computational power of a large model, providing highly regularized, high-density input for subsequent concurrent semantic comparison.

[0064] In the embodiments of this application, actual test data show that the median time for a single operation of this mechanical slicing step is 0.0 seconds, with no large model computing power consumption. While completely preserving the original layout structure, it provides high-density, low-loss input for subsequent comparison.

[0065] Feature 3: Reverse original text physical coordinate positioning mechanism.

[0066] The large model's returned difference reports can only provide string content, such as indicating that "EXP DATE:2028-11" in the label does not match "Expiry Date shall be Nov 2029" in the requirement. To help quality inspectors quickly locate the discrepancies in the original image, the system implements high-dimensional fuzzy alignment from text to physical image coordinates. Specifically: the original text fragments are used to locate character offsets in plain text data that preserves physical layout using either the longest common subsequence algorithm or an edit distance-based fuzzy matching algorithm; subsequently, the location locator searches for all word-level geometric bounding boxes within the offset interval in the structured coordinate data, performs polygon pixel merging, and dynamically outputs the absolute page number and pixel coordinate range of the text in the original multi-page PDF / image. This mechanism successfully breaks down the barrier between the semantic space of the large model and the physical space of the original image.

[0067] In the embodiments of this application, actual test data in the production environment show that the mechanism can achieve bidirectional coordinate positioning for 86.9% of the difference items, and 76.6% of the difference items can carry word-level physical bounding box coordinates. All coordinates are obtained through deterministic logic calculations, without relying on the spatial output of the large model, thus fundamentally avoiding the shortcomings of inaccurate spatial positioning of the large model.

[0068] Example 1: Intelligent verification of complex multilingual non-standard labels.

[0069] Taking a multi-center international clinical trial by Gaoteng Pharmaceuticals as an example, quality inspectors needed to verify an 18-page scanned PDF of non-standard labels containing a mix of English, French, and Korean text. Simultaneously, they uploaded a requirement document package containing four Word-format contracts and packaging details, totaling approximately 180K tokens. After OCR recognition, the system generated plain text and structured coordinate data. The mechanical slicing module divided the entire document into three text blocks using page line breaks as anchor points. The entire requirement document served as a unified background, forcibly bound to the three blocks to construct a verification task. The multi-threaded concurrent semantic comparison engine A401 scheduled three threads, identifying the inconsistency between the storage condition "Store below 25℃" on page 12 of the label and the requirement "Store between 2℃ and 8℃" within approximately 30 seconds. The reverse coordinate positioning engine A402 located the corresponding coordinates on page 12 through fuzzy matching, and the front end drew a highlighted positioning mark. The quality inspector completed the review within 2 seconds.

[0070] Example 2: Alignment of blurred text under typographic distortion and printing noise.

[0071] For a label whose Thai and French text layout was distorted due to scanning tilt and ink smudging, OCR recognition resulted in character breaks, such as "DIX COMPRIMES" being identified as "D1X C0MP RIMES". The system employs a sliding window algorithm based on edit distance to achieve highly fault-tolerant matching in plain text data, accurately obtaining character offsets. Subsequently, it retrieves and merges the scattered character bounding boxes, using affine transformation and a minimum bounding rectangle algorithm to obtain regularized pixel positions. The front end precisely overlays highlighted positioning markers above the tilted text, significantly reducing manual labor.

[0072] Example 3: Greedy Packaging and Full Validation in the Context of Massive Requirement Documents.

[0073] The total token count of a quality control requirement document for a multi-target oncology drug reached 680K tokens, exceeding the budget for a single background. The system automatically performed a greedy packaging algorithm, dividing the requirement document into "Background Group A (Clinical Standards and Procurement Specifications)" and "Background Group B (Compliance Amendments)". The 12-page tag set was treated as a single block, and two verification tasks were constructed by binding it to the two background groups respectively. After multi-threaded parallel comparison, the merged sub-report found that the tags did not use the "Lot No." format required by the amendment. The A402 reverse coordinate positioning engine locked the coordinates of the homepage footer. Clicking on the difference card would jump to the page and draw a highlighted positioning mark, guiding the quality inspector to quickly close the loop.

[0074] The beneficial effects of this application are highlighted here with the help of data.

[0075] 1. Actual test results of false negative rate and recall rate (corresponding to the effectiveness of architecture-level compliance assurance).

[0076] The physical slicing and full-volume requirement binding mechanism adopted by this system eliminates the risk of missed detections caused by alignment errors in the traditional search-then-compare scheme at the link level. The actual detection capability and recall effect are as follows:

[0077] 1.2 Penetrate OCR noise and suppress false alarms (accuracy side).

[0078] Non-standard label OCR recognition is inevitably accompanied by character noise. The system can correctly determine that the OCR recognized text does not match the actual semantics, such as character breaks, spelling errors, abnormal spaces, etc., as semantically consistent, avoiding misreporting OCR recognition errors as label differences, effectively reducing the false positive rate and improving the accuracy of detection results.

[0079] 1.3 Semantic-level detection examples (judgment capabilities that cannot be achieved by pure character comparison).

[0080] Unlike pure character comparison, which can only identify literal differences, this system can identify compliance risks at the semantic level. Typical examples of detected risks are as follows:

[0081] The first type of semantic difference is a typical risk of missed detection in character-level comparison: pure string comparison can only report "missing a word" and cannot determine its compliance impact; this system can identify the compliance risk of semantic weakening and determine failure, which reflects the gain of large language model semantic understanding on recall.

[0082] 1.4 Comparison of recall mechanisms (this patented solution vs. the traditional "search first, compare later" solution).

[0083]

[0084] 2. Semantic understanding and pixel-level physical positioning tests (corresponding to immersive interaction and accurate source tracing effects).

[0085] This system achieves pixel-level bounding box selection in the original image by using a deterministic coordinate inverse mapping link, while retaining the semantic understanding ability of large models and avoiding the shortcomings of inaccurate spatial positioning in large models. The actual test results are as follows:

[0086] The large model only outputs the difference type and the difference original text fragment. The absolute pixel coordinates are calculated by a deterministic link of character offset locking, fuzzy matching, and word-level bounding box synthesis. It does not rely on the output coordinates of the large model, thus fundamentally avoiding the shortcomings of the large model in terms of inaccurate spatial positioning.

[0087] 2.2 Multilingual line-level routing and word-level coordinate distribution.

[0088] The system supports multilingual sub-model recognition and word-level coordinate extraction. The line-level language model routing distribution is as follows:

[0089] Within the same tag, different languages ​​line by line call the corresponding recognition model, each outputting word-level coordinates, supporting accurate positioning in multilingual non-standard tag scenarios.

[0090] 2.3 End-to-end single real link (semantic judgment to the original image pixel red box).

[0091] Taking job number 3f4b0928f26a and dimension "Clinical Trial Statement (French)" as an example: ① Semantic layer (large model): Determine if Pour essais uniquement is missing clinics or semantically weakened → fail; ② Positioning layer (deterministic link): Locks the character offset of the segment, synthesizes it through word-level bounding boxes, and maps it back to the normalized polygon coordinates of the original image: poly_norm = [[0.3055, 0.5229], [0.4453, 0.5229],[0.4453, 0.5850], [0.3055, 0.5850]] (corresponding to line 14).

[0092] The fact that the same difference record contains both semantic conclusions and original image pixel coordinates proves that this solution does not only output plain text differences, but also accurately maps semantic conclusions back to the physical coordinate layer, achieving pixel-level highlighting on non-standard original images.

[0093] 3. Actual test of operational efficiency and token cost (corresponding to a significant improvement in quality inspection timeliness).

[0094] To address the potential for increased input and costs associated with full data binding, based on statistics from 147 real-world jobs with complete timing records, this system, while ensuring full data binding and zero missed detections, still outperforms traditional solutions in terms of overall efficiency and cost. The actual test data is as follows: 3.1 Time consumed for quality inspection of a single label.

[0095]

[0096] Compared to the baseline of approximately 30 minutes for manual item-by-item verification, the system reduces the time required for quality inspection of a single non-standard label to a median of 2 minutes, with 70% of the work completed within 3 minutes; the physical slicing step takes almost zero time, demonstrating the technical effectiveness of mechanical slicing in not calling up large models and not generating additional large model overhead.

[0097] 3.2 Actual test of token consumption.

[0098] The incremental value of real tokens from full binding is far lower than the budget of the large model context window, as shown in the following test data:

[0099] 3.3 Comparison of efficiency and cost options.

[0100]

[0101] The actual cost of the so-called "full binding to increase input" is extremely low: the average full requirement background is only about 247tok, accounting for about 0.05% of the single window budget; even if the requirement file grows significantly, this solution is designed to handle a single set of requirements up to 350Ktok, which still falls within a single 500K window. Moreover, because it eliminates the need for multiple rounds of calls for pre-semantic retrieval / clause alignment, the overall number of calls and latency are actually lower.

[0102] The technical scope of this application is not limited to the contents of the above specification. Those skilled in the art can make various modifications and variations to the above embodiments without departing from the technical concept of this application, and all such modifications and variations should fall within the scope of this application.

Claims

1. A smart-assisted quality inspection method for pharmaceutical labels, characterized in that, include: Multilingual optical character recognition is performed on the original image file of the medical label, and structured coordinate data with geometric bounding box coordinates and plain text data that retains physical line breaks and layout structure are obtained simultaneously. A mapping index relationship is established between the offset position of characters or words in the plain text data and the geometric bounding box coordinates in the structured coordinate data. The token density and total number of tokens of the plain text data are calculated by the local program, and the plain text data is mechanically divided into one or more text blocks by finding empty lines, table edges or physical dividing lines as cutting anchors, with a preset token budget as the upper limit. Flatten the full quality inspection requirement document, combine each text block with the flattened full quality inspection requirement text into the same model input task, so that each model input task includes the text block and the reference background covering the full quality inspection requirement document, and does not filter the reference background based on the pre-matching results between the tag block and the requirement clause, thus forming a full background association verification task set. By using multi-threaded concurrent calls to the large language model, the semantic comparison of each full-scale background association verification task is performed in parallel, and the difference sub-report is output. For the difference in the original text segment pointed out in the difference sub-report, the character position of the difference in the original text segment in the plain text data is determined by the fuzzy matching algorithm based on the plain text data. The corresponding geometric bounding box coordinates are then retrieved from the structured coordinate data based on the character position. After coordinate fusion, the absolute page number and pixel position of the difference on the original image file of the medical label are obtained, and a highlighted positioning mark is generated at the corresponding position in the original image.

2. The method according to claim 1, characterized in that, The structured coordinate data stores a unique identifier, page number, line number, and two-dimensional spatial coordinate parameter pair for each identified text line or word; the mapping index relationship is recorded in the coordinate-text mapping index table.

3. The method according to claim 1, characterized in that, The mechanical cutting process includes: Calculate the token density of each line in the plain text data and the total number of tokens in the entire text; If the total number of tokens does not exceed the preset token budget, the entire text will be preserved as a single text block. If the total number of tokens exceeds the preset token budget, then when the accumulated tokens approach the upper limit of the preset token budget, empty lines, table edges, or physical separators are preferentially selected as cutting anchors to truncate the text and generate multiple text blocks with consecutive start and end line numbers.

4. The method according to claim 1, characterized in that, After flattening the full-volume quality inspection requirement document, it also includes: Verify whether the total number of tokens after flattening exceeds the preset demand packaging budget window; If the required package budget window is exceeded, the full quality inspection requirement file is divided into multiple background groups according to physical boundaries, and each text block is combined with each background group to form the same model input task, so that each model input task includes the text block and the reference background covering the corresponding background group, thus constructing a cross-linked full background association verification task.

5. The method according to claim 1, characterized in that, When using multi-threaded concurrent calls to the large language model, a preset system comparison instruction containing inconsistency audit rules and user-input auxiliary task description information are injected into the large language model.

6. The method according to claim 1, characterized in that, The fuzzy matching algorithm is either the longest common subsequence algorithm or a sliding window algorithm based on edit distance; the step of determining the character position of the differing original text fragment in the plain text data using the fuzzy matching algorithm, and retrieving the corresponding geometric bounding box coordinates from the structured coordinate data based on the character position, specifically includes: Locate the matching region in the plain text data that has the smallest edit distance to the original text fragment with a similarity greater than a preset threshold, and obtain the character start and end offset range of the matching region. Retrieve the geometric bounding box coordinates of all characters or words located within the character start and end offset range in the structured coordinate data; The retrieved geometric bounding box coordinates are merged into polygon pixels, and the absolute page number and pixel position of the difference are output.

7. The method according to claim 1, characterized in that, After outputting the difference sub-reports and before performing the reverse retrieval, the process further includes: fusing the difference sub-reports, deduplicating and assembling the difference sub-reports returned by multiple concurrent threads according to the physical page order of the tags, fusing them to generate a unified master quality inspection report, and extracting the difference original text fragments from it.

8. The method according to claim 1, characterized in that, The highlighted positioning mark is a rectangular mark frame dynamically drawn at the corresponding position in the original image file of the medical label based on the absolute page number and pixel position; when the quality inspector clicks the difference card on the front-end interactive interface, the page is automatically redirected and the drawing of the highlighted positioning mark is completed.

9. A smart auxiliary quality inspection system for pharmaceutical labels, used to perform the method as described in any one of claims 1 to 8, characterized in that, include: The front-end interaction layer integrates a tag image upload interface, a reference document input interface, a red-boxed highlight difference visualization panel, an interactive positioning navigator, and a quality inspection report download module. The OCR recognition engine layer includes a multimodal OCR recognition engine and a mechanical physical slicing module. The multimodal OCR recognition engine is used to perform image preprocessing pipeline processing on the original medical label image file, perform text detection through a multilingual text detection network, perform automatic label region segmentation, and record physical coordinates line by line or block by block. It outputs structured coordinate data with geometric bounding box coordinates and plain text data that retains the physical layout structure, and establishes a coordinate-text mapping index table to record the mapping index relationship between the offset position of characters or words in the plain text data and the geometric bounding box coordinates in the structured coordinate data. The mechanical physical slicing module is used by a local program to calculate the token density and total token amount of the plain text data, and with a preset token budget as the upper limit, mechanically slices the plain text data into text blocks by finding empty lines, table edges or physical dividing lines as cutting anchor points. The semantic association layer includes a full-text background association module, which includes a reference specification parser, a semantic segmentation and alignment engine, a full-text context injection and comparison task orchestrator. The full-text background association module is used to take the flattened full-text quality inspection requirement document as a reference background, and combine each text block with the reference background into the same model input task. This ensures that each model input task includes the text block and the reference background that covers the full-text quality inspection requirement document, and does not filter the reference background based on the pre-matching results between the tag blocks and the requirement clauses, thus forming a full-text background association verification task. The comparison engine layer includes a multi-threaded parallel semantic comparison engine and a reverse coordinate localization engine. The multi-threaded parallel semantic comparison engine is equipped with a thread pool scheduler, a large model semantic inference unit, a difference classifier, and confidence scoring and aggregation, which are used to perform parallel semantic comparison on each of the full-scale background association verification tasks and output difference sub-reports. The reverse coordinate localization engine is used to map the difference original text fragments pointed out in the difference sub-reports to physical coordinates and calculate the coordinates marked in red boxes. The data and communication layer includes a unified data bus, a task queue manager, and result caching and persistent storage, providing data scheduling, caching, and persistence support for modules in each layer.

10. The system according to claim 9, characterized in that, The reverse coordinate positioning engine is specifically used to: use the plain text data as a reference, determine the character positions of the difference original text fragments through a fuzzy matching algorithm, and thereby retrieve the geometric bounding box coordinates from the structured coordinate data in reverse, and obtain the absolute page number and pixel position of the difference on the original image file of the medical label after coordinate fusion; the front-end interaction layer dynamically draws a highlighted positioning mark on the red-framed highlight difference visualization panel according to the absolute page number and pixel position, and realizes automatic page jump when the difference card is clicked through the interactive positioning navigator.