A two-dimensional layout algorithm selection method and system based on machine learning

By constructing an XGBoost model and a fully connected feedforward neural network model, and combining them with a two-dimensional nesting algorithm library, the nesting algorithm is automatically selected. This solves the problems of subjective bias caused by relying on human experience and low efficiency of trial and error in existing technologies, and achieves more efficient and accurate nesting algorithm selection.

CN120952220BActive Publication Date: 2026-06-26GUANGDONG UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG UNIV OF TECH
Filing Date
2025-07-22
Publication Date
2026-06-26

Smart Images

  • Figure CN120952220B_ABST
    Figure CN120952220B_ABST
Patent Text Reader

Abstract

The application discloses a two-dimensional layout algorithm selection method and system based on machine learning, and the method comprises the following steps: constructing and training XGBoost model and full connection neural network model, and establishing a two-dimensional layout algorithm library; acquiring real-time layout data, extracting features and calculating characteristic values, inputting the XGBoost model to obtain the selection probability of each algorithm, and screening out the candidate algorithm sequence exceeding the preset probability threshold; sorting the candidate algorithm according to whether the time factor needs to be considered, calling the solution in sequence, determining the final algorithm if successful, and trying the subsequent algorithm in sequence if failed; if all the algorithms fail, inputting the characteristic values into the full connection neural network to generate the first n optimal algorithms, and constituting a new sequence to solve again. The application solves the problems that in the two-dimensional layout algorithm selection method depending on artificial experience or trial-and-error method, the artificial experience may lead to subjective bias, thereby affecting the accuracy and optimality of algorithm selection; and the trial-and-error method is easy to introduce a large amount of invalid calculation, thereby leading to the problem of low algorithm selection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of two-dimensional nesting algorithm selection technology, specifically a two-dimensional nesting algorithm selection method and system based on machine learning. Background Technology

[0002] Two-dimensional nesting optimization is the process of spatially planning a set of two-dimensional geometric shapes, including rectangles and polygons, within a finite two-dimensional plane to satisfy specific constraints and achieve an optimization objective. This problem has significant applications in industrial production, as the nesting objects typically correspond to physical materials such as parts and raw materials in the manufacturing field. By optimizing the nesting scheme, objectives such as maximizing material utilization and minimizing production costs can be achieved. Solving two-dimensional nesting problems usually requires selecting a suitable two-dimensional nesting algorithm based on the characteristics of the problem, such as an exact algorithm or a metaheuristic algorithm. However, the current process of selecting two-dimensional nesting algorithms still heavily relies on human experience or trial-and-error methods. Human experience may lead to subjective biases, affecting the accuracy and optimality of the algorithm selection; while trial-and-error methods easily introduce a large amount of invalid computation, resulting in low algorithm selection efficiency. Summary of the Invention

[0003] To address the aforementioned shortcomings, this invention proposes a two-dimensional nesting algorithm selection method and system based on machine learning. The aim is to solve the problems in current two-dimensional nesting algorithm selection methods that rely on human experience or trial and error. Human experience may lead to subjective bias, thus affecting the accuracy and optimality of algorithm selection; while trial and error methods are prone to introducing a large amount of invalid computation, resulting in low algorithm selection efficiency.

[0004] To achieve this objective, the present invention adopts the following technical solution:

[0005] A machine learning-based two-dimensional nesting algorithm selection method includes the following steps:

[0006] Step S1: Construct and train the XGBoost model and the fully connected feedforward neural network model, and establish a two-dimensional nesting algorithm library containing various two-dimensional nesting algorithms;

[0007] Step S2: Obtain real-time sorting data, extract the features of the real-time sorting data, and calculate the value of the real-time sorting data features;

[0008] Step S3: Input the value of the real-time sorting data feature into the trained XGBoost model, calculate the selection probability of each two-dimensional sorting algorithm in the two-dimensional sorting algorithm library through the trained XGBoost model, and filter out two-dimensional sorting algorithms with a selection probability greater than a preset probability threshold to form a candidate algorithm sequence.

[0009] Step S4: Based on whether time factors need to be considered, sort the candidate algorithm sequences accordingly to obtain the sorted candidate algorithm sequences;

[0010] Step S5: According to the order of the sorted candidate algorithm sequence, call the candidate algorithms in turn to solve the real-time sorting data, and determine whether the current candidate algorithm has solved the problem successfully. If it has, the current candidate algorithm is determined as the final two-dimensional sorting algorithm. If not, call the next candidate algorithm to solve the problem until a candidate algorithm has solved the problem successfully.

[0011] If all candidate algorithms in the sorted candidate algorithm sequence fail to solve the problem, then proceed to step S6.

[0012] Step S6: Input the values ​​of the real-time layout data features into the trained fully connected feedforward neural network model. Generate the top n candidate algorithms through the trained fully connected feedforward neural network model to form a new candidate algorithm sequence. Then, re-execute steps S4-S5. If all the top n candidate algorithms after sorting in step S4 fail to solve the problem, it is determined that all two-dimensional layout algorithms in the two-dimensional layout algorithm library are invalid for solving the real-time layout data. Here, n is a positive integer.

[0013] Preferably, step S4 specifically includes the following sub-steps:

[0014] Step S41: For each candidate algorithm in the candidate algorithm sequence, use regularized linear regression to fit the corresponding feature-time curve;

[0015] Step S42: If time factors need to be considered, input the values ​​of the real-time sampling data features into the feature-time curve corresponding to each candidate algorithm, and output the prediction solution time of each candidate algorithm; normalize the prediction solution time of each candidate algorithm to obtain the normalized time of each candidate algorithm; calculate the weighted comprehensive score of each candidate algorithm based on the selection probability of each candidate algorithm, the normalized time of each candidate algorithm, the preset time weight, and the preset probability weight; and sort each candidate algorithm in descending order of the weighted comprehensive score to obtain the sorted candidate algorithm sequence; the specific calculation formula for the weighted comprehensive score of each candidate algorithm is as follows:

[0016] ;

[0017] in, This represents the weighted composite score of the i-th candidate algorithm. Let represent the selection probability of the i-th candidate algorithm. This represents the normalized time of the i-th candidate algorithm. Represents probability weights, Indicates time weight;

[0018] If time is not a factor to consider, then each candidate algorithm is sorted in descending order of selection probability to obtain a sorted sequence of candidate algorithms.

[0019] Preferably, in step S1, before training the XGBoost model and the fully connected feedforward neural network model, the following steps are also included:

[0020] Step A1: Obtain m sets of sorting data from the ORLibrary library, where m represents a positive integer;

[0021] Step A2: Extract the feature groups corresponding to the m sets of sampling data respectively;

[0022] Step A3: For each set of sampled data feature groups, calculate the Pearson correlation coefficient between every two features in the feature group and determine whether it is greater than the preset correlation coefficient threshold. If it is, remove the two features; otherwise, retain the two features to obtain the features after preliminary screening.

[0023] Step A4: For the features after preliminary screening of each set of sample data, construct the objective optimization function. ,in, Represent the features after the kth initial screening; and calculate elasticity coefficient ; and according to In the case of absolute values, a second screening is performed on the features after the initial screening. If the absolute value is greater than 1, then it means The impact on the objective function is flexible and preserves... ;like If the absolute value is less than 1, then it means The impact on the objective function is inflexible and should be eliminated. To obtain the features after secondary screening;

[0024] Step A5: Calculate the feature values ​​of each set of layout data after secondary screening, and solve each set of layout data by calling each two-dimensional layout algorithm in the two-dimensional layout algorithm library to obtain the solution time and target optimization value corresponding to each set of layout data.

[0025] Preferably, in step S1, training the XGBoost model specifically includes the following sub-steps:

[0026] Step S11: Set up the Softmax multi-classifier and calculate the sample weights using the inverse logarithm weighting method;

[0027] Step S12: Construct a structured hyperparameter search space, which includes the learning rate, tree depth, row sampling ratio, and column sampling ratio;

[0028] Step S13: Set the optimization strategy, which includes Bayesian optimizer, hierarchical 5-fold cross-validation and early stopping mechanism;

[0029] Step S14: Input the feature values ​​of each set of sampled data after secondary screening into the XGBoost model, and train it according to the structured hyperparameter search space and optimization strategy.

[0030] Preferably, in step S1, training the fully connected feedforward neural network model specifically includes the following sub-steps:

[0031] Step S15: Set the AdamW optimizer and its weight decay factor to 0.01, and set the early stopping mechanism and its trigger patience value to 10 epochs;

[0032] Step S16: Set the cost-sensitive cross-entropy loss function and the Frobenius norm penalty term for the feature correlation matrix;

[0033] Step S17: Input the feature values ​​of each group of sampled data after secondary screening into a fully connected feedforward neural network model for prediction, and output the prediction results;

[0034] Step S18: Based on the prediction results and the pre-divided test set in the sampling data, calculate the loss value using the cost-sensitive cross-entropy loss function and the Frobenius norm penalty term of the feature correlation matrix;

[0035] Step S19: Calculate the gradient of the cost-sensitive cross-entropy loss function with respect to the parameters of the fully connected feedforward neural network model using the backpropagation algorithm, and update the parameters of the fully connected feedforward neural network model using the AdamW optimizer based on the calculated gradient to complete one epoch of training.

[0036] Step S110: When 10 epochs of training are completed consecutively, the early stopping mechanism is triggered to complete the training of the fully connected feedforward neural network model.

[0037] Another aspect of this application provides a machine learning-based two-dimensional nesting algorithm selection system, the system comprising:

[0038] The first building block is used to build the XGBoost model;

[0039] The second building module is used to build a fully connected feedforward neural network model;

[0040] The first training module is used to train the XGBoost model;

[0041] The second training module is used to train a fully connected feedforward neural network model.

[0042] A module is created to build a library of two-dimensional nesting algorithms that includes various two-dimensional nesting algorithms;

[0043] The first acquisition module is used to acquire real-time sorting data;

[0044] The first feature extraction module is used to extract features from real-time sorting data;

[0045] The first calculation module is used to calculate the values ​​of real-time sorting data characteristics;

[0046] The second calculation module is used to input the values ​​of the real-time layout data features into the trained XGBoost model, and calculate the selection probability of each two-dimensional layout algorithm in the two-dimensional layout algorithm library through the trained XGBoost model.

[0047] The filtering module is used to filter out two-dimensional sorting algorithms whose selection probability is greater than a preset probability threshold, so as to form a candidate algorithm sequence;

[0048] The sorting module is used to sort the candidate algorithm sequence according to whether time factors need to be taken into account, and obtain the sorted candidate algorithm sequence.

[0049] The first solution module is used to sequentially call the candidate algorithms in the sorted candidate algorithm sequence to solve the real-time sorting data and execute the judgment module.

[0050] The judgment module is used to determine whether the current candidate algorithm has been successfully solved. If it has, the current candidate algorithm is determined as the final two-dimensional nesting algorithm. If not, the second solution module is executed until a candidate algorithm is successfully solved. If all candidate algorithms in the sorted candidate algorithm sequence fail to solve, the generation module is executed, and the sorting module and the first solution module are re-executed. If the top n best candidate algorithms after sorting by the sorting module all fail to solve, it is determined that all two-dimensional nesting algorithms in the two-dimensional nesting algorithm library are invalid for solving real-time nesting data, where n is a positive integer.

[0051] The second solution module is used to call the next candidate algorithm for solving the problem;

[0052] The generation module is used to input the values ​​of real-time sorting data features into the trained fully connected feedforward neural network model, and generate the top n candidate algorithms through the trained fully connected feedforward neural network model to form a new candidate algorithm sequence.

[0053] Preferably, the sorting module includes:

[0054] The curve fitting submodule is used to fit the corresponding feature-time curve for each candidate algorithm in the candidate algorithm sequence using a regularized linear regression method.

[0055] The input submodule is used to input the values ​​of the real-time sorting data features into the feature-time curve corresponding to each candidate algorithm;

[0056] The output submodule is used to output the prediction and solution time for each candidate algorithm;

[0057] The time normalization submodule is used to normalize the prediction and solution time of each candidate algorithm to obtain the normalized time of each candidate algorithm.

[0058] The first calculation submodule is used to calculate the weighted comprehensive score of each candidate algorithm based on the selection probability of each candidate algorithm, the normalized time of each candidate algorithm, the preset time weight, and the preset probability weight. The specific calculation formula for the weighted comprehensive score of each candidate algorithm is as follows:

[0059] ;

[0060] in, This represents the weighted composite score of the i-th candidate algorithm. Let represent the selection probability of the i-th candidate algorithm. This represents the normalized time of the i-th candidate algorithm. Represents probability weights, Indicates time weight;

[0061] The first sorting submodule is used to sort each candidate algorithm in descending order of weighted comprehensive score to obtain a sorted candidate algorithm sequence.

[0062] The second sorting submodule is used to sort each candidate algorithm in descending order of selection probability to obtain a sorted sequence of candidate algorithms.

[0063] If time factors need to be considered, then the input submodule and the output submodule are executed, as well as the time normalization submodule, the first calculation submodule, and the first sorting submodule are executed; if time factors do not need to be considered, then the second sorting submodule is executed.

[0064] Preferably, it further includes:

[0065] The second acquisition module is used to acquire m sets of sorting data from the ORLibrary library, where m represents a positive integer;

[0066] The second feature extraction module is used to extract the feature groups corresponding to the m groups of sampled data respectively;

[0067] The third calculation module is used to calculate the Pearson correlation coefficient between every two features in each set of sampled data.

[0068] The preliminary screening module is used to determine whether the Pearson correlation coefficient between two features is greater than a preset correlation coefficient threshold. If so, the first elimination module is executed; otherwise, the two features are retained to obtain the features after preliminary screening.

[0069] The first elimination module is used to eliminate two features whose Pearson correlation coefficient is greater than a preset correlation coefficient threshold.

[0070] The first retention module is used to retain two features whose Pearson correlation coefficient is less than a preset correlation coefficient threshold.

[0071] The third module is used to construct the objective optimization function based on the features after the initial screening of each set of sampling data. ,in, This represents the feature after the kth initial screening;

[0072] The fourth calculation module is used for calculation. elasticity coefficient ;

[0073] The secondary filtering module is used to filter based on... In the case of absolute values, a second screening is performed on the features after the initial screening. If the absolute value is greater than 1, then it means The impact on the objective function is flexible, and the second reserved module is executed; if If the absolute value is less than 1, then it means The impact on the objective optimization function is not flexible, and a second elimination module is executed to obtain features after secondary screening;

[0074] The second reservation module is used for reservation. ;

[0075] The second rejection module is used to reject... ;

[0076] The fifth calculation module is used to calculate the feature values ​​of each group of sampled data after secondary screening.

[0077] The third acquisition module is used to solve each set of layout data by calling each two-dimensional layout algorithm in the two-dimensional layout algorithm library, so as to obtain the solution time and target optimization value corresponding to each set of layout data.

[0078] Preferably, the first training module includes:

[0079] The first settings submodule is used to configure the Softmax multi-classifier;

[0080] The second calculation submodule is used to calculate the sample weights using the inverse logarithm weighting method of frequency;

[0081] The construction submodule is used to construct the structured hyperparameter search space, which includes the learning rate, tree depth, row sampling ratio, and column sampling ratio.

[0082] The second setting submodule is used to set optimization strategies, including Bayesian optimizer, hierarchical 5-fold cross-validation, and early stopping mechanism.

[0083] The training submodule is used to input the feature values ​​of each set of sampled data after secondary screening into the XGBoost model and train it according to the structured hyperparameter search space and optimization strategy.

[0084] Preferably, the second training module includes:

[0085] The third settings submodule is used to configure the AdamW optimizer;

[0086] The first setting submodule sets the weight decay coefficient of the AdamW optimizer to 0.01;

[0087] The fourth setting submodule is used to configure the early stop mechanism;

[0088] The second setting submodule is used to set the patience value for triggering the early stop mechanism to 10 epochs;

[0089] The fifth setting submodule is used to set the cost-sensitive cross-entropy loss function;

[0090] The sixth setting submodule is used to set the Frobenius norm penalty term for the feature correlation matrix;

[0091] The prediction submodule is used to input the feature values ​​of each set of sampled data after secondary screening into a fully connected feedforward neural network model for prediction and output the prediction results.

[0092] The third calculation submodule is used to calculate the loss value based on the prediction results and the pre-divided test set in the sorting data, using the cost-sensitive cross-entropy loss function and the Frobenius norm penalty term of the feature correlation matrix.

[0093] The fourth computational submodule is used to calculate the gradient of the cost-sensitive cross-entropy loss function with respect to the parameters of the fully connected feedforward neural network model using the backpropagation algorithm.

[0094] The fifth computational submodule is used to update the parameters of the fully connected feedforward neural network model based on the calculated gradient using the AdamW optimizer, in order to complete one epoch of training.

[0095] The trigger submodule is used to trigger an early stop mechanism when 10 consecutive epochs of training are completed, so as to complete the training of the fully connected feedforward neural network model.

[0096] The technical solutions provided in this application embodiment may include the following beneficial effects:

[0097] Compared to existing methods for selecting two-dimensional nesting algorithms that rely on human experience or trial and error, this solution achieves automated selection of nesting algorithms through the collaboration of the XGBoost model and the fully connected feedforward neural network model, as well as the linkage of a two-dimensional nesting algorithm library. This not only avoids subjective biases caused by human experience, thereby improving the accuracy and optimality of algorithm selection, but also avoids invalid calculations caused by trial and error, thereby improving the efficiency of algorithm selection. Attached Figure Description

[0098] Figure 1 This is a flowchart illustrating the steps of a two-dimensional nesting algorithm selection method based on machine learning. Detailed Implementation

[0099] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0100] A machine learning-based two-dimensional nesting algorithm selection method includes the following steps:

[0101] Step S1: Construct and train the XGBoost model and the fully connected feedforward neural network model, and establish a two-dimensional nesting algorithm library containing various two-dimensional nesting algorithms;

[0102] Step S2: Obtain real-time sorting data, extract the features of the real-time sorting data, and calculate the value of the real-time sorting data features;

[0103] Step S3: Input the value of the real-time sorting data feature into the trained XGBoost model, calculate the selection probability of each two-dimensional sorting algorithm in the two-dimensional sorting algorithm library through the trained XGBoost model, and filter out two-dimensional sorting algorithms with a selection probability greater than a preset probability threshold to form a candidate algorithm sequence.

[0104] Step S4: Based on whether time factors need to be considered, sort the candidate algorithm sequences accordingly to obtain the sorted candidate algorithm sequences;

[0105] Step S5: According to the order of the sorted candidate algorithm sequence, call the candidate algorithms in turn to solve the real-time sorting data, and determine whether the current candidate algorithm has solved the problem successfully. If it has, the current candidate algorithm is determined as the final two-dimensional sorting algorithm. If not, call the next candidate algorithm to solve the problem until a candidate algorithm has solved the problem successfully.

[0106] If all candidate algorithms in the sorted candidate algorithm sequence fail to solve the problem, then proceed to step S6.

[0107] Step S6: Input the values ​​of the real-time layout data features into the trained fully connected feedforward neural network model. Generate the top n candidate algorithms through the trained fully connected feedforward neural network model to form a new candidate algorithm sequence. Then, re-execute steps S4-S5. If all the top n candidate algorithms after sorting in step S4 fail to solve the problem, it is determined that all two-dimensional layout algorithms in the two-dimensional layout algorithm library are invalid for solving the real-time layout data. Here, n is a positive integer.

[0108] This scheme proposes a machine learning-based two-dimensional nesting algorithm selection method, such as... Figure 1As shown, the first step is to construct and train the XGBoost model and the fully connected feedforward neural network model, and to establish a two-dimensional nesting algorithm library containing various two-dimensional nesting algorithms. In this embodiment, the XGBoost model is a gradient boosting decision tree algorithm model. This model integrates multiple decision trees and uses a gradient boosting strategy for optimization, demonstrating excellent performance in various machine learning tasks, such as classification, regression, and ranking. The fully connected feedforward neural network model is a common deep learning model. This model excels at capturing high-dimensional nonlinear features and is suitable for handling algorithm recommendation problems in complex nesting scenarios. By constructing the XGBoost model, the fully connected feedforward neural network model, and the two-dimensional nesting algorithm library, model support and algorithm resources are provided for the subsequent selection of two-dimensional nesting algorithms. The second step is to acquire real-time layout data, extract its features, and calculate the values ​​of these features. In one embodiment, when the real-time layout data is a two-dimensional rectangular strip layout instance, the features include: area composition ratio (the ratio of strip area to rectangle area); perimeter composition ratio (the ratio of strip perimeter to the sum of all rectangle perimeters); size composition ratio (the ratio of average rectangle size to strip width); width composition ratio (the ratio of maximum rectangle size to strip width); and the number of layouts (the total number of rectangles to be included in the strip). The data includes the number of rectangles, the target size ratio (the number of times the lower bound of the strip is greater than the strip width), the average size factor (the average size of all rectangles), the size multiple ratio (the number of times the largest rectangle size is greater than the smallest rectangle size), the rectangle heterogeneity ratio (the proportion of different rectangles), the proportion of different rectangles with more than one number (the proportion of different rectangles with more than one number), the different size factor (the total number of different rectangle sizes), the maximum size factor (the size value of rectangles whose size is 10% larger than the average size), and the minimum size factor (the size value of rectangles whose size is 10% smaller than the average size). By extracting the features of the real-time nesting data and calculating their values, the original nesting information is transformed into a quantifiable structure, providing a standardized input basis for the selection of subsequent two-dimensional nesting algorithms. The third step is to input the values ​​of the real-time nesting data features into the trained XGBoost model. The trained XGBoost model calculates the selection probability of each two-dimensional nesting algorithm in the two-dimensional nesting algorithm library and selects two-dimensional nesting algorithms with a selection probability greater than a preset probability threshold to form a candidate algorithm sequence. In this embodiment, the preset probability threshold is set to 0.7. The selected probability of each two-dimensional nesting algorithm is calculated by the trained XGBoost model, and two-dimensional nesting algorithms with a selection probability greater than 0.7 are selected. This avoids indiscriminate verification of all two-dimensional nesting algorithms in the two-dimensional nesting algorithm library, thereby reducing the amount of computation in the subsequent solution process.The fourth step is to sort the candidate algorithm sequence according to whether or not time factors need to be considered, resulting in a sorted candidate algorithm sequence. In this embodiment, by considering or not considering time factors, a differentiated sorting strategy can be adopted to adapt to different user needs and improve the usability of the method. The fifth step is to call the candidate algorithms in the sorted candidate algorithm sequence in order to solve the real-time sorting data, and determine whether the current candidate algorithm solves the problem successfully. If it does, the current candidate algorithm is determined as the final two-dimensional sorting algorithm; if not, the next candidate algorithm is called to solve the problem until a candidate algorithm solves the problem successfully. If all candidate algorithms in the sorted candidate algorithm sequence fail to solve the problem, step S6 is executed. In this embodiment, by calling the candidate algorithms in the sorted candidate algorithm sequence in order to solve the real-time sorting data, and using the successfully solved candidate algorithm as the final two-dimensional sorting algorithm, a successful solution means that the sorting constraints are met and the solution time is within a reasonable range. This helps to ensure the effectiveness of algorithm selection. The sixth step involves inputting the values ​​of the real-time layout data features into the trained fully connected feedforward neural network model. This model generates the top n candidate algorithms to form a new candidate algorithm sequence. Steps S4-S5 are then re-executed. If all the top n candidate algorithms sorted in step S4 fail to solve the problem, it is determined that all two-dimensional layout algorithms in the two-dimensional layout algorithm library are ineffective for solving the real-time layout data. Here, n is a positive integer; in this embodiment, n is set to 3. When all candidate algorithms selected by the XGBoost model fail, a fully connected feedforward neural network is introduced to generate new candidate algorithms. Leveraging its advantage in capturing nonlinear features, it covers more complex or special layout scenarios, avoiding solution failures due to the limitations of a single model. Further explanation: During the generation of the top n candidate algorithms by the trained fully connected feedforward neural network model, the model uses historical layout data as a basis. It calculates the difference between the recommended average utilization rate of each candidate algorithm and the actual best average utilization rate in the corresponding scenario as the core evaluation index, prioritizing the selection of the top n algorithms with the smallest difference to form a new candidate algorithm sequence.

[0109] Compared to existing methods for selecting two-dimensional nesting algorithms that rely on human experience or trial and error, this solution achieves automated selection of nesting algorithms through the collaboration of the XGBoost model and the fully connected feedforward neural network model, as well as the linkage of a two-dimensional nesting algorithm library. This not only avoids subjective biases caused by human experience, thereby improving the accuracy and optimality of algorithm selection, but also avoids invalid calculations caused by trial and error, thereby improving the efficiency of algorithm selection.

[0110] Preferably, step S4 specifically includes the following sub-steps:

[0111] Step S41: For each candidate algorithm in the candidate algorithm sequence, use regularized linear regression to fit the corresponding feature-time curve;

[0112] Step S42: If time factors need to be considered, input the values ​​of the real-time sampling data features into the feature-time curve corresponding to each candidate algorithm, and output the prediction solution time of each candidate algorithm; normalize the prediction solution time of each candidate algorithm to obtain the normalized time of each candidate algorithm; calculate the weighted comprehensive score of each candidate algorithm based on the selection probability of each candidate algorithm, the normalized time of each candidate algorithm, the preset time weight, and the preset probability weight; and sort each candidate algorithm in descending order of the weighted comprehensive score to obtain the sorted candidate algorithm sequence; the specific calculation formula for the weighted comprehensive score of each candidate algorithm is as follows:

[0113] ;

[0114] in, This represents the weighted composite score of the i-th candidate algorithm. Let represent the selection probability of the i-th candidate algorithm. This represents the normalized time of the i-th candidate algorithm. Represents probability weights, Indicates time weight;

[0115] If time is not a factor to consider, then each candidate algorithm is sorted in descending order of selection probability to obtain a sorted sequence of candidate algorithms.

[0116] In this embodiment, in step S41, a regularized linear regression method is used to fit the feature-time curve of each candidate algorithm. On the one hand, regularization can effectively avoid the problem of curve overfitting, providing a reliable basis for subsequent prediction of solution time. On the other hand, by fitting the feature-time curve, the time consumption patterns of different candidate algorithms under different sampling data characteristics can be discovered in advance, providing data support for the ranking strategy that incorporates time factors. In step S42, when time factors need to be considered, the weighted comprehensive score of each candidate algorithm is calculated and sorted in descending order according to these scores, which helps to balance the dual requirements of algorithm performance and efficiency. When time factors do not need to be considered, the candidate algorithms are sorted in descending order by selection probability, which helps to ensure the reliability of selecting the optimal algorithm.

[0117] Preferably, in step S1, before training the XGBoost model and the fully connected feedforward neural network model, the following steps are also included:

[0118] Step A1: Obtain m sets of sorting data from the ORLibrary library, where m represents a positive integer;

[0119] Step A2: Extract the feature groups corresponding to the m sets of sampling data respectively;

[0120] Step A3: For each set of sampled data feature groups, calculate the Pearson correlation coefficient between every two features in the feature group and determine whether it is greater than the preset correlation coefficient threshold. If it is, remove the two features; otherwise, retain the two features to obtain the features after preliminary screening.

[0121] Step A4: For the features after preliminary screening of each set of sample data, construct the objective optimization function. ,in, Represent the features after the kth initial screening; and calculate elasticity coefficient ; and according to In the case of absolute values, a second screening is performed on the features after the initial screening. If the absolute value is greater than 1, then it means The impact on the objective function is flexible and preserves... ;like If the absolute value is less than 1, then it means The impact on the objective function is inflexible and should be eliminated. To obtain the features after secondary screening;

[0122] Step A5: Calculate the feature values ​​of each set of layout data after secondary screening, and solve each set of layout data by calling each two-dimensional layout algorithm in the two-dimensional layout algorithm library to obtain the solution time and target optimization value corresponding to each set of layout data.

[0123] In this embodiment, in step A1, the ORLibrary library, an open-source combinatorial optimization case library, provides rich and standard two-dimensional nesting examples. Obtaining m sets of nesting data from the ORLibrary library provides diverse data support for subsequent model training. In step A2, extracting the feature groups corresponding to the m sets of nesting data provides a standardized basis for subsequent feature correlation analysis. In step A3, the preset correlation coefficient threshold is set to 0.8. Calculating the Pearson correlation coefficient between every two features in the feature group helps assess the correlation between features, reveal feature redundancy, and provide an objective basis for feature selection. Preliminary screening of features in the feature group helps reduce feature dimensionality, thereby reducing the complexity of subsequent model training. In step A4, calculating the elasticity coefficients of each feature parameter in the objective optimization function accurately quantifies the correlation strength between features and the optimization objective. Secondary screening of the preliminarily screened features based on the absolute values ​​of the elasticity coefficients of the feature parameters in the objective optimization function ultimately retains key features with significant predictive power for the optimization objective, which helps improve the accuracy of subsequent model predictions. In step A5, the solution time and target optimization value corresponding to the sorted data are obtained by calculating the value of the features after secondary screening of the sorted data, which provides important parameters for the subsequent training of the model.

[0124] Preferably, in step S1, the XGBoost model is trained, which specifically includes the following sub-steps:

[0125] Step S11: Set up the Softmax multi-classifier and calculate the sample weights using the inverse logarithm weighting method;

[0126] Step S12: Construct a structured hyperparameter search space, which includes the learning rate, tree depth, row sampling ratio, and column sampling ratio;

[0127] Step S13: Set the optimization strategy, which includes Bayesian optimizer, hierarchical 5-fold cross-validation and early stopping mechanism;

[0128] Step S14: Input the feature values ​​of each set of sampled data after secondary screening into the XGBoost model, and train it according to the structured hyperparameter search space and optimization strategy.

[0129] In this embodiment, step S11, by setting a Softmax multi-class classifier, it is beneficial to address the modeling requirements of multi-class sorting optimization problems. The Softmax multi-class classifier, with its powerful multi-class processing capabilities, can map input features to the probability distributions of different classes, thereby providing accurate classification criteria for multi-class sorting optimization problems and ensuring that the XGBoost model can accurately identify and distinguish sorting schemes of different classes. Using the inverse logarithm weighting method to calculate sample weights helps to balance the impact of samples from different classes on model training.

[0130] In step S12, a structured hyperparameter search space is constructed to provide a solid parameter foundation for training the XGBoost model. Further explanation is needed, as the learning rate is a crucial parameter for each model update step. Tree depth represents the number of edges traversed from the root node to the farthest leaf node, directly affecting the model's complexity and generalization ability. Row sampling ratio represents the proportion of samples used in each decision tree construction. Column sampling ratio represents the proportion of features used in each decision tree construction.

[0131] In step S13, by setting a Bayesian optimizer, the hyperparameter space can be searched more efficiently, reducing search time and computational resource consumption. Setting a hierarchical 5-fold cross-validation method is beneficial for evaluating the performance of the XGBoost model. By setting an early stopping mechanism, training of the XGBoost model can be stopped in a timely manner when it reaches optimal performance, thereby improving the training efficiency of the XGBoost model.

[0132] In step S14, the XGBoost model is trained by inputting the feature values ​​of each set of sampled data after secondary screening into the XGBoost model, so that the XGBoost model gradually learns the potential patterns and features in the sampled data.

[0133] Preferably, in step S1, training the fully connected feedforward neural network model specifically includes the following sub-steps:

[0134] Step S15: Set the AdamW optimizer and its weight decay factor to 0.01, and set the early stopping mechanism and its trigger patience value to 10 epochs;

[0135] Step S16: Set the cost-sensitive cross-entropy loss function and the Frobenius norm penalty term for the feature correlation matrix;

[0136] Step S17: Input the feature values ​​of each group of sampled data after secondary screening into a fully connected feedforward neural network model for prediction, and output the prediction results;

[0137] Step S18: Based on the prediction results and the pre-divided test set in the sampling data, calculate the loss value using the cost-sensitive cross-entropy loss function and the Frobenius norm penalty term of the feature correlation matrix;

[0138] Step S19: Calculate the gradient of the cost-sensitive cross-entropy loss function with respect to the parameters of the fully connected feedforward neural network model using the backpropagation algorithm, and update the parameters of the fully connected feedforward neural network model using the AdamW optimizer based on the calculated gradient to complete one epoch of training.

[0139] Step S110: When 10 epochs of training are completed consecutively, the early stopping mechanism is triggered to complete the training of the fully connected feedforward neural network model.

[0140] In this embodiment, in step S15, setting the AdamW optimizer facilitates the subsequent updating of parameters in the fully connected feedforward neural network model. The weight decay coefficient of this optimizer is set to 0.01, which aims to introduce appropriate regularization constraints and effectively suppress overfitting in the fully connected feedforward neural network model. Simultaneously, setting an early stopping mechanism and setting its trigger patience value to 10 epochs helps prepare for the end of training of the fully connected feedforward neural network model. In step S16, a cost-sensitive cross-entropy loss function is set. This function fully considers the imbalance of class distribution in the sampled data and adjusts the loss weighted according to the frequency of each class, allowing the fully connected feedforward neural network model to pay more attention to rare classes during training. Furthermore, a Frobenius norm penalty term for the feature correlation matrix is ​​introduced as an auxiliary regularization method. This penalty term effectively constrains the correlation between features, preventing the fully connected feedforward neural network model from over-relying on certain specific feature combinations, further enhancing the generalization ability of the fully connected feedforward neural network model. In step S17, the feature values ​​after secondary filtering of each set of sampled data are input into the fully connected feedforward neural network model, and its output prediction results provide a data foundation for subsequent loss calculation and parameter optimization. In step S18, the loss value is calculated using a cost-sensitive cross-entropy loss function and a Frobenius norm penalty term for the feature correlation matrix. This comprehensively considers the dual impact of class imbalance and feature correlation, accurately measuring the deviation between the model's prediction results and the true values, and providing accurate feedback information for subsequent parameter adjustments. In step S19, the parameters of the fully connected feedforward neural network model are updated based on the calculated gradient using the AdamW optimizer, which helps to reduce the loss value. In step S110, an early stopping mechanism is triggered when 10 consecutive epochs of training are completed to prevent the fully connected feedforward neural network model from getting stuck in meaningless long-term training.

[0141] Another aspect of this application provides a machine learning-based two-dimensional nesting algorithm selection system, the system comprising:

[0142] The first building block is used to build the XGBoost model;

[0143] The second building module is used to build a fully connected feedforward neural network model;

[0144] The first training module is used to train the XGBoost model;

[0145] The second training module is used to train a fully connected feedforward neural network model.

[0146] A module is created to build a library of two-dimensional nesting algorithms that includes various two-dimensional nesting algorithms;

[0147] The first acquisition module is used to acquire real-time sorting data;

[0148] The first feature extraction module is used to extract features from real-time sorting data;

[0149] The first calculation module is used to calculate the values ​​of real-time sorting data characteristics;

[0150] The second calculation module is used to input the values ​​of the real-time layout data features into the trained XGBoost model, and calculate the selection probability of each two-dimensional layout algorithm in the two-dimensional layout algorithm library through the trained XGBoost model.

[0151] The filtering module is used to filter out two-dimensional sorting algorithms whose selection probability is greater than a preset probability threshold, so as to form a candidate algorithm sequence;

[0152] The sorting module is used to sort the candidate algorithm sequence according to whether time factors need to be taken into account, and obtain the sorted candidate algorithm sequence.

[0153] The first solution module is used to sequentially call the candidate algorithms in the sorted candidate algorithm sequence to solve the real-time sorting data and execute the judgment module.

[0154] The judgment module is used to determine whether the current candidate algorithm has been successfully solved. If it has, the current candidate algorithm is determined as the final two-dimensional nesting algorithm. If not, the second solution module is executed until a candidate algorithm is successfully solved. If all candidate algorithms in the sorted candidate algorithm sequence fail to solve, the generation module is executed, and the sorting module and the first solution module are re-executed. If the top n best candidate algorithms after sorting by the sorting module all fail to solve, it is determined that all two-dimensional nesting algorithms in the two-dimensional nesting algorithm library are invalid for solving real-time nesting data, where n is a positive integer.

[0155] The second solution module is used to call the next candidate algorithm for solving the problem;

[0156] The generation module is used to input the values ​​of real-time sorting data features into the trained fully connected feedforward neural network model, and generate the top n candidate algorithms through the trained fully connected feedforward neural network model to form a new candidate algorithm sequence.

[0157] This solution presents a machine learning-based two-dimensional nesting algorithm selection system. Through the cooperation of a first construction module, a second construction module, a first training module, a second training module, an establishment module, a first acquisition module, a first feature extraction module, a first calculation module, a second calculation module, a filtering module, a sorting module, a first solution module, a judgment module, a second solution module, and a generation module, the system achieves automated selection of two-dimensional nesting algorithms. This not only avoids subjective biases caused by human experience, thereby improving the accuracy and optimality of algorithm selection, but also avoids invalid calculations caused by trial and error, thereby improving the efficiency of algorithm selection.

[0158] Preferably, the sorting module includes:

[0159] The curve fitting submodule is used to fit the corresponding feature-time curve for each candidate algorithm in the candidate algorithm sequence using a regularized linear regression method.

[0160] The input submodule is used to input the values ​​of the real-time sorting data features into the feature-time curve corresponding to each candidate algorithm;

[0161] The output submodule is used to output the prediction and solution time for each candidate algorithm;

[0162] The time normalization submodule is used to normalize the prediction and solution time of each candidate algorithm to obtain the normalized time of each candidate algorithm.

[0163] The first calculation submodule is used to calculate the weighted comprehensive score of each candidate algorithm based on the selection probability of each candidate algorithm, the normalized time of each candidate algorithm, the preset time weight, and the preset probability weight. The specific calculation formula for the weighted comprehensive score of each candidate algorithm is as follows:

[0164] ;

[0165] in, This represents the weighted composite score of the i-th candidate algorithm. Let represent the selection probability of the i-th candidate algorithm. This represents the normalized time of the i-th candidate algorithm. Represents probability weights, Indicates time weight;

[0166] The first sorting submodule is used to sort each candidate algorithm in descending order of weighted comprehensive score to obtain a sorted candidate algorithm sequence.

[0167] The second sorting submodule is used to sort each candidate algorithm in descending order of selection probability to obtain a sorted sequence of candidate algorithms.

[0168] If time factors need to be considered, then the input submodule and the output submodule are executed, as well as the time normalization submodule, the first calculation submodule, and the first sorting submodule are executed; if time factors do not need to be considered, then the second sorting submodule is executed.

[0169] In this embodiment, by setting up a curve fitting submodule, the time consumption patterns of different candidate algorithms under different sampling data characteristics can be discovered in advance, providing data support for a sorting strategy that incorporates time factors. When time factors need to be considered, the cooperation between the input submodule, the output submodule, the time normalization submodule, the first calculation submodule, and the first sorting submodule helps to balance the dual requirements of algorithm performance and efficiency. When time factors do not need to be considered, executing the second sorting submodule helps to ensure the reliability of selecting the optimal algorithm.

[0170] Preferred options also include:

[0171] The second acquisition module is used to acquire m sets of sorting data from the ORLibrary library, where m represents a positive integer;

[0172] The second feature extraction module is used to extract the feature groups corresponding to the m groups of sampled data respectively;

[0173] The third calculation module is used to calculate the Pearson correlation coefficient between every two features in each set of sampled data.

[0174] The preliminary screening module is used to determine whether the Pearson correlation coefficient between two features is greater than a preset correlation coefficient threshold. If so, the first elimination module is executed; otherwise, the two features are retained to obtain the features after preliminary screening.

[0175] The first elimination module is used to eliminate two features whose Pearson correlation coefficient is greater than a preset correlation coefficient threshold.

[0176] The first retention module is used to retain two features whose Pearson correlation coefficient is less than a preset correlation coefficient threshold.

[0177] The third module is used to construct the objective optimization function based on the features after the initial screening of each set of sampling data. ,in, This represents the feature after the kth initial screening;

[0178] The fourth calculation module is used for calculation. elasticity coefficient ;

[0179] The secondary filtering module is used to filter based on... In the case of absolute values, a second screening is performed on the features after the initial screening. If the absolute value is greater than 1, then it means The impact on the objective function is flexible, and the second reserved module is executed; if If the absolute value is less than 1, then it means The impact on the objective optimization function is not flexible, and a second elimination module is executed to obtain features after secondary screening;

[0180] The second reservation module is used for reservation. ;

[0181] The second rejection module is used to reject... ;

[0182] The fifth calculation module is used to calculate the feature values ​​of each group of sampled data after secondary screening.

[0183] The third acquisition module is used to solve each set of layout data by calling each two-dimensional layout algorithm in the two-dimensional layout algorithm library, so as to obtain the solution time and target optimization value corresponding to each set of layout data.

[0184] In this embodiment, a second acquisition module provides diverse data support for subsequent model training. A second feature extraction module provides a standardized basis for analyzing the correlation between features. A third calculation module helps evaluate the correlation between features, reveal feature redundancy, and provide an objective basis for feature selection. A preliminary selection module helps reduce feature dimensionality, thereby reducing the complexity of subsequent model training. A fourth calculation module can accurately quantify the correlation strength between features and the optimization target. A secondary selection module helps improve the accuracy of subsequent model predictions. The fifth calculation module and the third acquisition module provide important parameters for subsequent model training.

[0185] Preferably, the first training module includes:

[0186] The first settings submodule is used to configure the Softmax multi-classifier;

[0187] The second calculation submodule is used to calculate the sample weights using the inverse logarithm weighting method of frequency;

[0188] The construction submodule is used to construct the structured hyperparameter search space, which includes the learning rate, tree depth, row sampling ratio, and column sampling ratio.

[0189] The second setting submodule is used to set optimization strategies, including Bayesian optimizer, hierarchical 5-fold cross-validation, and early stopping mechanism.

[0190] The training submodule is used to input the feature values ​​of each set of sampled data after secondary screening into the XGBoost model and train it according to the structured hyperparameter search space and optimization strategy.

[0191] In this embodiment, the first setup submodule helps address the modeling requirements of multi-class sorting optimization problems. The second computation submodule helps balance the impact of different sample classes on model training. The construction submodule provides a solid parameter foundation for XGBoost model training. The second setup submodule enables the Bayesian optimizer to search the hyperparameter space more efficiently, reducing search time and computational resource consumption; hierarchical 5-fold cross-validation is beneficial for evaluating the performance of the XGBoost model; and the early stopping mechanism ensures that the XGBoost model stops training promptly when it reaches optimal performance, thereby improving training efficiency. The training submodule allows the XGBoost model to gradually learn the potential patterns and features in the sorting data.

[0192] Preferably, the second training module includes:

[0193] The third settings submodule is used to configure the AdamW optimizer;

[0194] The first setting submodule sets the weight decay coefficient of the AdamW optimizer to 0.01;

[0195] The fourth setting submodule is used to configure the early stop mechanism;

[0196] The second setting submodule is used to set the patience value for triggering the early stop mechanism to 10 epochs;

[0197] The fifth setting submodule is used to set the cost-sensitive cross-entropy loss function;

[0198] The sixth setting submodule is used to set the Frobenius norm penalty term for the feature correlation matrix;

[0199] The prediction submodule is used to input the feature values ​​of each set of sampled data after secondary screening into a fully connected feedforward neural network model for prediction and output the prediction results.

[0200] The third calculation submodule is used to calculate the loss value based on the prediction results and the pre-divided test set in the sorting data, using the cost-sensitive cross-entropy loss function and the Frobenius norm penalty term of the feature correlation matrix.

[0201] The fourth computational submodule is used to calculate the gradient of the cost-sensitive cross-entropy loss function with respect to the parameters of the fully connected feedforward neural network model using the backpropagation algorithm.

[0202] The fifth computational submodule is used to update the parameters of the fully connected feedforward neural network model based on the calculated gradient using the AdamW optimizer, in order to complete one epoch of training.

[0203] The trigger submodule is used to trigger an early stop mechanism when 10 consecutive epochs of training are completed, so as to complete the training of the fully connected feedforward neural network model.

[0204] In this embodiment, the third setting submodule facilitates subsequent parameter updates for the fully connected feedforward neural network model. The first setting submodule introduces appropriate regularization constraints to effectively suppress overfitting. The fourth and second setting submodules prepare the model for the end of training. The fifth setting submodule, through its cost-sensitive cross-entropy loss function, fully considers the imbalance in class distribution within the sampled data, weighting the loss based on the frequency of each class, thus ensuring the fully connected feedforward neural network model pays more attention to rare classes during training. The sixth setting submodule, with its penalty term, effectively constrains the correlation between features, preventing the model from over-relying on specific feature combinations and further enhancing its generalization ability. The prediction submodule provides a data foundation for subsequent loss calculation and parameter optimization. The third calculation submodule comprehensively considers the dual impact of class imbalance and feature correlation, accurately measuring the deviation between the model's predictions and the true values, providing accurate feedback for subsequent parameter adjustments. Setting up a fourth and fifth computational submodule helps reduce the loss value. Setting up a trigger submodule prevents the fully connected feedforward neural network model from getting bogged down in meaningless, long training sessions.

[0205] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0206] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A two-dimensional nesting algorithm selection method based on machine learning, characterized in that: Includes the following steps: Step S1: Construct and train the XGBoost model and the fully connected feedforward neural network model, and establish a two-dimensional nesting algorithm library containing various two-dimensional nesting algorithms; Step S2: Obtain real-time layout data and extract the geometric features of the real-time layout data. The geometric features include at least one of area composition ratio, perimeter composition ratio, size composition ratio, and layout number. Calculate the value of the geometric features of the real-time layout data. The real-time layout data is a two-dimensional rectangular strip layout instance data. The area composition ratio is the ratio of the strip area to the rectangle area. The perimeter composition ratio is the ratio of the strip perimeter to the sum of the perimeters of all rectangles. The size composition ratio is the ratio of the average size of the rectangles to the strip width. The layout number is the total number of rectangles to be placed in the strip. Step S3: Input the value of the real-time sorting data feature into the trained XGBoost model, calculate the selection probability of each two-dimensional sorting algorithm in the two-dimensional sorting algorithm library through the trained XGBoost model, and filter out two-dimensional sorting algorithms with a selection probability greater than a preset probability threshold to form a candidate algorithm sequence. Step S4: Based on whether time factors need to be considered, sort the candidate algorithm sequences accordingly to obtain the sorted candidate algorithm sequences; Step S5: According to the order of the sorted candidate algorithm sequence, call the candidate algorithms in turn to solve the real-time sorting data, and determine whether the current candidate algorithm has solved the problem successfully. If it has, the current candidate algorithm is determined as the final two-dimensional sorting algorithm. If not, call the next candidate algorithm to solve the problem until a candidate algorithm has solved the problem successfully. If all candidate algorithms in the sorted candidate algorithm sequence fail to solve the problem, then proceed to step S6. Step S6: Input the values ​​of the real-time layout data features into the trained fully connected feedforward neural network model. Generate the top n candidate algorithms through the trained fully connected feedforward neural network model to form a new candidate algorithm sequence. Then, re-execute steps S4-S5. If all the top n candidate algorithms after sorting in step S4 fail to solve the problem, it is determined that all two-dimensional layout algorithms in the two-dimensional layout algorithm library are invalid for solving the real-time layout data. Here, n is a positive integer.

2. The two-dimensional nesting algorithm selection method based on machine learning according to claim 1, characterized in that: Step S4 specifically includes the following sub-steps: Step S41: For each candidate algorithm in the candidate algorithm sequence, use regularized linear regression to fit the corresponding feature-time curve; Step S42: If time factors need to be considered, the values ​​of the real-time sampling data features are input into the feature-time curve corresponding to each candidate algorithm, and the prediction solution time of each candidate algorithm is output; and the prediction solution time of each candidate algorithm is normalized to obtain the normalized time of each candidate algorithm. Based on the selection probability of each candidate algorithm, its normalized time, preset time weight, and preset probability weight, a weighted comprehensive score is calculated for each candidate algorithm. The candidate algorithms are then sorted in descending order of their weighted comprehensive scores to obtain a sorted sequence of candidate algorithms. The specific formula for calculating the weighted comprehensive score of each candidate algorithm is as follows: ; in, This represents the weighted composite score of the i-th candidate algorithm. Let represent the selection probability of the i-th candidate algorithm. This represents the normalized time of the i-th candidate algorithm. Represents probability weights, Indicates time weight; If time is not a factor to consider, then each candidate algorithm is sorted in descending order of selection probability to obtain a sorted sequence of candidate algorithms.

3. The two-dimensional nesting algorithm selection method based on machine learning according to claim 1, characterized in that: In step S1, before training the XGBoost model and the fully connected feedforward neural network model, the following steps are also included: Step A1: Obtain m sets of sorting data from the ORLibrary library, where m represents a positive integer; Step A2: Extract the feature groups corresponding to the m sets of sampling data respectively; Step A3: For each set of sampled data feature groups, calculate the Pearson correlation coefficient between every two features in the feature group and determine whether it is greater than the preset correlation coefficient threshold. If it is, remove the two features; otherwise, retain the two features to obtain the features after preliminary screening. Step A4: For the features after preliminary screening of each set of sampled data, construct the objective optimization function. ,in, Represent the features after the kth initial screening; and calculate elasticity coefficient ; and according to In the case of absolute values, a second screening is performed on the features after the initial screening. If the absolute value is greater than 1, then it means The effect on the objective function is flexible and preserves... ;like If the absolute value is less than 1, then it means The impact on the objective function is inflexible and should be eliminated. To obtain the features after secondary screening; Step A5: Calculate the feature values ​​of each set of layout data after secondary screening, and solve each set of layout data by calling each two-dimensional layout algorithm in the two-dimensional layout algorithm library to obtain the solution time and target optimization value corresponding to each set of layout data.

4. The two-dimensional nesting algorithm selection method based on machine learning according to claim 3, characterized in that: In step S1, the XGBoost model is trained, which specifically includes the following sub-steps: Step S11: Set up the Softmax multi-classifier and calculate the sample weights using the inverse logarithm weighting method; Step S12: Construct a structured hyperparameter search space, which includes the learning rate, tree depth, row sampling ratio, and column sampling ratio; Step S13: Set the optimization strategy, which includes Bayesian optimizer, hierarchical 5-fold cross-validation and early stopping mechanism; Step S14: Input the feature values ​​of each set of sampled data after secondary screening into the XGBoost model, and train it according to the structured hyperparameter search space and optimization strategy.

5. The two-dimensional nesting algorithm selection method based on machine learning according to claim 3, characterized in that: In step S1, the fully connected feedforward neural network model is trained, which specifically includes the following sub-steps: Step S15: Set the AdamW optimizer and its weight decay factor to 0.01, and set the early stopping mechanism and its trigger patience value to 10 epochs; Step S16: Set the cost-sensitive cross-entropy loss function and the Frobenius norm penalty term for the feature correlation matrix; Step S17: Input the feature values ​​of each group of sampled data after secondary screening into a fully connected feedforward neural network model for prediction, and output the prediction results; Step S18: Based on the prediction results and the pre-divided test set in the sampling data, calculate the loss value using the cost-sensitive cross-entropy loss function and the Frobenius norm penalty term of the feature correlation matrix; Step S19: Calculate the gradient of the cost-sensitive cross-entropy loss function with respect to the parameters of the fully connected feedforward neural network model using the backpropagation algorithm, and update the parameters of the fully connected feedforward neural network model using the AdamW optimizer based on the calculated gradient to complete one epoch of training. Step S110: When 10 epochs of training are completed consecutively, the early stopping mechanism is triggered to complete the training of the fully connected feedforward neural network model.

6. A machine learning-based two-dimensional nesting algorithm selection system, using the machine learning-based two-dimensional nesting algorithm selection method as described in any one of claims 1-5, characterized in that: The system includes: The first building block is used to build the XGBoost model; The second building module is used to build a fully connected feedforward neural network model; The first training module is used to train the XGBoost model; The second training module is used to train a fully connected feedforward neural network model. A module is created to build a library of two-dimensional nesting algorithms that includes various two-dimensional nesting algorithms; The first acquisition module is used to acquire real-time sorting data; The first feature extraction module is used to extract features from real-time sorting data; The first calculation module is used to calculate the values ​​of real-time sorting data characteristics; The second calculation module is used to input the values ​​of the real-time layout data features into the trained XGBoost model, and calculate the selection probability of each two-dimensional layout algorithm in the two-dimensional layout algorithm library through the trained XGBoost model. The filtering module is used to filter out two-dimensional sorting algorithms whose selection probability is greater than a preset probability threshold, so as to form a candidate algorithm sequence; The sorting module is used to sort the candidate algorithm sequence according to whether time factors need to be taken into account, and obtain the sorted candidate algorithm sequence. The first solution module is used to sequentially call the candidate algorithms in the sorted candidate algorithm sequence to solve the real-time sorting data and execute the judgment module. The judgment module is used to determine whether the current candidate algorithm has been successfully solved. If it has, the current candidate algorithm is determined as the final two-dimensional nesting algorithm. If not, the second solution module is executed until a candidate algorithm is successfully solved. If all candidate algorithms in the sorted candidate algorithm sequence fail to solve, the generation module is executed, and the sorting module and the first solution module are re-executed. If the top n best candidate algorithms after sorting by the sorting module all fail to solve, it is determined that all two-dimensional nesting algorithms in the two-dimensional nesting algorithm library are ineffective in solving real-time nesting data, where n is a positive integer. The second solution module is used to call the next candidate algorithm for solving the problem; The generation module is used to input the values ​​of real-time sorting data features into the trained fully connected feedforward neural network model, and generate the top n candidate algorithms through the trained fully connected feedforward neural network model to form a new candidate algorithm sequence.

7. The two-dimensional nesting algorithm selection system based on machine learning according to claim 6, characterized in that: The sorting module includes: The curve fitting submodule is used to fit the corresponding feature-time curve for each candidate algorithm in the candidate algorithm sequence using a regularized linear regression method. The input submodule is used to input the values ​​of the real-time sorting data features into the feature-time curve corresponding to each candidate algorithm; The output submodule is used to output the prediction and solution time for each candidate algorithm; The time normalization submodule is used to normalize the prediction and solution time of each candidate algorithm to obtain the normalized time of each candidate algorithm. The first calculation submodule is used to calculate the weighted comprehensive score of each candidate algorithm based on the selection probability of each candidate algorithm, the normalized time of each candidate algorithm, the preset time weight, and the preset probability weight. The specific calculation formula for the weighted comprehensive score of each candidate algorithm is as follows: ; in, This represents the weighted composite score of the i-th candidate algorithm. Let represent the selection probability of the i-th candidate algorithm. This represents the normalized time of the i-th candidate algorithm. Represents probability weights, Indicates time weight; The first sorting submodule is used to sort each candidate algorithm in descending order of weighted comprehensive score to obtain a sorted candidate algorithm sequence. The second sorting submodule is used to sort each candidate algorithm in descending order of selection probability to obtain a sorted sequence of candidate algorithms. If time factors need to be considered, then the input submodule and the output submodule are executed, as well as the time normalization submodule, the first calculation submodule, and the first sorting submodule are executed; if time factors do not need to be considered, then the second sorting submodule is executed.

8. The two-dimensional nesting algorithm selection system based on machine learning according to claim 6, characterized in that: Also includes: The second acquisition module is used to acquire m sets of sorting data from the ORLibrary library, where m represents a positive integer; The second feature extraction module is used to extract the feature groups corresponding to the m groups of sampled data respectively; The third calculation module is used to calculate the Pearson correlation coefficient between every two features in each set of sampled data. The preliminary screening module is used to determine whether the Pearson correlation coefficient between two features is greater than a preset correlation coefficient threshold. If so, the first elimination module is executed; otherwise, the two features are retained to obtain the features after preliminary screening. The first elimination module is used to eliminate two features whose Pearson correlation coefficient is greater than a preset correlation coefficient threshold. The first retention module is used to retain two features whose Pearson correlation coefficient is less than a preset correlation coefficient threshold. The third module is used to construct the objective optimization function based on the features after the initial screening of each set of sampling data. ,in, This represents the feature after the kth initial screening; The fourth calculation module is used for calculation. elasticity coefficient ; The secondary filtering module is used to filter based on... In the case of absolute values, a second screening is performed on the features after the initial screening. If the absolute value is greater than 1, then it means The impact on the objective function is flexible, and the second reserved module is executed; if If the absolute value is less than 1, then it means The impact on the objective optimization function is not flexible, and a second elimination module is executed to obtain features after secondary screening; The second reservation module is used for reservation. ; The second rejection module is used to reject... ; The fifth calculation module is used to calculate the feature values ​​of each group of sampled data after secondary screening. The third acquisition module is used to solve each set of layout data by calling each two-dimensional layout algorithm in the two-dimensional layout algorithm library, so as to obtain the solution time and target optimization value corresponding to each set of layout data.

9. The two-dimensional nesting algorithm selection system based on machine learning according to claim 8, characterized in that: The first training module includes: The first settings submodule is used to configure the Softmax multi-classifier; The second calculation submodule is used to calculate the sample weights using the inverse logarithm weighting method of frequency; The construction submodule is used to construct the structured hyperparameter search space, which includes the learning rate, tree depth, row sampling ratio, and column sampling ratio. The second setting submodule is used to set optimization strategies, including Bayesian optimizer, hierarchical 5-fold cross-validation, and early stopping mechanism. The training submodule is used to input the feature values ​​of each set of sampled data after secondary screening into the XGBoost model and train it according to the structured hyperparameter search space and optimization strategy.

10. A two-dimensional nesting algorithm selection system based on machine learning according to claim 8, characterized in that: The second training module includes: The third settings submodule is used to configure the AdamW optimizer; The first setting submodule sets the weight decay coefficient of the AdamW optimizer to 0.01; The fourth setting submodule is used to configure the early stop mechanism; The second setting submodule is used to set the patience value for triggering the early stop mechanism to 10 epochs; The fifth setting submodule is used to set the cost-sensitive cross-entropy loss function; The sixth setting submodule is used to set the Frobenius norm penalty term for the feature correlation matrix; The prediction submodule is used to input the feature values ​​of each set of sampled data after secondary screening into a fully connected feedforward neural network model for prediction and output the prediction results. The third calculation submodule is used to calculate the loss value based on the prediction results and the pre-divided test set in the sorting data, using the cost-sensitive cross-entropy loss function and the Frobenius norm penalty term of the feature correlation matrix. The fourth computational submodule is used to calculate the gradient of the cost-sensitive cross-entropy loss function with respect to the parameters of the fully connected feedforward neural network model using the backpropagation algorithm. The fifth computational submodule is used to update the parameters of the fully connected feedforward neural network model based on the calculated gradient using the AdamW optimizer, in order to complete one epoch of training. The trigger submodule is used to trigger an early stop mechanism when 10 consecutive epochs of training are completed, so as to complete the training of the fully connected feedforward neural network model.