Intelligent stack type generation method for packaging production line based on heuristic knowledge guidance

By integrating intelligent optimization and heuristic algorithms, combined with fine-tuning and transformation techniques, diverse and efficient stacking schemes are generated, solving the problems of single schemes and poor adaptability in existing technologies, and realizing efficient stacking design.

CN121871990APending Publication Date: 2026-04-17QINGDAO UNIV OF SCI & TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
QINGDAO UNIV OF SCI & TECH
Filing Date
2025-11-18
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies have problems such as the singleness or excessive similarity of solutions and poor adaptability when generating stacking schemes, making it difficult to meet the personalized and diversified needs of customers. Furthermore, when dealing with complex constraints such as box spacing, pallet edge distance, and support stability, it is difficult to effectively balance space utilization and layout rationality.

Method used

An integrated strategy combining intelligent optimization and heuristic algorithms is adopted, including the guillotine differential algorithm, spiral genetic algorithm, pruning bottom-left corner priority algorithm, pruning guillotine algorithm, and partitioning greedy strategy, to generate the original stack-type solution set. The optimal solution is then selected by fine-tuning the layout with compactness, edge alignment, and uniform distribution, combined with rotation and flip transformations.

Benefits of technology

The generated stacking solution set is highly diverse and effective, adaptable to various scenarios, improves the flexibility and engineering applicability of the solution, reduces the cost of manual adjustment, and improves design efficiency and versatility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121871990A_ABST
    Figure CN121871990A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of logistics storage and industrial automation, in particular to a package production line intelligent stack type generation method based on heuristic knowledge guidance, and the method comprises the steps: obtaining initial parameter data, building a coordinate system according to the initial parameter data, generating an original stack type solution set based on initial parameters and the coordinate system, and generating a package production line stack type solution set; performing stack type fine tuning processing on the original stack type solution set, performing similar stack type reduction on the regularized stack type solution set, and performing overturning decision according to the reduction solution set to screen an optimal scheme, including counting the number of overlapped boxes before and after overturning so as to divide stability levels, sorting stack types in combination with the number of boxes, and outputting an optimal stack type scheme set; the optimal stack type scheme set is verified, and a final result is output, the method can flexibly adapt to combinations of trays and boxes of different specifications, algorithm logic does not need to be developed again for specific sizes, and the problem that a traditional method is poor in adaptability under the scenes of multi-size box bodies and multi-specification trays is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of logistics warehousing and industrial automation technology, and in particular to a method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge guidance. Background Technology

[0002] With the rapid development of modern logistics, warehousing, and manufacturing, the demand for cost reduction and efficiency improvement is increasing. Intelligent pallet design, as a key technology, aims to rationally, efficiently, and stably place as many boxes as possible within a given pallet space. However, existing technical solutions in this field currently suffer from the following limitations: First, early research generally adopted heuristic algorithms based on fixed rules, such as greedy algorithms, guillotine segmentation algorithms, and bottom-left corner priority algorithms. Although these methods are computationally efficient, they are essentially greedy strategies and can usually only generate a stacking scheme that meets the requirements according to a single preset rule. In practical applications, customers often need to choose from multiple feasible solutions based on different handling machinery, warehouse space layouts, and aesthetic requirements. Such methods cannot provide diverse solutions and are difficult to meet customers' personalized and diversified needs, resulting in a serious lack of application flexibility. Secondly, to generate multiple solutions, subsequent research has introduced intelligent optimization algorithms such as genetic algorithms and differential evolution algorithms. These algorithms perform global search through population evolution mechanisms and theoretically have the ability to generate multiple solutions. However, when solving the pallet design problem, the intelligent optimization algorithms in the existing technology often generate pallet solutions with a single number or too high similarity. The population is prone to premature convergence and fails to provide truly distinguishable alternatives. On the other hand, due to the lack of effective guidance from heuristic knowledge in the packing field, the algorithm search process is largely blind. When dealing with complex constraints such as box spacing, pallet edge distance, and support stability, it is difficult to effectively balance space utilization and layout rationality. Its encoding strategy and evolution mechanism are poorly adaptable to the combination of multi-sized boxes and multi-specification pallets. At present, there is a need for an intelligent pallet generation method for packaging production lines based on heuristic knowledge guidance. Summary of the Invention

[0003] To address the issues of existing methods generating monotonous or overly similar pallet patterns and poor adaptability, this invention provides an intelligent pallet pattern generation method for packaging production lines based on heuristic knowledge guidance.

[0004] This invention provides a method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge, employing the following technical solution: A method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge guidance includes: S1. Obtain initial parameter data and construct a coordinate system based on the initial parameter data, including obtaining pallet size, box size, box spacing and pallet edge spacing, and constructing a two-dimensional rectangular coordinate system with the lower left corner of the pallet as the origin; S2. Generate the original stack type solution set based on the initial parameters and coordinate system, including generating the corresponding stack type schemes by using an integrated strategy of intelligent optimization algorithm and heuristic algorithm respectively, and merging all schemes to obtain the original stack type solution set; S3. Perform stack type fine-tuning on the original stack type solution set, including sequentially performing layout compaction adjustment, edge alignment adjustment and uniform distribution adjustment on each stack type in the solution set to obtain a regularized stack type solution set; S4. Perform similarity reduction on the normalized stack type solution set, including generating a set of rotation transformations and flip transformations for each stack type, judging the similarity of stack types based on coordinate matching rules, and removing similar stack types to obtain the reduced solution set; S5. Perform a flipping decision to select the optimal solution based on the reduced solution set, including counting the number of boxes overlapping before and after flipping to classify the stability level, sorting the stacking type according to the number of boxes packed, and outputting the optimal stacking type solution set. S6. Verify the optimal stacking scheme set and output the final result.

[0005] Furthermore, the strategy of integrating intelligent optimization algorithms and heuristic algorithms includes generating corresponding stacking schemes using the guillotine differential algorithm, spiral genetic algorithm, pruning bottom-left corner priority algorithm, pruning guillotine algorithm, and partitioning greedy strategy, respectively. The execution steps of the guillotine differential algorithm include: S211. Construct a candidate box library. Generate a set of candidate boxes based on the total number of boxes to be stacked, and arrange the candidate boxes in the set horizontally and vertically respectively. S212. Set the parameters of the differential evolution algorithm, including population size, number of iterations, mutation factor and crossover probability; S213. Perform mutation and crossover operations to generate offspring individuals. Calculate the mutated gene based on three randomly selected different parent individuals, and then control the fusion ratio of the mutated gene and the parent gene through the crossover probability. S214. Perform box placement and space segmentation, initialize the list of free rectangles, select candidate boxes according to the coding order of offspring individuals, traverse the free rectangles and select the optimal placement position through the scoring function, select the segmentation method according to the aspect ratio of the remaining space after placement, and update the list of free rectangles. S215. Repeat S214 until all boxes to be stacked are placed. Output the optimal stacking scheme corresponding to the population, denoted as . ; Further, the execution steps of the spiral genetic algorithm include defining the bin-packing starting point, setting expansion rules based on the bin-packing starting point, constructing a genetic algorithm encoding, the encoding containing the access order of the four starting points and the bin rotation probability of each starting point, setting genetic algorithm parameters and optimizing the population, including population size, number of iterations, and crossover weight coefficient, then performing crossover and mutation operations to optimize the population, selecting the optimal individual through a fitness function, evaluating the stacking space utilization and bin-packing quantity corresponding to each individual, and selecting the stacking scheme corresponding to the individual with the highest fitness, denoted as... The fitness function expression is: ; in, This represents the individual fitness value. To maximize space utilization, For packing quantity factor, and These are the weighting coefficients for space utilization and packing quantity factors, respectively.

[0006] Furthermore, the execution steps of the bottom-left corner priority pruning algorithm include sequentially placing objects horizontally and vertically according to the initial placement point coordinates, introducing a dual pruning strategy based on theoretical upper bounds and global optimal values ​​to set dual pruning conditions. The first level of the dual pruning conditions is... If the current optimal solution is known, the second condition is that the current branch's bin count reaches the global theoretical maximum bin count. If either condition is met, the branch search terminates. Valid candidate points are generated using the double pruning condition. Right-side and top-side candidate points are generated based on the current bin coordinates. The candidate points are traversed, and the optimal solution is searched. Combining the pruning condition, all valid candidate points are traversed, and the optimal stacking configuration is output, denoted as... ,in, ; In the formula, The maximum number of bins that can be packed in the current branch. This represents the number of boxes that have been placed. This represents the maximum number of bins that can be packed according to the grid arrangement theory. This represents the theoretical maximum number of bins that can be packed in the remaining space.

[0007] Furthermore, the execution steps of the pruning guillotine algorithm include: S241. Calculate the number of rows and columns of boxes that can be placed in the tray, based on either all horizontal or all vertical placement, and generate a grid-based baseline scheme. S242. The baseline scheme is divided vertically and horizontally in sequence, and the division points are calculated based on integer multiples of the box size and edge spacing to ensure that the sub-region after division can accommodate at least one box. S243. Set pruning optimization conditions, including terminating the branch when the theoretical maximum number of boxes packed in the current branch is less than or equal to the current known optimal solution. When the pallet is square, only vertical splitting is performed to reduce redundant calculations. S244. Recursively search for the optimal solution in each sub-region. Repeat S241-S243 for each divided sub-region until no more boxes can be placed in the sub-region. Output the optimal stacking scheme, denoted as... ; The calculation of the vertical dividing point is performed according to the following formula: ; in, Let n be the X-axis coordinate of the vertical dividing point, where n is a positive integer. The length of the box This refers to the spacing between the edges of the tray.

[0008] Further, the execution steps of the partitioning greedy strategy include: determining the maximum number of columns in the left horizontal placement area based on the relationship between pallet width and edge spacing, and box width and edge spacing; enumerating the number of columns on the left and calculating the packing quantity, enumerating sequentially from 1 to the maximum number of columns that can be placed; calculating the horizontal packing quantity of the left area for each column number; calculating the effective width of the right area based on the number of columns on the left; vertically placing boxes in the right area and calculating the packing quantity; filtering the optimal partitioning scheme; calculating the total packing quantity corresponding to each enumerated column number; and outputting the scheme with the highest total packing quantity, denoted as... The formula for calculating the maximum number of columns that can be placed on the left is: ;, in, This represents the maximum number of columns that can be placed in the left area. For the width of the pallet, This is the floor symbol.

[0009] Furthermore, the execution steps of the compact layout adjustment include calculating the maximum leftward and maximum downward movement distances for each box in the stack, updating the coordinates of each box based on the calculated movement distances, and then performing multiple iterations until all boxes can no longer move further to the left or downward. The formula for calculating the maximum leftward movement distance is: ; in, For the box The maximum distance to move to the left, For the box The X-axis coordinate of the bottom left corner For the spacing between boxes, For other boxes The lower left X-axis coordinate, For other boxes The side length along the X-axis, and Each represents a box and boxes The length of the side parallel to the Y-axis. and They represent boxes respectively. and Y-axis coordinate of the bottom left corner.

[0010] Furthermore, the uniform distribution adjustment includes, based on the boundary coordinates of the stack type, counting the number of boxes on each boundary, the total length of the boxes, and the effective length of the boundary; determining a uniform spacing that satisfies the minimum spacing constraint based on the effective length of the boundary, the total length of the boxes, and the number of boxes; adjusting the boundary and intermediate boxes; first, redistributing the positions of the boundary boxes according to the uniform spacing; then, dividing the intermediate boxes into horizontal and vertical groups based on similar Y-coordinates and similar X-coordinates; and adjusting the spacing between boxes within each group to a uniform spacing. The formula for calculating the uniform spacing is: ; in, For the effective length of the boundary, The total length of all boxes on the boundary. This represents the number of boundary boxes.

[0011] Furthermore, the method of determining stack type similarity based on coordinate matching rules includes setting a tolerance based on box size, then performing a normalization transformation to convert both stack types to a coordinate system with the lower left corner of their smallest bounding rectangle as the origin. The number of boxes in the two stack types is compared. If the number is the same, the coordinates of the center point of each box are calculated, and similarity is determined by matching the distance between the center points. If the number is different, they are determined to be dissimilar. The formula for calculating the normalization transformation is: ; in, and Let be the coordinates of the lower left corner of the smallest bounding rectangle of stack type B.

[0012] Furthermore, the step of performing a flip decision to select the optimal solution based on the reduced solution set includes: S511, Calculate the center coordinates of the tray , serving as the reference point for the flip transformation; S512. Perform a flip transformation based on the reference point. Perform a horizontal flip transformation and a vertical flip transformation on each stack type, and calculate the coordinates of the boxes after flipping. S513. Normalize the coordinates of the stack before and after flipping, count the number of boxes whose center point distance is less than the numerical tolerance, and obtain the horizontal flipping overlap number and the vertical flipping overlap number. S514. Sort all stack types in descending order of the number of boxes placed, and sort stack types with the same number of boxes in order of symmetry. Output the sorted stack type solution set as the optimal solution set. The coordinate calculation formula for the horizontal flip transformation is as follows: ; in, Here are the coordinates of the bottom left corner of the box after it has been horizontally flipped. Let x be the X-axis coordinate of the pallet center, and y be the coordinates of the bottom left corner of the box before it was flipped. H is the length of the box, and H is the total height of the pallet.

[0013] In summary, the present invention has the following beneficial technical effects: 1. This invention constructs the original stacking solution set by integrating five improved algorithms: guillotine differential algorithm, spiral genetic algorithm, pruning bottom left corner priority algorithm, pruning guillotine algorithm, and partitioning greedy strategy. The five algorithms work together to cover different search dimensions, which not only avoids the single-output defect of traditional single algorithm solutions, but also improves the convergence speed of intelligent optimization algorithms through heuristic knowledge guidance. The final generated original stacking solution set has high diversity and high effectiveness, providing a multi-scenario adaptability basis for packaging production lines.

[0014] 2. This invention addresses potential issues in the original stacking pattern, such as corner deviation and uneven spacing. It designs a three-level fine-tuning process: compact layout, edge alignment, and uniform distribution. The compact layout adjustment precisely calculates the maximum leftward and downward movement distance of the boxes to ensure they are compactly aligned with the lower left corner of the pallet, eliminating invalid gaps. The edge alignment adjustment identifies boundary boxes based on tolerance and aligns them to the minimum bounding rectangle boundary of the stacking pattern, constructing a regular rectangular layout. The uniform distribution adjustment ensures uniform spacing that meets safety constraints, achieving uniform spacing between boundary and middle boxes. After these three levels of fine-tuning, the stacking pattern not only meets the regularity requirements of automated palletizing equipment but also avoids manual adjustments, reducing production line operating costs and improving the engineering applicability of the solution.

[0015] 3. This invention generates a set of rotation and flip transformations for the stack type, combines normalization transformation to eliminate positional deviations, and then judges similarity based on the comparison of the number of boxes and the matching of the center point distance. If the number is different, it is directly determined that they are not similar. If the number is the same, the similarity relationship is determined by comparing the center point distance and tolerance. This effectively removes pseudo-diversity schemes with similar shapes in the solution set, avoids redundant schemes occupying screening resources, ensures the dissimilarity of the solution set, reduces the computational amount of subsequent flip decisions, and improves the overall design efficiency.

[0016] 4. This invention provides a formulaic calculation process from initial parameter acquisition and algorithm parameter setting to fine-tuning, reduction, and decision-making stages. This allows the method to flexibly adapt to different specifications of pallet and box combinations without the need to redevelop algorithm logic for specific sizes. It solves the problem of poor adaptability of traditional methods in scenarios with multiple sizes of boxes and multiple specifications of pallets, and significantly improves the engineering application scope and versatility of the method. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the overall process of a method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge, according to an embodiment of the present invention.

[0018] Figure 2 This is a computational structure diagram of a method for generating intelligent stacking patterns for packaging production lines based on heuristic knowledge, according to an embodiment of the present invention.

[0019] Figure 3 This is a generation effect diagram of an intelligent stacking method for packaging production lines based on heuristic knowledge guidance, according to an embodiment of the present invention.

[0020] Figure 4 This is another effect diagram of an intelligent stacking method for packaging production lines based on heuristic knowledge guidance, according to an embodiment of the present invention. Detailed Implementation

[0021] The present invention will be further described in detail below with reference to the accompanying drawings.

[0022] Example 1 Reference Figure 1 This embodiment of a method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge includes: Obtain initial parameter data and construct a coordinate system based on the initial parameter data, including obtaining pallet size, box size, box spacing and pallet edge spacing, and construct a two-dimensional rectangular coordinate system with the lower left corner of the pallet as the origin; The original stack type solution set is generated based on the initial parameters and coordinate system, including generating corresponding stack type schemes by using an integrated strategy of intelligent optimization algorithm and heuristic algorithm, and merging all schemes to obtain the original stack type solution set; The original stack pattern solution set is subjected to stack pattern fine-tuning processing, including sequentially performing layout compaction adjustment, edge alignment adjustment and uniform distribution adjustment on each stack pattern in the solution set to obtain a regularized stack pattern solution set; Perform similarity reduction on the normalized stack type solution set, including generating a set of rotation transformations and flip transformations for each stack type, judging the similarity of stack types based on coordinate matching rules, and removing similar stack types to obtain the reduced solution set; Based on the reduced solution set, the flipping decision is performed to select the optimal solution, including counting the number of boxes overlapping before and after flipping to classify the stability level, sorting the stacking type according to the number of boxes packed, and outputting the optimal stacking type solution set. Verify the optimal stacking scheme set and output the final result.

[0023] like Figure 1 As shown, specifically, a method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge includes the following: S1. Obtain initial parameter data and construct a coordinate system based on the initial parameter data, including obtaining pallet size, box size, box spacing and pallet edge spacing, and constructing a two-dimensional rectangular coordinate system with the lower left corner of the pallet as the origin; First, initial parameter data acquisition is performed. High-precision dimensional measuring equipment (such as laser rangefinders and industrial imaging measurement systems) is used to collect four types of core parameters required for the packaging production line. Among them, pallet size parameters include the horizontal length W and vertical width H of the pallet; box size parameters include the horizontal length w and vertical width h of the boxes to be stacked; and box spacing parameters are also collected. The safety clearance required between two adjacent boxes is determined based on the box material and compressive strength, and the pallet edge spacing parameters are as follows. This is the minimum distance between the outermost box and the edge of the pallet, used to prevent boxes from exceeding the pallet boundary and causing the stack to collapse. After parameter acquisition is completed, a parameter storage and verification mechanism is established to store the acquired W, H, w, h, and , Parameters are imported into the database module of the industrial control computer, and verified according to preset rules, such as... This ensures that individual boxes can be placed correctly within the pallet and automatically verifies the validity of parameters. If any parameters do not meet the constraints, the system automatically triggers a re-collection command until all parameters meet the actual palletizing constraints.

[0024] Subsequently, a coordinate system construction operation is performed. Based on the physical structure of the pallet, the origin, coordinate axis directions, and coordinate range of the two-dimensional rectangular coordinate system are determined: the pallet is placed horizontally on a flat workbench, and the lower left corner vertex of the pallet is captured by the vision positioning system. This vertex is the intersection of the horizontal length direction and the vertical width direction of the pallet, and has no protrusions or depressions. This vertex is set as the origin of the coordinate system. The horizontal extension direction of the pallet is defined as the X-axis, with the positive X-axis direction to the right, and the coordinate range is [0, W], which is used to describe the position of the box in the horizontal direction of the pallet. The vertical extension direction of the pallet is defined as the Y-axis, with upward as the positive Y-axis, and the coordinate range is [0, H], used to describe the position of the box in the vertical direction of the pallet; at the same time, the position representation rule of the box is clearly defined in the coordinate system, that is, for any box in this coordinate system, the X-axis coordinate of its lower left vertex is used to represent the position of the box. Y-axis coordinate The spatial position and shape of the box can be uniquely determined by its horizontal length w and vertical width h. The coordinates of the upper right corner vertex of the box can be obtained through... The calculations provide a unified mathematical benchmark for calculating the placement of boxes and determining space occupancy in subsequent algorithms.

[0025] After the coordinate system is constructed, its accuracy is verified using the coordinate calibration module. Feature points at known locations on the tray, such as the top left, top right, and bottom right corners, are selected, and their theoretical coordinates in the constructed coordinate system are measured. The theoretical coordinates of the top left corner are... The coordinate system is constructed with the upper right corner vertex (W,H) and the lower right corner vertex (W,0) as the actual measured coordinates. The deviation between the two is calculated. If the deviation is less than 0.1mm, the coordinate system is considered to be qualified. If the deviation exceeds the threshold, the origin position and coordinate axis direction are readjusted through the visual positioning system until the coordinate system accuracy meets the requirements. This ensures that all subsequent calculations related to the box position are based on a precise and unified spatial reference.

[0026] S2. Generate the original stack type solution set based on the initial parameters and coordinate system, including generating the corresponding stack type schemes by using an integrated strategy of intelligent optimization algorithm and heuristic algorithm respectively, and merging all schemes to obtain the original stack type solution set; like Figure 2 As shown, this step proposes an integrated strategy of intelligent optimization algorithm and heuristic algorithm. This strategy first integrates the heuristic rules of the guillotine algorithm and the spiral algorithm into two intelligent optimization algorithms to develop two heuristic knowledge-guided intelligent optimization algorithms. Then, it improves three heuristic algorithms by using pruning conditions and partitioning ideas. Finally, it integrates the above five algorithms to construct the original stacking solution set. While improving the algorithm's running efficiency, it generates stacking solution sets with diversity. The following will describe in detail the solution process of the five algorithms under the given pallet size W×H, box size w×h, box spacing sp, and edge spacing sb.

[0027] 2.2.1 Guillotine Differential Algorithm The basic idea of ​​the Guillotine Differential Algorithm is to combine the Differential Evolutionary Algorithm with an improved guillotine space partitioning strategy. It searches for the optimal bin arrangement sequence and placement strategy through the Differential Evolutionary Algorithm, making two improvements over the traditional Differential Evolutionary Algorithm: 1. It integrates the partitioning rules of the Guillotine Algorithm into the Differential Evolutionary Algorithm, using heuristic knowledge to guide the direction of population evolution; 2. It designs a scoring function and space partitioning strategy for the bin packing problem, improving the algorithm's solution efficiency. Details are as follows: First, set the placement sequence length. Build an expanded library of boxes that includes boxes arranged horizontally and vertically. A set of candidate boxes. Among them, the first One is in the horizontal direction w × h ,back Each is in the vertical direction h × w .

[0028] Then, the basic parameters of the differential algorithm, such as population size, number of iterations, mutation factor, and crossover probability, are set, and the box placement sequence is optimized using the differential evolution framework. The mutation operation uses the differential operator, and the crossover operation uses binary crossover. The calculation processes for crossover and mutation are shown in equations (1) and (2): (1) (2) in, This represents the j-th dimension gene of the i-th individual. , and Let J represent the j-th dimension of three randomly selected distinct individuals, and F represent the mutation factor. This represents the crossover probability, and rand is a random number between 0 and 1.

[0029] Next, initialize the list of free rectangles, covering the entire tray area. As the initial free space matrix, it records the space currently available for placing boxes. Boxes are placed sequentially according to the individual codes, with the codes of offspring individuals representing the box placement order. The algorithm places candidate boxes into the free space rectangle in this order. The placement of each box requires two steps: position scoring and spatial partitioning. The following two steps are performed sequentially for each box: 1. Traverse all free rectangles and assign a position score to the location that can accommodate the current box. The scoring function is as follows: (3) in, and This represents the X and Y coordinates of the bottom left corner of the currently empty rectangle and the person's position. This indicates the number of overlapping boxes, with the aim of selecting the position closest to the bottom left corner of the tray that minimizes the number of overlapping boxes after placement.

[0030] 2. After a box is successfully placed, it will occupy some free rectangular space. The remaining space needs to be divided into new free rectangles for subsequent box placement. The division direction should be selected based on the aspect ratio of the remaining space, and the new rectangles obtained after division should be used to update the list of free rectangles. The division direction is determined as follows: when the remaining width is greater than the remaining height, vertical division is used; when the remaining width is less than the remaining height, horizontal division is used.

[0031] Finally, until Once all candidate boxes have been placed, the algorithm terminates. The set of solutions corresponding to the current optimal population is taken as the final set of solutions for this algorithm, denoted as . .

[0032] 2.2.2 Spiral Genetic Algorithm The basic idea of ​​the spiral genetic algorithm is to use a spiral corner-filling strategy as the basic bin packing method, and optimize the corner access order and corner rotation probability through genetic algorithm. Compared with the traditional genetic algorithm, it makes two improvements: 1. Designing the corner access order and rotation probability as parameters to be optimized to construct the encoding of the pallet packing problem; 2. Introducing the corner-filling strategy of the spiral algorithm as a decoding method, combining bin packing domain knowledge with genetic algorithm search, as detailed below: First, define the four corners—bottom left (BL), top left (UL), top right (UR), and bottom right (BR)—as the starting points for packing. Then, design the placement logic and spiral expansion direction for each corner, as follows: For the bottom left corner... BL Align the bottom left corner of the box with this point, and update the corner position after placement. This achieves upward spiral expansion; for the top-left corner UL, the top-left corner of the box is aligned to that point, and the corner position is updated after placement. This achieves a rightward spiral expansion; for the top-right corner UR, the top-right corner of the box is aligned to that point, and the corner position is updated after placement. This achieves downward spiral expansion; for the bottom right corner BR, the bottom right corner of the box is aligned to that point, and the corner position is updated after placement. This allows for a leftward spiral expansion.

[0033] Then, a genetic optimization algorithm framework is used to optimize two key parameters: corner access order and corner rotation probability. The corner access order is the arrangement order of the four corners, while the corner rotation probability determines the preferred orientation of each corner box, that is, the horizontal orientation is considered when attempting to place the boxes. w × h and vertical direction h × w There are two directions, determined by the relationship between the random number and the corner rotation probability. Here, the corner rotation probability is set to 0.5 to ensure that the probability of placement in the horizontal and vertical directions is equal. The crossover operators for the corner access order and rotation probability are shown in equations (4) and (5), respectively, and the mutation operators are shown in equations (6) and (7), respectively. (4) Where C is the child individual, P1 and P2 are two parent individuals, CornerOrder is the corner access order, rand is a random number, and CR is the crossover probability (set to 0.8). This operation randomly inherits the corner access order of the parent, ensuring that the child retains the excellent order logic of the parent. Rotation probability crossover: (5) in, It is the rotation probability of the j-th corner. It is the cross-weight coefficient. This operation combines the rotation probabilities of the two parents by weighted average to avoid the instability caused by sudden changes in rotation probability. Mutation operation: Corner access order mutation, according to the formula: (6) Where n is the number of iterations, and Swap is a swap operation that randomly selects and swaps the access order of two corners. This operation can break the local optimum of the population and explore new combinations of access orders. The variation of rotational probability is expressed by the formula: (7) Where C represents the offspring individual, P1 and P2 represent two randomly selected parent individuals, CornerOrder represents the order of visits to the four corners of the corresponding individual, and RotationProbs j This represents the rotation probability of the j-th corner. CornerOrder represents the cross-weight coefficient, n represents the number of iterations. j This indicates the j-th corner in the placement order.

[0034] Finally, the fitness function is set as follows. The fitness function is used to evaluate the quality of individuals and must consider two core indicators: space utilization and packing quantity. The formula is: (8) in, Space utilization rate is the ratio between the total area and the remaining area. The packing quantity factor is represented by dividing the total number of packing boxes in the packing scheme by 100. 0.7 and 0.3 are the weighting coefficients for space utilization and packing quantity factor, respectively. The scheme corresponding to the individual with the highest fitness is selected as the output scheme. .

[0035] 2.2.3 Pruning algorithm prioritizing the bottom left corner The basic idea of ​​the bottom-left corner pruning algorithm is to start from the bottom left corner of the pallet, generate candidate points according to rules, and gradually build the pallet shape. Compared with the traditional bottom-left corner priority algorithm, it makes the following improvements: it introduces a dual pruning strategy based on theoretical bounds and global optimal values, which improves the algorithm efficiency. Specifically: First, start from the bottom left corner of the tray. Start by placing boxes in two directions: horizontal (w×h) and vertical (h×w). Update the coordinates of the bottom left corner of the currently placed box. Try the horizontal direction first, then try the vertical direction.

[0036] The pruning strategy is the core improvement of the algorithm. It determines whether the current search branch is valuable by calculating the "theoretical upper bound". If it is not valuable, the search terminates directly. The specific rules are as follows: First, calculate the two theoretical values ​​using the formula. Then, two pruning termination conditions are set to improve the computation speed of the algorithm. One is to immediately stop the search of the branch when the known optimal solution cannot be reached. Specifically, the theoretical maximum value of the current branch is calculated according to formulas (9)-(11). U 当前 ,when U 当前 If the current optimal solution is less than or equal to the current optimal solution, stop searching that branch; secondly, when the global theoretical maximum value is reached... U 全局 When this happens, immediately stop the search on that branch, where, U 全局 Calculated by equation (2).

[0037] (9) (10) (11) (12) in, W 有效 This indicates the width after removing the edge spacing. H 有效 This indicates the width after removing the edge spacing. S 剩余 S represents the area of ​​the remaining portion without boxes. 箱子 Indicates the area of ​​the box. N 当前 This indicates the current number of boxes that have been placed. The maximum number of bins that can be packed in the current branch. This represents the number of boxes that have been placed. This represents the maximum number of bins that can be packed according to the grid arrangement theory. This represents the theoretical maximum number of bins that can be packed in the remaining space.

[0038] Next, we will try to place two new candidate points, namely the candidate point on the right. and the candidate points above Among them, the newly added candidate points are guaranteed to be able to place at least one box, that is, for the candidate points on the right, the following conditions must be met. For the upper candidate points, satisfy .

[0039] Finally, when the termination condition is met or all branches have been searched, the currently known optimal solution is taken as the final solution of this sub-algorithm, denoted as... .

[0040] 2.2.4 Pruning Guillotine Algorithm The basic idea of ​​the pruning guillotine algorithm is to continuously divide the pallet area into smaller rectangular sub-regions using vertical or horizontal cutting lines, and find the optimal box placement scheme within each sub-region. Compared to the traditional guillotine algorithm, it makes three improvements: 1. Adding a pruning condition based on a theoretical upper bound to avoid invalid searches; 2. Special handling for square pallets to reduce redundant calculations in symmetrical partitioning; 3. Improving the termination condition for recursive partitioning to increase the algorithm's convergence speed. Details are as follows: First, try a simple grid arrangement, that is, placing all boxes horizontally or vertically. Considering the influence of the box spacing, calculate the number of rows that can be placed horizontally and the number of columns that can be placed vertically, and use the obtained grid arrangement scheme as the benchmark scheme.

[0041] Then, a recursive segmentation method is used to attempt to segment any rectangular area within the pallet at different positions, first attempting vertical segmentation and then horizontal segmentation. The vertical segmentation position is based on an integer of the pallet width. n The calculation is multiplied by the integer value of the box height, and the horizontal segmentation position is based on the box height. n The calculation is multiplied to ensure that the divided sub-region can accommodate at least one box. The calculation formulas for the vertical and horizontal division positions are shown in equations (13) and (14).

[0042] (13) (14) Next, a recursive search method is used for each segmented sub-region. First, the grid arrangement scheme is calculated, and then vertical or horizontal segmentation is tried to search for a scheme that can place more boxes. During the box placement process, boxes are placed in both horizontal and vertical directions in each region. Two pruning conditions are added to improve the algorithm's search speed: First, when the theoretical upper limit cannot exceed the current known optimal solution, the search of that branch is terminated in advance. The theoretical upper limit is calculated as shown in equations (9)-(11); Second, when the pallet size is square, i.e. W = H When considering only one direction of the segmentation scheme, here we only consider the vertical direction segmentation.

[0043] Finally, the recursion stops when the pruning condition is met or all sub-regions obtained from the partition cannot accommodate boxes, resulting in the final solution, denoted as . .

[0044] 2.2.5 Partition Greedy Strategy The basic idea of ​​the partitioned greedy strategy is to divide the tray into two areas, left and right, with the left area divided horizontally. w The boxes are arranged in an ×h pattern, with the right side area arranged vertically. h × w Arrange the boxes and find the globally optimal solution by enumerating different numbers of the left column. Compared to the traditional greedy algorithm, the following improvement is made: the trays are divided into horizontal and vertical placement areas to fully utilize the spatial advantages of different directions. Specifically: First, calculate the maximum number of columns that can be placed on the left according to formula (15). and enumerate from 1 to Given all integers, calculate the number of rows and the total number of boxes corresponding to each number of columns on the left.

[0045] (15) in, This represents the maximum number of columns that can be placed in the left area. For the width of the pallet, The floor sign is used. Then, for each number of columns that can be placed on the left, vertical boxes are placed in the corresponding remaining area on the right, and the number of boxes placed in the right area is calculated. The division of the remaining area on the right is obtained by formula (16): (16) in, It is the left side area The width occupied by the horizontal boxes in the column. Given the effective width of the right-hand area, finally, calculate the total number of boxes packed under different left-hand column conditions, and select the scheme with the highest total number of boxes packed as the final scheme.

[0046] 2.2.6 Ensemble Algorithm Considering that intelligent optimization algorithms have global search capabilities but lack domain knowledge, and heuristic algorithms contain rich bin packing experience but are prone to getting trapped in local optima, this paper integrates heuristic rules into intelligent optimization algorithms to achieve knowledge-guided evolution. Furthermore, pruning and partitioning are used to improve heuristic algorithms and increase computational efficiency. Finally, five improved algorithms are integrated to construct a diverse original stacking solution set, providing more candidate solutions for subsequent selection. The integration of the original solution set is shown in equation (17): (17) in, Let represent the solution set generated by the i-th algorithm, i=1,2,...,5, and B is the final original stack-type solution set.

[0047] S3. Perform stack type fine-tuning on the original stack type solution set, including sequentially performing layout compaction adjustment, edge alignment adjustment and uniform distribution adjustment on each stack type in the solution set to obtain a regularized stack type solution set; The original stacking solution set generated by the algorithm in step S2 is affected by the algorithm's own placement rules. The constructed original stacking may be biased towards the corner or scattered on the edge of the pallet. In actual engineering, it is often more desirable to place the stacking in an orderly and regular manner. This not only ensures stability and safety but also helps to improve automation efficiency. Therefore, this step proposes a stacking fine-tuning technique to adjust the scheme in the original stacking solution set so that its placement edge forms a regular rectangle and the spacing between adjacent boxes is kept consistent.

[0048] In the stacking fine-tuning technique, the first step is to employ a compact layout strategy to move the boxes in the stack as far as possible towards the lower left corner of the pallet. Specifically, for the stacking... Each box uses the coordinates of its lower left corner. It means that the side length is The maximum distance each box can move to the left and down is calculated using equations (18) and (19). Under the constraints of box spacing and pallet edge distance, the box coordinates are updated sequentially according to equation (20) in the order from left to right and from bottom to top. This process is repeated until all boxes can no longer move, resulting in a compact stack solution set. (18) (19) in, For the box The maximum distance to move to the left, For the box The X-axis coordinate of the bottom left corner For the spacing between boxes, For other boxes The lower left X-axis coordinate, For other boxes The side length along the X-axis, and Each represents a box and boxes The length of the side parallel to the Y-axis. and They represent boxes respectively. and The Y-axis coordinate of the bottom left corner For the box and The criteria for determining overlapping projections along the Y-axis.

[0049] Then, edge alignment is used to achieve edge box recognition and boundary alignment, making the stack edges form regular rectangles. Specifically, the stack boundary coordinates are first calculated. Then, based on equations (21)-(24), identify the tolerance level. rThe boxes on the four inner boundaries are assembled, and boundary alignment is performed in the following two steps: First, the left and right boundaries are horizontally aligned, that is, the left edge of the left box is aligned to... The right edge of the box on the right is aligned with... The second step is to vertically align the upper and lower boundary boxes, that is, align the bottom edge of the lower box to... The upper edge of the upper box is aligned with This ensures that all edge boxes form regular rectangular boundaries.

[0050] Left boundary box : (21), that is, the left edge of the box and If the difference is within the tolerance r, the box is considered to belong to the left boundary.

[0051] Right boundary box : (22), that is, the right edge of the box and The difference is within the tolerance r and belongs to the right boundary.

[0052] lower boundary box : (23), that is, the lower edge of the box and The difference is within the tolerance r and belongs to the lower boundary.

[0053] upper boundary box : (24) That is, the upper edge of the box and The difference is within the tolerance r and belongs to the upper boundary. Finally, the stacking pattern is adjusted to ensure uniform spacing between adjacent boxes. For boundary boxes, the uniform spacing is calculated according to formula (25) based on available space and the number of boxes, and the positions of the boundary boxes are redistributed to make their spacing uniform. For intermediate boxes, they are handled separately according to horizontal and vertical groups. The spacing between them and adjacent boxes is made uniform by adjusting the positions of the boxes within the group. The criteria for determining whether a group is horizontal or vertical are within the tolerance level. r Inner box y coordinates or x The coordinates are the same.

[0054] (25) in, For the effective length of the boundary, The total length of all boxes on the boundary. This represents the number of boundary boxes. S4. Perform similarity reduction on the normalized stack type solution set, including generating a set of rotation transformations and flip transformations for each stack type, judging the similarity of stack types based on coordinate matching rules, and removing similar stack types to obtain the reduced solution set; The original stacking solution set constructed by the ensemble of multiple algorithms may contain similar stacking patterns, which are invalid solutions for the overall algorithm. Therefore, a similar stacking pattern reduction technique is needed to filter out similar stacking patterns. Specifically: First, generate a transformation set for each stack type in the solution set, including five transformation sets: 90-degree, 180-degree, and 270-degree rotation transformations, as well as horizontal and vertical flip transformations. Rotation and flip transformation operations can be performed based on the pallet center. Calculated.

[0055] Then, set the tolerance. A similarity judgment strategy is given. Specifically, two stack types are selected from the stack type solution set, normalized according to equation (26), and the coordinate set of the boxes in the stack type is extracted. The similarity is judged by the following matching algorithm: if the number of boxes in the two stack types is different, they are directly judged as dissimilar; if the number is the same, the center point of each box in the first stack type is compared. In the second stack type, the distance is determined according to equation (27). Less than tolerance r If a unique match can be found for all points, then the two stack types are determined to be similar stack types.

[0056] (26) in, and Let be the coordinates of the lower left corner of the smallest bounding rectangle of stack type B.

[0057] (27) Finally, the filtering process is repeated. For any two stack types in the solution set, the transformation set of the first stack type after all symmetric transformations is calculated, and it is checked whether there are any transformation results similar to the second stack type. During the comparison process, the two stack types are first normalized to a coordinate system with the origin as the starting point, and then coordinate matching is performed. If there is a transformation that satisfies the similarity judgment strategy, the two stack types are considered similar, and the second stack type is removed from the solution set. Finally, all dissimilar stack types are retained to form the reduced stack type solution set.

[0058] S5. Perform a flipping decision to select the optimal solution based on the reduced solution set, including counting the number of boxes overlapping before and after flipping to classify the stability level, sorting the stacking type according to the number of boxes packed, and outputting the optimal stacking type solution set. In the problem of stacking goods, the stability of the upper layers needs to be considered when stacking multiple layers of goods. This is often determined by the symmetry of the stack structure between the upper and lower layers. Specifically, if the stack structure after flipping is completely asymmetrical compared to the original stack structure, it indicates good stability. Conversely, if there are completely overlapping boxes regardless of the flipping method, it indicates poor stability. Therefore, this step proposes a flipping decision-making technique, as follows: First, using the center of the pallet as the flipping point, perform horizontal and vertical flipping transformations on the current stack type. Horizontal flipping places each box symmetrically about the vertical central axis, while vertical flipping places each box symmetrically about the horizontal central axis, resulting in the flipped stack type.

[0059] Then, the center coordinates of the stack before and after flipping are normalized to the same coordinate system, and statistical analysis is performed according to equation (27) within a numerical tolerance of 10. -6 Define an overlap counting function to count the number of overlapping coordinates of boxes in the stack before and after flipping within the specified range, including the number of overlaps during horizontal flipping. and vertical flip overlap number .

[0060] Next, based on the overlap analysis results, stability assessment and screening were performed, and the stack types were classified according to the amount of overlap: if and If the overlap is zero in only one direction, the stack type has complete asymmetry, marked as "CompleteAsymmetry"; if the overlap is zero in only one direction, it has unidirectional symmetry, marked as "HorizontalSymmetry" or "VerticalSymmetry" respectively; if there is overlap in both directions, the minimum overlap is calculated as a stability index.

[0061] Finally, all stack types are sorted in descending order of the number of boxes placed, and stack types with the same number of boxes are sorted by their symmetry. The sorted stack type solution set is output as the optimal solution set, providing customers with stack type solutions that are diverse, stable, and distinct.

[0062] S6. Verify the optimal stacking scheme set and output the final result.

[0063] The box layout of each scheme is displayed in two-dimensional graphic form, and the coordinates of the lower left corner of each box are marked. Side length The pallet dimensions (W×H), edge spacing (sb), and box spacing (sp) visually represent the regularity of the stacking and space utilization. Key performance indicators are marked for each solution, including: Packing quantity: The total number of boxes that can be stacked under this scheme; Space utilization rate: Total floor area of ​​boxes / Total floor area of ​​pallets × 100%; Stability level: Fully asymmetric / Unidirectionally symmetric / Asymmetric, with asymmetric aspects labeled. ; Finally, the results were verified through the experiment in Example 2, and the final output was completed. Example 2 The difference between this embodiment and Embodiment 1 is that this embodiment provides a verification method for a packaging production line intelligent pallet generation method based on heuristic knowledge guidance; This section's experiments were conducted under two actual pallet and box size examples, with specific parameters described below. Example 1: Pallet size 10×12, box size 2.8×4.2, box spacing 0.05, pallet spacing 0.05; Example 2: Pallet size 11×13, box size 2.7×3.3, box spacing 0.02, pallet spacing 0.02. Table 1 shows the comparison results of the five improved algorithms, the proposed ensemble algorithm, and the five comparative algorithms described in this paper on the two examples.

[0064] Table 1 shows the comparison results of various algorithms:

[0065] As can be seen from Table 1, a single heuristic algorithm can only produce one solution, and the running time of the Guillotine algorithm increases dramatically with the maximum number of boxes that can be placed on the pallet. In addition, due to the lack of heuristic knowledge, the genetic algorithm may be affected by position overlap, boundary overflow, etc. during the box placement process, which may prevent the algorithm from generating an effective solution.

[0066] Of the five improved algorithms, the Guillotine Differential Algorithm can provide multiple stacking schemes, while the Genetic Algorithm, guided by the spiral placement strategy, can also generate effective schemes in a relatively short time. Furthermore, the Guillotine Algorithm with added pruning conditions and the bottom-left corner priority algorithm also show significant improvements in running time. Although adding the partitioning idea to the greedy strategy cannot find the scheme with the maximum number of boxes in scheme 2, it provides a new stacking scheme for the overall algorithm.

[0067] The ensemble algorithm generates the original stacking solution set by integrating five improved algorithms, and obtains the final stacking solution set through stacking fine-tuning and similar stacking reduction. It can be seen that the ensemble algorithm has high running efficiency and can provide customers with multiple solutions while ensuring that the solution with the maximum number of boxes is found, which greatly improves its flexibility in practical engineering applications.

[0068] like Figure 3 , Figure 4As shown in the figure, the proposed algorithm runs on two instances. It can be seen from the figure that the solutions provided by the proposed algorithm are all dissimilar stack type solutions. Moreover, the solutions obtained after fine-tuning are more uniform and regular, and more practical and aesthetically pleasing. In addition, under the premise of meeting the high-level stability requirements, the algorithm can also provide customers with a variety of stack type solutions, indicating that the proposed algorithm can meet the requirements of stack type design diversity, stability and dissimilarity.

[0069] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for generating intelligent pallet patterns in a packaging production line based on heuristic knowledge guidance, characterized in that, include: S1. Obtain initial parameter data and construct a coordinate system based on the initial parameter data, including obtaining pallet size, box size, box spacing and pallet edge spacing, and constructing a two-dimensional rectangular coordinate system with the lower left corner of the pallet as the origin; S2. Generate the original stack type solution set based on the initial parameters and coordinate system, including generating the corresponding stack type schemes by using an integrated strategy of intelligent optimization algorithm and heuristic algorithm respectively, and merging all schemes to obtain the original stack type solution set; S3. Perform stack type fine-tuning on the original stack type solution set, including sequentially performing layout compaction adjustment, edge alignment adjustment and uniform distribution adjustment on each stack type in the solution set to obtain a regularized stack type solution set; S4. Perform similarity reduction on the normalized stack type solution set, including generating a set of rotation transformations and flip transformations for each stack type, judging the similarity of stack types based on coordinate matching rules, and removing similar stack types to obtain the reduced solution set; S5. Perform a flipping decision to select the optimal solution based on the reduced solution set, including counting the number of boxes overlapping before and after flipping to classify the stability level, sorting the stacking type according to the number of boxes packed, and outputting the optimal stacking type solution set. S6. Verify the optimal stacking scheme set and output the final result.

2. The method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge as described in claim 1, characterized in that, The strategy of integrating intelligent optimization algorithms and heuristic algorithms includes using the guillotine differential algorithm, spiral genetic algorithm, pruning bottom-left corner priority algorithm, pruning guillotine algorithm, and partitioning greedy strategy to generate corresponding stacking schemes. The execution steps of the guillotine differential algorithm include: S211. Construct a candidate box library. Generate a set of candidate boxes based on the total number of boxes to be stacked, and arrange the candidate boxes in the set horizontally and vertically respectively. S212. Set the parameters of the differential evolution algorithm, including population size, number of iterations, mutation factor and crossover probability; S213. Perform mutation and crossover operations to generate offspring individuals. Calculate the mutated gene based on three randomly selected different parent individuals, and then control the fusion ratio of the mutated gene and the parent gene through the crossover probability. S214. Perform box placement and space segmentation, initialize the list of free rectangles, select candidate boxes according to the coding order of offspring individuals, traverse the free rectangles and select the optimal placement position through the scoring function, select the segmentation method according to the aspect ratio of the remaining space after placement, and update the list of free rectangles. S215. Repeat S214 until all boxes to be stacked are placed. Output the optimal stacking scheme corresponding to the population, denoted as . .

3. The method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge as described in claim 2, characterized in that, The execution steps of the spiral genetic algorithm include defining the bin-packing starting point, setting expansion rules based on the bin-packing starting point, constructing the genetic algorithm encoding, which includes the access order of the four starting points and the bin rotation probability of each starting point, setting the genetic algorithm parameters and optimizing the population, including population size, number of iterations, and crossover weight coefficient, then performing crossover and mutation operations to optimize the population, selecting the optimal individual through a fitness function, evaluating the stacking space utilization and bin quantity corresponding to each individual, and selecting the stacking scheme corresponding to the individual with the highest fitness, denoted as . The fitness function expression is: ; in, This represents the individual fitness value. To maximize space utilization, For packing quantity factor, and These are the weighting coefficients for space utilization and packing quantity factors, respectively.

4. The method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge as described in claim 2, characterized in that, The execution steps of the bottom-left corner priority pruning algorithm include sequentially placing objects horizontally and vertically according to the initial placement point coordinates, introducing a dual pruning strategy based on theoretical upper bounds and global optimal values ​​to set dual pruning conditions. The first level of the dual pruning conditions is... If the current optimal solution is known, the second condition is that the current branch's bin count reaches the global theoretical maximum bin count. If either condition is met, the branch search terminates. Valid candidate points are generated using the double pruning condition. Right-side and top-side candidate points are generated based on the current bin coordinates. The candidate points are traversed, and the optimal solution is searched. Combining the pruning condition, all valid candidate points are traversed, and the optimal stacking configuration is output, denoted as... ,in, ; In the formula, The maximum number of bins that can be packed in the current branch. This represents the number of boxes that have been placed. This represents the maximum number of bins that can be packed according to the grid arrangement theory. This represents the theoretical maximum number of bins that can be packed in the remaining space.

5. The method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge as described in claim 2, characterized in that, The execution steps of the pruning guillotine algorithm include: S241. Calculate the number of rows and columns of boxes that can be placed in the tray, based on either all horizontal or all vertical placement, and generate a grid-based baseline scheme. S242. The baseline scheme is divided vertically and horizontally in sequence, and the division points are calculated based on integer multiples of the box size and edge spacing to ensure that the sub-region after division can accommodate at least one box. S243. Set pruning optimization conditions, including terminating the branch when the theoretical maximum number of boxes packed in the current branch is less than or equal to the current known optimal solution. When the pallet is square, only vertical splitting is performed to reduce redundant calculations. S244. Recursively search for the optimal solution in each sub-region. Repeat S241-S243 for each divided sub-region until no more boxes can be placed in the sub-region. Output the optimal stacking scheme, denoted as... ; The calculation of the vertical dividing point is performed according to the following formula: ; in, Let n be the X-axis coordinate of the vertical dividing point, where n is a positive integer. The length of the box This refers to the spacing between the edges of the tray.

6. The method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge as described in claim 3, characterized in that, The execution steps of the partitioning greedy strategy include: determining the maximum number of columns in the left horizontal placement area based on the relationship between pallet width and edge spacing, and box width and edge spacing; enumerating the number of columns in the left area and calculating the packing quantity, enumerating sequentially from 1 to the maximum number of columns, calculating the horizontal packing quantity in the left area for each column number; calculating the effective width of the right area based on the number of columns in the left area; vertically placing boxes in the right area and calculating the packing quantity; filtering the optimal partitioning scheme; calculating the total packing quantity corresponding to each enumerated column number; and outputting the scheme with the highest total packing quantity, denoted as . The formula for calculating the maximum number of columns that can be placed on the left is: ; in, This represents the maximum number of columns that can be placed in the left area. For the width of the pallet, This is the floor symbol.

7. The method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge as described in claim 1, characterized in that, The execution steps of the compact layout adjustment include calculating the maximum leftward and maximum downward movement distances for each box in the stack, updating the coordinates of each box based on the calculated movement distances, and then performing multiple iterations until all boxes can no longer move further to the left or downward. The formula for calculating the maximum leftward movement distance is: ; in, For the box The maximum distance to move to the left, For the box The X-axis coordinate of the bottom left corner For the spacing between boxes, For other boxes The lower left X-axis coordinate, For other boxes The side length along the X-axis, and Each represents a box and boxes The length of the side parallel to the Y-axis. and They represent boxes respectively. and Y-axis coordinate of the bottom left corner.

8. The method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge as described in claim 1, characterized in that, The uniform distribution adjustment includes, based on the boundary coordinates of the stack type, counting the number of boxes on each boundary, the total length of the boxes, and the effective length of the boundary; determining the uniform spacing that satisfies the minimum spacing constraint based on the effective length of the boundary, the total length of the boxes, and the number of boxes; adjusting the boundary and intermediate boxes; first, redistributing the boundary box positions according to the uniform spacing; then, dividing the intermediate boxes into horizontal and vertical groups based on similar Y-coordinates and similar X-coordinates; and adjusting the spacing between boxes within each group to a uniform spacing. The formula for calculating the uniform spacing is: ; in, For the effective length of the boundary, The total length of all boxes on the boundary. This represents the number of boundary boxes.

9. The method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge as described in claim 1, characterized in that, The method for determining stack type similarity based on coordinate matching rules includes setting a tolerance based on box size, then performing a normalization transformation to convert both stack types to a coordinate system with the lower left corner of their smallest bounding rectangle as the origin. The number of boxes in the two stack types is compared; if the numbers are the same, the center point coordinates of each box are calculated, and similarity is determined by matching the distance between the center points. If the numbers are different, they are determined to be dissimilar. The formula for calculating the normalization transformation is as follows: ; in, and Let be the coordinates of the lower left corner of the smallest bounding rectangle of stack type B.

10. The method for generating intelligent pallet patterns for packaging production lines based on heuristic knowledge as described in claim 1, characterized in that, The step of performing a flip decision to select the optimal solution based on the reduced solution set includes: S511, Calculate the center coordinates of the tray , serving as the reference point for the flip transformation; S512. Perform a flip transformation based on the reference point. Perform a horizontal flip transformation and a vertical flip transformation on each stack type, and calculate the coordinates of the boxes after flipping. S513. Normalize the coordinates of the stack before and after flipping, count the number of boxes whose center point distance is less than the numerical tolerance, and obtain the horizontal flipping overlap number and the vertical flipping overlap number. S514. Sort all stack types in descending order of the number of boxes placed, and sort stack types with the same number of boxes in order of symmetry. Output the sorted stack type solution set as the optimal solution set. The coordinate calculation formula for the horizontal flip transformation is as follows: ; in, Here are the coordinates of the bottom left corner of the box after it has been horizontally flipped. Let x be the X-axis coordinate of the pallet center, and y be the coordinates of the bottom left corner of the box before it was flipped. H is the length of the box, and H is the total height of the pallet.