Express sheet printing template configuration method and device, equipment and storage medium

By building a basic template library and intelligently matching and modifying it according to user instructions, the customization and management problems of express waybill template configuration are solved, realizing efficient and flexible template configuration and improving configuration efficiency and accuracy.

CN120848824APending Publication Date: 2025-10-28SHANGHAI DONGPU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510882222.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-10-28

Smart Images

  • Figure CN120848824A_ABST
    Figure CN120848824A_ABST
Patent Text Reader

Abstract

The invention relates to the field of logistics, and discloses an express waybill printing template configuration method, device and equipment and a storage medium, and the method is used for realizing efficient and flexible configuration of an express waybill template. The method comprises the following steps: constructing a plurality of basic templates according to different display styles and layouts of express sheet elements, and storing the basic templates in a preset basic template library; receiving a template configuration instruction input by a user, and analyzing the template configuration instruction to obtain application scene information, a target element and element attribute setting information; screening out a basic template with the highest matching degree from a basic template library according to the application scene information and the target element as a to-be-configured template; modifying the to-be-configured template according to the target element and the element attribute setting information, and generating an express sheet printing template meeting user requirements; and configuring a template number for the express sheet printing template, and storing the express sheet printing template in a preset printing template storage library.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of logistics, and in particular to a method, apparatus, equipment, and storage medium for configuring express waybill printing templates. Background Technology

[0002] In the context of digital transformation in the logistics industry, the efficient configuration of express waybill printing templates has become crucial for improving operational efficiency. Current technology has limitations in terms of template configuration flexibility and adaptability, necessitating innovation and optimization to meet the rapidly evolving needs of the industry.

[0003] With the rapid development of e-commerce and logistics, express delivery volume has exploded. As a crucial carrier of logistics information, the efficient configuration of express waybill printing templates has become a key factor in improving logistics efficiency. Traditional methods for configuring express waybill printing templates mainly rely on manual design and static template libraries, which have the following significant problems:

[0004] First, the template customization capabilities are insufficient. Existing template libraries mostly offer fixed styles, making it difficult to meet the diverse needs of different business scenarios such as e-commerce, cross-border logistics, and fresh food delivery for field combinations, layout structures, and styles. For example, cross-border logistics waybills need to include customs declaration information and multilingual fields, which traditional templates struggle to adapt quickly.

[0005] Secondly, the configuration efficiency is low. Manually modifying the template requires manually adjusting the position and attributes of elements, which is not only time-consuming and labor-intensive, but also prone to problems such as information overlap and exceeding the printing area due to layout conflicts, increasing the cost of template debugging.

[0006] Third, there is a lack of intelligent management mechanisms. Templates are stored in a scattered manner, lacking unified numbering and version management, making it difficult to quickly retrieve and reuse them; at the same time, template updates lag behind changes in the rules of express delivery companies (such as privacy-protected waybill policies and the addition of mandatory fields), leading to compliance risks.

[0007] Therefore, existing technologies still need improvement and development. Summary of the Invention

[0008] This invention provides a method, apparatus, device, and storage medium for configuring express waybill printing templates, enabling efficient and flexible configuration of express waybill templates.

[0009] The first aspect of this invention provides a method for configuring a courier waybill printing template. The method includes: constructing multiple basic templates based on different display styles and layouts of courier waybill elements, and storing them in a preset basic template library; receiving a template configuration instruction input by a user, parsing the instruction to obtain application scenario information, target elements, and element attribute setting information; selecting the basic template with the highest matching degree from the basic template library as the template to be configured based on the application scenario information and the target elements; modifying the template to be configured based on the target elements and the element attribute setting information to generate a courier waybill printing template that meets the user's needs; assigning a template number to the courier waybill printing template, and storing the template in a preset printing template repository.

[0010] Optionally, in a first implementation of the first aspect of the present invention, the step of constructing multiple basic templates based on different display styles and layouts of express delivery waybill elements and storing them in a preset basic template library includes: classifying and combining express delivery waybill elements according to different display styles and layouts to form multiple basic templates; configuring template application scenarios and identification codes for each basic template; and grouping and storing the configured basic templates according to template application scenarios in a preset basic template library.

[0011] Optionally, in a second implementation of the first aspect of the present invention, receiving the template configuration instruction input by the user, parsing the template configuration instruction to obtain application scenario information, target elements, and element attribute setting information includes: receiving the template configuration instruction input by the user; cleaning and standardizing the template configuration instruction to obtain a processed template configuration instruction; parsing the processed template configuration instruction to obtain multiple fields; and extracting application scenario information, target elements, and element attribute setting information from the multiple fields.

[0012] Optionally, in a third implementation of the first aspect of the present invention, the step of selecting the basic template with the highest matching degree from the basic template library as the template to be configured based on the application scenario information and the target element includes: traversing each basic template in the basic template library, calculating the matching degree between each basic template and the template configuration instruction based on the application scenario information and the target element; sorting the basic templates in descending order of matching degree, and selecting the basic template with the highest matching degree as the template to be configured; if there are multiple basic templates with the same and highest matching degree, then randomly selecting one basic template from the multiple basic templates with the same and highest matching degree as the template to be configured.

[0013] Optionally, in a fourth implementation of the first aspect of the present invention, the step of modifying the template to be configured according to the target element and the element attribute setting information to generate a courier waybill printing template that meets the user's needs includes: extracting elements of the template to be configured, and performing deletion or addition operations on the elements of the template to be configured according to the target element to obtain an adjusted template to be configured; modifying the attributes of the adjusted template to be configured according to the element attribute setting information to obtain a modified template; determining whether the elements of the modified template exceed the printing area, and if the elements of the modified template exceed the printing area, adjusting the modified template to generate a courier waybill printing template that meets the user's needs.

[0014] Optionally, in a fifth implementation of the first aspect of the present invention, determining whether the elements of the modified template exceed the printing area, and adjusting the modified template to generate a courier waybill printing template that meets the user's needs, includes: abstracting each element of the modified template into a rectangular area and calculating the area occupied by each element; checking whether any element's occupied area exceeds the printing area, and if so, calculating the proportion of the element exceeding the printing area; determining the proportion level to which the proportion of the excess printing area belongs, and executing a compression strategy, layout rearrangement strategy, or structural reorganization strategy according to different proportion levels to adjust the modified template and generate a courier waybill printing template that meets the user's needs.

[0015] Optionally, in a sixth implementation of the first aspect of the present invention, configuring a template number for the express waybill printing template and storing the express waybill printing template in a preset printing template repository includes: generating a template number for the express waybill printing template based on a preset template numbering rule; determining whether the generated template number already exists; if so, regenerating the template number; if not, binding the generated template number to the current express waybill printing template; storing the express waybill printing template in the preset printing template repository and establishing an index.

[0016] A second aspect of the present invention provides a device for configuring express waybill printing templates, comprising: a construction module, configured to construct multiple basic templates according to different display styles and layouts of express waybill elements, and store them in a preset basic template library; a parsing module, configured to receive template configuration instructions input by a user, parse the template configuration instructions, and obtain application scenario information, target elements, and element attribute setting information; a matching module, configured to select the basic template with the highest matching degree from the basic template library as the template to be configured based on the application scenario information and the target elements; a modification module, configured to modify the template to be configured based on the target elements and the element attribute setting information, and generate an express waybill printing template that meets the user's needs; and a generation module, configured to assign a template number to the express waybill printing template and store the express waybill printing template in a preset printing template storage library.

[0017] Optionally, in a first implementation of the second aspect of the present invention, the construction module includes: a construction unit, used to classify and combine express waybill elements according to different display styles and layouts to form multiple basic templates; a configuration unit, used to configure template application scenarios and identification codes for each basic template; and a first storage unit, used to group and store the configured basic templates according to template application scenarios in a preset basic template library.

[0018] Optionally, in a second implementation of the second aspect of the present invention, the parsing module includes: a preprocessing unit, configured to receive a template configuration instruction input by a user, clean and standardize the template configuration instruction to obtain a processed template configuration instruction; a parsing unit, configured to parse the processed template configuration instruction to obtain multiple fields; and an extraction unit, configured to extract application scenario information, target elements, and element attribute setting information from the multiple fields.

[0019] Optionally, in a third implementation of the second aspect of the present invention, the matching module includes: a calculation unit, configured to traverse each basic template in the basic template library and calculate the matching degree between each basic template and the template configuration instruction based on the application scenario information and the target element; a selection unit, configured to sort the basic templates in descending order of matching degree and select the basic template with the highest matching degree as the template to be configured; and a matching unit, configured to randomly select one basic template from the multiple basic templates with the same and highest matching degree as the template to be configured if there are multiple basic templates with the same and highest matching degree.

[0020] Optionally, in a fourth implementation of the second aspect of the present invention, the modification module includes: a first adjustment unit, configured to extract elements of the template to be configured, and perform deletion or addition operations on the elements of the template to be configured according to the target element to obtain an adjusted template to be configured; a modification unit, configured to modify the attributes of the adjusted template to be configured according to the element attribute setting information to obtain a modified template; and a second adjustment unit, configured to determine whether the elements of the modified template exceed the printing area, and if the elements of the modified template exceed the printing area, adjust the modified template to generate a courier waybill printing template that meets the user's needs.

[0021] Optionally, in a fifth implementation of the second aspect of the present invention, the generation module includes: a generation unit, configured to generate a template number for the express waybill printing template based on a preset template numbering rule; a judgment unit, configured to determine whether the generated template number already exists; if so, to regenerate the template number; if not, to bind the generated template number to the current express waybill printing template; and a second saving unit, configured to store the express waybill printing template in a preset printing template repository and establish an index.

[0022] A third aspect of the present invention provides a device for configuring a courier waybill printing template, comprising: a memory and at least one processor, wherein the memory stores computer-readable instructions, and the memory and the at least one processor are interconnected via a circuit; the at least one processor invokes the computer-readable instructions in the memory to cause the courier waybill printing template configuration device to perform the various steps of the courier waybill printing template configuration method described above.

[0023] A fourth aspect of the present invention provides a computer-readable storage medium storing computer-readable instructions that, when executed on a computer, cause the computer to perform the steps of the express waybill printing template configuration method described above.

[0024] The technical solution provided by this invention constructs a basic template library, modularly storing common waybill styles and layouts used in express delivery, such as multi-product display templates commonly used in e-commerce shipping and simplified contact information templates for same-city express delivery. This enables resource reuse and significantly reduces configuration workload. Furthermore, by parsing template configuration instructions and extracting key information, user needs can be quickly identified, and the most suitable basic template can be matched based on application scenario information and target elements. In addition, the template to be configured can be modified according to target elements and element attribute settings to generate express waybill printing templates that meet user needs, making modifications more flexible. A template number is assigned to the express waybill printing template, and the template is stored in a preset printing template repository, facilitating efficient template management and rapid retrieval. This effectively improves the efficiency and accuracy of express waybill template configuration and reduces operating costs. Attached Figure Description

[0025] Figure 1 This is a first flowchart of the method for configuring express waybill printing templates provided in an embodiment of the present invention;

[0026] Figure 2 This is a second flowchart of the method for configuring express waybill printing templates provided in an embodiment of the present invention;

[0027] Figure 3 This is a third flowchart of the express waybill printing template configuration method provided in the embodiments of the present invention;

[0028] Figure 4 This is a fourth flowchart of the express waybill printing template configuration method provided in this embodiment of the invention;

[0029] Figure 5 This is a fifth flowchart of the method for configuring express waybill printing templates provided in an embodiment of the present invention;

[0030] Figure 6 The sixth flowchart of the express waybill printing template configuration method provided in the embodiments of the present invention;

[0031] Figure 7 This is a schematic diagram of the structure of the express waybill printing template configuration device provided in an embodiment of the present invention;

[0032] Figure 8 A schematic diagram of the configuration device for the express waybill printing template provided in an embodiment of the present invention. Detailed Implementation

[0033] This invention provides a method, apparatus, device, and storage medium for configuring express waybill printing templates. The method enables efficient and flexible configuration of express waybill templates. The method includes: constructing multiple basic templates based on different display styles and layouts of express waybill elements, and storing them in a preset basic template library; receiving template configuration instructions input by a user, parsing the instructions to obtain application scenario information, target elements, and element attribute setting information; selecting the basic template with the highest matching degree from the basic template library as the template to be configured based on the application scenario information and target elements; modifying the template to be configured based on the target elements and element attribute setting information to generate an express waybill printing template that meets the user's needs; assigning a template number to the express waybill printing template, and storing the express waybill printing template in a preset printing template storage library.

[0034] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0035] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of a method for configuring a courier waybill printing template in this invention includes:

[0036] S101. Construct multiple basic templates based on the different display styles and layouts of the express waybill elements, and save them in the preset basic template library.

[0037] It is understood that the executing entity of this invention can be a courier waybill printing template configuration device, a terminal, or a server; no specific limitation is made here. This embodiment of the invention will be described using a server as an example.

[0038] In this embodiment, the required elements for express delivery waybills are determined based on the specific needs of different business scenarios. For example, for e-commerce platform bulk shipping scenarios, a template is configured containing elements such as product name, quantity, unit price, order number, and recipient details, using a column layout to ensure clear and organized information display. For same-city express delivery, a template is designed highlighting elements such as rider contact information, estimated delivery time, and urgency indicators, using a concise and intuitive layout to improve information delivery efficiency. Multiple basic templates are created according to different display styles and layout specifications. During the creation process, the font, font size, color, margins, and other attributes of each element are precisely set to ensure the template's standardization and aesthetics. After the basic templates are completed, they are saved in a preset basic template library in JSON format. Each template includes detailed metadata, including applicable scenarios, included elements, creation time, and creator information, facilitating subsequent retrieval and management. For example, the metadata of the e-commerce shipping template clearly indicates "Applicable scenario: E-commerce platform bulk shipping; Included elements: Product information, order number, recipient information, etc."

[0039] S102. Receive the template configuration instruction input by the user, parse the template configuration instruction, and obtain the application scenario information, target element, and element attribute setting information.

[0040] In this embodiment, when a user inputs a template configuration command through the system interface or API interface, the system's built-in command parsing module first uses regular expressions to perform preliminary processing on the command, extracting keywords and key phrases such as "cross-border logistics," "recipient's English address," and "bold font." Then, using Natural Language Processing (NLP) technology, semantic analysis is performed on the extracted content to accurately identify application scenario information, target elements, and element attribute settings. For example, for the command "Configure cross-border logistics waybill, requiring display of recipient's English address and customs declaration information, with bold font," the system determines through semantic analysis that "cross-border logistics" is the application scenario information, "recipient's English address" and "customs declaration information" are the target elements, and "bold font" is the element attribute setting information.

[0041] S103. Based on the application scenario information and target elements, select the basic template with the highest matching degree from the basic template library as the template to be configured.

[0042] In this embodiment, based on the parsed application scenario information and target elements, the system performs a filtering operation in the basic template library. The filtering process uses a weighted scoring algorithm to evaluate each template in the basic template library. Different weight values ​​are set to measure the degree of matching between the template and the user's needs. For example, for application scenario information, if the applicable scenario of the template is completely consistent with the user's specified scenario, a higher weight score is given; for target elements, the score is increased for each target element required by the user. Taking the cross-border logistics scenario as an example, if the basic template contains elements such as the recipient's English address and the customs declaration form format area, and the layout conforms to the specifications of cross-border logistics waybills, the template will receive a higher score during the scoring. By sorting the scores of all templates, the template with the highest score is selected as the template to be configured.

[0043] S104. Modify the template to be configured based on the target element and element attribute settings to generate a courier waybill printing template that meets the user's needs.

[0044] In this embodiment, the template editing engine adjusts and adds elements in the template based on the target element and element attribute settings. If the user requests that certain text elements be bolded, the editing engine will find the corresponding HTML or CSS code and modify the font style attributes. If a new target element needs to be added, such as adding a QR code to a waybill, the editing engine will call the system's image generation interface to generate a QR code image that meets the requirements and insert it into the appropriate position in the template. At the same time, the layout of related elements will be adjusted to ensure that the overall layout is aesthetically pleasing and harmonious. During the modification process, the system generates a preview image of the template in real time, which the user can view and provide feedback through the interface, and make further modification suggestions, such as adjusting the position of elements or changing the color scheme.

[0045] S105. Configure a template number for the express waybill printing template and store the express waybill printing template in the preset printing template repository.

[0046] In this embodiment, a unique template number is assigned to each generated express waybill printing template. The numbering rule follows the format of "business type code + year + month + serial number", such as "KD-2025-06-008", where "KD" represents express delivery business, "2025-06" represents June 2025, and "008" is the 8th template generated in that month. The template and its related metadata (including configuration instructions, modification records, generation time, associated base template number, etc.) are stored in a preset printing template repository.

[0047] This embodiment provides a method for configuring express delivery waybill printing templates. It constructs a basic template library, modularly storing common waybill styles and layouts used in express delivery, such as multi-product display templates commonly used in e-commerce shipping and simplified contact information templates for same-city express delivery. This enables resource reuse and significantly reduces configuration workload. Furthermore, by parsing template configuration instructions and extracting key information, it can quickly locate user needs and match the most suitable basic template based on application scenario information and target elements. In addition, it modifies the template to be configured based on target elements and element attribute settings to generate express delivery waybill printing templates that meet user needs, making modifications more flexible. The method assigns template numbers to express delivery waybill printing templates and stores them in a preset printing template repository, facilitating efficient template management and rapid retrieval, effectively improving the efficiency and accuracy of express delivery waybill template configuration, and reducing operating costs.

[0048] See also Figure 2 The second embodiment of the express waybill printing template configuration method in this invention includes:

[0049] S201. Classify and combine the express waybill elements according to different display styles and layouts to form multiple basic templates.

[0050] In this embodiment, firstly, all elements involved in the express delivery business on the waybill are comprehensively reviewed, including the recipient's name, phone number, address, sender information, tracking number, product name, weight, volume, insurance label, and signature field. The display characteristics of these elements are analyzed according to different business needs. For example, in the scenario of bulk shipments on e-commerce platforms, to facilitate quick scanning and verification, the tracking number is highlighted in large font and a prominent color, while product name, quantity, and other information are arranged in a table format. Same-city express delivery emphasizes timeliness, placing elements such as estimated delivery time and rider contact information in a prominent position on the waybill.

[0051] S202. Configure template application scenarios and identification codes for each basic template.

[0052] In this embodiment, the applicable application scenario for each template is clearly defined. The determination of the application scenario comprehensively considers factors such as business type, customer group, and transportation method. For example, a template that includes elements such as a detailed product list and return address is set as an application scenario for e-commerce return business; a template with cold chain temperature monitoring labels and fresh food shelf-life reminders is suitable for fresh food cold chain delivery business. At the same time, a unique identification code is assigned to each basic template. The identification code adopts a specific coding rule, such as a combination of letters and numbers. The letters represent the category to which the template belongs (e.g., "E" represents e-commerce related templates, and "L" represents general logistics templates), and the numbers are sequential numbers, such as "E-001" representing the first basic template in the e-commerce category.

[0053] S203. Group and save the configured basic templates in a preset basic template library according to the template application scenarios.

[0054] In this embodiment, a preset basic template library is established, and its storage structure can adopt a combination of a distributed file system and a database. According to the application scenarios configured for each basic template, the templates are grouped and saved. For example, different grouping directories such as "e-commerce shipping", "same-city express delivery", "cross-border logistics", and "fresh food distribution" are created, and the basic templates corresponding to the application scenarios are placed in the corresponding directories.

[0055] In this embodiment, by classifying and combining the elements of the express waybill, various common styles and layouts can be efficiently integrated, avoiding repeated design; configuring application scenarios and identification codes for the templates makes the template attributes clear and definite, facilitating subsequent accurate screening; storing by application scenarios in groups greatly improves the template retrieval efficiency, making the entire basic template library well-managed and convenient to call, providing a solid and reliable resource basis for the rapid configuration of express waybill printing templates.

[0056] Please refer to Figure 3 , the third embodiment of a method for configuring an express waybill printing template in an embodiment of the present invention includes:

[0057] S301. Receive the template configuration instruction input by the user, clean and standardize the template configuration instruction to obtain the processed template configuration instruction.

[0058] In this embodiment, the instructions input by the user may have problems such as spelling mistakes, redundant expressions, inconsistent formats, etc. First, clean the instructions, and then use the text correction algorithm in natural language processing technology to automatically detect and correct the typos in the instructions. For example, correct "express waybill of quick悌" to "express waybill". At the same time, remove the invalid characters and redundant information in the instructions, such as extra spaces, special symbols, etc., to make the instruction content more concise and standardized. Finally, perform standardization processing to统一 the vocabulary in the instructions into the standard terms preset by the system. For example, convert the expressions such as "same-city express delivery" and "intra-city express delivery" input by the user into the system standard "same-city express delivery"; standardize "recipient's contact phone number" to "recipient's phone number". In addition, for information such as dates and times, standardize them according to a unified format, such as standardizing "June 2025" to "2025-06".

[0059] S302. Analyze the processed template configuration instruction to obtain multiple fields.

[0060] In this embodiment, the instruction is divided into multiple independent parts according to preset syntax rules and a keyword library. For example, for the instruction "Configure cross-border logistics waybill, which must include the recipient's English address and the product's HS code, and set the font to Arial", the system will divide the instruction into parts such as "cross-border logistics waybill", "recipient's English address and product's HS code", and "set the font to Arial" based on keywords such as "configure", "include", and "set to". Then, using Named Entity Recognition (NER) technology, the entity type in each part is identified, such as identifying "cross-border logistics waybill" as an application scenario-related entity, "recipient's English address" and "product's HS code" as target elements, and "Arial" as a font attribute-related entity.

[0061] S303. Extract application scenario information, target element, and element attribute setting information from multiple fields.

[0062] In this embodiment, after obtaining multiple fields, the system accurately extracts application scenario information, target elements, and element attribute settings from these fields using preset information extraction rules. For application scenario information, the system matches a pre-defined scenario keyword library in fields containing scenario descriptions. For example, if keywords such as "cross-border logistics," "e-commerce delivery," and "same-city express delivery" are found in the parsed fields, the corresponding field content is extracted as application scenario information.

[0063] In this embodiment, the process design of instruction cleaning and standardization, field parsing, and precise information extraction can efficiently and accurately sort out user needs. Instruction cleaning and standardization can remove interfering information and unify the format, avoiding parsing errors caused by differences in expression. Multi-field parsing and targeted information extraction can comprehensively and meticulously explore users' requirements for application scenarios, target elements, and attribute settings, ensuring that subsequent template selection and configuration work is targeted, greatly improving the efficiency and accuracy of express waybill template configuration, and reducing repeated modifications caused by misunderstandings of requirements.

[0064] See also Figure 4 A fourth embodiment of a method for configuring a courier waybill printing template in this invention includes:

[0065] S401. Traverse each basic template in the basic template library and calculate the matching degree between each basic template and the template configuration instructions based on the application scenario information and the target element.

[0066] In this embodiment, upon receiving the user's template configuration instruction and parsing the application scenario information and target elements, a process of traversing the basic template library is initiated, evaluating each template in the library one by one. A weighted scoring algorithm is used to calculate the matching degree. Application scenario information is assigned a higher weight because the application scenario determines the basic framework and scope of application of the template. For example, if the user's application scenario is "cross-border logistics," and a basic template's application scenario is also labeled as "cross-border logistics," then that template will receive full marks in the application scenario category. If the relevance is only partial, such as if the template is applicable to "international express delivery" and has some connection with "cross-border logistics," then a corresponding score is given based on the degree of relevance.

[0067] S402. Sort the basic templates in descending order of matching degree, and select the basic template with the highest matching degree as the template to be configured.

[0068] In this embodiment, after calculating the matching degree of all basic templates, a sorting algorithm (such as quicksort, mergesort, etc.) is used to arrange the basic templates in descending order of matching degree. Thus, the basic template with the highest matching degree will be at the top of the list. This top-ranked basic template is then directly selected as the template to be configured; this template is the one that best matches the user's configuration command.

[0069] S403. If there are multiple basic templates with the same and highest matching degree, then randomly select one basic template from the multiple basic templates with the same and highest matching degree as the template to be configured.

[0070] In this embodiment, during the actual screening process, multiple basic templates may have the same and highest matching degree. For example, two basic templates may fully meet the user's application scenario and target element requirements, but have slight differences in some detailed layouts. In this case, a random selection mechanism is activated, and a random index is generated by a random number generator. The template with the corresponding index is selected from these basic templates with the same and highest matching degree as the template to be configured.

[0071] In this embodiment, quantitative calculations are performed based on application scenarios and target elements to ensure that the screening results are highly consistent with the user's configuration instructions. Moreover, through matching degree calculation and intelligent sorting mechanisms, the template that best meets the user's needs can be quickly and accurately located from the basic template library, effectively avoiding the inefficiency and subjectivity of manual screening. In addition, the flexible sorting and random selection strategies can prioritize the best matching template and make reasonable choices when multiple high-quality options appear, greatly improving the efficiency and accuracy of express waybill template configuration.

[0072] See also Figure 5The fifth embodiment of a method for configuring a courier waybill printing template in this invention includes:

[0073] S501. Extract the elements of the template to be configured, and perform deletion or addition operations on the elements of the template to be configured according to the target element to obtain the adjusted template to be configured.

[0074] In this embodiment, the underlying code of the template to be configured (such as an HTML, CSS, or JSON template file) is first read, and all elements contained in the template are parsed out, including text boxes (such as recipient name and address), icons (such as logistics icons and warning icons), barcodes, QR codes, etc., and these elements are stored in an element list. Then, the parsed target elements are compared one by one with the element list of the template to be configured. If an element that the user does not need is found in the template (i.e., an element that does not exist in the target element list), a deletion operation is automatically performed. For example, if the user configuration instruction does not mention the target element "insured amount", but the template to be configured contains this element, the corresponding element tag and its related attribute settings will be deleted from the template code, and the layout of other elements will be adjusted to ensure that the remaining elements are arranged reasonably.

[0075] For target elements that exist in the user's requirements but are missing from the template, an addition operation is performed. First, the corresponding element code is retrieved from the system's preset element library. For example, when adding a "product traceability code" element, the code module for generating the traceability code is retrieved from the element library. Then, according to the overall layout and design specifications of the template, the new element is inserted into the appropriate position. For example, if there is a reserved area for additional information on the right side of the template, the traceability code element is added there, and its size and margins are adjusted to maintain coordination and consistency with surrounding elements, ultimately resulting in the adjusted template to be configured.

[0076] S502. Modify the attributes of the adjusted template to be configured according to the element attribute setting information to obtain the modified template.

[0077] In this embodiment, element attribute settings information is obtained. These settings include style attributes such as font (e.g., SimSun, HeiTi), font size (e.g., 12px, 14px), color (e.g., RGB values, hexadecimal color codes), bold, italics, and alignment (left-aligned, center-aligned), as well as layout attributes such as the element's position coordinates, width, and height. Based on these attribute settings, the corresponding elements in the adjusted template to be configured are modified.

[0078] For text elements, the system locates the CSS or related style properties in the template code that control the text style, and modifies the font, font size, color, and other properties to the user-specified values. For non-text elements such as graphics and icons, the system adjusts their size, position, and display effects.

[0079] S503. Determine whether the elements of the modified template exceed the printing area. If the elements of the modified template exceed the printing area, adjust the modified template to generate a courier waybill printing template that meets the user's needs.

[0080] In this embodiment, it is determined whether the elements of the modified template exceed the printing area. If the elements of the modified template exceed the printing area, the modified template is adjusted to generate a courier waybill printing template that meets the user's needs. This includes: abstracting each element of the modified template into a rectangular area and calculating the area occupied by each element; checking whether any element's occupied area exceeds the printing area. If so, the proportion of the element exceeding the printing area is calculated; determining the proportion level to which the proportion of the excess printing area belongs, and executing a compression strategy, layout rearrangement strategy, or structural reorganization strategy according to different proportion levels to adjust the modified template and generate a courier waybill printing template that meets the user's needs.

[0081] In this embodiment, multiple proportion level ranges are preset, such as 0-10% for low level, 10%-30% for medium level, and above 30% for high level. The proportion level is determined based on the calculated proportion of an element that exceeds the printing area.

[0082] Low level (0-10%): When the proportion of elements exceeds this range, the system executes a compression strategy.

[0083] Medium level (10%-30%): If the proportion exceeds this range, the system adopts a layout rearrangement strategy. It analyzes the positional relationships and priorities of each element in the template, moves out-of-bounds elements to blank areas within the template, and adjusts the positions and spacing of adjacent or related elements to ensure overall layout harmony.

[0084] High Level (30% or more): When the proportion of elements exceeding the limit is high, a structural reorganization strategy is initiated. The overall layout structure of the template is redesigned, for example, changing the original multi-column layout to a single-column layout, or grouping and integrating the information in the template, folding or hiding secondary information to make room for out-of-bounds elements.

[0085] In this embodiment, a systematic and hierarchical operation process ensures that the generated template accurately matches user needs and meets actual printing requirements. The addition and deletion of elements can flexibly adapt to users' personalized needs for information display. Attribute modification enables the template to achieve the best visual presentation effect. The verification and adjustment of the printing area are based on practical application to avoid printing problems caused by design errors, effectively improving the efficiency and practicality of template configuration, reducing resource waste caused by rework, and ensuring the efficient operation of express delivery services in the waybill printing process.

[0086] See also Figure 6The sixth embodiment of a method for configuring a courier waybill printing template in this invention includes:

[0087] S601. Generate template numbers for express waybill printing templates based on preset template numbering rules.

[0088] In this embodiment, the numbering rule is "Business Type Code + Year + Month + Serial Number". The "Business Type Code" uses specific letters or letter combinations to represent different express delivery business scenarios, such as "EC" for e-commerce delivery and "LC" for same-city logistics. The "Year" and "Month" are represented by four and two digits respectively, such as "202506" for June 2025. The "Serial Number" is a three-digit number starting from 001 and incrementing sequentially, used to distinguish different templates within the same period. When a new express waybill printing template is generated, the corresponding business type code is obtained based on the template's business type. Combined with the current date, the year and month information are generated. The current serial number is then retrieved from the number counter. These information are combined to generate a template number such as "EC-202506-008".

[0089] S602. Determine whether the generated template number already exists. If yes, regenerate the template number. If no, bind the generated template number to the current express waybill printing template.

[0090] In this embodiment, a database query (such as a SELECT statement in SQL) is used to check if the same template number already exists in the repository. If the query result shows that the number already exists, it means that a template has already used this number. The number counter is then updated by incrementing the serial number by 1. The template number is then regenerated according to the numbering rules, and deduplication is checked again. This process is repeated until a unique number that does not exist in the repository is generated. When it is confirmed that the generated template number has not been used, the number is bound to the current express waybill printing template. The number is recorded in the metadata information of the express waybill printing template, and a relationship between the express waybill printing template and the number is established in the database.

[0091] S603. Store the express waybill printing template to the preset printing template repository and create an index.

[0092] In this embodiment, the generated express waybill printing templates are stored in a preset printing template repository in a specific file format (such as PDF, JSON, XML, etc.). To improve template retrieval efficiency, the system creates indexes in the database based on commonly used retrieval fields such as template number, application scenario, and creation time. For example, a B-Tree index structure is used to create an index on the template number field.

[0093] In this embodiment, through number generation, deduplication and binding mechanisms, combined with a scientific storage and indexing process, efficient management and rapid retrieval of express waybill printing templates are achieved.

[0094] The method for configuring the express waybill printing template in the embodiments of the present invention has been described above. The apparatus in the embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 7 The implementation methods of the express waybill printing template configuration device in this invention include:

[0095] Module 701 is used to build multiple basic templates based on different display styles and layouts of express waybill elements, and save them in the preset basic template library;

[0096] The parsing module 702 is used to receive template configuration instructions input by the user, parse the template configuration instructions, and obtain application scenario information, target elements, and element attribute setting information;

[0097] The matching module 703 is used to select the basic template with the highest matching degree from the basic template library as the template to be configured based on the application scenario information and the target element;

[0098] Modification module 704 is used to modify the template to be configured according to the target element and the element attribute setting information, so as to generate a courier waybill printing template that meets the user's needs;

[0099] The generation module 705 is used to configure a template number for the express waybill printing template and store the express waybill printing template in a preset printing template repository.

[0100] In this embodiment, the construction module 701 includes: a construction unit 7011, used to classify and combine express waybill elements according to different display styles and layouts to form multiple basic templates; a configuration unit 7012, used to configure template application scenarios and identification codes for each basic template; and a first storage unit 7013, used to group and store the configured basic templates according to template application scenarios in a preset basic template library.

[0101] In this embodiment, the parsing module 702 includes: a preprocessing unit 7021, used to receive template configuration instructions input by the user, clean and standardize the template configuration instructions to obtain processed template configuration instructions; a parsing unit 7022, used to parse the processed template configuration instructions to obtain multiple fields; and an extraction unit 7023, used to extract application scenario information, target elements, and element attribute setting information from the multiple fields.

[0102] In this embodiment, the matching module 703 includes: a calculation unit 7031, used to traverse each basic template in the basic template library and calculate the matching degree between each basic template and the template configuration instruction based on the application scenario information and the target element; a selection unit 7032, used to sort the basic templates in descending order of matching degree and select the basic template with the highest matching degree as the template to be configured; and a matching unit 7033, used to randomly select one basic template from the multiple basic templates with the same and highest matching degree as the template to be configured if there are multiple basic templates with the same and highest matching degree.

[0103] In this embodiment, the modification module 704 includes: a first adjustment unit 7041, used to extract elements of the template to be configured, and perform deletion or addition operations on the elements of the template to be configured according to the target element to obtain an adjusted template to be configured; a modification unit 7042, used to modify the attributes of the adjusted template to be configured according to the element attribute setting information to obtain a modified template; and a second adjustment unit 7043, used to determine whether the elements of the modified template exceed the printing area. If the elements of the modified template exceed the printing area, the modified template is adjusted to generate a courier waybill printing template that meets the user's needs.

[0104] In this embodiment, the generation module 705 includes: a generation unit 7051, used to generate a template number for the express waybill printing template based on a preset template numbering rule; a judgment unit 7052, used to judge whether the generated template number already exists; if so, regenerate the template number; if not, bind the generated template number to the current express waybill printing template; and a second storage unit 7053, used to store the express waybill printing template in a preset printing template storage repository and establish an index.

[0105] In this embodiment, a basic template library is constructed to modularly store common waybill styles and layouts used in express delivery, such as multi-product display templates commonly used in e-commerce shipping and simplified contact information templates for same-city express delivery. This enables resource reuse and significantly reduces configuration workload. Furthermore, by parsing template configuration instructions and extracting key information, user needs can be quickly identified, and the most suitable basic template can be matched based on application scenario information and target elements. In addition, the template to be configured can be modified according to the target elements and element attribute settings to generate express waybill printing templates that meet user needs. Modification is more flexible. The express waybill printing templates are assigned template numbers and stored in a preset printing template repository, facilitating efficient template management and quick retrieval. This effectively improves the efficiency and accuracy of express waybill template configuration and reduces operating costs.

[0106] Figure 7The structure of the express waybill printing template configuration device shown does not constitute a limitation on the express waybill printing template configuration device, and can implement the steps of the express waybill printing template configuration method provided in the above method embodiments.

[0107] above Figure 7 The express waybill printing template configuration device in this embodiment of the invention is described in detail from the perspective of modular functional entities. The express waybill printing template configuration device in this embodiment of the invention is described in detail from the perspective of hardware processing.

[0108] Figure 8 This is a schematic diagram of a configuration device for a courier waybill printing template provided in an embodiment of the present invention. The device 800 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 810 (e.g., one or more processors) and a memory 820, and one or more storage media 830 (e.g., one or more mass storage devices) for storing application programs 833 or data 832. The memory 820 and storage media 830 can be temporary or persistent storage. The program stored in the storage media 830 may include one or more modules (not shown), each module including a series of instruction operations on the device 800. Furthermore, the processor 810 may be configured to communicate with the storage media 830 and execute the series of instruction operations in the storage media on the device 800.

[0109] Device 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input / output interfaces 860, and / or one or more operating systems 831, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.

[0110] This invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of the express waybill printing template configuration method.

[0111] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0112] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0113] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for configuring a courier waybill printing template, characterized in that, The method for configuring the express waybill printing template includes: Multiple basic templates are built based on the different display styles and layouts of the express waybill elements, and saved in the preset basic template library; Receive template configuration instructions input by the user, parse the template configuration instructions, and obtain application scenario information, target elements, and element attribute setting information; Based on the application scenario information and the target element, the basic template with the highest matching degree is selected from the basic template library as the template to be configured; The template to be configured is modified according to the target element and the element attribute setting information to generate a courier waybill printing template that meets the user's needs; Assign a template number to the express waybill printing template and store the express waybill printing template in a preset printing template repository.

2. The method for configuring a courier waybill printing template according to claim 1, characterized in that, The process involves constructing multiple basic templates based on different display styles and layouts of express delivery waybill elements, and saving them in a preset basic template library, including: The elements of the express delivery waybill are categorized and combined according to different display styles and layouts to form multiple basic templates; Configure a template application scenario and identification code for each of the basic templates; The configured basic templates are grouped and saved in a preset basic template library according to the template application scenarios.

3. The method for configuring a courier waybill printing template according to claim 1, characterized in that, The process of receiving user-input template configuration instructions, parsing the template configuration instructions, and obtaining application scenario information, target elements, and element attribute setting information includes: Receive template configuration instructions input by the user, clean and standardize the template configuration instructions to obtain processed template configuration instructions; The processed template configuration instructions are parsed to obtain multiple fields; Extract application scenario information, target element, and element attribute setting information from multiple fields.

4. The method for configuring a courier waybill printing template according to claim 1, characterized in that, The step of selecting the most matching basic template from the basic template library as the template to be configured based on the application scenario information and the target element includes: Iterate through each basic template in the basic template library, and calculate the matching degree between each basic template and the template configuration instruction based on the application scenario information and the target element; The basic templates are sorted in descending order of matching degree, and the basic template with the highest matching degree is selected as the template to be configured. If there are multiple basic templates with the same and highest matching degree, then one basic template with the same and highest matching degree will be randomly selected as the template to be configured.

5. The method for configuring a courier waybill printing template according to claim 1, characterized in that, The step of modifying the template to be configured based on the target element and the element attribute setting information to generate a courier waybill printing template that meets the user's needs includes: Extract the elements of the template to be configured, and perform deletion or addition operations on the elements of the template to be configured according to the target element to obtain the adjusted template to be configured; Based on the element attribute setting information, the attributes of the adjusted template to be configured are modified to obtain the modified template; Determine whether the elements of the modified template exceed the printing area. If the elements of the modified template exceed the printing area, adjust the modified template to generate a courier waybill printing template that meets the user's needs.

6. The method for configuring a courier waybill printing template according to claim 5, characterized in that, The step of determining whether the elements of the modified template exceed the printing area, and if the elements of the modified template exceed the printing area, adjusting the modified template to generate a courier waybill printing template that meets the user's needs, includes: Abstract each element of the modified template into a rectangular region, and calculate the area occupied by each element; Check if any element occupies an area that exceeds the print area. If so, calculate the proportion of the element that exceeds the print area. Determine the scale level of the proportion exceeding the printing area, and execute compression, layout rearrangement, or structural reorganization strategies according to different scale levels to adjust the modified template and generate a courier waybill printing template that meets the user's needs.

7. The method for configuring a courier waybill printing template according to claim 1, characterized in that, The step of configuring a template number for the express waybill printing template and storing the express waybill printing template in a preset printing template repository includes: A template number is generated for the express waybill printing template based on a preset template numbering rule; Determine if the generated template number already exists. If so, regenerate the template number. If not, bind the generated template number to the current express waybill printing template. The express waybill printing template is stored in a preset printing template repository and an index is created.

8. A device for configuring a printing template for express delivery waybills, characterized in that, include: The building module is used to create multiple basic templates based on different display styles and layouts of express waybill elements, and save them in a preset basic template library; The parsing module is used to receive template configuration instructions input by the user, parse the template configuration instructions, and obtain application scenario information, target elements, and element attribute setting information; The matching module is used to select the basic template with the highest matching degree from the basic template library as the template to be configured based on the application scenario information and the target element; The modification module is used to modify the template to be configured based on the target element and the element attribute setting information, so as to generate a courier waybill printing template that meets the user's needs. The generation module is used to configure a template number for the express waybill printing template and store the express waybill printing template in a preset printing template repository.

9. A device for configuring express waybill printing templates, characterized in that, It includes a memory and at least one processor, wherein the memory stores computer-readable instructions; The at least one processor invokes the computer-readable instructions in the memory to perform the steps of the express waybill printing template configuration method as described in any one of claims 1-7.

10. A computer-readable storage medium storing computer-readable instructions thereon, characterized in that, When the computer-readable instructions are executed by a processor, they implement the steps of the express waybill printing template configuration method as described in any one of claims 1-7.