Express sheet generation method and device, equipment and storage medium
By dynamically adjusting the placeholding layout of the page order, the problem of high blank space rate of logistics page orders in the existing technology is solved, and more efficient page order generation is achieved, reducing the waste of page order consumables.
Patent Information
- Application Number
- CN202311788058.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2025-06-24
AI Technical Summary
In the prior art, logistics panels generated based on fixed panel templates are prone to large-area blanking, resulting in waste of panel consumables.
By determining the logistics information and page sheet specifications, determining the display attributes of the information to be printed and the label to be printed, performing placeholder typesetting, generating an initial page sheet, and adjusting the placeholder typesetting results until the spaced rate is not greater than the preset value, obtaining the final logistics page sheet.
It realizes the generation of logistics noodle sheets with low blanking rate, reducing the waste of noodle sheet consumables.
Smart Images

Figure CN120197590A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of logistics technologies, and in particular, to a method, apparatus, device, and storage medium for generating a shipping label. Background Art
[0002] With the booming development of e-commerce and the Internet economy, more and more users choose to satisfy their shopping needs by shopping online. To facilitate the circulation of items among merchants, logistics service providers, and users, it is necessary to paste a shipping label on the item. The shipping label can display information such as the sender's information, the recipient's information, and the item information. The logistics service provider provides the corresponding item to the user according to the shipping label.
[0003] In the prior art, usually a label template is selected according to the usage scenario, and then a shipping label is generated according to the selected label template and the logistics information of the item.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following technical problems in the prior art:
[0005] The shipping label generated according to a fixed label template is prone to large areas of blank space, resulting in waste of label consumables. Summary of the Invention
[0006] The present invention provides a method, apparatus, device, and storage medium for generating a shipping label to generate a shipping label with a lower blank space rate and reduce waste of label consumables.
[0007] In a first aspect, an embodiment of the present invention provides a method for generating a shipping label, including:
[0008] After determining the logistics information and label specifications according to the received shipping label generation request, determining the information to be printed corresponding to the logistics information, where the information to be printed includes a plurality of fields to be printed;
[0009] After determining the display attributes of the labels to be printed corresponding to the fields to be printed, performing placeholder layout on the labels to be printed based on the display attributes of the labels to be printed, and generating an initial shipping label according to the placeholder layout result and the label specifications;
[0010] In the case where it is determined that the blank space rate of the initial shipping label is greater than a preset value, adjusting the placeholder layout result until the blank space rate is not greater than the preset value to obtain a shipping label, where the blank space rate is determined by the total area of the labels of the labels to be printed and the total area of the shipping label of the initial shipping label.
[0011] In a second aspect, an embodiment of the present invention further provides a device for generating a shipping label, including:
[0012] A determination module, configured to determine the information to be printed corresponding to the logistics information after determining the logistics information and the waybill specification according to the received waybill generation request, where the information to be printed includes a plurality of fields to be printed;
[0013] A generation module, configured to, after determining the display attributes of the to-be-printed labels corresponding to the respective fields to be printed, perform placeholder layout on the respective to-be-printed labels based on the display attributes of the respective to-be-printed labels, and generate an initial waybill according to the placeholder layout result and the waybill specification;
[0014] An adjustment module, configured to, when it is determined that the blank space ratio of the initial waybill is greater than a preset value, adjust the placeholder layout result until the blank space ratio is not greater than the preset value, to obtain a logistics waybill, where the blank space ratio is determined by the total area of the labels of the to-be-printed labels and the total area of the waybill of the initial waybill.
[0015] In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
[0016] One or more processors;
[0017] A storage device, configured to store one or more programs,
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the waybill generation method as described in any one of the first aspect.
[0019] In a fourth aspect, an embodiment of the present invention further provides a storage medium including computer-executable instructions, where the computer-executable instructions are used to execute the waybill generation method as described in any one of the first aspect when executed by a computer processor.
[0020] The embodiments in the above-mentioned invention have the following advantages or beneficial effects:
[0021] An embodiment of the present invention provides a waybill generation method, including: after determining the logistics information and waybill specifications according to the received waybill generation request, determining the information to be printed corresponding to the logistics information, where the information to be printed includes a plurality of fields to be printed; after determining the display attributes of the to-be-printed labels corresponding to each of the to-be-printed fields, performing placeholder layout on each of the to-be-printed labels based on the display attributes of each of the to-be-printed labels, and generating an initial waybill according to the placeholder layout result and the waybill specifications; in the case where it is determined that the blank rate of the initial waybill is greater than a preset value, adjusting the placeholder layout result until the blank rate is not greater than the preset value to obtain a logistics waybill, where the blank rate is determined by the total area of the labels of the to-be-printed labels and the total area of the waybill of the initial waybill. According to the above technical solution, after receiving the waybill generation request, the logistics information and waybill specifications included in the waybill generation request can be determined. Subsequently, the information to be printed can be determined according to the logistics information, and the display attributes of each of the to-be-printed labels included in the information to be printed can be determined. Furthermore, placeholder layout can be performed on each of the to-be-printed labels based on the display attributes of each of the to-be-printed labels, and an initial waybill can be generated according to the placeholder layout result and the previously determined waybill specifications, realizing the initial placeholder layout of the to-be-printed labels. In the case where it is determined that the blank rate of the initial waybill is not greater than the preset value, the initial waybill can be determined as the logistics waybill. In the case where it is determined that the blank rate of the initial waybill is greater than the preset value, by adjusting the initial waybill, a logistics waybill with a blank rate not greater than the preset value is obtained, realizing the generation of a logistics waybill with a lower blank rate and reducing the waste of waybill consumables. Description of the Drawings
[0022] Figure 1 It is a flowchart of a waybill generation method provided by an embodiment of the present invention;
[0023] Figure 2 It is a flowchart of another waybill generation method provided by an embodiment of the present invention;
[0024] Figure 3a 、 3b 3c and 3d are schematic diagrams of adjusting the initial waybill to obtain an intermediate waybill in another waybill generation method provided by an embodiment of the present invention;
[0025] Figure 4 It is a schematic structural diagram of a waybill generation device provided by an embodiment of the present invention;
[0026] Figure 5 It is a schematic structural diagram of a computer device provided by an embodiment of the present invention. Detailed Embodiments
[0027] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. Additionally, it should be noted that for the convenience of description, only parts related to the present invention rather than all structures are shown in the drawings.
[0028] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operations are completed, but it can also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, and so on. In addition, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.
[0029] When the prior art generates a logistics label for an item based on a selected label template and the logistics information of the item, large blank areas often appear on the generated logistics label, seriously wasting label consumables. When the daily average number of logistics labels printed by a logistics service provider is in the order of 10 million, if the blank rate of each logistics label is 10%, and the cost of each logistics label is 0.1 yuan, on average, 10 million × 10% × 0.1 ≈ 100,000 yuan of label consumables are wasted every day, and 36.5 million yuan of label consumables will be wasted annually, which is an astonishing figure.
[0030] Moreover, the fixed label template may not be able to display complete logistics information. Using one label consumable cannot print a complete logistics label, and using multiple label consumables may cause the logistics label to be split.
[0031] Therefore, the present application proposes a label generation method to dynamically generate logistics labels with a lower blank rate and reduce the waste of label consumables.
[0032] The label generation method proposed by the present application will be described in detail below with reference to the drawings and embodiments.
[0033] Figure 1 It is a flowchart of a label generation method provided by an embodiment of the present invention. The embodiment of the present invention is applicable to the situation where it is necessary to reduce the blank rate of labels to reduce the waste of label consumables. This method can be executed by a label generation device, and the device can be implemented in the form of software and / or hardware. As Figure 1 described, the method specifically includes the following steps:
[0034] Step 110: After determining the logistics information and label specifications according to the received label generation request, determine the information to be printed corresponding to the logistics information.
[0035] Among them, the information to be printed includes a plurality of fields to be printed.
[0036] The user operating the waybill printing device can trigger a waybill generation request, and the waybill printing device can send the waybill generation request to the server.
[0037] Specifically, after receiving the waybill generation request sent by the waybill printing device, the server can determine the logistics information and waybill specifications included in the waybill generation request. The logistics information can be understood as the logistics waybill number of the item, and the waybill specifications can be understood as the waybill printing specifications that the waybill printing device can provide. For example, the total area of the waybill.
[0038] After determining the logistics information, the logistics system can be queried according to the logistics information to determine the information to be printed corresponding to the logistics information. The information to be printed can be understood as the information that needs to be displayed on the logistics waybill. Therefore, the information to be printed can include at least one field to be printed. For example, it can include fields corresponding to timeliness information, logistics waybill number, routing information, business department name, road area number, settlement method, sender and recipient information, item information, remarks information, etc.
[0039] In the embodiments of the present invention, it is realized to determine the logistics information and waybill specifications according to the received waybill generation request, and to determine the information to be printed corresponding to the logistics information, providing an information basis for generating the logistics waybill corresponding to the logistics information.
[0040] Step 120, after determining the display attributes of the printing tags corresponding to each of the fields to be printed, perform placeholder layout on each of the printing tags based on the display attributes of each of the printing tags, and generate an initial waybill according to the placeholder layout result and the waybill specifications.
[0041] The printing tag corresponding to the field to be printed can be understood as the field to be printed and the placeholder corresponding to the field to be printed. The attribute information of the printing tag can include display attributes and placeholder attributes. The display attributes can include the number of characters, font, placeholder size, placeholder area, etc. The placeholder attribute can be priority placeholder or ordinary placeholder.
[0042] Specifically, the display attributes of the printing tags are determined by the placeholder specifications of the printing tags. Therefore, after determining the information to be printed, first, the placeholder specifications of the printing tags corresponding to each of the fields to be printed included in the information to be printed can be determined. The placeholder specifications can be understood as the data formats of each of the printing tags. Furthermore, the display attributes of each of the printing tags can be determined according to the placeholder specifications of each of the printing tags. Specifically, the number of characters, font, placeholder size, placeholder area, etc. of each of the printing tags can be determined.
[0043] After determining the display attributes of the to-be-printed labels corresponding to the to-be-printed fields included in the to-be-printed information, the to-be-printed labels can be typeset for placeholder based on the display attributes of the to-be-printed labels. Since the placeholder attribute of the to-be-printed label is either priority placeholder or normal placeholder, when the placeholder attribute of the to-be-printed label is priority placeholder, the to-be-printed label needs to be preferentially displayed. Therefore, first, the to-be-printed labels with the placeholder attribute of priority placeholder can be typeset for placeholder, that is, the to-be-printed labels with the placeholder attribute of priority placeholder can be typeset for placeholder based on the display attributes of the to-be-printed labels with the placeholder attribute of priority placeholder. Second, the to-be-printed labels with the placeholder attribute of normal placeholder can be typeset for placeholder, that is, the to-be-printed labels with the placeholder attribute of normal placeholder can be typeset for placeholder based on the display attributes of the to-be-printed labels with the placeholder attribute of normal placeholder. After the typesetting for placeholder of all the to-be-printed labels is completed, the typesetting result for placeholder can be obtained. Furthermore, an initial waybill can be generated according to the typesetting result for placeholder and the waybill specification determined above.
[0044] In an embodiment of the present invention, after determining the to-be-printed information corresponding to the logistics information, the display attributes of the to-be-printed labels corresponding to the to-be-printed fields included in the to-be-printed information can be determined. Furthermore, the to-be-printed labels can be typeset for placeholder based on the display attributes of the to-be-printed labels. Finally, an initial waybill can be generated according to the typesetting result for placeholder and the waybill specification, realizing the initial typesetting for placeholder of the to-be-printed labels and generating the initial waybill.
[0045] Step 130: In the case where it is determined that the blank rate of the initial waybill is greater than a preset value, adjust the typesetting result for placeholder until the blank rate is not greater than the preset value to obtain a logistics waybill.
[0046] Wherein, the blank rate is determined by the total area of the labels of the to-be-printed labels and the total area of the waybill of the initial waybill.
[0047] The blank rate can be understood as the ratio of the blank area of the waybill to the total area. Therefore, after generating the initial waybill, the blank area of the initial waybill and the total area of the waybill can be determined. Among them, the total area of the waybill of the initial waybill can be determined according to the waybill specification. The blank area of the initial waybill can be determined according to the total area of the waybill and the total area of the labels. The total area of the labels can be determined according to the size of the placeholders of the to-be-printed labels.
[0048] Specifically, after generating the initial waybill, the total area of the waybill of the initial waybill can be determined according to the generated waybill specification, the total area of the labels of the to-be-printed labels can be determined according to the size of the placeholders of the to-be-printed labels, and the blank area can be determined according to the difference between the total area of the waybill and the total area of the labels. Furthermore, the ratio of the blank area to the total area of the waybill is determined as the blank rate.
[0049] Compare the blank space ratio of the initial shipping label with the preset value. If it is determined that the blank space ratio of the initial shipping label is not greater than the preset value, the initial shipping label can be determined as the logistics shipping label. If it is determined that the blank space ratio of the initial shipping label is greater than the preset value, the initial shipping label needs to be adjusted. Specifically, the display attributes of each label to be printed can be adjusted to adjust the placeholder layout result corresponding to the initial shipping label, and an intermediate shipping label can be obtained.
[0050] In practical applications, at least one of the number of characters, font, placeholder size, and placeholder area of each label to be printed can be adjusted to adjust the display attributes of each label to be printed, and further adjust the placeholder layout result corresponding to the initial shipping label to obtain an intermediate shipping label.
[0051] Of course, the blank space ratio of the intermediate shipping label can be continuously determined, and the blank space ratio of the intermediate shipping label can be compared with the preset value. If it is determined that the blank space ratio of the intermediate shipping label is not greater than the preset value, the intermediate shipping label can be determined as the logistics shipping label. Otherwise, the intermediate shipping label can be continuously adjusted until the blank space ratio is not greater than the preset value, and the intermediate shipping label corresponding to the blank space ratio not greater than the preset value at this time is determined as the logistics shipping label.
[0052] It should be noted that if the information to be printed includes labels to be printed with a placeholder attribute of "priority placeholder", when adjusting the initial shipping label and the intermediate shipping label, the display attributes of these labels to be printed with a placeholder attribute of "priority placeholder" do not need to be adjusted to ensure the placeholder priority of the labels to be printed with a placeholder attribute of "priority placeholder".
[0053] In the embodiment of the present invention, by adjusting the initial shipping label, a logistics shipping label with a blank space ratio not greater than the preset value is obtained, realizing the generation of a logistics shipping label with a lower blank space ratio and reducing the waste of shipping label consumables.
[0054] The waybill generation method provided by an embodiment of the present invention includes: after determining the logistics information and the waybill specification according to the received waybill generation request, determining the information to be printed corresponding to the logistics information, where the information to be printed includes a plurality of fields to be printed; after determining the display attributes of the waybill labels corresponding to each of the fields to be printed, performing placeholder layout on each of the waybill labels based on the display attributes of each of the waybill labels, and generating an initial waybill according to the placeholder layout result and the waybill specification; in the case where it is determined that the blank space ratio of the initial waybill is greater than a preset value, adjusting the placeholder layout result until the blank space ratio is not greater than the preset value to obtain a logistics waybill, where the blank space ratio is determined by the total area of the waybill labels and the total area of the initial waybill. According to the above technical solution, after receiving a waybill generation request, the logistics information and the waybill specification included in the waybill generation request can be determined. Subsequently, the information to be printed can be determined according to the logistics information, and the display attributes of the waybill labels corresponding to each of the fields to be printed included in the information to be printed can be determined. Furthermore, placeholder layout can be performed on each of the waybill labels based on the display attributes of each of the waybill labels, and an initial waybill can be generated according to the placeholder layout result and the previously determined waybill specification, realizing the initial placeholder layout of the waybill labels. In the case where it is determined that the blank space ratio of the initial waybill is not greater than the preset value, the initial waybill can be determined as the logistics waybill. In the case where it is determined that the blank space ratio of the initial waybill is greater than the preset value, by adjusting the initial waybill, a logistics waybill with a blank space ratio not greater than the preset value is obtained, realizing the generation of a logistics waybill with a lower blank space ratio and reducing the waste of waybill consumables.
[0055] Figure 2 It is a flowchart of another waybill generation method provided by an embodiment of the present invention. The embodiment of the present invention is applicable to the situation where it is necessary to reduce the blank space ratio of the waybill to reduce the waste of waybill consumables. On the basis of the above embodiment, after generating the initial waybill according to the placeholder layout result and the waybill specification, the embodiment of the present invention adds "determining the total area of the waybill according to the waybill specification; determining the total area of the labels according to the display attributes of each of the waybill labels, and determining the blank space area according to the total area of the labels and the total area of the waybill." The explanations of the same or corresponding terms in the above embodiments are not repeated here. Refer to Figure 2 The waybill generation method provided by an embodiment of the present invention includes:
[0056] Step 210, determining the logistics information and the waybill specification according to the received waybill generation request.
[0057] In one implementation, step 210 may specifically include:
[0058] After receiving the waybill generation request, parsing the waybill generation request to obtain the logistics information and the waybill specification corresponding to the waybill generation request.
[0059] Specifically, after the server receives the waybill generation request sent by the waybill printing device, it can parse the waybill generation request to determine the logistics information and waybill specifications included in the waybill generation request.
[0060] In the embodiment of the present invention, by parsing the received waybill generation request, it is realized to determine the logistics information and waybill specifications included in the waybill generation request.
[0061] Step 220: Determine the information to be printed corresponding to the logistics information.
[0062] Among them, the information to be printed includes multiple fields to be printed.
[0063] In one implementation manner, step 220 may specifically include:
[0064] Search for the logistics details table based on the logistics information to determine the logistics details corresponding to the logistics information; determine the logistics details as the information to be printed.
[0065] Specifically, the logistics information can be understood as the logistics waybill number of the item. In the logistics system, based on the logistics details table, there are stored the logistics waybill number, timeliness information, routing information, business department name, road area number, settlement method, sender and recipient information, item information, note information, etc. of the item. After determining the logistics waybill number, the logistics details table can be searched based on the logistics waybill number to determine the timeliness information, routing information, business department name, road area number, settlement method, sender and recipient information, item information, note information, etc. corresponding to the logistics waybill number.
[0066] Determine the fields such as the timeliness information, routing information, business department name, road area number, settlement method, sender and recipient information, item information, note information, etc. corresponding to the logistics waybill number as the fields to be printed. Furthermore, determine all the fields to be printed as the information to be printed.
[0067] In the embodiment of the present invention, it is realized to determine the information to be printed corresponding to the logistics information according to the logistics details corresponding to the logistics information.
[0068] Step 230: Determine the display attributes of each of the to-be-printed labels.
[0069] In one implementation manner, step 230 may specifically include:
[0070] Determine the placeholder specifications of the to-be-printed labels corresponding to each of the to-be-printed fields; by parsing the placeholder specifications of each of the to-be-printed labels, determine the display attributes of each of the to-be-printed labels, where the display attributes at least include the number of characters, font, placeholder size, and placeholder area.
[0071] Specifically, for the printing labels corresponding to each printing field included in the information to be printed, the placeholder specifications of the printing labels can be parsed to determine the display attributes of the printing labels, specifically, at least one of the number of characters, font, placeholder size, and placeholder area of the printing labels can be determined.
[0072] In the embodiments of the present invention, by parsing the placeholder specifications of the printing labels corresponding to each printing field included in the information to be printed, the display attributes of each printing label are determined.
[0073] Step 240: Perform placeholder layout on each of the printing labels based on the display attributes of each of the printing labels, and generate an initial waybill according to the placeholder layout result and the waybill specification.
[0074] In one implementation, step 240 may specifically include:
[0075] After performing priority placeholder layout on the printing labels with the placeholder attribute of priority placeholder based on the display attributes of each of the printing labels, perform placeholder layout on other printing labels to obtain the placeholder layout result; adjust the placeholder layout result according to the waybill specification to obtain the initial waybill.
[0076] Specifically, first, the placeholder attributes of each printing label can be determined, and priority placeholder layout can be performed on the printing labels with the placeholder attribute of priority placeholder first, and then placeholder layout can be performed on other printing labels, that is, the printing labels with the placeholder attribute of ordinary placeholder, to obtain the placeholder layout result.
[0077] At this time, the obtained placeholder layout result does not consider the waybill specification. Therefore, the placeholder layout result can be adjusted according to the waybill specification to obtain the initial waybill.
[0078] In the embodiments of the present invention, after performing placeholder layout on each printing label based on the display attributes of each printing label, the placeholder layout result is adjusted according to the waybill specification to obtain the initial waybill, realizing the initial placeholder layout of the printing labels and generating the initial waybill.
[0079] Step 250: Determine the total area of the waybill according to the waybill specification.
[0080] As mentioned above, the waybill specification can be understood as the waybill printing specification that the waybill printing device can provide. For example, the total area of the waybill. Since the initial waybill is obtained by adjusting the placeholder layout result according to the waybill specification, the total area of the waybill reflected by the waybill specification can be determined as the total area of the waybill of the initial waybill.
[0081] Step 260: Determine the total label area according to the display attributes of each of the printing labels.
[0082] Specifically, the placeholder size in the display attributes of each label to be printed determines the label area of each label to be printed. Therefore, the total label area of the labels to be printed can be determined according to the placeholder size in the display attributes of each label to be printed.
[0083] Furthermore, the difference between the total area of the initial waybill and the total label area of the labels to be printed can be determined as the blank area of the initial waybill.
[0084] In the embodiments of the present invention, the total label area of the labels to be printed is determined according to the placeholder size in the display attributes of each label to be printed, and then the blank area of the initial waybill is determined.
[0085] Step 270: When it is determined that the blank rate of the initial waybill is greater than a preset value, adjust the placeholder layout result until the blank rate is not greater than the preset value to obtain a logistics waybill.
[0086] In one implementation, step 270 may specifically include:
[0087] When it is determined that the blank rate of the initial waybill is greater than a preset value, adjust the placeholder layout result by adjusting the display attributes of the other labels to be printed to obtain an intermediate waybill; when it is determined that the blank rate of the intermediate waybill is not greater than the preset value, determine the intermediate waybill as the logistics waybill.
[0088] Specifically, the ratio of the blank area of the initial waybill to the total area of the waybill can be determined as the blank rate of the initial waybill. Compare the blank rate of the initial waybill with the preset value. When it is determined that the blank rate of the initial waybill is not greater than the preset value, it can be determined that the blank rate of the initial waybill meets the preset requirements, and then the initial waybill can be determined as the logistics waybill. When it is determined that the blank rate of the initial waybill is greater than the preset value, it can be determined that the blank rate of the initial waybill does not meet the preset requirements, and then the initial waybill can be adjusted. Specifically, the display attributes of the labels to be printed with the placeholder attribute being ordinary placeholders can be adjusted, that is, at least one of the number of characters, font, placeholder size, and placeholder area of the labels to be printed with the placeholder attribute being ordinary placeholders can be adjusted to adjust the placeholder layout result corresponding to the initial waybill to obtain an intermediate waybill.
[0089] Figure 3a 、 3b 3c, 3d are all schematic diagrams of adjusting the initial waybill to obtain an intermediate waybill in another waybill generation method provided by the embodiments of the present invention. As Figure 3a shown, the left side is the initial waybill, and the right side is the intermediate waybill. By reducing the placeholder size of each character to be printed, the placeholder layout result corresponding to the initial waybill is adjusted to obtain an intermediate waybill; as Figure 3bAs shown, the initial waybill is on the left and the intermediate waybill is on the right. By moving the placeholder area of the character "1" to be printed to the right of the character "2" to be printed, the adjustment of the placeholder layout result corresponding to the initial waybill is achieved, and the intermediate waybill is obtained. For example, Figure 3c As shown, the initial waybill is on the left and the intermediate waybill is on the right. By reducing the number of characters of the character "A" to be printed and ensuring that the meaning of the field to be printed corresponding to the character to be printed remains unchanged, the adjustment of the placeholder layout result corresponding to the initial waybill is achieved, and the intermediate waybill is obtained. For example, Figure 3d As shown, the initial waybill is on the left and the intermediate waybill is on the right. By reducing the font size of the character to be printed, the adjustment of the placeholder layout result corresponding to the initial waybill is achieved, and the intermediate waybill is obtained.
[0090] In practical applications, the adjustment of the placeholder layout result corresponding to the initial waybill can be achieved by adjusting at least one of the number of characters, font, placeholder size, and placeholder area of the label to be printed with the placeholder attribute being a normal placeholder, so as to obtain the intermediate waybill. Of course, the adjustment of the placeholder layout result corresponding to the initial waybill can also be achieved by other means, which are not specifically limited here.
[0091] Furthermore, the blank rate of the intermediate waybill can be continuously determined, and the blank rate of the intermediate waybill is compared with a preset value. When it is determined that the blank rate of the intermediate waybill is not greater than the preset value, the intermediate waybill can be determined as the logistics waybill; otherwise, the intermediate waybill can be continuously adjusted until the blank rate is not greater than the preset value, and the intermediate waybill corresponding to the blank rate not greater than the preset value is determined as the logistics waybill.
[0092] In the embodiments of the present invention, by adjusting the initial waybill, a logistics waybill with a blank rate not greater than the preset value is obtained, realizing the generation of a logistics waybill with a lower blank rate and reducing the waste of waybill consumables.
[0093] The waybill generation method provided by the embodiment of the present invention includes: determining logistics information and waybill specifications according to the received waybill generation request; determining the information to be printed corresponding to the logistics information; determining the display attributes of each of the to-be-printed labels; performing placeholder layout on each of the to-be-printed labels based on the display attributes of each of the to-be-printed labels, and generating an initial waybill according to the placeholder layout result and the waybill specifications; determining the total area of the waybill according to the waybill specifications; determining the total area of the labels according to the display attributes of each of the to-be-printed labels; in the case where it is determined that the blank space ratio of the initial waybill is greater than a preset value, adjusting the placeholder layout result until the blank space ratio is not greater than the preset value to obtain a logistics waybill. In the above technical solution, after receiving the waybill generation request, by parsing the received waybill generation request, it is realized to determine the logistics information and waybill specifications included in the waybill generation request. Subsequently, the information to be printed can be determined according to the logistics information, and the display attributes of the to-be-printed labels corresponding to each of the to-be-printed fields included in the information to be printed can also be determined. Furthermore, placeholder layout can be performed on each of the to-be-printed labels based on the display attributes of each of the to-be-printed labels, and the placeholder layout result can be adjusted according to the waybill specifications to obtain an initial waybill, realizing the initial placeholder layout of the to-be-printed labels. After determining the total area of the labels and the total area of the waybill, the blank space area is determined according to the difference between the total area of the waybill and the total area of the labels, and the blank space ratio is determined according to the ratio of the blank space area to the total area of the waybill. The blank space ratio is compared with the preset value. In the case where it is determined that the blank space ratio is not greater than the preset value, the initial waybill can be determined as the logistics waybill. In the case where it is determined that the blank space ratio of the initial waybill is greater than the preset value, through the adjustment of the initial waybill, a logistics waybill with a blank space ratio not greater than the preset value is obtained, realizing the generation of a logistics waybill with a lower blank space ratio, that is, realizing the generation of a logistics waybill using a single waybill consumable, and saving the area of the waybill consumable and reducing the waste of the waybill consumable.
[0094] Figure 4 It is a schematic structural diagram of a waybill generation device provided by an embodiment of the present invention. This device and the waybill generation methods of the above embodiments belong to the same inventive concept. For the details not described in detail in the embodiment of the waybill generation device, reference can be made to the embodiments of the above waybill generation methods.
[0095] The specific structure of this waybill generation device is as Figure 4 shown and includes:
[0096] A determination module 410, configured to determine the information to be printed corresponding to the logistics information after determining the logistics information and waybill specifications according to the received waybill generation request, wherein the information to be printed includes a plurality of to-be-printed fields;
[0097] A generation module 420, which is configured to, after determining the display attributes of the to-be-printed labels corresponding to each to-be-printed field, perform placeholder layout on each of the to-be-printed labels based on the display attributes of each of the to-be-printed labels, and generate an initial waybill according to the placeholder layout result and the waybill specification;
[0098] An adjustment module 430, which is configured to, when determining that the blank rate of the initial waybill is greater than a preset value, adjust the placeholder layout result until the blank rate is not greater than the preset value to obtain a logistics waybill, where the blank rate is determined by the total label area of the to-be-printed labels and the total waybill area of the initial waybill.
[0099] Based on the above embodiments, the determination module 410 is specifically configured to:
[0100] After receiving the waybill generation request, parse the waybill generation request to obtain the logistics information and the waybill specification corresponding to the waybill generation request; search a logistics details table based on the logistics information to determine the logistics details corresponding to the logistics information; and determine the logistics details as the to-be-printed information, where the to-be-printed information includes a plurality of to-be-printed fields.
[0101] Based on the above embodiments, the generation module 420 is specifically configured to:
[0102] Determine the placeholder specifications of the to-be-printed labels corresponding to each of the to-be-printed fields; determine the display attributes of each of the to-be-printed labels by parsing the placeholder specifications of each of the to-be-printed labels, where the display attributes at least include the number of characters, font, placeholder size, and placeholder area; perform priority placeholder layout on the to-be-printed labels with the placeholder attribute of priority placeholder based on the display attributes of each of the to-be-printed labels, and then perform placeholder layout on other to-be-printed labels to obtain the placeholder layout result; and adjust the placeholder layout result according to the waybill specification to obtain the initial waybill.
[0103] Based on the above embodiments, the device further includes:
[0104] An execution module, which is configured to determine the total waybill area according to the waybill specification; and determine the total label area according to the display attributes of each of the to-be-printed labels.
[0105] Based on the above embodiments, the adjustment module 430 is specifically configured to:
[0106] When determining that the blank rate of the initial waybill is greater than a preset value, adjust the placeholder layout result by adjusting the display attributes of the other to-be-printed labels to obtain an intermediate waybill; and when determining that the blank rate of the intermediate waybill is not greater than the preset value, determine the intermediate waybill as the logistics waybill.
[0107] The waybill generation device provided by an embodiment of the present invention can execute the waybill generation method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the waybill generation method.
[0108] It should be noted that in the above embodiments of the waybill generation device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the present invention.
[0109] Figure 5 It is a schematic structural diagram of a computer device provided by an embodiment of the present invention. Figure 5 It shows a block diagram of an exemplary computer device 5 suitable for implementing the embodiments of the present invention. Figure 5 The displayed computer device 5 is only an example and should not bring any limitations to the functions and usage scope of the embodiments of the present invention.
[0110] As Figure 5 shown, the computer device 5 is presented in the form of a general-purpose computing electronic device. The components of the computer device 5 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
[0111] The bus 18 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any bus structure in a variety of bus structures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0112] The computer device 5 typically includes a variety of computer system readable media. These media can be any available media accessible by the computer device 5, including volatile and non-volatile media, removable and non-removable media.
[0113] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 5 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used for reading and writing non-removable, non-volatile magnetic media ( Figure 5not shown, commonly referred to as a "hard disk drive"). Although Figure 5 not shown in Figure 5 , a disk drive for reading and writing a removable non-volatile disk (such as a "floppy disk") and an optical disk drive for reading and writing a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 through one or more data medium interfaces. The system memory 28 may include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0114] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods in the embodiments described in the present invention.
[0115] The computer device 5 may also communicate with one or more external devices 14 (such as a keyboard, a pointing device, a display 24, etc.), and may also communicate with one or more devices that enable a user to interact with the computer device 5, and / or communicate with any device that enables the computer device 5 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication may be through the input / output (I / O) interface 22. And, the computer device 5 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 20. As Figure 5 shown, the network adapter 20 communicates with other modules of the computer device 5 through the bus 18. It should be understood that although Figure 5 not shown in Figure 5 , other hardware and / or software modules may be used in combination with the computer device 5, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0116] The processing unit 16 executes various functional applications and page displays by running the programs stored in the system memory 28, such as implementing the waybill generation method provided by the embodiments of the present invention. The method includes:
[0117] After determining the logistics information and the waybill specification according to the received waybill generation request, determining the information to be printed corresponding to the logistics information, where the information to be printed includes a plurality of fields to be printed;
[0118] After determining the display attributes of the to-be-printed labels corresponding to the to-be-printed fields, perform placeholder layout on each of the to-be-printed labels based on the display attributes of the to-be-printed labels, and generate an initial waybill according to the placeholder layout result and the waybill specification;
[0119] In the case where it is determined that the blank rate of the initial waybill is greater than a preset value, adjust the placeholder layout result until the blank rate is not greater than the preset value to obtain a logistics waybill, where the blank rate is determined by the total label area of the to-be-printed labels and the total waybill area of the initial waybill.
[0120] Of course, those skilled in the art can understand that the processor can also implement the technical solutions of the waybill generation method provided in any embodiment of the present invention.
[0121] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements, for example, the waybill generation method provided in the embodiment of the present invention. The method includes:
[0122] After determining the logistics information and the waybill specification according to the received waybill generation request, determine the to-be-printed information corresponding to the logistics information, where the to-be-printed information includes a plurality of to-be-printed fields;
[0123] After determining the display attributes of the to-be-printed labels corresponding to the to-be-printed fields, perform placeholder layout on each of the to-be-printed labels based on the display attributes of the to-be-printed labels, and generate an initial waybill according to the placeholder layout result and the waybill specification;
[0124] In the case where it is determined that the blank rate of the initial waybill is greater than a preset value, adjust the placeholder layout result until the blank rate is not greater than the preset value to obtain a logistics waybill, where the blank rate is determined by the total label area of the to-be-printed labels and the total waybill area of the initial waybill.
[0125] The computer storage medium of an embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device.
[0126] The computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device.
[0127] The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0128] The computer program code for performing the operations of the present invention can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages - such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0129] Those of ordinary skill in the art should understand that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device. They can be concentrated on a single computing device or distributed across a network composed of multiple computing devices. Optionally, they can be implemented using program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0130] Note that the above is only the preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments here, and various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments only. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for generating a face sheet, characterized in that, Including: After determining the logistics information and waybill specification according to the received waybill generation request, determine the information to be printed corresponding to the logistics information, where the information to be printed includes multiple fields to be printed; After determining the display attributes of the labels to be printed corresponding to each of the fields to be printed, perform placeholder layout on each of the labels to be printed based on the display attributes of each of the labels to be printed, and generate an initial waybill according to the placeholder layout result and the waybill specification; In the case where it is determined that the blank space rate of the initial waybill is greater than a preset value, adjust the placeholder layout result until the blank space rate is not greater than the preset value to obtain a logistics waybill, where the blank space rate is determined by the total area of the labels of the labels to be printed and the total area of the waybill of the initial waybill.
2. The method for generating a shipping label according to claim 1, wherein Determining the logistics information and waybill specification according to the received waybill generation request includes: After receiving the waybill generation request, parse the waybill generation request to obtain the logistics information and the waybill specification corresponding to the waybill generation request.
3. The method for generating a shipping label according to claim 1, wherein Determining the information to be printed corresponding to the logistics information includes: Based on the logistics information, search the logistics details table to determine the logistics details corresponding to the logistics information; Determine the logistics details as the information to be printed.
4. The method for generating a face sheet according to claim 1, wherein, Determining the display attributes of the labels to be printed corresponding to each of the fields to be printed includes: Determine the placeholder specifications of the labels to be printed corresponding to each of the fields to be printed; By parsing the placeholder specifications of each of the labels to be printed, determine the display attributes of each of the labels to be printed, where the display attributes at least include the number of characters, font, placeholder size, and placeholder area.
5. The method for generating a face sheet according to claim 4, wherein Performing placeholder layout on each of the labels to be printed based on the display attributes of each of the labels to be printed, and generating an initial waybill according to the placeholder layout result and the waybill specification includes: After performing priority placeholder layout on the labels to be printed with a placeholder attribute of priority placeholder based on the display attributes of each of the labels to be printed, perform placeholder layout on other labels to be printed to obtain the placeholder layout result; Adjust the placeholder layout result according to the waybill specification to obtain the initial waybill.
6. The method for generating a shipping label according to claim 4, wherein, After generating the initial waybill according to the placeholder layout result and the waybill specification, it further includes: Determine the total area of the waybill according to the waybill specification; Determine the total area of the labels according to the display attributes of each of the labels to be printed.
7. The method for generating a face sheet according to claim 5, characterized in that, Adjusting the placeholder layout result until the blank space rate is not greater than the preset value to obtain a logistics waybill includes: Adjust the placeholder layout result by adjusting the display attributes of the other labels to be printed to obtain an intermediate waybill; In the case where it is determined that the blank space rate of the intermediate waybill is not greater than the preset value, determine the intermediate waybill as the logistics waybill.
8. A waybill generating device, characterized in that, Including: A determination module, configured to determine the information to be printed corresponding to the logistics information after determining the logistics information and the waybill specification according to the received waybill generation request, where the information to be printed includes multiple fields to be printed; A generation module, configured to determine display attributes of the to-be-printed labels corresponding to the to-be-printed fields, then perform placeholder layout on the to-be-printed labels based on the display attributes of the to-be-printed labels, and generate an initial waybill according to the placeholder layout result and the waybill specification; An adjustment module, configured to, when it is determined that the blank space ratio of the initial waybill is greater than a preset value, adjust the placeholder layout result until the blank space ratio is not greater than the preset value, so as to obtain a logistics waybill, where the blank space ratio is determined by the total area of the labels of the to-be-printed labels and the total area of the waybill of the initial waybill.
9. A computer device, characterized in that, The computer device includes: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the waybill generation method according to any one of claims 1-7.
10. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions are used to execute the waybill generation method according to any one of claims 1-7 when executed by a computer processor.