A strip-based multi-page two-dimensional layout method, device and electronic equipment

By combining box layout and strip layout, and utilizing the global search and compression mechanism of strip layout, the number of pages and the initial layout are quickly determined, and the natural flow and rearrangement of samples are realized on the strip. This solves the difficulty of global optimization for large-scale multi-page layout and achieves efficient sample distribution and page layout.

CN123140352APending Publication Date: 2026-11-20HANGZHOU FENGYUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611373563.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-04
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In industrial production, existing technologies struggle to effectively improve global optimization in large-scale, multi-page nesting tasks, especially when there are many samples. Traditional box nesting faces problems of a large search space and complex cross-box swapping, while strip nesting faces the problem of search explosion.

Method used

The method employs local optimal filling in box-packing layout to quickly determine the number of pages and the initial layout. Each page is spliced ​​into strips using page placeholders, and a global search is performed on the strips. The compression and pushing mechanism of strip layout is used to realize the natural flow and rearrangement of the sample pieces on the continuous strips. Finally, the layout result is divided into multiple pages according to the position of the placeholders.

Benefits of technology

While ensuring computational feasibility, it effectively improves the global optimization effect of large-scale multi-page layout, avoids the combinatorial explosion problem caused by cross-box swapping and the superlinear growth of the search space for single full-volume strip layout, and realizes the automatic coordinated distribution of samples between pages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123140352A_ABST
    Figure CN123140352A_ABST
Patent Text Reader

Abstract

The application discloses a strip-based multi-page two-dimensional layout method and device and electronic equipment. Relates to the technical field of industrial production, through obtaining the layout set and the page size, adopting the local optimal filling of the container layout, determining the page number and the initial page layout. Each page is spliced into a strip through a placeholder, and the initial strip layout is mapped, and the multi-container cross-box exchange problem is converted into single-strip layout, which effectively avoids the high overhead of complex mechanisms such as candidate evaluation and chain collision. When performing global search on the initial strip, the compression pushes the sample from the sparse page segment to the dense page segment. After optimization, the strip is divided according to the placeholder, and the layout scheme of each page is restored. It not only avoids the time risk of super-linear growth of search space when the full amount of single-strip layout is used in the sample, but also overcomes the local optimal defect of the container layout caused by the early page locking, effectively improves the global optimization effect of large-scale multi-page layout under controllable computing cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of industrial production technology, and in particular to a method, apparatus and electronic device for multi-page two-dimensional layout based on strips. Background Technology

[0002] In industrial production, nesting tasks often involve a set of sample sheets and a batch of raw material sheets of the same size, but the number of raw material sheets needed is unknown in advance. The required number of sheets depends on the tightness of the arrangement between the sample sheets, which in turn depends on the capabilities of the optimization algorithm. This is an interdependent relationship; without nesting, the number of sheets cannot be determined, and setting the wrong number of sheets can lead to a series of problems. If the number of sheets is set too high, placeholders need to be set between adjacent sheets. Densely packed placeholders will restrict the sample sheets to their respective sheet segments, hindering cross-page pushing and making it difficult to eliminate excess sheets through compression, resulting in insufficient nesting. If the number of sheets is set too low, the sample sheet on the last sheet will exceed the sheet length and cannot be accommodated.

[0003] The main solution to this problem in current technology is bin packing and layout, which treats each page as a bin of equal size and selects which bin to place each sample in among multiple bins. However, for bin packing and layout to achieve good results, it must support cross-bin swapping, that is, moving samples from one bin to another, and vice versa, repeatedly trying until the overall optimal solution is found. The cross-bin swapping mechanism is quite complex; the search space equals the number of samples multiplied by the number of bins. With thousands of samples and dozens of bins, the search space becomes extremely large, making it difficult to complete an effective search within a limited time in practical applications.

[0004] Another approach is to run strip layout directly on a very long strip for all samples. However, this approach faces the problem of search explosion in large-scale scenarios. When the number of samples exceeds 500, the convergence speed of the separation search decreases superlinearly with the number of samples, and the search space is on the order of the square of the number of samples, making it difficult to control the time.

[0005] It is evident that, while ensuring computational feasibility, effectively improving the global optimization effect of large-scale multi-page layout is a problem that needs to be solved by those skilled in the art. Summary of the Invention

[0006] The purpose of this application is to provide a strip-based multi-page two-dimensional nesting method, apparatus, and electronic device that can effectively improve the global optimization effect of large-scale multi-page nesting while ensuring computational feasibility.

[0007] This application provides a multi-page two-dimensional layout method based on stripes, including: Obtain the set to be laid out and the page size; Local optimal filling is performed on all samples contained in the layout set according to the page size to determine the number of pages required for the layout set and the initial page layout of each page; Each page is joined together to form a strip using page placeholders, and the initial page layout of each page is mapped to the corresponding position of the strip to obtain the initial strip layout; where page placeholders are the no-entry areas between adjacent pages; Perform a global strip layout search on the initial strip layout to obtain the optimized strip layout; Based on the position of the page placeholders, the optimized strip layout is divided into multiple pages of layout results.

[0008] On the one hand, local optimal filling is performed on all sample images contained in the set to be laid out according to the page size to determine the number of pages required for the set to be laid out and the initial page layout of each page, including: Each page is treated as a container according to its size. A local search for bin packing and nesting is performed within the container for each sample piece contained in the set to be nested to obtain an initial allocation scheme. Based on the initial allocation scheme and the set non-overlapping constraint for the samples, each sample is placed into the corresponding page in the set order to determine the number of pages required for the sample set and the initial page layout of each page; wherein, the non-overlapping constraint for the samples includes that the samples do not overlap and that the samples do not exceed the page boundaries.

[0009] On the one hand, a global strip layout search is performed on the initial strip layout to obtain an optimized strip layout, including: The positions of each sample in the initial strip layout are randomly perturbed to obtain the perturbed strip layout; According to the preset compression step size, each sample in the disturbed strip layout is compressed along the length of the strip; If overlapping samples occur in the compressed strip, perform rotation adjustment and / or position shift adjustment on the overlapping samples; After eliminating sample overlap by performing rotation adjustment and / or position movement adjustment, return to the operation step of compressing each sample in the disturbed strip layout along the length direction of the strip according to the preset compression step size; If the overlap of samples is not eliminated after a set number of consecutive rotation adjustments and / or position shift adjustments, the strip layout that does not exhibit sample overlap in the last iteration will be taken as the optimized strip layout.

[0010] On the one hand, positional movement includes positional translation and positional exchange; In cases where overlapping samples occur after compression, rotational and / or positional adjustments are performed on the overlapping samples, including: Perform rotation and translation operations sequentially on the samples in the overlapping region, and determine the amount of overlap after each operation; If the overlap after the operation is less than the overlap before the operation, the operation is retained. If the overlap is not eliminated after a set number of consecutive rotation and translation operations, the first sample from the overlapping samples is selected and its position is swapped with the second sample from the strip; wherein the size of the first sample is larger than the size of the second sample. If the overlap after position swapping is greater than or equal to the overlap before position swapping, restore the sample position before position swapping. If the overlap after the position swap is less than the overlap before the position swap, retain the swap result and return to perform rotation and translation operations on the sample in the overlapping area in sequence, and determine the overlap after each operation.

[0011] On the one hand, after dividing the optimized strip layout into multiple pages based on the position of the page placeholders, it also includes: Perform in-page compression adjustments on the layout results of multiple pages to obtain the final layout results for each page.

[0012] On the one hand, in-page compression adjustments are performed on the layout results of multiple pages to obtain the final layout results of each page, including: Each page is compressed along the length of the page, and overlapping samples are rotated and / or moved to obtain a first layout result without overlapping samples; For each first layout result, the corresponding page is compressed downwards along the page height direction, and the overlapping samples are rotated and / or moved to obtain a second layout result without overlapping samples.

[0013] On the one hand, the page corresponding to each first layout result is compressed downwards along the page height direction, and the overlapping samples are rotated and / or moved to obtain a second layout result without overlapping samples, including: According to the preset sinking step length, each sample in the page corresponding to the first row of samples is moved downward along the height of the page; When sample overlap occurs during the movement, perform rotation adjustment and / or position movement adjustment on the overlapping sample to determine the amount of overlap after adjustment; If the adjusted overlap is zero, retain this operation; If the overlap is not zero after a series of consecutive adjustments, the strip layout that does not show overlap in the last iteration is taken as the second layout result.

[0014] On the one hand, before performing in-page compression adjustments on the layout results of multiple pages, it also includes: Determine the compression time for each page based on its area; The number of pages to be compressed in parallel is determined according to the set semaphore.

[0015] This application also provides a multi-page two-dimensional layout device based on strips, including an acquisition unit, a filling unit, a splicing unit, a search unit, and a segmentation unit; The acquisition unit is used to acquire the page size of the set to be arranged and the page. The fill unit is used to perform local optimal fill of all the sample pieces contained in the layout set according to the page size, so as to determine the number of pages required for the layout set and the initial page layout of each page; The splicing unit is used to splice the pages into a strip using page placeholders, and to map the initial page layout of each page to the corresponding position of the strip to obtain the initial strip layout; wherein, the page placeholder is the forbidden area between adjacent pages; The search unit is used to perform a global strip layout search on the initial strip layout to obtain an optimized strip layout. The segmentation unit is used to divide the optimized strip layout into multiple pages based on the position of the page placeholders.

[0016] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described strip-based multi-page two-dimensional layout methods.

[0017] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described strip-based multi-page two-dimensional nesting methods.

[0018] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described strip-based multi-page two-dimensional layout methods.

[0019] As can be seen from the above technical solution, by obtaining the set of samples to be arranged and the page size, and by using bin packing nesting with local optimal filling to quickly determine the number of pages and the initial layout of each page, the dilemma of traditional solutions being unable to perform effective nesting due to the inability to determine the number of pages in advance is solved. An initial result containing the relationship between samples and page ownership can be obtained within seconds. On this basis, each page is spliced ​​into a strip by page placeholders and the initial layout of each page is mapped to the corresponding position of the strip. The bin packing nesting problem, which originally required complex cross-bin swapping between multiple independent containers, is transformed into a single strip nesting problem on a continuous strip. This avoids the computational overhead caused by complex mechanisms such as candidate evaluation, chain collisions, and rollback costs in traditional bin packing nesting. When performing a global search for strip nesting on the initial strip layout, the compression and pushing mechanism of strip nesting allows samples to flow naturally from sparse page segments to dense page segments on the continuous strip. The collision gradient is used to automatically guide the cross-page rearrangement of samples, thereby avoiding the combinatorial explosion problem caused by cross-bin swapping in bin packing nesting. Finally, based on the placeholder positions, the optimized strip layout is divided into multiple page layout results, allowing the global optimization results to be converted into independently usable page layout schemes. Through the above operations, while quickly determining the page number framework using bin packing layout, the global search capability of strip packing layout enables the automatic coordinated distribution of samples among pages. This avoids the time uncontrollability problem caused by the superlinear growth of the search space in a single full strip packing layout when the number of samples is large, and overcomes the local optimum defect of bin packing layout where the sample combination of early pages is locked, resulting in subsequent pages only being able to use samples with mismatched shapes. Under the premise of ensuring computational feasibility, it effectively improves the global optimization effect of large-scale multi-page layout. Attached Figure Description

[0020] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments 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 A flowchart of a multi-page two-dimensional layout method based on stripes provided in this application embodiment; Figure 2 A flowchart illustrating a method for optimizing strip layout provided in an embodiment of this application; Figure 3 This is a schematic diagram of a multi-page two-dimensional layout device based on strips, provided in an embodiment of this application. Detailed Implementation

[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0023] The terms "comprising" and "having," and any variations thereof, in the specification and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may include steps or units not listed.

[0024] Currently, one solution for nesting tasks is box-and-pack nesting. For box-and-pack nesting to achieve good results, it must support cross-box swapping. However, the mechanism for cross-box swapping is quite complex. Each sample needs to be evaluated and scored among multiple candidate boxes to determine which box provides the most compact anti-collision position. Swapping two samples may trigger a chain reaction of collisions, meaning that after a sample is swapped to another box, it collides with the original samples in that box. The same applies to reverse swapping; both boxes need to be re-compacted after the swap, and the compaction result may actually worsen the swapping effect. The search space equals the number of samples multiplied by the number of boxes. With thousands of samples and dozens of boxes, the search space becomes enormous, making it difficult to complete an effective search within a limited time in practical applications.

[0025] Another approach is to run strip layout directly on a very long strip for all samples. However, this approach faces the problem of search explosion in large-scale scenarios. When the number of samples exceeds 500, the time becomes difficult to control.

[0026] Another approach is to use a greedy, page-by-page filling method, which involves sorting the samples and filling each page sequentially, moving to the next page once the previous one is full. The problem with this method is that the sample combinations for earlier pages are locked, meaning subsequent pages can only use the remaining samples with mismatched shapes, leading to a significant decrease in overall material utilization.

[0027] Therefore, this application provides a method, apparatus, and electronic device for multi-page two-dimensional layout based on strips. It combines the Bin Packing Problem (BPP) and Strip Packing Problem (SPP) to achieve large-scale sample layout. First, BPP is used to quickly estimate and determine the number of pages and generate the initial page layout for each page, providing container configuration and a hot-start starting point for subsequent SPP. The page number error obtained from BPP layout is generally ±1~2 pages. For these errors, SPP compresses back the excess pages. Multiple pages are spliced ​​into a continuous strip and separated by placeholders, allowing the separation search of SPP to naturally push the components across pages on the continuous strip. The global search and compression capabilities of SPP are used to solve the bin elimination problem of BPP, transforming the multi-page bin packing problem into a single strip layout problem. The natural pushing of SPP on the strip automatically completes the bin elimination without complex cross-bin swapping. The initial page layout, serving as a warm-start solution, provides SPP with a high-quality starting point, meaning the sample pages are roughly within the correct page segments and the spacing is already optimal. SPP only needs fine-tuning instead of searching from scratch, significantly reducing the search burden. After global SPP convergence, it precisely splits back into multiple pages at placeholders. This allows large-scale multi-page layouts to achieve near-global optimal solutions within a feasible timeframe.

[0028] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0029] Example 1: Figure 1 A flowchart of a multi-page two-dimensional layout method based on stripes is provided for embodiments of this application. The method includes the following steps.

[0030] S101: Obtain the set to be laid out and the page size of the page.

[0031] A set of samples to be arranged refers to a collection of multiple two-dimensional samples that need to be cut or arranged on one or more raw material sheets in industrial production.

[0032] A sample is a two-dimensional part shape represented by a simple polygon, which is a polygon without self-intersections or holes. In the footwear and apparel industries, samples can be the shapes of shoe uppers, soles, or garment pieces; in metal processing and laser cutting, samples can be the outlines of various metal parts. Each sample has a geometric shape and dimensions, and its area can be calculated using the polygon area formula, which will not be elaborated here.

[0033] A sheet refers to a rectangular piece of raw material used for laying out samples, such as a sheet of leather, a section of a roll of fabric, or a standard steel plate. The sheet dimensions include both length and width. For the same batch of sample laying tasks, all sheets can have the same dimensions because raw material sheets in industrial production typically come from rolls or sheets of the same specifications.

[0034] S102: Perform local optimal filling of all samples contained in the layout set according to the page size to determine the number of pages required for the layout set and the initial page layout of each page.

[0035] The purpose of this step is to quickly estimate how many pages are needed and generate an initial page layout for each page.

[0036] The rapid estimation process can employ the locally optimal filling method found in bin packing. When placing samples within a given container, it selects the position that best maximizes the remaining space among the currently available placement locations, rather than exhaustively searching for all possible combinations. Because the rapid estimation process uses a low sampling rate, this step can be completed within seconds.

[0037] In the specific implementation, each page is first treated as a container according to its size. The sample pieces contained in the set to be laid out are then subjected to a local search for bin packing and layout within the container to obtain an initial allocation scheme.

[0038] The initial allocation scheme refers to the logical grouping result of which page each sample is assigned to. This allocation scheme is an approximately optimal grouping obtained through local search within the framework of the bin packing algorithm. Its goal is to minimize the number of pages used while ensuring relatively uniform filling of each page.

[0039] After obtaining the initial allocation scheme, based on the initial allocation scheme and the set non-overlapping constraint of the samples, each sample is placed into the corresponding page in the set order to determine the number of pages required for the sample set and the initial page layout of each page.

[0040] The order can be set to include left-to-right or bottom-to-top.

[0041] The non-overlapping constraint for sample pieces can include ensuring that sample pieces do not overlap and that they do not exceed the page boundaries. Specifically, the first sample piece can be placed with its bottom left corner aligned with the page's origin. Then, the remaining sample pieces are placed sequentially, from left to right and from bottom to top. Each time a sample piece is placed, it is checked for overlap with already placed samples and for exceeding the page boundaries. If overlap or exceeding occurs, the position or rotation angle of the sample piece is adjusted until a position that satisfies the constraints is found. During placement, a certain spacing can be maintained between sample pieces to meet the requirements of actual cutting or processing techniques.

[0042] In the partial search of the packing layout, the estimated number of pages is no less than the minimum number of pages actually required for the sample. A conservative estimation method is used to avoid situations where the estimated number of pages is less than the actual required number, resulting in the sample not being able to accommodate all pages. Because the subsequent global search of the strip layout has page elimination capabilities, even if the estimated number of pages is one or two pages more than the actual optimal number, the compression mechanism during the global search process can empty and eliminate the excess pages. Therefore, estimating a slightly higher number of pages will not result in material waste.

[0043] The initial page layout includes which samples are placed on each page, and the coordinates of the position of each sample within that page. The position of a sample can be represented by the coordinates of its lower left corner or its center.

[0044] Local search for packing layout does not require fine-tuning of the complex interlocking relationships between samples; it only needs to ensure that samples do not overlap or exceed boundaries. This allows for the rapid determination of the number of pages and a rough layout. Although the initial page layout is not highly precise, it provides a high-quality starting point for subsequent global search of strip layout, eliminating the need to start the search from scratch and improving the efficiency of global strip layout search.

[0045] S103: Concatenate the pages into a strip using page placeholders, and map the initial page layout of each page to the corresponding position of the strip to obtain the initial strip layout.

[0046] After determining the number of pages and the initial page layout, the pages are pieced together in page order to form a continuous strip, which can be called a strip. This strip is a rectangular area with a fixed width and variable length. The strip layout problem is to arrange irregularly shaped components in a strip of fixed width, with the goal of minimizing the length of the strip.

[0047] Page placeholders are forbidden areas between adjacent pages. When stitching N pages together into a long strip, a narrow rectangular area is inserted as a placeholder between page n and page n+1. The width of the placeholder can be preset, for example, a typical width of 10 mm.

[0048] The purpose of placeholders is to prevent strip patterns from crossing page boundaries during the global search for strip layout, thus ensuring that long strips can be cleanly segmented back into independent pages. Placeholders allow strip patterns to temporarily cross or overlap during the search, but strip patterns cannot fall within the placeholder area during final convergence.

[0049] While stitching the pages into a strip, the initial page layout of each page is mapped to the corresponding position in that strip. Specifically, the layout of page 1 is mapped to the coordinate range corresponding to page 1 in the strip, the layout of page 2 is mapped to the coordinate range corresponding to page 2, and so on, with placeholder blank areas reserved between the layouts of adjacent pages. After mapping, the initial strip layout is obtained, which is the starting point for the global search of strip layout. This initial strip layout contains the position information of all samples in the stitched strip, with the samples roughly located within the page segment corresponding to their initial assigned page.

[0050] By stitching pages together into strips and mapping the layout onto those strips, the original multi-page binning problem is transformed into a single-strip layout problem. The advantage of this transformation is that the separation search and compression mechanisms in strip layout can directly apply to all samples, driving them to flow naturally along the continuous strips. The pushing and shoving between samples causes them to move from sparse to dense page segments, thus achieving natural page elimination without the need for complex cross-bin swapping logic within the binning layout framework.

[0051] S104: Perform a global strip layout search on the initial strip layout to obtain the optimized strip layout.

[0052] Global search in strip layout involves continuously adjusting the positions of individual samples within a fixed-width strip to reduce its overall length. Unlike boxed layout, the total length of strip layout is variable, and its optimization objective is to minimize the length, not the number of pages. However, in this application, since the strips are obtained by splicing pages of fixed length, the total length of the strip remains constant during the search process; the search adjusts the positional distribution of the samples within the strip.

[0053] This step starts with the initial strip layout and adjusts the positions of the samples based on this initial layout. During the search process, the strip layout algorithm attempts to push the samples to the left, making them more closely arranged along the length of the strip. Since all samples are located on a continuous strip, when a sample in one area is pushed, it will affect the samples in adjacent areas through collision transmission. This chain reaction allows the samples to flow naturally between different page segments.

[0054] The strip layout global search employs a two-stage iterative improvement approach of exploration and compression. In the exploration stage, the positions of the strips are randomly perturbed to explore various possible layout variations. In the compression stage, the strips are compressed to the left along the strip length to make the arrangement more compact. If strip overlap occurs during compression, rotation and / or positional adjustments are performed on the overlapping strips to eliminate the overlap problem. The two stages alternate, and with each round of exploration and compression, the strip layout moves one step further towards a better outcome. The number of iterations in the search process can be preset, or convergence can be determined when no further significant improvement in the layout is observed.

[0055] During the global search, the page placeholder area serves to limit the cross-page boundaries of the sample. Although the placeholder allows samples to temporarily overlap during the search, samples cannot fall into the placeholder area when the search finally converges. The existence of the placeholder ensures that although samples can flow across pages to some extent, they can still be cleanly separated back into independent pages in the end.

[0056] It should be noted that compression in the global search of strip layout refers to pushing the entire sample sheet to the left, while keeping the total length of the strip unchanged, only adjusting the positional distribution of the sample sheets along the strip length. This differs from traditional strip layout, which optimizes the target by shortening the strip length. In this application, compression redistributes the sample sheet positions under a fixed total length, making the distribution of the sample sheets among the page segments more reasonable.

[0057] Through a global search of the strip layout, the unreasonable distribution caused by the rough estimation of the packing layout in the initial strip layout is corrected. The natural flow of samples from high-density page segments to low-density page segments gradually hollows out some page segments. When the number of samples in a page segment is reduced to zero, that page has actually been eliminated. This process achieves the goal of cross-box swapping in packing layout, but it does not require direct cross-box swapping; instead, it is completed automatically through the pushing mechanism of the strip layout.

[0058] S105: Based on the position of the page placeholders, divide the optimized strip layout into multiple pages of layout results.

[0059] After the global search for strip layout is completed and the optimized strip layout is obtained, the long strip needs to be split back into independent pages. The splitting is based on the position of each page's placeholder within the long strip. Each placeholder is located between two adjacent pages, forming a split boundary. Based on which side of which placeholder the coordinates of each sample's center point in the optimized layout fall on, the sample is assigned back to the corresponding page.

[0060] In the implementation, starting from the left end of the long strip, when the first placeholder is encountered, all samples to the left of that placeholder belong to page 1, and samples to the right of that placeholder continue to be assigned to the next page. When the second placeholder is encountered, samples between the first and second placeholders belong to page 2, and so on. Since placeholders are forbidden areas, samples will not fall inside the placeholders in the optimized layout, so the segmentation boundaries are clear, and there are no samples crossing the boundaries.

[0061] After segmentation, for each page, the relative coordinates of the sample image within that page need to be calculated based on its absolute coordinates. In practice, this can be achieved by subtracting the page's initial offset within the long strip from the sample image's absolute coordinates.

[0062] Because the sample pieces move between page segments during the global search for strip layout, the sample set for each page after segmentation may differ from the initial allocation scheme. Some pages may no longer have sample pieces; these pages belong to the blank area on the right and can be discarded after segmentation. For example, if the estimated number of pages is 10, but only the first 8 pages contain sample pieces after the global search, and the last 2 pages are empty, then only the layout results of the first 8 pages will be retained after segmentation. The actual number of pages used is determined by the actual output of the global search and is not limited by the initial estimate.

[0063] By performing a segmentation operation, the solution can recover the independent layout results of each page from the global optimization results of strip layout. The layout result of each page is an effective layout that satisfies the requirements of non-overlapping patterns and not exceeding the page boundaries. At the same time, since the segmentation is based on placeholders, the independence between pages is guaranteed, and each page can be used independently for cutting or processing in actual production.

[0064] As can be seen from the above technical solution, by obtaining the set of samples to be arranged and the page size, and by using bin packing nesting with local optimal filling to quickly determine the number of pages and the initial layout of each page, the dilemma of traditional solutions being unable to perform effective nesting due to the inability to determine the number of pages in advance is solved. An initial result containing the relationship between samples and page ownership can be obtained within seconds. On this basis, each page is spliced ​​into a strip by page placeholders and the initial layout of each page is mapped to the corresponding position of the strip. The bin packing nesting problem, which originally required complex cross-bin swapping between multiple independent containers, is transformed into a single strip nesting problem on a continuous strip. This avoids the computational overhead caused by complex mechanisms such as candidate evaluation, chain collisions, and rollback costs in traditional bin packing nesting. When performing a global search for strip nesting on the initial strip layout, the compression and pushing mechanism of strip nesting allows samples to flow naturally from sparse page segments to dense page segments on the continuous strip. The collision gradient is used to automatically guide the cross-page rearrangement of samples, thereby avoiding the combinatorial explosion problem caused by cross-bin swapping in bin packing nesting. Finally, based on the placeholder positions, the optimized strip layout is divided into multiple page layout results, allowing the global optimization results to be converted into independently usable page layout schemes. Through the above operations, while quickly determining the page number framework using bin packing layout, the global search capability of strip packing layout enables the automatic coordinated distribution of samples among pages. This avoids the time uncontrollability problem caused by the superlinear growth of the search space in a single full strip packing layout when the number of samples is large, and overcomes the local optimum defect of bin packing layout where the sample combination of early pages is locked, resulting in subsequent pages only being able to use samples with mismatched shapes. Under the premise of ensuring computational feasibility, it effectively improves the global optimization effect of large-scale multi-page layout.

[0065] Example 2: Figure 2 The flowchart illustrates a method for optimizing strip layout provided in this application embodiment. This method further refines S104 in Embodiment 1 and includes the following steps.

[0066] S201: Randomly perturb the positions of each sample in the initial strip layout to obtain the perturbed strip layout.

[0067] The initial strip layout was obtained based on a local search of the packing layout. Although the samples were roughly located within their respective page segments, this layout was not optimal, and there was room for further improvement in the relative positions between the samples. To enable the global search of the strip layout to explore a better layout, the positions of each sample in the initial strip layout were first randomly perturbed.

[0068] Specific methods of random perturbation may include randomly selecting some samples and adding a random offset to their position coordinates; or randomly selecting some samples and making small adjustments to their rotation angles; or randomly swapping the positions of two samples. The magnitude of the perturbation should not be too large, usually controlled within a few percent of the sample feature size, to avoid disrupting the overall structure of the initial layout. The perturbed layout may result in overlap between samples, which is permissible and will be handled in subsequent steps.

[0069] The purpose of random perturbation is to break the local optima that may exist in the initial stripe layout, providing diverse starting points for subsequent compression operations. If compression begins directly from the initial layout, it may get stuck in local optima. Performing a random perturbation before each compression operation generates multiple different layout variants, increasing the likelihood of finding a better solution.

[0070] S202: According to the preset compression step size, compress each sample in the disturbed strip layout along the length direction of the strip.

[0071] Compression operation refers to moving all the samples in the strip to the left along the length of the strip.

[0072] During compression, each sample is moved the same distance to the left. After this movement, the relative spacing between the samples decreases, and some samples may overlap. The goal of the compression operation is to make the samples more closely aligned along the length, thus providing a basis for eliminating redundant pages.

[0073] The compression step size should not be too large, otherwise it will produce a lot of overlap, increasing the difficulty of subsequent adjustments; nor should it be too small, otherwise the search efficiency will be low. Therefore, the compression step size can be preset. The compression step size can be an absolute length value, such as compressing 4 mm each time; or it can be a relative proportion value, such as compressing 4% of the total length of the current strip each time.

[0074] In strip layout, compression is an iterative process. After each compression, if overlap occurs, the overlap elimination process is initiated; if there is no overlap, the next compression continues until the preset compression ratio is reached or further compression is no longer possible.

[0075] S203: In the event of overlapping samples after compression, perform rotation adjustment and / or position shift adjustment on the overlapping samples.

[0076] After compression, due to the reduced spacing between samples, some samples are likely to overlap. Overlapping samples need to be adjusted to eliminate or at least reduce the overlap. Adjustment methods can include rotation and positional adjustment.

[0077] Rotation adjustment refers to rotating a sample in an overlapping area around its center point, changing its orientation angle to find an orientation that does not overlap with other samples. Because irregularly shaped parts are prone to collisions, rotating them by a certain angle may precisely avoid them from colliding with other samples. The rotation angle can be a few preset discrete angles, such as 0 degrees, 90 degrees, 180 degrees, and 270 degrees, or it can be an angle continuously searched within a certain range.

[0078] Position movement adjustment refers to changing the position coordinates of a sample, moving the sample to another location. Position movement can include two methods: position translation and position swapping.

[0079] Position translation involves moving overlapping samples a certain distance in a certain direction to a nearby position where there is no overlap.

[0080] Position swapping involves exchanging the positions of two samples as a whole. Typically, this involves swapping the positions of a large, overlapping sample with smaller samples in other positions within the strip.

[0081] A large sample refers to a sample whose size is larger than the first size value, and a small sample refers to a sample whose size is smaller than the second size value. The first size value is greater than the second size value, which means that the size threshold of the large sample is higher than the size threshold of the small sample. There is a certain size difference between the two to ensure that the swap is a meaningful size exchange.

[0082] During the adjustment process, the overlap amount is calculated after each operation (rotation, translation, or swap). The overlap amount can be represented by the area of ​​the overlapping region; the smaller the overlap amount, the denser the layout. If the overlap amount after adjustment is less than the overlap amount before adjustment, the operation is retained; if the overlap amount after adjustment is greater than or equal to the overlap amount before adjustment, the operation is canceled, and the layout is restored to its previous state.

[0083] For rotation and translation adjustments, the operation sequence can be as follows: First, perform a rotation operation on the overlapping samples and evaluate the change in overlap after rotation; then perform a translation operation and evaluate the change in overlap after translation. If neither operation can effectively reduce the overlap, then proceed with the position swap operation.

[0084] The specific implementation of position swapping can include selecting a larger first sample from the overlapping samples, selecting a smaller second sample from other positions in the strip, moving the first sample to the position of the second sample, and moving the second sample to the original position of the first sample. After swapping, evaluate whether the overlap has decreased. If it has decreased, retain the swapping result and return to the rotation and translation operation stages to continue adjustment; if it has not decreased, restore the layout before swapping.

[0085] By employing a multi-level adjustment strategy involving rotation, translation, and swapping, an optimization logic progressing from simple to complex is achieved. Rotation and translation are the most basic adjustment methods, with low computational cost, and most overlaps can be resolved using these two methods. Swapping, a more aggressive approach, is only used when the basic methods fail. Swapping involves exchanging the positions of two sample pieces, resulting in a significant change that may lead to more noticeable layout improvements.

[0086] During the adjustment process, multiple operations need to be performed, iteratively executing sequences of rotation, translation, and swap until a layout without overlap is found, or the maximum number of iterations is reached.

[0087] S204: After eliminating sample overlap by performing rotation adjustment and / or position movement adjustment, return to the operation step of compressing each sample in the disturbed strip layout along the length direction of the strip according to the preset compression step size.

[0088] Once all sample overlaps have been successfully eliminated through rotation and / or position adjustment, the current strip layout is considered a valid, non-overlapping layout. At this point, the next compression operation can be performed, i.e., returning to S202 to further compress the strips according to the preset compression step size.

[0089] This iterative process of compression and adjustment continues, with each compression further reducing the spacing between the samples, and then adjustments are made to eliminate any new overlaps. After multiple iterations, the samples become increasingly densely packed on the strips, and the strip fill rate continuously improves.

[0090] S205: If the overlap of samples is not eliminated after a set number of consecutive rotation adjustments and / or position movement adjustments, the strip layout in which the last sample overlap did not occur is taken as the optimized strip layout.

[0091] During the iterative process of compression adjustment, the following situation may occur: after a certain round of compression, no matter how many rotation, translation, or swap operations are performed, the overlap between samples cannot be completely eliminated. This indicates that the current compression step size is too large, or the layout has reached a limit state under a given compression step size. At this point, we no longer continue to try to eliminate overlap, but instead take the last strip layout without sample overlap as the optimized strip layout. In other words, before entering the current round of compression, the layout was non-overlapping; after compression, an unavoidable overlap occurred, so we revert to the state before compression, and take the non-overlapping layout state as the final optimization result.

[0092] If the overlap of samples cannot be eliminated after a set number of rotation and position adjustments, it indicates that the benefit of continuing the search is minimal, and the search process can be terminated. This termination condition effectively controls the time complexity of the search and avoids wasting computational resources on layouts that cannot be improved.

[0093] Through the above process, the global search for strip layout optimizes the initial layout within a limited number of iterations. The optimized strip layout output is a layout with more compact strip arrangement and more reasonable page distribution after pushing and adjusting.

[0094] The method for optimizing strip layout provided in this embodiment forms a complete global search mechanism for strip layout by breaking local optima through random perturbation, pushing samples to be closely arranged through compression, and eliminating overlap through multi-level adjustments of rotation, translation, and swapping. Random perturbation provides diverse starting points for the search, compression drives the flow of samples, and multi-level adjustments ensure that samples can be restored to a non-overlapping state after compression. The synergistic effect of these three factors enables the global search for strip layout to obtain high-quality layout optimization results within a feasible time, realizing the natural pushing and cross-page flow of samples on continuous strips. In the optimized strip layout, samples are compressed as much as possible along the length of the strip, low-density page segments are naturally hollowed out, and the fill rate of high-density page segments is further improved.

[0095] Example 3: During the global search process for strip layout, when sample overlap occurs due to compression, a series of adjustment operations are required to eliminate the overlap. This embodiment provides a detailed description of the position swapping operation during position movement.

[0096] Position swapping is an adjustment method used when rotation and translation adjustments fail to effectively eliminate overlap. Its logic involves exchanging the positions of large overlapping samples with smaller samples in other locations within the strip, utilizing the fact that smaller samples are easier to place in overlapping areas to eliminate the original overlap.

[0097] In the case of sample overlap after compression, the samples in the overlapping area are first rotated and translated sequentially, and the amount of overlap after each operation is determined.

[0098] The amount of overlap can be represented by the overlap area. The smaller the overlap area, the denser the layout.

[0099] When the overlap after the operation is less than the overlap before the operation, it means that the operation has improved the layout. The result of this operation is retained, and the next operation is tried.

[0100] If the overlap is not eliminated after a set number of rotation and translation operations are performed consecutively, it indicates that simply relying on rotation and translation can no longer further improve the layout. At this point, a position swap operation is triggered.

[0101] The specific steps of position swapping may include selecting a first sample from the overlapping samples, which is larger in size; and selecting a second sample from a position other than the location of the first sample from the strip, which is smaller in size. The size of the first sample is larger than the size of the second sample, that is, replacing the large sample in the overlapping area with the smaller sample. This makes it easier to find a position in the overlapping area where the smaller sample does not overlap with other samples, while the larger sample, after being swapped to another position, may fit perfectly into the space there.

[0102] In practice, the selection of the first and second samples can be based on area as the dimensional standard. Samples with an area larger than the first dimension value can be candidates for the first sample, and samples with an area smaller than the second dimension value can be candidates for the second sample. The first dimension value should be greater than the second dimension value to ensure a sufficient dimensional difference between the large and small samples.

[0103] When selecting a second sample, prioritize samples that are farther away from the overlapping area. This is because samples that are farther away may have less connection with other samples in the overlapping area, making it easier to assess the impact on the overall layout after the swap. Alternatively, prioritize samples placed in sparse page segments, as these samples have more space around them, making it easier to accommodate larger samples after the swap.

[0104] After performing the position swap, the overlap in the stripe is recalculated. The overlap after the swap may have the following situations: If the overlap after the swap is greater than or equal to the overlap before the swap, it means that this swap did not improve the layout, or even made the layout worse. In this case, the sample position before the swap is restored, that is, the swap operation is canceled.

[0105] If the overlap after the swap is less than the overlap before the swap, it means the swap improved the layout. The swap result is retained, and the process returns to the stage where rotation and translation operations are performed sequentially on the samples in the overlapping area. The reason for returning to the rotation and translation stage after a successful swap is that the swap changes the distribution of samples in the strip; the original sample combination in the overlapping area changes. Rotation and translation may further optimize the layout under the new combination, achieving better results.

[0106] If the overlap decreases after the position swap but overlap still exists between the samples, continue performing rotation and translation operations to attempt to further eliminate the remaining overlap. If the overlap decreases after the position swap and the samples no longer overlap, it means the swap was successful and all overlaps were eliminated, and the next compression operation can proceed.

[0107] If the overlap cannot be reduced after multiple consecutive position swaps, it means that the strip layout has reached the limit of its adjustment capability at the current compression step size. At this point, we will stop trying to swap and take the layout before multiple swaps as the current state to proceed to the next step of judgment, namely, whether to continue compression or terminate the search.

[0108] Through the aforementioned position swapping operation, the global search for strip nesting achieves a reconfiguration of the layout by exchanging large and small samples when rotation and translation cannot eliminate overlap, allowing compression to continue. This swapping mechanism is similar in concept to cross-box swapping in box nesting, but the implementation is completely different. Cross-box swapping in box nesting requires independent evaluation of the placement position of each sample in multiple boxes, which is computationally complex. In contrast, the position swapping in this application is naturally triggered during the compression process of strip nesting, and the swapping evaluation is based solely on changes in overlap, without the need for candidate evaluation across multiple boxes, resulting in low computational cost and simple implementation.

[0109] The sample overlap elimination method provided in this embodiment achieves effective overlap elimination in the global search of strip layout through the hierarchical application of three operations: rotation, translation, and swapping. Rotation and translation serve as basic adjustment methods to handle most overlap cases, while swapping, as an advanced method, intervenes when the basic methods are ineffective. The three form a complete overlap elimination strategy. The swapping operation exchanges the positions of large and small sample pieces, utilizing the layout flexibility brought about by the size differences of irregular parts, so that the overlap problem during the compression process can be effectively solved, thereby ensuring the convergence of the global search of strip layout.

[0110] Example 4: After dividing the optimized strip layout into multiple pages based on the position of page placeholders, the global strip layout search is performed on a strip-by-strip basis. Therefore, the page layout within each segmented page may not be the optimal state achievable by that page in independent layout. Thus, further in-page compression adjustments are needed to obtain the final layout for each page.

[0111] In-page compression adjustments are performed independently on each page, including two stages: horizontal compression and gravity-based compression.

[0112] The horizontal compression stage involves compressing each page along its length and performing rotation and position adjustments on overlapping samples to obtain a first layout result without overlapping samples.

[0113] The operation of horizontal compression is similar to compression in strip layout global search, except that horizontal compression is limited to within a single page and does not involve cross-page movement.

[0114] In the specific implementation, each sample in the page can be compressed to the left along the length of the page. When samples overlap, rotation adjustment and / or position translation operations are performed on the overlapping samples. If necessary, the positions are swapped until all overlaps are eliminated or the preset number of iterations is reached.

[0115] The goal of horizontal compression is to eliminate local gaps that may be introduced during page boundary re-division, making the samples more closely arranged along the length of the page.

[0116] After horizontal compression is completed, the gravity sinking phase begins.

[0117] Gravity sinking compresses the page corresponding to each first layout result downward along the page height direction, and performs rotation and position adjustment on overlapping samples to obtain a second layout result without sample overlap.

[0118] The gravity-down operation is performed in the same direction as gravity, causing the sample image to converge downwards on the page. Through gravity-down, the sample image is compressed along the page's height, leaving more blank space at the top of the page.

[0119] The specific implementation of gravity sinking can include moving each sample piece in the page corresponding to the first row of samples downward along the height direction of the page according to a preset sinking step.

[0120] The drop step can be an absolute length value, such as dropping 1 mm each time; or it can be a relative proportion value, such as dropping 2% of the page height each time.

[0121] After moving downwards, the vertical spacing between the samples decreases, and some samples may overlap.

[0122] Therefore, when sample overlap occurs during the movement, rotation and position adjustment are performed on the overlapping samples, and the amount of overlap after adjustment is determined. If the amount of overlap after adjustment is zero, it means that the sinking operation is successful, and the operation is retained to continue to the next sinking. If the amount of overlap after a set number of consecutive adjustments is not zero, it means that the benefit of continuing to sink is very low, and the strip layout that did not have sample overlap in the last time is taken as the second layout result.

[0123] It should be noted that the overlap processing strategy in gravity sinking is the same as that in horizontal compression, both employing a hierarchical approach of rotation adjustment, position translation adjustment, and position swapping adjustment. However, in gravity sinking, since the sample moves vertically, the directions of rotation adjustment and position translation adjustment are different; the translation operation is mainly a vertical movement.

[0124] In this application, horizontal compression is first applied to make the sample images more compact along the length direction, reducing the horizontal size of the page; then, gravity compression is applied to make the sample images more compact along the height direction, reducing the vertical blank space of the page. Optimizing these two directions sequentially maximizes the overall page fill rate.

[0125] The time budget for in-page compression adjustments can be determined based on the area of ​​each page. Page area refers to the sum of the areas of all samples within that page, representing the actual workload for that page. Pages with larger total sample areas have more samples, more complex collision relationships between samples, and require more time for compression adjustments; conversely, pages with smaller total sample areas have fewer samples, making adjustments relatively simpler and requiring less time. By adaptively allocating the time budget based on area, computational resources can be concentrated on pages with a larger workload, improving overall compression efficiency.

[0126] In the implementation, the intra-page compression adjustments for each page can be executed in parallel. Each page's compression task is independent and does not share data, thus allowing them to run simultaneously. During parallel execution, semaphores are used to control the number of pages running concurrently, preventing excessive thread concurrency that could lead to CPU resource contention and thus avoiding diminishing marginal utility.

[0127] The value of the semaphore can be set according to the number of CPU cores. For example, it can be set to the number of CPU cores minus one, reserving one CPU core for system management and input / output operations.

[0128] Through in-page compression adjustments, the layout of each page after segmentation was further refined. Horizontal compression eliminated the local looseness that might be introduced by page boundary segmentation, while gravity sinking utilized the natural aggregation effect of gravity to make the samples more compact within the page. The combination of these two methods resulted in the final output layout of each page achieving an optimal level of material utilization.

[0129] The in-page compression adjustment method provided in this embodiment performs independent secondary refinement on each page based on global stripe layout search. Horizontal compression and gravity sinking tighten the page layout from the length and height directions, respectively, and the dual compression further improves the fill rate of each page. The area-adaptive computation time allocation and the parallel execution of semaphore control make this refinement process computationally efficient.

[0130] Example 5: Figure 3 A schematic diagram of a multi-page two-dimensional layout device based on strips provided in this application embodiment includes an acquisition unit 31, a filling unit 32, a splicing unit 33, a search unit 34, and a segmentation unit 35; The acquisition unit 31 is used to acquire the page size of the set to be arranged and the page; The filling unit 32 is used to perform local optimal filling of all the sample pieces contained in the layout set according to the page size, so as to determine the number of pages required for the layout set and the initial page layout of each page. The splicing unit 33 is used to splice each page into a strip using page placeholders, and to map the initial page layout of each page to the corresponding position of the strip to obtain the initial strip layout; wherein, the page placeholder is the forbidden area between adjacent pages; Search unit 34 is used to perform a global strip layout search on the initial strip layout to obtain an optimized strip layout; The segmentation unit 35 is used to divide the optimized strip layout into multiple pages based on the position of the page placeholder.

[0131] In some embodiments, the filling unit is used to treat each page as a container according to the page size, perform a local search for packing and layout within the container for each sample in the set to be laid out, and obtain an initial allocation scheme; according to the initial allocation scheme and the set sample non-overlapping constraint, the sample is placed into the corresponding page in a set order to determine the number of pages required for the set to be laid out and the initial page layout of each page; wherein, the sample non-overlapping constraint includes that the samples do not overlap and that the samples do not exceed the page boundaries.

[0132] In some embodiments, the search unit includes a perturbation subunit, a compression subunit, an adjustment subunit, and a control subunit; The perturbation sub-unit is used to randomly perturb the position of each sample in the initial strip layout to obtain the perturbated strip layout. The compression subunit is used to compress each sample in the disturbed strip layout along the length of the strip according to a preset compression step size; The adjustment subunit is used to perform rotational adjustment and / or positional movement adjustment on the overlapping samples when the samples overlap after compression; after the sample overlap is eliminated after the rotational adjustment and / or positional movement adjustment, the compression subunit is triggered to perform the operation step of compressing each sample in the disturbed strip layout along the length direction of the strip according to the preset compression step size. As a sub-unit, it is used to select the strip layout in which no strip overlap occurs last time, in the case that the overlap of the strips is not eliminated after a set number of consecutive rotational adjustments and / or positional adjustments.

[0133] In some embodiments, position movement includes position translation and position swapping; The adjustment subunit is used to sequentially perform rotation and translation operations on the samples in the overlapping area, and to determine the amount of overlap after each operation; If the overlap after the operation is less than the overlap before the operation, the operation is retained. If the overlap is not eliminated after a set number of consecutive rotation and translation operations, the first sample from the overlapping samples is selected and its position is swapped with the second sample from the strip; wherein the size of the first sample is larger than the size of the second sample. If the overlap after position swapping is greater than or equal to the overlap before position swapping, restore the sample position before position swapping. If the overlap after the position swap is less than the overlap before the position swap, retain the swap result and return to perform rotation and translation operations on the sample in the overlapping area in sequence, and determine the overlap after each operation.

[0134] In some embodiments, after dividing the optimized strip layout into multiple pages based on the position of the page placeholders, an in-page compression unit is also included. The in-page compression unit is used to perform in-page compression adjustments on the layout results of multiple pages to obtain the final layout result of each page.

[0135] In some embodiments, the in-page compression unit includes a length compression subunit and a height compression subunit; The length compression subunit is used to compress each page along the length of the page and perform rotation adjustment and / or position movement adjustment on overlapping samples to obtain a first layout result without sample overlap. The height compression subunit is used to compress the page corresponding to each first layout result downward along the page height direction, and to perform rotation adjustment and / or position movement adjustment on the overlapping samples to obtain a second layout result without sample overlap.

[0136] In some embodiments, the high compression subunit is used to move each sample piece in the page corresponding to the first sorting result downward along the page height direction according to a preset sinking step size; When sample overlap occurs during the movement, perform rotation adjustment and / or position movement adjustment on the overlapping sample to determine the amount of overlap after adjustment; If the adjusted overlap is zero, retain this operation; If the overlap is not zero after a series of consecutive adjustments, the strip layout that does not show overlap in the last iteration is taken as the second layout result.

[0137] In some embodiments, before performing in-page compression adjustments on the layout results of multiple pages, a time determination unit and a quantity determination unit are further included; The time determination unit is used to determine the compression time for each page based on the area of ​​each page; The quantity determination unit is used to determine the number of pages to be compressed in parallel according to the set semaphore.

[0138] For a description of the features in the embodiment of the strip-based multi-page two-dimensional nesting device, please refer to the relevant description of the embodiment of the strip-based multi-page two-dimensional nesting method, which will not be repeated here.

[0139] As can be seen from the above technical solution, by obtaining the set of samples to be arranged and the page size, and by using bin packing nesting with local optimal filling to quickly determine the number of pages and the initial layout of each page, the dilemma of traditional solutions being unable to perform effective nesting due to the inability to determine the number of pages in advance is solved. An initial result containing the relationship between samples and page ownership can be obtained within seconds. On this basis, each page is spliced ​​into a strip by page placeholders and the initial layout of each page is mapped to the corresponding position of the strip. The bin packing nesting problem, which originally required complex cross-bin swapping between multiple independent containers, is transformed into a single strip nesting problem on a continuous strip. This avoids the computational overhead caused by complex mechanisms such as candidate evaluation, chain collisions, and rollback costs in traditional bin packing nesting. When performing a global search for strip nesting on the initial strip layout, the compression and pushing mechanism of strip nesting allows samples to flow naturally from sparse page segments to dense page segments on the continuous strip. The collision gradient is used to automatically guide the cross-page rearrangement of samples, thereby avoiding the combinatorial explosion problem caused by cross-bin swapping in bin packing nesting. Finally, based on the placeholder positions, the optimized strip layout is divided into multiple page layout results, allowing the global optimization results to be converted into independently usable page layout schemes. Through the above operations, while quickly determining the page number framework using bin packing layout, the global search capability of strip packing layout enables the automatic coordinated distribution of samples among pages. This avoids the time uncontrollability problem caused by the superlinear growth of the search space in a single full strip packing layout when the number of samples is large, and overcomes the local optimum defect of bin packing layout where the sample combination of early pages is locked, resulting in subsequent pages only being able to use samples with mismatched shapes. Under the premise of ensuring computational feasibility, it effectively improves the global optimization effect of large-scale multi-page layout.

[0140] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above embodiments of the strip-based multi-page two-dimensional nesting method.

[0141] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the strip-based multi-page two-dimensional nesting method.

[0142] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0143] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the strip-based multi-page two-dimensional layout method.

[0144] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above embodiments of the strip-based multi-page two-dimensional nesting method.

[0145] Those skilled in the art will further 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, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. 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.

[0146] The foregoing has provided a detailed description of a strip-based multi-page two-dimensional layout method, apparatus, electronic device, computer-readable storage medium, and computer program product provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of this application.

Claims

1. A multi-page two-dimensional layout method based on stripes, characterized in that, include: Obtain the set to be laid out and the page size; The sample pieces contained in the set to be laid out are locally optimally filled according to the page size to determine the number of pages required for the set to be laid out and the initial page layout of each page; Each page is joined together into a strip using page placeholders, and the initial page layout of each page is mapped to the corresponding position of the strip to obtain the initial strip layout; wherein, the page placeholder is a no-entry area between adjacent pages; Perform a global strip layout search on the initial strip layout to obtain an optimized strip layout; Based on the position of the page placeholder, the optimized strip layout is divided into multiple pages of layout results.

2. The multi-page two-dimensional layout method based on strips according to claim 1, characterized in that, According to the page size, perform local optimal filling on all samples contained in the set to be laid out to determine the number of pages required for the set to be laid out and the initial page layout of each page, including: Each page is treated as a container according to its size. A local search for binning and layout is performed on each sample piece contained in the set to be laid out within the container to obtain an initial allocation scheme. Based on the initial allocation scheme and the set non-overlapping constraint for the samples, each sample is placed in the corresponding page in a set order to determine the number of pages required for the sample set and the initial page layout of each page; wherein, the non-overlapping constraint for the samples includes that the samples do not overlap and that the samples do not exceed the page boundaries.

3. The multi-page two-dimensional layout method based on strips according to claim 1, characterized in that, Perform a global strip layout search on the initial strip layout to obtain an optimized strip layout, including: The positions of each sample in the initial strip layout are randomly perturbed to obtain the perturbed strip layout; According to the preset compression step size, each sample in the disturbed strip layout is compressed along the length direction of the strip; If overlapping samples occur in the compressed strip, perform rotation adjustment and / or position shift adjustment on the overlapping samples; After eliminating sample overlap by performing rotation adjustment and / or position movement adjustment, return to the operation step of compressing each sample in the disturbed strip layout along the length direction of the strip according to the preset compression step size; If the overlap of samples is not eliminated after a set number of consecutive rotation adjustments and / or position shift adjustments, the strip layout that does not exhibit sample overlap in the last iteration will be taken as the optimized strip layout.

4. The multi-page two-dimensional layout method based on strips according to claim 3, characterized in that, The position movement includes position translation and position swapping; In cases where overlapping samples occur after compression, rotational and / or positional adjustments are performed on the overlapping samples, including: Perform rotation and translation operations sequentially on the samples in the overlapping area, and determine the amount of overlap after each operation; If the overlap after the operation is less than the overlap before the operation, the operation is retained. If the overlap is not eliminated after a set number of consecutive rotation and translation operations, a first sample is selected from the overlapping samples and its position is swapped with a second sample in the strip; wherein the size of the first sample is larger than the size of the second sample. If the overlap after position swapping is greater than or equal to the overlap before position swapping, restore the sample position before position swapping. If the overlap after the position swap is less than the overlap before the position swap, retain the swap result and return to perform rotation and translation operations on the sample in the overlapping area in sequence, and determine the overlap after each operation.

5. The multi-page two-dimensional layout method based on strips according to claim 1, characterized in that, After dividing the optimized strip layout into multiple pages based on the position of the page placeholders, the method further includes: Perform in-page compression adjustments on the layout results of multiple pages to obtain the final layout results for each page.

6. The multi-page two-dimensional layout method based on strips according to claim 5, characterized in that, Perform in-page compression adjustments on the layout results of multiple pages separately to obtain the final layout results for each page, including: Each page is compressed along the length of the page, and overlapping samples are rotated and / or moved to obtain a first layout result without overlapping samples; For each first layout result, the corresponding page is compressed downwards along the page height direction, and the overlapping samples are rotated and / or moved to obtain a second layout result without overlapping samples.

7. The multi-page two-dimensional layout method based on strips according to claim 6, characterized in that, For each first layout result, the corresponding page is compressed downwards along the page height direction, and overlapping samples are rotated and / or moved to obtain a second layout result without overlapping samples, including: According to the preset sinking step length, each sample in the page corresponding to the first row of samples is moved downward along the height of the page; When sample overlap occurs during the movement, perform rotation adjustment and / or position movement adjustment on the overlapping sample to determine the amount of overlap after adjustment; If the adjusted overlap is zero, retain this operation; If the overlap is not zero after a series of consecutive adjustments, the strip layout that does not show overlap in the last iteration is taken as the second layout result.

8. The multi-page two-dimensional layout method based on strips according to claim 5, characterized in that, Before performing in-page compression adjustments on the layout results of multiple pages, the following steps are also included: Determine the compression time for each page based on its area; The number of pages to be compressed in parallel is determined according to the set semaphore.

9. A multi-page two-dimensional layout device based on strips, characterized in that, It includes acquisition units, filling units, splicing units, search units, and segmentation units; The acquisition unit is used to acquire the page size of the set to be sorted and the page; The filling unit is used to perform local optimal filling of all the sample pieces contained in the set to be laid out according to the page size, so as to determine the number of pages required for the set to be laid out and the initial page layout of each page. The splicing unit is used to splice each page into a strip using page placeholders, and to map the initial page layout of each page to the corresponding position of the strip to obtain the initial strip layout; wherein, the page placeholder is a forbidden area between adjacent pages; The search unit is used to perform a global strip layout search on the initial strip layout to obtain an optimized strip layout; The segmentation unit is used to segment the optimized strip layout into multiple pages based on the position of the page placeholder.

10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the strip-based multi-page two-dimensional layout method as described in any one of claims 1 to 8 when executing the computer program.