Packing box stock layout method and equipment
By progressively selecting candidate packaging boxes with high similarity to the already arranged packaging boxes from the packaging box set for arrangement, the problems of time-consuming calculation and low material utilization in the existing technology are solved, realizing an efficient packaging box arrangement method and equipment.
Patent Information
- Application Number
- CN202511544228.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-10-28
AI Technical Summary
Existing technologies take a long time to recalculate packaging box layout schemes for urgent orders, packaging box design changes, or small-batch production. Traditional layout algorithms are poorly adaptable to irregular shapes, resulting in low material utilization and production delays.
By obtaining the planar features of the set of packaging boxes to be sorted, the packaging box with the largest area is determined as the first packaging box. Based on this, candidate packaging boxes with high similarity are selected step by step for sorting, forming a closed-loop iterative process, reducing computational complexity, narrowing the search range, and making it suitable for small-batch, multi-variety production.
It improves the efficiency of packaging box layout and material utilization, adapts to irregularly shaped packaging boxes, reduces calculation time and material waste, and supports rapid response to small-batch production needs.
Smart Images

Figure CN121010618A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of packaging boxes, and particularly relates to a packaging box layout method and device. BACKGROUND
[0002] Packaging box layout refers to, in the production and manufacturing process of packaging boxes, carefully arranging and laying out the unfolded diagrams of multiple packaging boxes on raw materials (such as paperboard, plastic board, etc.) according to the sizes, shapes and specifications of the materials used, so as to improve the utilization rate of raw materials, reduce material waste, reduce production costs, and at the same time, take into account the convenience and efficiency of production and processing.
[0003] The prior art relies on offline calculation, that is, a packaging box layout scheme is generated in advance and stored, but when facing emergency orders, packaging box design changes or small-batch production of packaging boxes, it takes a long time to recalculate the packaging box layout scheme, resulting in production delay. The traditional layout algorithm has poor adaptability to irregular shapes, and a large number of blank areas are easily generated when laying out irregular packaging boxes, resulting in low material utilization. Therefore, the layout efficiency of multiple packaging boxes is low in the current production process of packaging boxes. SUMMARY
[0004] The embodiments of the application provide a packaging box layout method and device, which can continuously and accurately layout multiple packaging boxes, thereby improving the layout efficiency.
[0005] In a first aspect, the embodiments of the application provide a packaging box layout method, comprising: obtaining the planar features of each packaging box in a packaging box set to be laid out; wherein the packaging box set comprises a first packaging box and other packaging boxes, the first packaging box comprises a laid-out packaging box, and the planar features comprise the size of the unfolded diagram; In the case that none of the packaging boxes in the packaging box set has been laid out, laying out the packaging box with the largest area in the packaging box set and determining it as the first packaging box; laying out one of the other packaging boxes: determining a group of candidate packaging boxes from the packaging box set; wherein in the case that the other packaging boxes comprise multiple packaging boxes, the candidate packaging box is one of the other packaging boxes with a similarity greater than a similarity threshold to the outline of the unfolded diagram of the first packaging box, and in the case that the other packaging boxes comprise one packaging box, the candidate packaging box is the one of the other packaging boxes; for each candidate packaging box, obtaining the probability that the candidate packaging box is a second packaging box according to the planar features of the first packaging box and the planar features of the candidate packaging box; wherein the second packaging box is the current layout target; The second packaging box is determined based on the probability that each of the candidate packaging boxes is the second packaging box; Arrange the second packaging box in a layout; Repeat the step of arranging one of the other boxes until all boxes in the box set have been arranged.
[0006] The technical solutions described in this application embodiment have at least the following technical effects: The packaging box layout method provided in this application involves obtaining the planar features of each packaging box in a set of packaging boxes to be layoutd; when none of the packaging boxes in the set have been layoutd, the packaging box with the largest area in the set is layoutd and determined as the first packaging box; for the other packaging boxes, a set of candidate packaging boxes is determined from the set; for each candidate packaging box, the probability that the candidate packaging box is the second packaging box is obtained based on the planar features of the first packaging box and the planar features of the candidate packaging boxes; the second packaging box is determined based on the probability that each candidate packaging box is the second packaging box; the second packaging box is layoutd; and the steps of layouting one of the other packaging boxes are repeated until all packaging boxes in the set have been layoutd. Therefore, the packaging box layout method provided in this application forms a closed-loop iterative process by removing the layoutd packaging boxes after each layout and using the newly determined second packaging box as the first packaging box for the next round. Each iteration only needs to address the matching problem between the current layout target and the candidate packaging boxes, rather than calculating all permutations and combinations of boxes at once. This transforms the combinatorial explosion problem into a linear iteration, which helps reduce computational complexity. By calculating the similarity between the unfolded outlines of other packaging boxes and the first packaging box, and selecting other packaging boxes with similarity greater than the similarity threshold as candidate packaging boxes, the search range is effectively narrowed. With the current layout target as the core, only its local matching relationship with candidate packaging boxes is considered, which helps improve the layout speed and is suitable for small-batch, multi-variety packaging box production scenarios.
[0007] In one possible implementation of the first aspect, determining a set of candidate packaging boxes from the set of packaging boxes includes: Multiple key points of each package in the package set are obtained by uniformly sampling the unfolded graphic outline of each package in the package set; For each key point in the set of packaging boxes, calculate the polar coordinate histogram of each key point to other key points to obtain the shape context vector; The minimum matching cost for each of the other boxes is obtained based on the shape context vector of the first box and the shape context vectors of the other boxes. The corresponding similarity is obtained based on the minimum matching cost for each of the above. A set of candidate packaging boxes is determined from the set of packaging boxes based on the aforementioned similarity.
[0008] In one possible implementation of the first aspect, determining a set of candidate packaging boxes from the set of packaging boxes based on the respective similarities includes: Based on the aforementioned similarity scores, a third set of packaging boxes with similarity scores greater than the aforementioned similarity threshold is determined from the set of packaging boxes; Arrange the samples within the preset material area, and determine a set of candidate packaging boxes from the third packaging box based on the remaining area of the preset material area.
[0009] In one possible implementation of the first aspect, the step of determining the probability that a candidate packaging box is a second packaging box for each candidate packaging box based on the planar features of the first packaging box and the planar features of the candidate packaging box includes: For each candidate packaging box, a pair of complementary features is obtained based on the planar features of the first packaging box and the planar features of the candidate packaging box; wherein, the pair of complementary features is used to reflect the degree of fit between the candidate packaging box and the first packaging box; The probability that the candidate packaging box is the second packaging box is obtained based on the collaborative features.
[0010] In one possible implementation of the first aspect, the collaborative feature pair includes the rotation angle of the candidate packaging box and the overlap contour length of the first packaging box and the candidate packaging box; obtaining the collaborative feature pair based on the planar features of the first packaging box and the planar features of the candidate packaging box includes: The corresponding circumscribed polygon is obtained based on the planar features of the first packaging box and the planar features of the candidate packaging box; wherein, the circumscribed polygon refers to the smallest polygon that contains the unfolded shape of the packaging box. Rotate the outer polygon of the candidate packaging box around the outer polygon of the first packaging box; If, during rotation, the distance between any pair of sides of the circumscribed polygon of the candidate packaging box and the circumscribed polygon of the first packaging box is less than a distance threshold, the rotation angle and the corresponding overlapping contour length are determined; wherein, the rotation angle includes the rotation angle of the candidate packaging box and the revolution angle around the first packaging box.
[0011] In one possible implementation of the first aspect, the planar feature further includes a marking path, the marking path including an indentation path and / or a perforation path; the step of obtaining the probability that the candidate packaging box is the second packaging box based on the collaborative feature includes: If the marking paths of the candidate packaging box and the first packaging box are determined to be continuous based on the rotation angle, the lengths of the marking paths of the candidate packaging box and the first packaging box are summed to obtain the marking path length. The probability that the candidate packaging box is the second packaging box is obtained based on the overlapping contour length and the corresponding mark path length.
[0012] In one possible implementation of the first aspect, obtaining the probability that the candidate packaging box is the second packaging box based on the overlapping contour length and the corresponding marker path length includes: The overlap rate is obtained by normalizing the overlapping contour length based on the perimeter of the candidate packaging box. The marking path efficiency is obtained by normalizing the marking path length based on the total marking path length of each packaging box in the packaging box set. The probability that the candidate packaging box is the second packaging box is obtained based on the contour overlap rate and the marking path efficiency.
[0013] In one possible implementation of the first aspect, determining the second packaging box based on the probability that each of the candidate packaging boxes is the second packaging box includes: The probability of each candidate packaging box being the second packaging box is ranked, and the candidate packaging box with the highest probability is determined as the second packaging box.
[0014] In one possible implementation of the first aspect, the method is applied to a packaging box layout device, which is communicatively connected to a die-cutting device, and the method further includes: After the layout is completed, for each box in the set of boxes, the spatial index is used within the preset material area to quickly query the neighboring boxes and obtain the shortest marking path and the shortest cutting path. The shortest marking path and the shortest cutting path are sent to the die-cutting device.
[0015] Secondly, embodiments of this application provide a packaging box arrangement device, comprising: An acquisition module is used to acquire the planar features of each packaging box in a set of packaging boxes to be arranged; wherein, the set of packaging boxes includes a first packaging box and other packaging boxes, the first packaging box includes the already arranged packaging boxes, and the planar features include the dimensions of the unfolded graphic; The first layout module is used to arrange the largest packaging box in the packaging box set when none of the packaging boxes in the packaging box set are laid out, and to determine it as the first packaging box. Other layout modules are used to arrange one of the other packaging boxes: A candidate packaging box module is used to determine a set of candidate packaging boxes from the set of packaging boxes; wherein, when the other packaging boxes include multiple packaging boxes, the candidate packaging box is one of the other packaging boxes whose similarity to the unfolded graphic outline of the first packaging box is greater than a similarity threshold; and when the other packaging boxes include one packaging box, the candidate packaging box is one of the other packaging boxes. The probability module is used to determine the probability that each candidate packaging box is a second packaging box based on the planar features of the first packaging box and the planar features of the candidate packaging box; wherein the second packaging box is the current sorting target. The second packaging box module is used to determine the second packaging box based on the probability that each of the candidate packaging boxes is the second packaging box; The second layout module is used to arrange the second packaging box. The repeat module is used to repeat the step of arranging one of the other packaging boxes until all packaging boxes in the packaging box set have been arranged.
[0016] Thirdly, embodiments of this application provide a packaging box layout device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method as described in any one of the first aspects above.
[0017] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any of the first aspects above.
[0018] Fifthly, embodiments of this application provide a computer program product that, when run on a packaging box layout device, causes the packaging box layout device to perform the method described in any one of the first aspects above.
[0019] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic flowchart of a packaging box arrangement method provided in an embodiment of this application; Figure 2 This is an example diagram of packaging box layout provided in one embodiment of this application; Figure 3 This is a schematic diagram of the implementation process of steps S310 and S315 in the packaging box arrangement method provided in an embodiment of this application; Figure 4 This is a schematic diagram of the implementation process of steps S321, S322 and S3222 in the packaging box arrangement method provided in an embodiment of this application; Figure 5 This is a schematic diagram of the implementation process of steps S320 and S330 in the packaging box arrangement method provided in an embodiment of this application; Figure 6 This is a schematic diagram of the packaging box sorting device provided in the embodiments of this application; Figure 7 This is a schematic diagram of the packaging box layout equipment provided in the embodiments of this application. Detailed Implementation
[0022] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0023] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0024] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0025] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0026] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0027] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0028] In related technologies, many rely on offline calculations, i.e., pre-generating and storing packaging box layout plans. However, when faced with urgent orders, packaging box design changes, or small-batch production, recalculating the packaging box layout plan is time-consuming, leading to production delays. Traditional layout algorithms have poor adaptability to irregular shapes, easily generating large blank areas when laying out irregularly shaped packaging boxes, resulting in low material utilization. Therefore, the current packaging box production process suffers from low efficiency in laying out multiple types of packaging boxes.
[0029] To address the aforementioned problems, this application provides a packaging box layout method and apparatus. The method involves: acquiring the planar features of each packaging box in a set of packaging boxes to be layout; if none of the packaging boxes in the set are layouted, the packaging box with the largest area in the set is layouted and identified as the first packaging box; layouting one of the other packaging boxes: determining a group of candidate packaging boxes from the set; for each candidate packaging box, obtaining the probability that the candidate packaging box is the second packaging box based on the planar features of the first packaging box and the candidate packaging box; determining the second packaging box based on the probability of each candidate packaging box being the second packaging box; layouting the second packaging box; repeating the steps of layouting one of the other packaging boxes until all packaging boxes in the set have been layouted. Therefore, the packaging box layout method provided in this application forms a closed-loop iterative process by removing the layouted packaging boxes after each layout and using the newly determined second packaging box as the first packaging box for the next round. Each iteration only addresses the matching between the current layout target and candidate packaging boxes, rather than calculating all permutations and combinations of boxes at once. This transforms the combinatorial explosion problem into a linear iteration, reducing computational complexity. By calculating the similarity between the unfolded outlines of other packaging boxes and the first packaging box, and selecting those with similarity greater than a similarity threshold as candidate packaging boxes, the search scope is effectively narrowed. Focusing on the current layout target and considering only its local matching relationships with candidate packaging boxes improves layout speed and is suitable for small-batch, multi-variety packaging box production scenarios.
[0030] The packaging box layout method provided in this application embodiment can be applied to packaging box layout equipment. In this case, the packaging box layout equipment is the main body for executing the packaging box layout method provided in this application embodiment. This application embodiment does not impose any restrictions on the specific type of packaging box layout equipment.
[0031] For example, packaging box layout equipment can be a tablet computer, laptop computer, ultra-mobile personal computer (UMPC), netbook, desktop computer, handheld device with wireless communication capabilities, computing device or other processing device connected to a wireless modem, computer, laptop computer, handheld computing device, etc., but is not limited to these.
[0032] To better understand the packaging box layout method provided in the embodiments of this application, the specific implementation process of the packaging box layout method provided in the embodiments of this application will be described by way of example below.
[0033] Figure 1 This illustration shows a schematic flowchart of a packaging box layout method provided in an embodiment of this application. The packaging box layout method includes: S100, Obtain the planar features of each package in the set of packages to be arranged. The set of packages includes a first package and other packages. The first package includes the already arranged packages, and its planar features include the dimensions of the unfolded graphic.
[0034] It is understandable that each package in the set of packages to be arranged can refer to a complete package or a component of a package.
[0035] For example, the unfolded shape (e.g., DXF format) of each package in the set of packages to be laid out can be exported, the outline coordinates of each package's unfolded shape can be parsed, and for each package, the dimensions (length and width) of its minimum bounding rectangle and the convex hull of its outline polygon can be calculated to obtain the planar features of each package. Alternatively, process parameters from the packaging production process (such as the cardboard grain direction, the die-cutting line position of the die-cutting equipment, i.e., the marking path of the package) can be extracted as additional features.
[0036] S200: If no individual packaging box in the packaging box set is laid out, lay out the packaging box with the largest area in the packaging box set and determine it as the first packaging box.
[0037] For example, the largest packaging box in the packaging box set can be placed in the upper left corner of the layout board, i.e., the preset material area, and its position coordinates (e.g., (0, 0)) can be recorded. The packaging box can be marked as "layout" and removed from the packaging box set to be laidout.
[0038] S300, arrange one of the other packaging boxes: For example, in the remaining area of the preset material area, one of the other packaging boxes can be placed in the adjacent area (such as the right or below) of the first packaging box, and the placement point of one of the other packaging boxes can be generated in the order of the scan lines (such as from left to right, from top to bottom).
[0039] S310, determine a set of candidate packaging boxes from the set of packaging boxes. Wherein, if other packaging boxes include multiple packaging boxes, the candidate packaging box is one of the other packaging boxes whose similarity to the unfolded graphic outline of the first packaging box is greater than a similarity threshold; if other packaging boxes include one packaging box, the candidate packaging box is one of the other packaging boxes.
[0040] For example, IoU (Intersection over Union) or contour matching algorithms (such as Hausdorff distance) can be used to calculate the contour similarity between the unfolded shape of other boxes and the first box, and candidate boxes can be selected from the set of boxes based on the contour similarity.
[0041] S320, for each candidate packaging box, the probability that the candidate packaging box is the second packaging box is obtained based on the planar features of the first packaging box and the planar features of the candidate packaging box. The second packaging box is the current sorting target.
[0042] It can be understood that the planar features of the first packaging box refer to the overall unfolded graphic features of the already laid-out packaging boxes and the current layout target.
[0043] For example, for each candidate packaging box, the size ratio similarity and contour similarity between each candidate packaging box and the first packaging box can be obtained based on the planar features of the first packaging box and the planar features of the candidate packaging box. The probability of the candidate packaging box being the second packaging box is calculated by weighting the size ratio similarity and contour similarity.
[0044] S330, determine the second packaging box based on the probability that each candidate packaging box is the second packaging box.
[0045] For example, the candidate packaging boxes that can be arranged can be determined based on the planar features of each candidate packaging box and the remaining area of the preset arrangement area, and the candidate packaging box with the highest probability is selected as the second packaging box.
[0046] S340, Arrange the second packaging box.
[0047] For example, such as Figure 2 As shown, the NFP (No-FitPolygon) algorithm can be used to calculate the placement position of the second packaging box in the remaining area of the preset material area, and the splicing position closest to the first packaging box is selected first. The second packaging box is then removed from the set of packaging boxes to be arranged and marked as "arranged".
[0048] S400, repeat the step of laying out one of the other boxes until all boxes in the box set have been laid out.
[0049] For example, step S300 can be executed repeatedly, adding the latest completed packaging box to the first packaging box each time, and searching for the second packaging box in the set of packaging boxes to be arranged according to the planar features of the first packaging box, until all packaging boxes are arranged. If only one packaging box remains in the set of packaging boxes to be arranged in a certain cycle, it is directly arranged to the remaining area of the preset material area; if the remaining area of the preset material area cannot arrange any packaging box in the set of packaging boxes to be arranged in a certain cycle, the remaining packaging boxes in the set of packaging boxes to be arranged are arranged to a new preset material area, the packaging box with the largest area in the set of packaging boxes is arranged and determined as the first packaging box, and step S300 is executed again.
[0050] In one possible implementation, please refer to Figure 3 S310, determine a set of candidate packaging boxes from the set of packaging boxes, including: S311, uniformly sample multiple key points of each package in the package set on the unfolded graphic outline of each package in the package set.
[0051] For example, the outline polygon can be extracted from the unfolded shape of each packaging box, and key points can be sampled at equal intervals along the outline. The sampling interval is 1 / N of the perimeter of the outline (N is the number of sampling points, such as N=20). Based on the sampling interval and the outline polygon of each packaging box, multiple key points of each packaging box can be obtained.
[0052] S312, for each key point in the set of packaging boxes, calculate the polar coordinate histogram of each key point to other key points to obtain the shape context vector.
[0053] For example, for each key point of each packaging box, the polar coordinates from it to all other key points of the packaging box can be calculated, the polar coordinate space can be divided into multiple bins, the number of key points in each bin can be counted to form a histogram, and the histograms of all key points of each packaging box can be concatenated into a global vector to obtain the shape context vector.
[0054] S313, based on the shape context vector of the first box and the shape context vectors of the other boxes, obtain the minimum matching cost for each of the other boxes.
[0055] For example, the matching cost of the shape context vector of the first package can be calculated using cost functions such as Earth Mover's Distance (EMD) or chi-square (χ²) distance, and the optimal correspondence between key points can be found through the Hungarian algorithm to obtain the minimum matching cost.
[0056] S314, obtain the corresponding similarity based on the minimum matching cost.
[0057] For example, each minimum matching cost can be normalized and mapped to the [0,1] interval to obtain the corresponding similarity.
[0058] S315, determine a set of candidate packaging boxes from the set of packaging boxes based on each similarity.
[0059] For example, if the total area of the minimum bounding rectangle of all boxes in the set of boxes to be sorted is less than the area of a preset material region, boxes with a similarity greater than a similarity threshold (e.g., 0.7) can be selected as candidate boxes. If all similarities are less than the similarity threshold, candidate boxes can be selected based on similarity ranking (e.g., the top n boxes).
[0060] Through the above steps S311 to S315, the outline of the packaging box is described by shape context. Combined with cost function and dynamic threshold screening, a high-precision similarity assessment of irregularly shaped packaging boxes is achieved. It can adapt to packaging boxes with complex shapes. Prioritizing similar shapes can reduce material fragmentation and improve material utilization.
[0061] Optionally, please refer to Figure 3 S315, Determine a set of candidate packaging boxes from the packaging box set based on each similarity, including: S3151, determine a set of third packaging boxes from the packaging box set whose similarity is greater than the similarity threshold based on each similarity.
[0062] For example, if the total area of the minimum bounding rectangle of all boxes in the set of boxes to be sorted is not less than the area of the preset material region, the set of boxes can be traversed, and boxes with a similarity greater than a similarity threshold can be retained and denoted as the third box. If all similarities are less than the similarity threshold, the third box can be determined based on the similarity ranking (e.g., the first n boxes).
[0063] S3152, Arrange samples within the preset material area, and determine a set of candidate packaging boxes from the third packaging box based on the remaining area of the preset material area.
[0064] For example, after layout within a preset material area, the remaining area is updated in real time (by subtracting layout boxes using Boolean subtraction). For each box in the third packaging box, its outline is first checked to see if it can be completely embedded into the remaining area through rotation and displacement. Then, boxes whose aspect ratio matches the local shape of the remaining area are prioritized as candidate boxes (e.g., if the remaining area is a narrow strip, long strip boxes are prioritized for layout). The area utilization rate and shape similarity of each box in the remaining area can be obtained based on the remaining area and each box in the third packaging box. The layout score of each box in the third packaging box is obtained by weighted summation of each area utilization rate and each shape similarity. Candidate boxes are selected based on each layout score.
[0065] Traditional nesting algorithms rely solely on size matching while ignoring shape similarity. Static nesting orders (such as descending order by area) cannot adapt to the dynamic shapes of remaining areas. Through steps S3151 to S3152, similarity pre-screening and remaining area adaptation can avoid multiple cuts or fragmentation caused by shape mismatch, thereby improving material utilization and nesting efficiency.
[0066] In one possible implementation, please refer to Figure 5 S320, For each candidate packaging box, the probability that the candidate packaging box is the second packaging box is obtained based on the planar features of the first packaging box and the planar features of the candidate packaging box, including: S321, for each candidate packaging box, a collaborative feature pair is obtained based on the planar features of the first packaging box and the planar features of the candidate packaging box. The collaborative feature pair reflects the fit between the candidate packaging box and the first packaging box.
[0067] For example, geometric features (such as convex hull, minimum bounding rectangle) and topological features (such as number of holes) can be extracted from the planar features of the first packaging box, and collaborative feature pairs can be obtained by extracting features of the same dimension for each candidate packaging box based on the planar features of the candidate packaging boxes.
[0068] S322, based on the collaborative feature pair, obtain the probability that the candidate packaging box is the second packaging box.
[0069] For example, model training data can be obtained from historical layout cases. Logistic regression or random forest models can be trained based on the model training data (inputting a pair of collaborative feature pairs of packaging boxes and outputting the probability that one packaging box in the pair is arranged around the other packaging box). A probability model can be obtained by inputting the collaborative feature pairs into the probability model to obtain the probability that the candidate packaging box is the second packaging box.
[0070] Through the above steps S321 to S322, multi-dimensional collaborative feature pairs are constructed to comprehensively evaluate shape and topological fit, output probabilities based on data-driven models, and support dynamic threshold filtering.
[0071] Optionally, please refer to Figure 4 The collaborative feature pair includes the rotation angle of the candidate packaging box and the overlap contour length of the first packaging box and the candidate packaging box. In S321, the collaborative feature pair is obtained based on the planar features of the first packaging box and the planar features of the candidate packaging box, including: S3211, Obtain the corresponding circumscribed polygon based on the planar features of the first packaging box and the planar features of the candidate packaging boxes. The circumscribed polygon is the smallest polygon that contains the unfolded shape of the packaging box.
[0072] For example, the corresponding circumscribed polygons can be generated using a convex hull algorithm (such as Andrew's monotone chain) or a minimum area circumscribed rectangle algorithm (rotation caliper method) based on the planar features of the first packaging box and the planar features of the candidate packaging boxes.
[0073] S3212, rotate the outer polygon of the candidate packaging box around the outer polygon of the first packaging box.
[0074] For example, a feasible rotation angle can be determined based on the remaining area of the preset material area and the circumscribed polygon of the candidate packaging box, and the circumscribed polygon of the candidate packaging box can be rotated around the circumscribed polygon of the first packaging box according to the feasible rotation angle.
[0075] S3213, if during rotation, the distance between any pair of sides of the circumscribed polygon of the candidate packaging box and the circumscribed polygon of the first packaging box is less than a distance threshold, the rotation angle and the corresponding overlapping contour length are determined. The rotation angle includes the rotation angle of the candidate packaging box and its revolution angle around the first packaging box.
[0076] For example, the shortest distance from any side of the circumscribed polygon of the candidate packaging box to any side of the circumscribed polygon of the first packaging box can be calculated. When it is determined during rotation that the shortest distance between any pair of sides of the circumscribed polygon of the candidate packaging box and the circumscribed polygon of the first packaging box is less than a distance threshold, the rotation angle is recorded, and the corresponding overlapping contour length is calculated (i.e., the distance from any point on the side of the circumscribed polygon of the candidate packaging box in the pair of sides where the shortest distance is less than the distance threshold to any point on the circumscribed polygon of the first packaging box is calculated, and the overlapping contour length is obtained based on the points on the side of the circumscribed polygon of the candidate packaging box that are less than the distance threshold).
[0077] Through the above steps S3211 to S3213, a compact circumscribed polygon is generated to reduce computational complexity; all possible poses of the candidate packaging box are simulated to cover the optimal solution; and effective poses are selected based on geometric distance and overlapping contour length to improve material utilization.
[0078] Optionally, please refer to Figure 4 The planar features also include marked paths, which include indentation paths and / or perforation paths. S322, the probability of obtaining a candidate packaging box as the second packaging box based on the collaborative features includes: S3221, when the marking paths of the candidate packaging box and the first packaging box are determined to be continuous based on the rotation angle, the lengths of the marking paths of the candidate packaging box and the first packaging box are added together to obtain the marking path length.
[0079] For example, the position coordinates of the candidate packaging box and the first packaging box in the preset material area can be determined according to the rotation angle. The Euclidean distance of the marking path of the candidate packaging box and the first packaging box can be determined according to the position coordinates. If the Euclidean distance is less than a preset threshold, the marking path of the candidate packaging box and the first packaging box is continuous. The length of the marking path is obtained by summing the lengths of the marking paths of the candidate packaging box and the first packaging box (the indentation path and the punching path are summed separately).
[0080] S3222, the probability that the candidate packaging box is the second packaging box is obtained based on the overlapping contour length and the corresponding mark path length.
[0081] For example, the overlapping contour length and the corresponding marker path length can be normalized and weighted to obtain a comprehensive score. The comprehensive score can then be converted into the probability that a candidate box is the second box based on the number of candidate boxes.
[0082] By taking into account space utilization and process compatibility through the above steps S3221 to S3222, it is beneficial to adapt to the requirements of different types of packaging boxes, and at the same time, it helps to improve the sorting speed and support rapid decision-making for automated production of packaging boxes.
[0083] For example, please refer to Figure 4 S3222, the probability that a candidate box is the second box is obtained based on the overlapping contour length and the corresponding marker path length, including: S32221, the overlap rate is obtained by normalizing the overlapping contour length based on the perimeter of the candidate packaging box.
[0084] For example, the overlap ratio can be obtained by normalizing the overlap length of the candidate packaging box according to the ratio of the overlap length of the overlap outline to the perimeter.
[0085] S32222, the marking path efficiency is obtained by normalizing the marking path length based on the total marking path length of each packaging box in the packaging box set.
[0086] For example, the marking path efficiency can be obtained by normalizing the marking path length based on the proportion of the marking path length to the total marking path length.
[0087] S32223, based on the contour overlap rate and the marking path efficiency, obtain the probability that the candidate packaging box is the second packaging box.
[0088] For example, the probability of a candidate box being the second box can be obtained by weighted summation and normalization of the contour overlap rate and the marking path efficiency.
[0089] Existing technologies do not consider the overall process burden of multiple packaging boxes, and may select packaging boxes with extremely long paths but low space utilization, causing overload of die-cutting equipment or packaging box layout failure. Through the above steps S32221 to S32223, perimeter normalization is used to eliminate dimensional deviations, accurately measure space sharing rate, and total set length is normalized to reflect the proportion of process resource consumption. The optimal solution is output through a weighted probability model, balancing space and process requirements and enhancing production stability.
[0090] In one possible implementation, please refer to Figure 5 S330, determining the second packaging box based on the probability that each candidate packaging box is the second packaging box, including: S331, sort the probabilities of each candidate packaging box being the second packaging box, and determine the candidate packaging box with the highest probability as the second packaging box.
[0091] For example, the probability of each candidate box being the second box can be sorted, and the candidate box with the highest probability can be determined as the second box. If multiple candidate boxes have the same probability, the candidate box with the larger contour overlap rate is selected as the second box.
[0092] Through the above step S331, the optimal second packaging box is selected by using probability sorting and secondary conditions to avoid layout conflicts and improve layout efficiency.
[0093] In one possible implementation, please refer to Figure 5 This method is applied to packaging box layout equipment, which is connected to die-cutting equipment. The method also includes: S500, after layout, for each package in the package set, use spatial indexing within the preset material area to quickly query neighboring packages and obtain the shortest marking path and the shortest cutting path.
[0094] For example, the preset material region can be meshed. For the coordinate information of each package in the set of packages in the preset material region, adjacent meshes are recursively merged to form a spatial index (such as an R-tree or quadtree structure). The spatial index is used to quickly query the neighboring packages and their marked paths within the preset material region. Algorithms such as Dijkstra are used to obtain the shortest marked path and the shortest cutting path.
[0095] S600 sends the shortest marking path and the shortest cutting path to the die-cutting device.
[0096] For example, the coordinate sequence of the shortest marker path and the shortest cutting path can be sent to the die-cutting device.
[0097] Existing technologies typically transmit raw coordinate data directly, consuming bandwidth and easily causing die-cutting equipment to time out while waiting for data, thus reducing production cycle time. Through the steps S500 to S600 above, spatial indexing is used to quickly query nearby paths, supporting the processing of large-scale irregularly shaped boxes and improving packaging box production efficiency.
[0098] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0099] Corresponding to the packaging box layout method described in the above embodiments, this application also provides a packaging box layout device, the various modules of which can realize the various steps of the packaging box layout method. Figure 6 The diagram shows a structural block diagram of the packaging box arrangement device provided in the embodiments of this application. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0100] ReferenceFigure 6 The device includes: An acquisition module is used to acquire the planar features of each packaging box in a set of packaging boxes to be arranged; wherein, the set of packaging boxes includes a first packaging box and other packaging boxes, the first packaging box includes the already arranged packaging boxes, and the planar features include the dimensions of the unfolded graphic; The first layout module is used to arrange the largest packaging box in the packaging box set when none of the packaging boxes in the packaging box set are laid out, and to determine it as the first packaging box. Other layout modules are used to arrange one of the other packaging boxes: A candidate packaging box module is used to determine a set of candidate packaging boxes from the set of packaging boxes; wherein, when the other packaging boxes include multiple packaging boxes, the candidate packaging box is one of the other packaging boxes whose similarity to the unfolded graphic outline of the first packaging box is greater than a similarity threshold; and when the other packaging boxes include one packaging box, the candidate packaging box is one of the other packaging boxes. The probability module is used to determine the probability that each candidate packaging box is a second packaging box based on the planar features of the first packaging box and the planar features of the candidate packaging box; wherein the second packaging box is the current sorting target. The second packaging box module is used to determine the second packaging box based on the probability that each of the candidate packaging boxes is the second packaging box; The second layout module is used to arrange the second packaging box. The repeat module is used to repeat the step of arranging one of the other packaging boxes until all packaging boxes in the packaging box set have been arranged.
[0101] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0102] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0103] This application also provides a packaging box sorting device. Figure 7 This is a schematic diagram of the structure of a packaging box arrangement device provided in one embodiment of this application. Figure 7 As shown, the packaging box sorting device 7 of this embodiment includes: at least one processor 70 ( Figure 7 Only one is shown in the image), at least one memory 71 ( Figure 7 (Only one is shown in the image) and a computer program 72 stored in the at least one memory 71 and executable on the at least one processor 70. When the processor 70 executes the computer program 72, it causes the packaging box layout device 7 to perform the steps in any of the above-described packaging box layout method embodiments, or causes the packaging box layout device 7 to perform the functions of each module / unit in the above-described device embodiments.
[0104] For example, the computer program 72 may be divided into one or more modules / units, which are stored in the memory 71 and executed by the processor 70 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 72 in the packaging box sorting device 7.
[0105] The packaging box layout device 7 can be a desktop computer, laptop, handheld computer, or cloud server, etc. This packaging box layout device may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will understand that... Figure 7This is merely an example of the packaging box layout device 7 and does not constitute a limitation on the packaging box layout device 7. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, buses, etc.
[0106] The processor 70 can be a Central Processing Unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0107] In some embodiments, the memory 71 can be an internal storage unit of the packaging box layout device 7, such as a hard drive or memory of the packaging box layout device 7. In other embodiments, the memory 71 can also be an external storage device of the packaging box layout device 7, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the packaging box layout device 7. Further, the memory 71 can include both internal storage units and external storage devices of the packaging box layout device 7. The memory 71 is used to store operating systems, applications, bootloaders, data, and other programs, such as the program code of the computer program. The memory 71 can also be used to temporarily store data that has been output or will be output.
[0108] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0109] This application provides a computer program product that, when run on a packaging box layout device, enables the packaging box layout device to perform the steps described in any of the above method embodiments.
[0110] 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, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a packaging box arrangement device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, such as a USB flash drive, a portable hard drive, a magnetic disk, or an optical disk.
[0111] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0112] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0113] In the embodiments provided in this application, it should be understood that the disclosed packaging box layout equipment and method can be implemented in other ways. For example, the packaging box layout equipment embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0114] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0115] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for arranging packaging boxes, characterized in that, include: Obtain the planar features of each packaging box in the set of packaging boxes to be arranged; wherein, the set of packaging boxes includes a first packaging box and other packaging boxes, the first packaging box includes the arranged packaging boxes, and the planar features include the dimensions of the unfolded graphic; If none of the boxes in the set of boxes are arranged, the box with the largest area in the set of boxes is arranged and determined as the first box. Arrange one of the other packaging boxes in a layout: A set of candidate packaging boxes is determined from the set of packaging boxes; wherein, when the other packaging boxes include multiple packaging boxes, the candidate packaging box is one of the other packaging boxes whose similarity to the unfolded graphic outline of the first packaging box is greater than a similarity threshold, and when the other packaging boxes include one packaging box, the candidate packaging box is one of the other packaging boxes; For each candidate packaging box, the probability that the candidate packaging box is the second packaging box is obtained based on the planar features of the first packaging box and the planar features of the candidate packaging box; wherein, the second packaging box is the current sorting target; The second packaging box is determined based on the probability that each of the candidate packaging boxes is the second packaging box; Arrange the second packaging box in a layout; Repeat the step of arranging one of the other boxes until all boxes in the box set have been arranged.
2. The packaging box layout method as described in claim 1, characterized in that, The step of determining a set of candidate packaging boxes from the set of packaging boxes includes: Multiple key points of each package in the package set are obtained by uniformly sampling the unfolded graphic outline of each package in the package set; For each key point in the set of packaging boxes, calculate the polar coordinate histogram of each key point to other key points to obtain the shape context vector; The minimum matching cost for each of the other boxes is obtained based on the shape context vector of the first box and the shape context vectors of the other boxes. The corresponding similarity is obtained based on the minimum matching cost for each of the above. A set of candidate packaging boxes is determined from the set of packaging boxes based on the aforementioned similarity.
3. The packaging box layout method as described in claim 2, characterized in that, The step of determining a set of candidate packaging boxes from the set of packaging boxes based on the aforementioned similarities includes: Based on the aforementioned similarity scores, a third set of packaging boxes with similarity scores greater than the aforementioned similarity threshold is determined from the set of packaging boxes; Arrange the samples within the preset material area, and determine a set of candidate packaging boxes from the third packaging box based on the remaining area of the preset material area.
4. The packaging box layout method as described in claim 1, characterized in that, For each candidate packaging box, the probability that the candidate packaging box is the second packaging box is obtained based on the planar features of the first packaging box and the planar features of the candidate packaging box, including: For each candidate packaging box, a pair of complementary features is obtained based on the planar features of the first packaging box and the planar features of the candidate packaging box; wherein, the pair of complementary features is used to reflect the fit between the candidate packaging box and the first packaging box; The probability that the candidate packaging box is the second packaging box is obtained based on the collaborative features.
5. The packaging box layout method as described in claim 4, characterized in that, The collaborative feature pair includes the rotation angle of the candidate packaging box and the length of the overlapping contour of the first packaging box and the candidate packaging box; The step of obtaining a cooperative feature pair based on the planar features of the first packaging box and the planar features of the candidate packaging box includes: The corresponding circumscribed polygon is obtained based on the planar features of the first packaging box and the planar features of the candidate packaging box; wherein, the circumscribed polygon refers to the smallest polygon that contains the unfolded shape of the packaging box. Rotate the outer polygon of the candidate packaging box around the outer polygon of the first packaging box; If, during rotation, the distance between any pair of sides of the circumscribed polygon of the candidate packaging box and the circumscribed polygon of the first packaging box is less than a distance threshold, the rotation angle and the corresponding overlapping contour length are determined; wherein, the rotation angle includes the rotation angle of the candidate packaging box and the revolution angle around the first packaging box.
6. The packaging box layout method as described in claim 5, characterized in that, The planar features further include marking paths, which include indentation paths and / or perforation paths; the step of obtaining the probability that the candidate packaging box is the second packaging box based on the collaborative features includes: If the marking paths of the candidate packaging box and the first packaging box are determined to be continuous based on the rotation angle, the lengths of the marking paths of the candidate packaging box and the first packaging box are summed to obtain the marking path length. The probability that the candidate packaging box is the second packaging box is obtained based on the overlapping contour length and the corresponding mark path length.
7. The packaging box layout method as described in claim 6, characterized in that, The step of obtaining the probability that the candidate packaging box is the second packaging box based on the overlapping contour length and the corresponding marker path length includes: The overlap rate is obtained by normalizing the overlapping contour length based on the perimeter of the candidate packaging box. The marking path efficiency is obtained by normalizing the marking path length based on the total marking path length of each packaging box in the packaging box set. The probability that the candidate packaging box is the second packaging box is obtained based on the contour overlap rate and the marking path efficiency.
8. The packaging box layout method as described in claim 1, characterized in that, The step of determining the second packaging box based on the probability that each of the candidate packaging boxes is the second packaging box includes: The probability of each candidate packaging box being the second packaging box is ranked, and the candidate packaging box with the highest probability is determined as the second packaging box.
9. The packaging box layout method as described in claim 3, characterized in that, The method, applied to a packaging box layout device, wherein the packaging box layout device is communicatively connected to a die-cutting device, further includes: After the layout is completed, for each box in the set of boxes, the spatial index is used within the preset material area to quickly query the neighboring boxes and obtain the shortest marking path and the shortest cutting path. The shortest marking path and the shortest cutting path are sent to the die-cutting device.
10. A packaging box layout device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
A two-dimensional contour layout method based on center of gravity
CN109145279A
Two-dimensional irregular layout method and application based on network migration and hybrid positioning
CN117151277A
Two-dimensional irregular part layout method and system based on contour matching
CN117807873A
Automatic typesetting method and device for two-dimensional graph
CN119005443A
CAD drawing batch typesetting processing method
CN119150387A