Test material case packing label generation method and system based on heterogeneous order analysis
Patent Information
- Application Number
- CN202611247485.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-18
- Publication Date
- 2026-10-16
AI Technical Summary
[0008]本发明的目的是提供基于异构订单解析的考试材料装箱标签生成方法及系统,以解决现有技术中人工将交叉表逐格转录为订单表的过程工作量极大,一个中等规模的考试涉及上百考区、数十科目、数万袋数据,转录耗时可达数天,同时,转录过程中科目与数量错位、考区名称遗漏等录入错误难以避免,而现有技术完全不对此类错误提供拦截手段;更严重的是,当源文件本身存在数据残缺(如某考区块有数据行但缺失考区名称行、某行数据被意外截断等)时,人工转录者往往难以在浩繁的表格中发现这些异常,残缺数据被当作正常数据转录后直接流入后续装箱和打印环节,导致错箱、错发甚至漏发,构成重大考务隐患的问题
[0053]Compared with existing technologies, the examination material packing label generation method and system based on heterogeneous order parsing provided by this invention can directly parse the complex cross-tabulated question distribution details issued by the examination administration department into standardized flat order line records through automatic identification and segmentation of block structure features. This eliminates the need for manual transcription, effectively removing the potential for errors in the manual transcription process. Simultaneously, block integrity verification is performed during the parsing process. When data lines exist but are missing, such as examination area names, the error location is precisely located at the source file line number level, and the subsequent label generation process is blocked. This intercepts data incompleteness issues at the incoming stage, eliminating the risk of incorrect packing and distribution due to source data errors from the outset.
Smart Images

Figure CN122927345A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of printed packaging logistics processing technology, specifically to a method and system for generating packing labels for examination materials based on heterogeneous order parsing. Background Technology
[0002] After the exam papers and answer sheets are printed, they must be packed into boxes according to exam area, subject, and bag type, labeled, and sent to hundreds of exam areas across the province. Zero errors in quantity and destination are required: incorrect boxes, incorrect distribution, or missing bags could constitute an exam administration incident. With the continuous expansion of exam scale, a single exam can involve tens of thousands of bags and thousands of boxes of exam papers and answer sheets, making the efficiency and accuracy of the packing process a key bottleneck in exam organization. Currently, the field of exam material packing and label generation mainly relies on the following technologies:
[0003] Firstly, the practice of manually calculating packing information and using handwritten or Excel-edited box labels remains widespread. Operators estimate the number of bags to be packed in each box based on the shipping details and experience, with arbitrary handling of odd-numbered bags and a lack of standardized packing constraints. Quantity verification relies on manual counting line by line, without a systematic verification mechanism. Box label information is manually transcribed or filled out using Excel templates and then printed, and errors are easily made in transcribing information such as subject names, number of bags, and examination area names. Box labels usually only contain text information without standardized coding, making it impossible to quickly verify through barcode scanning devices during the warehousing process, and requiring manual counting of each box.
[0004] Secondly, general-purpose label printing software (such as Bartender and NiceLabel) has been introduced for box label layout and printing. This type of software provides label template design functions and database field binding capabilities, allowing fields from Excel spreadsheets to be mapped to label layouts and printed in batches. However, general-purpose label printing software essentially only solves the "layout + output" problem and lacks packing planning logic—it cannot automatically split large orders into several boxes based on packing constraints such as "minimum number of bags per box" and "maximum number of bags per box," nor can it handle business rules specific to examination administration, such as merging loose items across subjects and packing large and small cards separately. Packing plans still require manual pre-calculation and data entry into tables; the software only prints the entered results. If upstream calculations are incorrect, incorrect labels are still printed, and data errors flow directly into the production line along with the printing process.
[0005] Third, some examination institutions with a high degree of informatization have introduced QR code box labels. A common practice is to encode all information contained in the box (including product type, city, district / county, subject, bag type, number of bags, serial number, total number of boxes, etc.) into a QR code, hoping to obtain complete box information at once through scanning. However, this full-load encoding method faces serious problems in actual low-resolution thermal printing scenarios—examination material box labels are usually printed on-site using a 203 DPI portable thermal label printer. When the QR code load is too large, the encoder is forced to select a higher QR code version (such as version 4 or above) to accommodate all the data. Higher version QR codes have more modules and significantly smaller physical dimensions of individual modules. After printing at a low resolution of 203 DPI, adjacent modules are prone to sticking together or becoming blurry, causing the scanning equipment to be unable to read stably, resulting in a "prints but cannot be scanned" on-site fault, rendering the scanning verification process ineffective.
[0006] The common flaw of the above-mentioned technical methods lies in the fact that the original order data issued by the competent authorities exists in a complex cross-tabulation format (blocked by examination area, with subjects arranged horizontally, numbers listed separately for backup, and examination area names located after the data blocks). This is typical heterogeneous and non-standardized data. All the existing technologies assume that the data has been manually transcribed into a standardized order list before processing. The process of manually transing the cross-tabulation into an order table is extremely labor-intensive. A medium-sized examination involves hundreds of examination areas, dozens of subjects, and tens of thousands of bags of data, and the transcription process can take several days. At the same time, input errors such as misalignment of subjects and quantities and omission of examination area names are difficult to avoid during the transcription process, and the existing technologies do not provide any means to intercept such errors. More seriously, when the source file itself has data defects (such as a data row in an examination area block but missing the examination area name row, or a data row being accidentally truncated), manual transcribers often find it difficult to find these anomalies in the vast number of tables. The incomplete data is transcribed as normal data and flows directly into the subsequent packing and printing stages, resulting in incorrect packing, incorrect distribution, or even omissions, posing a major examination administration risk.
[0007] In response to this problem, this application proposes a method and system for generating packing labels for examination materials based on heterogeneous order parsing. Summary of the Invention
[0008] The purpose of this invention is to provide a method and system for generating packing labels for examination materials based on heterogeneous order parsing. This addresses the problem that in existing technologies, the process of manually transcribing crosstabs into order tables is extremely labor-intensive. A medium-sized examination involves hundreds of examination areas, dozens of subjects, and tens of thousands of bags of data, and the transcription process can take several days. Furthermore, errors such as misalignment of subjects and quantities, and omission of examination area names are difficult to avoid during the transcription process, and existing technologies do not provide any means to intercept such errors. More seriously, when the source file itself has incomplete data (such as a block of examination area data having rows but missing rows of examination area names, or a row of data being accidentally truncated), manual transcribers often find it difficult to detect these anomalies in the vast amount of tables. Incomplete data is transcribed as normal data and directly flows into the subsequent packing and printing stages, leading to incorrect packing, incorrect distribution, or even omissions, posing a significant risk to examination administration.
[0009] To achieve the above objectives, the present invention provides the following technical solution:
[0010] Firstly, this application provides a method for generating packing labels for examination materials based on heterogeneous order parsing, including:
[0011] Obtain heterogeneous exam material order data, automatically identify and segment the order data according to block structure features, expand the cross-tab structured order data into flattened order row records, and obtain a standardized order dataset;
[0012] The standardized order dataset is grouped and packed according to the preset multi-dimensional packing rules. The order quantity is divided into several full boxes and the number of loose bags is processed according to the selected mode to generate a packing plan that includes the packing details of each box.
[0013] Assign a structured globally unique box number to each box in the packing scheme, and extract the minimum unique identification key from the box number to generate a two-dimensional barcode payload with a byte count not exceeding a preset upper limit and adapted to low-resolution thermal printing, thereby obtaining the identification data of each box;
[0014] Box labels are generated based on the identification data, and the printing order of the labels is organized according to a multi-level sorting key to obtain a label printing sequence arranged according to the production line rhythm.
[0015] Generate a packing verification report corresponding to the label printing sequence, automatically compare the total packing quantity with the total order quantity dimension by dimension, and prohibit label output when the quantity is inconsistent or the source data is incomplete.
[0016] Furthermore, the automatic identification and segmentation of the order data according to block structure features includes:
[0017] The data file format is automatically determined based on the worksheet name and header keyword characteristics, and different format types follow their respective parsing paths.
[0018] The examination area blocks are divided according to the block structure characteristics of category header row - sub-header row - data row - examination area name row. The crosstab of each examination area block is expanded into a flat order row with examination area, subject, bag type and quantity as fields.
[0019] Automatically extract exam name, customer, and batch information from the table title and description text;
[0020] The built-in administrative division comparison table resolves the examination area to the prefecture-level city affiliation, and supports the overlay and supplementation of external comparison documents.
[0021] Furthermore, the automatic identification and segmentation of the order data according to block structure features also includes:
[0022] Perform integrity checks on each segmented test area block. If a data row exists but the corresponding test area name is missing, generate error data containing the source file line number and context location information, and pass the error data to the tag output access control to hard block tag generation.
[0023] Furthermore, the step of grouping and packing the standardized order dataset according to preset multi-dimensional packing rules includes:
[0024] Standardized order data is grouped by product type, card type, city / county, and subject.
[0025] For each group, the quantity is divided into several whole boxes according to the rules of minimum number of bags per box, maximum number of bags per box, and target number of bags per box, and the number of bags in each box is evenly distributed under the constraints of the rules.
[0026] Two processing paths are provided for the number of loose bags: a combined box mode and a tail box mode, including:
[0027] In the combined box mode, loose items from different subjects within the same district or county are combined into one box. In the tail box mode, loose items from each subject are packed into a separate tail box and marked as insufficient to fill a whole box.
[0028] Furthermore, the packing rules are determined by a multi-level fallback hierarchy: subject + card type specific rules > card type default rules > product default rules > built-in default rules.
[0029] The packing rules are saved as a fully structured external file in Chinese and can be edited and maintained through a password-protected graphical interface.
[0030] Furthermore, the step of extracting the minimum unique identification key from the box number to generate a two-dimensional barcode payload with a byte count not exceeding a preset upper limit and adapted to low-resolution thermal printing includes:
[0031] Extract the product type, card type abbreviation, city, district / county, and serial number fields from the structured globally unique box number as the smallest unique identification key, discard fields that do not participate in the uniqueness identification of the box, and compress the card type into a single-word abbreviation, so that the two-dimensional barcode load is controlled within 37 bytes and the QR code version is reduced to no higher than version 3;
[0032] A readable two-dimensional barcode is generated by laying out a white quiet zone around the two-dimensional barcode drawing area.
[0033] Furthermore, the uniqueness of the field combination of the two-dimensional barcode payload is verified by the full set of box numbers to ensure that the cardinality of the payload set is equal to the total number of boxes.
[0034] The box label also prints the complete Chinese box number in text form, forming a dual-track reading layout that combines a simplified two-dimensional barcode for machine reading and a full text box number for human reading.
[0035] Furthermore, the coding structure of the structured globally unique box number is: product type - card type - city - district / county - serial number - total number of boxes, wherein the card type distinguishes between A3 and A4 sizes and is numbered independently.
[0036] Within the same district or county, containers are assigned serial numbers after being sorted stably by type, contents, and quantity.
[0037] The question card box number is appended with a statistical information field indicating the total number of question card boxes in this district / county (Z boxes).
[0038] Furthermore, the multi-level sorting key is a composite sorting key that includes unit import order, whether to merge boxes, product type, card type, subject, and box order;
[0039] Labels are output in the order of units when the data is imported. Within the same unit, full boxes for single subjects are printed first, followed by boxes for combined odds and ends. It also supports output mode that prints by subject group.
[0040] The packing verification report shall include at least a packing list and a quantity verification report;
[0041] The automatic comparison is performed dimension by dimension to calculate the total order quantity and total packing quantity. If the quantity in any dimension is inconsistent, the label output is prohibited, and the inconsistency information is located to the specific dimension and numerical difference.
[0042] Secondly, this application provides a system for generating packing labels for examination materials based on heterogeneous order parsing, including:
[0043] The data parsing module is used to acquire exam material order data in heterogeneous formats, automatically identify and segment the order data according to block structure features, and expand the cross-tab structured order data into flattened order row records to obtain a standardized order dataset.
[0044] The packing planning module is used to group and plan the standardized order dataset according to the preset multi-dimensional packing rules, split the order quantity into several full boxes and process the number of loose bags according to the selected mode, and generate a packing plan that includes the packing details of each box.
[0045] The identification generation module is used to assign a structured globally unique box number to each box in the packing scheme, and extract the minimum unique identification key from the box number to generate a two-dimensional barcode payload with a byte count not exceeding a preset upper limit and adapted to low-resolution thermal printing, thereby obtaining the identification data of each box.
[0046] The label rendering and printing sorting module is used to render and generate box labels based on the identification data, and organize the printing order of the labels according to a multi-level sorting key to obtain a label printing sequence arranged according to the production line rhythm.
[0047] The audit and verification module is used to generate a packing verification report corresponding to the label printing sequence, automatically compare the total packing quantity with the total order quantity dimension by dimension, and prohibit label output when the quantity is inconsistent or the source data is incomplete.
[0048] Thirdly, this application also provides an electronic device, the electronic device comprising:
[0049] At least one processor; and
[0050] A memory communicatively connected to the at least one processor; wherein,
[0051] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in the first aspect.
[0052] Fourthly, this application also provides a computer-readable storage medium, wherein a computer program is stored on the medium, and the computer program, when executed by a processor, implements the method described in the first aspect.
[0053] Compared with existing technologies, the examination material packing label generation method and system based on heterogeneous order parsing provided by this invention can directly parse the complex cross-tabulated question distribution details issued by the examination administration department into standardized flat order line records through automatic identification and segmentation of block structure features. This eliminates the need for manual transcription, effectively removing the potential for errors in the manual transcription process. Simultaneously, block integrity verification is performed during the parsing process. When data lines exist but are missing, such as examination area names, the error location is precisely located at the source file line number level, and the subsequent label generation process is blocked. This intercepts data incompleteness issues at the incoming stage, eliminating the risk of incorrect packing and distribution due to source data errors from the outset. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0055] Figure 1 A flowchart of a method for generating packing labels for exam materials based on heterogeneous order parsing, provided in an embodiment of the present invention;
[0056] Figure 2 This is a block diagram of the examination material packing label generation system based on heterogeneous order parsing provided in an embodiment of the present invention. Detailed Implementation
[0057] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.
[0058] As attached Figure 1 As shown:
[0059] Example 1:
[0060] A method for generating packing labels for exam materials based on heterogeneous order parsing includes:
[0061] S1. Obtain exam material order data in heterogeneous format, automatically identify and segment the order data according to block structure features, expand the cross-tab structure order data into flat order row records, and obtain a standardized order dataset.
[0062] In step S1, the data file format type is automatically determined based on the worksheet name and header keyword characteristics, and different format types follow their respective parsing paths;
[0063] The examination area blocks are divided according to the block structure characteristics of category header row - sub-header row - data row - examination area name row. The crosstab of each examination area block is expanded into a flat order row with examination area, subject, bag type and quantity as fields.
[0064] Automatically extract exam name, customer, and batch information from the table title and description text;
[0065] The built-in administrative division comparison table resolves the examination area to the prefecture-level city affiliation, and supports the overlay and supplementation of external comparison documents;
[0066] In addition, perform integrity checks on each segmented test area block. When a data line exists but the corresponding test area name is missing, generate error data containing the source file line number and context location information, and pass the error data to the label output access control to hard block label generation.
[0067] Furthermore, after the exam papers and answer sheets are printed, they must be packed into boxes according to the exam area, subject, and bag type, and labeled with box tags before being sent to hundreds of exam areas throughout the province.
[0068] The packing process involves multiple subjects, multiple bag types (standard bags, tail bags, spare bags, etc.), and large and small cards (A3 / A4 answer sheets), and can reach tens of thousands of bags and thousands of boxes.
[0069] Original order data issued by the competent authority usually exists in two formats:
[0070] One type is a well-structured standard order form;
[0071] Another type is a complex cross-tabulated "question details" table, which is divided into blocks by test area, with subjects arranged horizontally, the last digit of the number in the column as a backup, and the test area name located after the data block. It needs to be manually transcribed into an order table cell by cell, which is a large workload and prone to errors.
[0072] This step begins by obtaining the exam materials order data file in a heterogeneous format.
[0073] In the data access layer, the file type is automatically determined by the worksheet name and header keyword characteristics of the file being read through the automatic format recognition route.
[0074] If standard order header fields such as "examination area", "subject", and "number of bags" are detected, the standard order reading path will be followed.
[0075] If cross-tab feature columns such as "label", "tail", and "spare" are detected, as well as structural features such as being divided into blocks by test area, the system will automatically route to the question release details analysis path. The two paths are mutually exclusive and do not require manual selection by the user, achieving seamless switching.
[0076] For documents containing detailed exam questions, they are segmented according to the block structure of "category header row - subheader row - data row - exam area name row".
[0077] An Excel file detailing exam questions typically contains multiple exam blocks. The header of each exam block indicates the subject category (such as "Chinese" or "Mathematics"). The sub-header rows further distinguish between bag-type columns such as "Standard", "Tail", and "Spare". The data rows are filled with the number of bags corresponding to each bag type. The exam area name row is located after the data block.
[0078] By identifying these block-like structural features, each exam area block is segmented from the file as an independent parsing unit. After segmentation, the crosstab of each exam area block is expanded into a flattened order line record, that is, the two-dimensional crosstab data is converted into a one-dimensional order line with "exam area, subject, bag type, quantity" as fields.
[0079] For example, in a certain examination area, under the subject of "Chinese", the number of "30 letters marked" is 5 and the number of "20 letters at the end" is 1. Then it can be expanded into two rows: (examination area, Chinese, 30 letters marked, 5) and (examination area, Chinese, 20 letters at the end, 1).
[0080] The mapping relationship between "label / tail / spare" and specific bag type names is set as needed through an external configuration file to adapt to the differences in bag type definitions for different batches. After the above analysis and expansion, the crosstab data, which was originally complex in structure and could not be directly used for packing calculations, is transformed into standardized order line records with clear fields and a unified structure. Each record contains at least four fields: examination area, subject, bag type, and quantity.
[0081] At the same time, metadata such as exam name, client, and batch number are automatically extracted from the table titles and explanatory text of the document. For example, the exam name is extracted as "2026 Provincial Unified Examination" from the title "Details of Question Issuance for the 2026 Provincial Unified Examination", and the client name and batch number are extracted from the header or explanatory text.
[0082] The extracted metadata is presented to the operator on the interface, allowing for manual revisions to address situations where the file format is not standardized or metadata is missing.
[0083] In addition, the built-in administrative division comparison table resolves the name of the examination area to the city to which it belongs (for example, resolving "Hefei urban area" to "Hefei city"). This comparison table supports external file overwriting and supplementation. When a new examination area is added or the name of the examination area changes, the external comparison file can be edited to complete the update without modifying the software code.
[0084] To ensure data quality, a block integrity check is performed after parsing each test block:
[0085] If a test area block contains data rows (i.e., non-empty bag count values), but the corresponding test area name row is empty or missing, it is considered incomplete data. An error record containing the source Excel file row numbers and context information is generated, for example, "Data block from row 15 to row 28:
[0086] The error message "Data exists but the examination area name is missing; line 29 was expected to be the examination area name line" indicates a problem. This error record is passed to the subsequent audit access control process, where it is forcibly blocked during label output, thus intercepting mis-distribution caused by incomplete data at the source.
[0087] For data in the standard order format, field integrity checks are also performed to check for anomalies such as required fields being empty or quantities being negative. After the above parsing, expansion, metadata extraction, city / region parsing, and integrity checks, a standardized order dataset is finally output. Each record contains fields such as examination area, city / region, subject, bag type, and quantity, which can be directly used for subsequent packing planning.
[0088] S2. Group and plan the standardized order dataset according to the preset multi-dimensional packing rules, divide the order quantity into several full boxes and process the number of loose bags according to the selected mode, and generate a packing plan that includes the packing details of each box.
[0089] In step S2, the standardized order data is grouped by product type, card type, city, district / county, and subject.
[0090] For each group, the quantity is divided into several whole boxes according to the rules of minimum number of bags per box, maximum number of bags per box, and target number of bags per box, and the number of bags in each box is evenly distributed under the constraints of the rules.
[0091] Two processing paths are provided for the number of loose bags: a combined box mode and a tail box mode, including:
[0092] In the combined box mode, the odd amounts from different subjects within the same district or county are combined and packed into one box; in the tail box mode, the odd amounts from each subject are packed into a separate tail box and marked as insufficient to fill a whole box.
[0093] Specifically, the packing rules are determined by a multi-level fallback hierarchy: subject + card type specific rules > card type default rules > product default rules > built-in default rules.
[0094] The packing rules are saved as a fully Chinese structured external file and can be edited and maintained through a password-protected graphical interface;
[0095] Furthermore, after obtaining the standardized order dataset, the dataset is grouped and packed according to the preset multi-dimensional packing rules. The order quantity is split into several full boxes and the number of loose bags is processed according to the selected mode, and finally a packing plan containing the packing details of each box is generated.
[0096] First, the standardized order data is grouped by product type, card type, city, district / county, and subject.
[0097] The product types are divided into "exam papers" and "question cards (answer sheets)", and the card sizes are divided into "large cards (A3 size)" and "small cards (A4 size)". The city and county are the administrative levels, and the subject is the name of the specific exam subject.
[0098] The purpose of grouping is:
[0099] Packing rules and subsequent box number allocation are based on these dimensions, and order data within the same group shares the same packing parameters and numbering logic. After grouping, the corresponding packing rule parameters are read for each group.
[0100] The packing rule is defined as a triple of (minimum number of bags per box, maximum number of bags per box, target number of bags per box). For example, for the grouping of (question cards, large cards, math), the rule may be (20, 30, 25), which means that each box contains 20 to 30 bags, preferably 25 bags.
[0101] The rule values are determined using a multi-level fallback mechanism:
[0102] First, find the specific rules for "subject + card type";
[0103] If it does not exist, revert to the default rule for "Card Type"; if it still does not exist, revert to the default rule for "Product".
[0104] Finally, revert to the built-in default rule.
[0105] All rules are saved in a fully Chinese structured external file (such as JSON format) and edited through a password-protected graphical interface, which cannot be modified by unauthorized personnel.
[0106] After obtaining the packing parameters, the total number of bags within each group is used to split the entire carton. The splitting logic is as follows:
[0107] The total number of bags is divided into several full boxes according to the "target number of bags per box", while ensuring that the actual number of bags in each box is not less than the "minimum number of bags per box" and does not exceed the "maximum number of bags per box".
[0108] To achieve a balanced distribution of the number of bags in the boxes, a balanced distribution strategy is adopted. For example, if a group has a total of 127 bags and the target number of bags is 25 bags, it is initially divided into 5 boxes (5 × 25 = 125 bags), with the remaining 2 bags as odds and ends.
[0109] However, under balanced distribution, the 127 bags can be divided into 4 boxes of 26 bags each and 1 box of 23 bags each (assuming a minimum of 20 and a maximum of 30 bags), minimizing the difference in the number of bags in each box and avoiding the unbalanced situation of "the first box is full and the last box has only one bag".
[0110] In practice, first calculate the total number of boxes N = floor(total number of bags / target number of bags). If there is a remainder R, then distribute R bags to the first R boxes in order, with 1 bag per box, so that the number of bags in each box is the target number of bags + 1, and the remaining boxes are the target number of bags.
[0111] Alternatively, a more sophisticated algorithm can be used to ensure that the number of bags in all boxes is within the allowable range and that the variance is minimized.
[0112] After the entire carton is unpacked, any remaining loose bags (less than the minimum quantity for a full carton) will be handled according to the selected mode. Two modes are available, which the operator can choose on-site based on batch requirements:
[0113] In the combined box mode, the number of small change bags from different subjects within the same district or county are combined and packed into one or more small change boxes.
[0114] For example, if a district has 3 bags of "Chinese", 4 bags of "Mathematics", and 2 bags of "English" remaining, totaling 9 bags, and if the boxing rules allow for mixed packing of different subjects, then the 9 bags can be combined into one box, with a detailed list of the number of bags for each subject attached to the box.
[0115] The combined box mode is suitable for scenarios where test areas are scattered, there are many subjects, and the number of odd numbers is small, which can effectively reduce the total number of boxes.
[0116] In the tail box mode, the remaining items for each subject are transported in a separate tail box, not combined with other subjects, and are marked with "less than a full box" in red on the box label. The tail box mode is suitable for scenarios with strict examination requirements where each subject must be transported separately in separate boxes, making it easier for the examination area to count the items one by one when receiving them.
[0117] Regardless of the mode, large cards (A3) and small cards (A4) are used as independent group keys, packed separately and without confusion, to ensure that the box size matches the contents.
[0118] After grouping, splitting full boxes, and processing small amounts, a complete packing plan is finally generated. This plan records the product type, card type, city, district / county, subject, bag type, number of bags, and box type (full box / last box / combined box) of each box in the form of structured data, providing complete details for subsequent numbering and label generation.
[0119] S3. Assign a structured globally unique box number to each box in the packing scheme, and extract the minimum unique identification key from the box number to generate a two-dimensional barcode payload with a byte count not exceeding a preset upper limit and adapted to low-resolution thermal printing, thereby obtaining the identification data of each box.
[0120] In step S3, the product type, card type abbreviation, city, district / county, and serial number fields are extracted from the structured globally unique box number as the smallest unique identification key. Fields that do not participate in the uniqueness identification of the box are discarded, and the card type is compressed into a single-word abbreviation, so that the two-dimensional barcode load is controlled within 37 bytes and the QR code version is reduced to no higher than version 3.
[0121] A readable two-dimensional barcode is generated by laying out a white quiet zone around the two-dimensional barcode drawing area;
[0122] The uniqueness of the field combination of the two-dimensional barcode payload is verified by the full set of box numbers, ensuring that the cardinality of the payload set is equal to the total number of boxes.
[0123] The box label also prints the complete Chinese box number in text form, forming a dual-track reading layout of two-dimensional barcode machine-readable simplified code and text human-readable full box number;
[0124] Specifically, the coding structure of the structured globally unique box number is: product type - card type - city - district / county - serial number - total number of boxes, where the card type distinguishes between A3 and A4 sizes and is numbered independently.
[0125] Within the same district or county, containers are stably sorted by type, contents, and quantity, and then assigned serial numbers.
[0126] The box number of the question card box is appended with a statistical information field showing the total number of Z boxes of question cards in this district / county;
[0127] Furthermore, after obtaining the packing scheme, a structured globally unique box number is assigned to each box, and the minimum unique identification key is extracted from the box number to generate a two-dimensional barcode payload with a byte count not exceeding a preset upper limit and adapted to low-resolution thermal printing, thus forming the identification data of each box.
[0128] The coding structure for the box number is "Product Type - Card Type - City - District / County - Serial Number - Total Number of Boxes". The product type can be either "Exam Paper" or "Question Card".
[0129] The card size can be either "A3" or "A4" (only the question cards have this feature; the exam paper does not).
[0130] The prefecture-level city and district / county are the administrative regions to which the container belongs;
[0131] The serial number is the sequential number of the box within the same district / county, product type, and card type;
[0132] The total number of boxes refers to the total number of boxes of this product type and card type within the district / county.
[0133] The specific method for assigning serial numbers is as follows:
[0134] After grouping the packing scheme by (product type, card type, city, district / county, subject), the boxes in each group are stably sorted according to "box type (full box / last box / combined box), contents (subject name), number of bags". Stable sorting ensures that the same data will be sorted consistently under different operating environments.
[0135] After sorting, assign a serial number starting from 1 to each box in sequence.
[0136] For example, if a district or county has 15 boxes of A3-sized answer sheets, the box numbers would be sequentially "Answer Sheets-A3-Hefei City-Baohe District-001-015" to "Answer Sheets-A3-Hefei City-Baohe District-015-015".
[0137] For question card boxes, the statistical information "Z boxes of question cards in this district / county" is added to the box number and printed on the box label in text form to facilitate the recipient to check the total number and prevent missing boxes. Z represents the total number of question card boxes in this district / county.
[0138] After the box number is assigned, five fields are extracted from the complete box number of each box: "product type, card type abbreviation, city, district / county, and serial number" as the minimum unique identification key, which is used to generate the QR code payload.
[0139] Among them, the card type is compressed into single-word abbreviations, "large" represents A3 size and "small" represents A4 size, and the card type field is directly omitted if the test paper does not have a card type field.
[0140] This load excludes redundant fields such as "total number of containers" that do not participate in the identification of container uniqueness.
[0141] For example, the smallest unique identifier for the complete box number “Question Card-A3-Hefei City-Baohe District-001-015” is “Question Card-Large-Hefei City-Baohe District-001”.
[0142] The reason for simplification is that if all the information of the complete box number is written into the QR code on a 203DPI low-resolution thermal printer, the excessive load will force the QR code version to be upgraded (after simplification, it should not be higher than version 3, while the full load requires version 4 or above). This results in an increase in the number of QR code modules and a reduction in the physical size of each module. After printing at 203DPI, the modules are blurry and cannot be reliably read by the scanning device, i.e., "can be printed, but cannot be scanned".
[0143] By limiting the payload to the smallest unique identification key, the QR code payload can be controlled within 37 bytes and the QR code version can be reduced to no higher than version 3. At this time, the physical size of a single module at 203 DPI is sufficient to ensure reliable reading.
[0144] To ensure that the simplified load uniquely identifies each container, a uniqueness verification is performed on the full container number dataset:
[0145] Add the smallest unique identifier key of all boxes to a set, and check if the cardinality of the set is equal to the total number of boxes.
[0146] If they are equal, there is no collision, and the verification is successful.
[0147] Otherwise, an error will be reported and subsequent tag generation will be prevented.
[0148] When generating a QR code image, a white quiet zone is laid out around the drawing area. The quiet zone is a blank area around the QR code symbol that does not contain any graphics or text. It is used to assist the reading and positioning algorithm in confirming the QR code boundary. Its width is not less than four times the width of the module.
[0149] In low-resolution printing conditions, the quiet zone is crucial for the first-read success rate.
[0150] After the above processing, complete identification data is generated for each container, including a complete Chinese container number (for manual reading), a simplified QR code payload (for machine scanning), and a QR code image (including a quiet zone), which will then be used for label rendering.
[0151] S4. Render and generate box labels based on the identification data, and organize the printing order of the labels according to the multi-level sorting key to obtain a label printing sequence arranged according to the production line rhythm.
[0152] In step S4, the multi-level sorting key is a composite sorting key of unit import order, whether to merge boxes, product type, card type, subject, and box order;
[0153] Labels are output in the order of units when the data is imported. Within the same unit, full boxes for single subjects are printed first, followed by boxes for combined odds and ends. It also supports output mode that prints by subject group.
[0154] Furthermore, the label rendering uses an 80×60 mm horizontal template, outputting one sheet per box, adapting to the continuous printing needs of roll label printers.
[0155] In terms of label layout design, "City-County" is the core address information, placed in a prominent position at the top in bold font;
[0156] Key fields such as the number of bags and the type of test paper / question card are also arranged in bold, large font to ensure that handling personnel can identify them from a distance of more than 1 meter.
[0157] For small and large boxes, a warning message such as "Insufficient to fill a full box" or "Large box" will be displayed in large red letters.
[0158] The label should display the complete structured Chinese box number in text form (e.g., “Question Card-A3-Hefei City-Baohe District-001-015”) for manual verification.
[0159] All Chinese fonts are embedded in the label template along with the file, and printing does not depend on the target printer's operating system font library, ensuring consistent output across different printer models.
[0160] The QR code image is placed in a separate area on the right or lower right corner of the label, with ample white space around it, and does not overlap with any text or graphics.
[0161] The QR code and the text box number together form a dual-track reading layout: "QR code machine-readable simplified code, text box number human-readable full box number". The scanning device reads the QR code to quickly identify the box, and the human visually reads the text box number to complete the verification. The two complement each other to ensure accurate identification of the box under any circumstances.
[0162] After the labels are rendered, the printing order is organized according to the multi-level sorting key.
[0163] The sorting key is a composite key consisting of "unit import order, whether to merge boxes, product type, card type, subject, and box order".
[0164] The specific sorting logic is as follows:
[0165] The first level ensures that the box labels of the same unit are printed continuously according to the order in which the units (prefecture-city - district / county) appear during data import;
[0166] The second level is within the same unit, with single-subject full boxes arranged first and combined partial boxes arranged later, so that the production line can process full boxes first and then process partial boxes in a centralized manner; the third level is classified according to product type (exam papers / question cards);
[0167] The fourth level is categorized by card type (A3 / A4); the fifth level is sorted by subject name; and the sixth level is sorted by box number from smallest to largest.
[0168] In addition, a "print by subject" switch option is supported. When enabled, the printing order is adjusted to print all box labels for the "Chinese" subject of all units first, then print all box labels for the "Mathematics" subject of all units, and so on, in order to adapt to the production line rhythm of "one package per subject" and avoid operational chaos and efficiency loss caused by frequent switching of subjects.
[0169] After the above sorting, a label printing sequence is generated according to the actual operation rhythm of the production line, which can be directly sent to the thermal label printer for printing.
[0170] S5. Generate a packing verification report corresponding to the label printing sequence, automatically compare the total packing quantity with the total order quantity dimension by dimension, and prohibit label output when the quantity is inconsistent or the source data is incomplete.
[0171] In step S5, the packing verification report shall include at least a packing list and a quantity verification report;
[0172] The automatic comparison is performed dimension by dimension to calculate the total order quantity and total packing quantity according to product type, card type, city, district / county, and subject. If the quantity in any dimension is inconsistent, the label output is prohibited, and the inconsistency information is located to the specific dimension and numerical difference.
[0173] Furthermore, the packing verification report should be output as an Excel workbook, containing at least two worksheets:
[0174] The "Packing List" records line by line the box number, product type, card type, city, district / county, category, bag type, number of bags, box type (full box / last box / combined box), and the serial number of the box in its respective district / county and the total number of boxes.
[0175] The "Quantity Verification Table" summarizes and compares the total order quantity and the total packing quantity according to product type, card type, city, district / county, and subject.
[0176] The specific comparison method is as follows:
[0177] Summarize the total number of bags in each group from the standardized order dataset, grouped by (product type, card type, city, district / county, subject).
[0178] At the same time, the total number of bags in each assembly box is summarized from the packing plan according to the same dimension (i.e., the sum of the number of bags in all boxes in that group).
[0179] Then compare the two sets of results one by one. If they are equal, mark them as "consistent" and if they are not equal, mark them as "inconsistent" and record the difference value (e.g., "order 50 bags, pack 48 bags, difference -2 bags").
[0180] After the comparison is completed, a consistency access control judgment is performed: if the total order quantity and the total packing quantity are consistent across all dimensions, and no incomplete errors (such as missing test area name, empty required fields, etc.) are detected in the aforementioned data parsing steps, then the access control is opened, allowing the output label printing sequence to be sent to the printer;
[0181] If any dimension has inconsistent values, or if incomplete errors were reported during the data parsing phase, the access control will be closed, label output will be prohibited, and specific error information will be displayed on the interface, such as "[Interception] Hefei City - Baohe District - Question Card - A3 - Mathematics:
[0182] Ordered 50 bags, packed 48 bags, discrepancy -2 bags, please check" or "[Interception] Data block 15-28 of source file is missing test area name, please add and try again."
[0183] This access control mechanism ensures that the total number of boxes and bags in the packing plan completely matches the original order data, that is, "strong consistency between accounts and actual goods". Any discrepancies or data omissions will block the generation of labels, preventing examination-related accidents such as wrong boxes, wrong shipments, and missing bags from the source.
[0184] Only after all checks pass will the label printing sequence be sent to the printer for actual printing. At the same time, the packing verification report and labels will be output synchronously for operators to archive and check.
[0185] As can be seen from the above, this invention, through its method of automatic identification and segmentation of block structure features, can directly parse the complex cross-tabulated question distribution details issued by the examination administration department into standardized flat order line records, eliminating the need for manual transcription and effectively removing the potential for errors in the manual transcription process. Simultaneously, block integrity verification is performed during the parsing process. When data lines exist but are missing, such as examination area names, the error location is precisely located at the source file line number level, and the subsequent label generation process is rigidly blocked. This ensures that data incompleteness is intercepted at the input stage, eliminating the risk of incorrect packaging and distribution due to errors in the source data.
[0186] This invention extracts the smallest unique identification key from the structured globally unique box number as the QR code payload, discards redundant fields that do not participate in uniqueness identification, and compresses the card type description into a single-word abbreviation, controlling the QR code payload to an extremely low byte level, thereby significantly reducing the QR code version. After the version reduction, the number of QR code modules decreases, and the physical size of a single module can be increased under 203 DPI thermal printing. Combined with a quiet zone protection design, this ensures that the QR code can still be stably read by scanning devices after printing at this resolution. This solves the technical problem of traditional full-load QR codes being "printable but unscannable" on low-resolution thermal label printers, ensuring the effective operation of the inbound and outbound scanning verification process.
[0187] like Figure 2 As shown, in one embodiment, the present invention also provides an examination material packing label generation system based on heterogeneous order parsing, comprising:
[0188] The data parsing module is used to acquire exam material order data in heterogeneous formats, automatically identify and segment the order data according to block structure features, and expand the cross-tab structured order data into flattened order row records to obtain a standardized order dataset.
[0189] The packing planning module is used to group and plan the standardized order dataset according to the preset multi-dimensional packing rules, split the order quantity into several full boxes and process the number of loose bags according to the selected mode, and generate a packing plan that includes the packing details of each box.
[0190] The identification generation module is used to assign a structured globally unique box number to each box in the packing scheme, and extract the minimum unique identification key from the box number to generate a two-dimensional barcode payload with a byte count not exceeding a preset upper limit and adapted to low-resolution thermal printing, so as to obtain the identification data of each box.
[0191] The label rendering and printing sorting module is used to render and generate box labels based on the identification data, and organize the printing order of the labels according to a multi-level sorting key to obtain a label printing sequence arranged according to the production line rhythm.
[0192] The audit and verification module is used to generate a packing verification report corresponding to the label printing sequence, automatically compare the total packing quantity with the total order quantity dimension by dimension, and prohibit label output when the quantity is inconsistent or the source data is incomplete.
[0193] Its beneficial effects are the same as those of the embodiment of the method for generating packing labels for exam materials based on heterogeneous order parsing, and will not be repeated here.
[0194] In one embodiment, this application also provides an electronic device, the electronic device comprising:
[0195] At least one processor; and
[0196] A memory communicatively connected to the at least one processor; wherein,
[0197] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in Embodiment 1.
[0198] In one embodiment, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in Embodiment 1.
[0199] The foregoing has only described certain exemplary embodiments of the present invention by way of illustration. Undoubtedly, those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the foregoing drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.
Claims
1. A method for generating packing labels for exam materials based on heterogeneous order parsing, characterized in that, include: Obtain heterogeneous exam material order data, automatically identify and segment the order data according to block structure features, expand the cross-tab structure order data into flat order row records, and obtain a standardized order dataset; The standardized order dataset is grouped and packed according to the preset multi-dimensional packing rules. The order quantity is divided into several full boxes and the number of loose bags is processed according to the selected mode to generate a packing plan that includes the packing details of each box. Assign a structured, globally unique box number to each box in the packing scheme, and extract the minimum unique identification key from the box number to generate a two-dimensional barcode payload with a byte count not exceeding a preset upper limit and adapted to low-resolution thermal printing, thereby obtaining the identification data of each box; Box labels are generated based on the identification data, and the printing order of the labels is organized according to a multi-level sorting key to obtain a label printing sequence arranged according to the production line rhythm. Generate a packing verification report corresponding to the label printing sequence, automatically compare the total packing quantity with the total order quantity dimension by dimension, and prohibit label output when the quantity is inconsistent or the source data is incomplete.
2. The method for generating packing labels for examination materials based on heterogeneous order parsing according to claim 1, characterized in that, The automatic identification and segmentation of the order data according to block structure features includes: The data file format is automatically determined based on the worksheet name and header keyword characteristics, and different format types follow their respective parsing paths. The examination area blocks are divided according to the block structure characteristics of category header row - sub-header row - data row - examination area name row. The crosstab of each examination area block is expanded into a flat order row with examination area, subject, bag type and quantity as fields. Automatically extract exam name, customer, and batch information from the table title and description text; The built-in administrative division comparison table resolves the examination area to the prefecture-level city affiliation, and supports the overlay and supplementation of external comparison documents.
3. The method for generating packing labels for examination materials based on heterogeneous order parsing according to claim 2, characterized in that, The automatic identification and segmentation of the order data according to block structure features also includes: Perform integrity checks on each segmented test area block. If a data row exists but the corresponding test area name is missing, generate error data containing the source file line number and context location information, and pass the error data to the tag output access control to hard block tag generation.
4. The method for generating packing labels for examination materials based on heterogeneous order parsing according to claim 1, characterized in that, The step of grouping and packing the standardized order dataset according to preset multi-dimensional packing rules includes: Standardized order data is grouped by product type, card type, city / county, and subject. For each group, the quantity is divided into several whole boxes according to the rules of minimum number of bags per box, maximum number of bags per box, and target number of bags per box, and the number of bags in each box is evenly distributed under the constraints of the rules. Two processing paths are provided for the number of loose bags: a combined box mode and a tail box mode, including: In the combined box mode, loose items from different subjects within the same district or county are combined into one box. In the tail box mode, loose items from each subject are packed into a separate tail box and marked as insufficient to fill a whole box.
5. The method for generating packing labels for examination materials based on heterogeneous order parsing according to claim 4, characterized in that, The packing rules are determined by a multi-level fallback hierarchy: subject + card type specific rules > card type default rules > product default rules > built-in default rules. The packing rules are saved as a fully structured external file in Chinese and can be edited and maintained through a password-protected graphical interface.
6. The method for generating packing labels for examination materials based on heterogeneous order parsing according to claim 1, characterized in that, The step of extracting the minimum unique identification key from the box number to generate a two-dimensional barcode payload with a byte count not exceeding a preset upper limit and adapted to low-resolution thermal printing includes: Extract the product type, card type abbreviation, city, district / county, and serial number fields from the structured globally unique box number as the smallest unique identification key, discard fields that do not participate in the uniqueness identification of the box, and compress the card type into a single-word abbreviation, so that the two-dimensional barcode load is controlled within 37 bytes and the QR code version is reduced to no higher than version 3; A readable two-dimensional barcode is generated by laying out a white quiet zone around the two-dimensional barcode drawing area.
7. The method for generating packing labels for examination materials based on heterogeneous order parsing according to claim 6, characterized in that, The uniqueness of the field combination of the two-dimensional barcode payload is verified by the full set of box numbers, ensuring that the cardinality of the payload set is equal to the total number of boxes. The box label also prints the complete Chinese box number in text form, forming a dual-track reading layout that combines a simplified two-dimensional barcode for machine reading and a full text box number for human reading.
8. The method for generating packing labels for examination materials based on heterogeneous order parsing according to claim 1, characterized in that, The structured globally unique box number is: product type - card type - city - district / county - serial number - total number of boxes, where card type is distinguished between A3 and A4 sizes and is numbered independently. Within the same district or county, containers are stably sorted by type, contents, and quantity, and then assigned serial numbers. The question card box number is appended with a statistical information field indicating the total number of question card boxes in this district / county (Z boxes).
9. The method for generating packing labels for examination materials based on heterogeneous order parsing according to claim 1, characterized in that, The multi-level sorting key is a composite sorting key based on unit import order, whether to merge boxes, product type, card type, subject, and box order; Labels are output in the order of units when the data is imported. Within the same unit, full boxes for single subjects are printed first, followed by boxes for combined odds and ends. It also supports output mode that prints by subject group. The packing verification report shall include at least a packing list and a quantity verification report; The automatic comparison is performed dimension by dimension to calculate the total order quantity and total packing quantity. If the quantity in any dimension is inconsistent, the label output is prohibited, and the inconsistency information is located to the specific dimension and numerical difference.
10. A system for generating packing labels for examination materials based on heterogeneous order parsing, characterized in that, include: The data parsing module is used to acquire exam material order data in heterogeneous formats, automatically identify and segment the order data according to block structure features, and expand the cross-tab structured order data into flattened order row records to obtain a standardized order dataset. The packing planning module is used to group and plan the standardized order dataset according to the preset multi-dimensional packing rules, split the order quantity into several full boxes and process the number of loose bags according to the selected mode, and generate a packing plan that includes the packing details of each box. The identification generation module is used to assign a structured globally unique box number to each box in the packing scheme, and extract the minimum unique identification key from the box number to generate a two-dimensional barcode payload with a byte count not exceeding a preset upper limit and adapted to low-resolution thermal printing, so as to obtain the identification data of each box. The label rendering and printing sorting module is used to render and generate box labels based on the identification data, and organize the printing order of the labels according to a multi-level sorting key to obtain a label printing sequence arranged according to the production line rhythm. The audit and verification module is used to generate a packing verification report corresponding to the label printing sequence, automatically compare the total packing quantity with the total order quantity dimension by dimension, and prohibit label output when the quantity is inconsistent or the source data is incomplete.
11. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The medium is a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it implements the method as described in any one of claims 1-9.