Packaging box folding path planning method based on intelligent optimization algorithm

Through the mathematical mapping model and optimization function based on intelligent optimization algorithm, the optimal folding path problems are solved, and the packaging box folding path planning is achieved with high precision, stability and efficient automation.

CN120386288APending Publication Date: 2025-07-29ZHEJIANG COLLEGE OF SECURITY TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510379077.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

The existing packaging box folding path planning methods lack adaptability and cannot dynamically adjust the folding order for different packaging boxes, resulting in insufficient generalization capabilities of path planning, prone to structural interference and low efficiency, making it difficult to meet the needs of efficient automated production.

Method used

Based on the intelligent optimization algorithm, by obtaining the expansion state and folding target state data of the packaging box, a mathematical mapping model is established, and the optimization function is built with the shortest path, the least interference and the optimal order. Genetic algorithm, ant colony algorithm or deep reinforcement learning is used to generate the optimal folding path, and simulation analysis and path correction are carried out, and finally imported into the automated execution device for folding.

Benefits of technology

It improves the generalization ability and adaptability of packaging box folding path planning, avoids structural interference, improves folding accuracy and stability, enhances automation execution efficiency, and meets the needs of large-scale production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386288A_ABST
    Figure CN120386288A_ABST
Patent Text Reader

Abstract

The invention discloses a packaging box folding path planning method based on an intelligent optimization algorithm, and the method comprises the steps: collecting the unfolding state data and folding target state data of a packaging box, building a mathematical mapping model between an unfolding state and a folding target state through feature point marks, determining a state transition constraint condition in a folding process, and carrying out the folding of the packaging box. On the basis of the model, an optimization function with the shortest folding path length, the minimum number of structural interference times and the optimal action sequence as targets is constructed; the optimization function is solved through an intelligent optimization algorithm, an optimal folding path is iteratively generated, simulation analysis is conducted on the path, structural interference possibly existing in the folding process is recognized and corrected, the corrected path is imported into automatic execution equipment, and automatic folding of the packaging box is completed through driving equipment; according to the method, the problems of insufficient path planning precision and low automation degree in the prior art are effectively solved, and the intelligence and production efficiency of packaging box folding operation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of packaging boxes, and particularly to a method for planning the folding path of a packaging box based on an intelligent optimization algorithm. Background Art

[0002] In the prior art, the folding process of a packaging box mainly relies on a fixed folding die or a preset mechanical path to achieve automatic folding. Traditional folding methods usually rely on preset folding sequences and mechanical control parameters, which can meet the folding requirements of standardized packaging boxes to a certain extent. In addition, some intelligent folding technologies rely on rule design or simple heuristic methods for path planning, and it is difficult to provide an optimal path in complex folding tasks.

[0003] There are still many problems with the existing folding path planning methods. For example, the preset folding path lacks adaptability and cannot dynamically adjust the folding sequence for different packaging boxes, resulting in insufficient generalization ability of path planning. In addition, the existing path planning methods are prone to structural interference problems during the folding process, affecting the folding quality and stability. At the same time, due to the optimization of the folding path relying on manual experience or simple algorithms, the folding efficiency is low, and it is difficult to meet the requirements of high-efficiency automated production.

[0004] In view of the above problems, a method for planning the folding path of a packaging box based on an intelligent optimization algorithm is proposed. Summary of the Invention

[0005] This application provides a method for planning the folding path of a packaging box based on an intelligent optimization algorithm to achieve the intelligent and high-efficiency forming of the packaging box.

[0006] This application provides a method for planning the folding path of a packaging box based on an intelligent optimization algorithm, including: Obtain the unfolded state data and the folded target state data of the packaging box, establish a mathematical mapping model between the unfolded state and the folded target state through feature point marking, and determine the state transition constraint conditions during the folding process of the packaging box; According to the mathematical mapping model, construct an optimization function with the objectives of the shortest folding path length, the least number of interference times, and the optimal folding action sequence; Use an intelligent optimization algorithm to solve the optimization function, and generate the optimal folding path of the packaging box from the unfolded state to the target state through iterative optimization; Conduct a simulation analysis on the generated folding path, identify possible structural interferences during the folding process, and perform path correction; Import the corrected optimal folding path into an automated execution device, and drive the execution device to perform an automated folding action on the packaging box according to the path planning.

[0007] The beneficial effects of the technical solution provided by this application include: (1) By establishing a mathematical mapping model between the unfolded state and the folded target state of the packaging box, and using intelligent optimization algorithms (such as genetic algorithms, ant colony algorithms, or deep reinforcement learning) to iteratively solve the optimal folding path, this method can dynamically adjust the folding sequence for packaging boxes of different sizes, shapes, and materials, avoiding reliance on fixed molds or preset paths, and improving the generalization ability and adaptability of path planning. (2) An optimization function is adopted with the goal of minimizing the number of interferences, and the folding path is corrected by combining simulation analysis to effectively identify and avoid possible structural interference problems during the folding process, ensuring the rationality of the folding sequence, improving the folding accuracy, reducing the scrap rate of finished products, and thus enhancing the assembly quality and stability of the packaging box. (3) By importing the optimized folding path into an automated execution device, this method can significantly improve the execution efficiency of packaging box folding, reduce the need for manual intervention, and speed up the forming speed of the packaging box, thereby improving the automation level of the production line and meeting the requirements of large-scale production. Description of the Drawings

[0008] Figure 1 It is a flowchart of a packaging box folding path planning method based on an intelligent optimization algorithm provided by the first embodiment of the present application. Detailed Embodiments

[0009] Many specific details are set forth in the following description in order to provide a thorough understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the connotation of the present application. Therefore, the present application is not limited by the specific embodiments disclosed below.

[0010] The first embodiment of the present application provides a packaging box folding path planning method based on an intelligent optimization algorithm. Please refer to Figure 1 , which is a schematic diagram of the first embodiment of the present application. The following will be described in detail with reference to Figure 1 a packaging box folding path planning method based on an intelligent optimization algorithm provided by the first embodiment of the present application.

[0011] Step S101: Obtain the unfolded state data and folded target state data of the packaging box, establish a mathematical mapping model between the unfolded state and the folded target state through feature point marking, and determine the state transition constraint conditions during the folding process of the packaging box.

[0012] In step S101, it is first necessary to obtain the unfolded state data and the folded target state data of the packaging box to ensure the accuracy and executability of the folding path planning. The unfolded state data includes the geometric parameters of the packaging box, such as the dimensions, shapes, material properties, thicknesses, lengths and angles of the folding lines of each folding surface, as well as the initial coordinate system information in the unfolded state. The folded target state data is used to describe the three-dimensional form of the packaging box after folding, including the relative positions, contact relationships, final fixing methods (such as gluing, snapping or plugging) between the folding surfaces, and the structural stability requirements of the packaging box after folding. The data can be obtained by extracting key geometric parameters based on a computer-aided design (CAD) model, or by collecting unfolded images through computer vision technology and performing three-dimensional reconstruction in combination with point cloud data to ensure the integrity and accuracy of the data.

[0013] After the data acquisition is completed, it is necessary to mark the key geometric points of the packaging box with feature points to establish a mathematical mapping relationship between the unfolded state and the folded target state. Feature points include, but are not limited to, the endpoints of the folding lines, the vertices of the folding surfaces, the boundary connection points, the folding center points, and the gluing or contact points. Each feature point has a unique corresponding relationship in the unfolded state and the folded target state, and the change of its coordinates in the three-dimensional space can be described by a transformation matrix. To construct a complete mapping relationship, it is necessary to define a local coordinate system for each folding surface in the unfolded state and calibrate all feature points in this coordinate system, so as to ensure that the relative position changes of each surface during the folding process can be accurately described by mathematical transformations.

[0014] To achieve the folding path planning, it is necessary to construct a mathematical model to map the feature points in the unfolded state to the folded target state. The folding transformation can be described by a rotation matrix and a translation vector, that is, a transformation matrix is defined for each folding surface, and this matrix includes a rotation transformation part and a displacement transformation part. The rotation transformation part is used to describe the rotation of the surface relative to the folding axis during the folding process, and the displacement transformation part is used to describe the translation of the folding surface during the folding process. Specifically, the coordinate of the feature point in the unfolded state can be expressed as a vector, and the coordinate in the folded target state is obtained after the action of the folding transformation matrix. The folding path of the entire packaging box consists of a series of folding transformation matrices. By optimizing the calculation of these matrices, the optimal folding sequence and path can be found.

[0015] When establishing a mathematical mapping model, it is necessary to define the state transition constraint conditions during the folding process of the packaging box to ensure the rationality and feasibility of the folding path. The constraint requirements for the folding order follow the "far-end first" principle, that is, the faces far from the final fixed point are folded first to reduce interference and structural obstacles. In addition, a directed acyclic graph (DAG) can be used to describe the folding order relationship. The nodes of the graph represent the folding faces, and the edges represent the folding dependency relationships, ensuring that each folding step conforms to the pre-dependencies and avoiding the inability to complete subsequent folds due to the premature folding of a certain folding face.

[0016] To avoid the problem of structural interference during the folding process, collision detection needs to be carried out. By using the method of axis-aligned bounding box (AABB) detection, it is possible to check whether two folding faces physically conflict during the folding path calculation. Specifically, in each folding step, calculate the bounding box of the folding face in the new position and determine whether it overlaps with other unfolded faces. If a conflict occurs, the folding order needs to be adjusted or the folding path needs to be modified. In addition, different materials of packaging boxes have different maximum folding angles allowed during folding, so it is necessary to set rotation angle constraints to ensure that the folding angle is within the range allowed by the material and avoid breakage or deformation caused by excessive bending.

[0017] In summary, step S101 includes data acquisition, feature point marking, construction of a mathematical mapping relationship, and setting of state transition constraint conditions.

[0018] Furthermore, the obtaining of the unfolded state data and the folded target state data of the packaging box, the establishment of a mathematical mapping model between the unfolded state and the folded target state through feature point marking, and the determination of the state transition constraint conditions during the folding process of the packaging box include: Obtain the unfolded form data of the packaging box, extract the geometric information of the edges of the folding faces, the endpoints of the folding lines, and the connection parts, and generate an initial data set containing the coordinates of all key feature points; Based on the initial data set, construct the topological relationship of the folding faces of the packaging box, and set unique identifiers at the endpoints of the folding lines, the intersections of the folding faces, and the target bonding positions to generate a feature point matrix for describing the relative position changes of the folding faces; Using the feature point matrix, combined with the folding order constraint, the maximum folding angle constraint, and the boundary contact relationship, establish a mathematical mapping model between the various states during the folding process and generate a state transition matrix.

[0019] In the implementation process, it is first necessary to obtain the unfolded form data of the packaging box to ensure the accuracy and integrity of the input data for the folding path planning. The unfolded form data can be obtained in various ways, such as directly extracting the geometric structure of the packaging box based on computer-aided design (CAD) software, or using a computer vision system combined with a depth sensor for 3D scanning. This data should include the boundary information of all folding surfaces, the starting and ending positions of the folding lines, the relative connection relationships between each surface, and material properties, etc. For the convenience of subsequent mathematical modeling, it is necessary to describe the coordinates of all key feature points in the unfolded state of the packaging box and generate an initial data set. This data set includes the vertex coordinates of the folding surfaces, the endpoint coordinates of the folding lines, the feature point coordinates of the connection parts, and assigns a unique index to each feature point to ensure the stability of subsequent calculations.

[0020] After obtaining the initial data set, it is necessary to further analyze the geometric structure of the packaging box and establish the topological relationship of the folding surfaces. The topological relationship is used to describe the connection method of each folding surface in the unfolded state and the relative movement of each surface during the folding process. Specifically, by constructing a topological graph, each folding surface can be defined as a node in the graph, and the folding line or connection part can be defined as an edge in the graph, thus forming a complete structural relationship graph of the packaging box. On this basis, it is necessary to mark the feature points at the folding line endpoints, the intersections of the folding surfaces, and the target bonding positions, and assign a unique identifier to each feature point. This identifier is used to ensure that the movement trajectory of each feature point can be accurately tracked during the folding process, thereby ensuring the accuracy of the folding path.

[0021] After completing the feature point marking, it is necessary to use these feature point data and combine the folding sequence constraint, the maximum folding angle constraint, and the boundary contact relationship to establish a mathematical mapping model between the various states during the folding process. The folding sequence constraint is used to ensure the executability of the folding operation, that is, some folding surfaces must be folded after other surfaces are folded to completion, to avoid mechanical interference caused by incorrect folding sequences. The maximum folding angle constraint takes into account the foldability of the packaging box material. For example, the folding angle of a paper packaging box may be limited by thickness and stress. Therefore, when establishing the mathematical mapping model, it is necessary to ensure that all folding angles are within the allowable range. The boundary contact relationship is used to describe which folding surfaces will finally contact or bond during the folding process and ensure that these contact relationships are not damaged during the folding path optimization process.

[0022] Based on the above information, a mathematical mapping model can be established, and the changes in each state during the folding process can be described through a state transition matrix. The state transition matrix is used to represent the transformation process of the packaging box from the unfolded state to the final folded state, where each column represents the change in the position of the characteristic points in a certain folding step, and each row represents the trajectory of a certain characteristic point during the entire folding process. The construction of this matrix needs to combine the topological structure, folding order constraints, folding angle constraints, and contact relationships to ensure that it can correctly describe the folding process of the packaging box. When optimizing the folding path, this state transition matrix will be used as the basic data input into the optimization algorithm to calculate the optimal folding path.

[0023] Furthermore, based on the initial data set, the topological relationship of the folding surface of the packaging box is constructed, and unique identifiers are set at the endpoints of the folding lines, the junctions of the folding surfaces, and the target bonding positions to generate a characteristic point matrix for describing the relative position changes of the folding surfaces, including: Perform geometric topological analysis on the initial data set, establish an adjacency relationship graph between the folding surfaces, use the spatial vector analysis method to calculate the normal vector angles between the folding surfaces, and determine the priority of the folding axes based on the boundary collinearity rule of the folding surfaces to form a folding surface connection structure based on topological constraints; At the endpoints of the folding lines, the junctions of the folding surfaces, and the target bonding positions, use the unique identifier coding method to assign a globally unique index to each characteristic point, and establish a multi-dimensional correlation matrix to record the position change trajectory, rotation angle, and constraint state of the characteristic points during the folding process to ensure the traceability and computability of the mathematical mapping; Use the correlation matrix, combined with the feasible folding path optimization strategy, to simulate the influence of different folding orders, and calculate the optimal motion mode of the folding surfaces at each stage based on the principle of minimum energy to generate the characteristic point matrix.

[0024] During the implementation process, it is first necessary to perform geometric topology analysis on the initial dataset to establish an adjacency relationship graph between the folding surfaces of the packaging box. Specifically, it is necessary to identify all the folding surfaces of the packaging box in the unfolded state and extract their boundary information. By calculating the common edges between the folding surfaces, it is determined which surfaces are connected to each other during the folding process. For each pair of adjacent folding surfaces, it is necessary to calculate their normal vectors and use the spatial vector analysis method to calculate the angle between the two to determine the rotation direction and possible movement trend during folding. If the angle between the normal vectors of two folding surfaces is close to 180 degrees, it indicates that the folding method is a flip fold; if the angle is close to 90 degrees, it indicates that the folding method is a vertical fold. In addition, based on the boundary collinearity rule of the folding surface, the folding axes that meet the folding requirements can be further screened. For example, if the length of the collinear boundary between two folding surfaces is long enough and the material properties allow, this boundary can be determined as the folding axis. According to the rationality of the folding order, all possible folding axes are sorted by priority to ensure that the folding order conforms to the constraints of the topological structure during the subsequent path optimization process.

[0025] After completing the construction of the folding topology structure, it is necessary to set unique identifiers at the endpoints of the folding lines, the intersections of the folding surfaces, and the target bonding positions to ensure the full traceability of the folding path. Specifically, for each key point on each folding surface, including the endpoints of the folding axis, the vertices at the connection, and the contact points that need to be bonded or fixed finally, a globally unique index needs to be assigned. This index can be encoded based on geometric coordinates, so that each feature point can be quickly queried through the index during the entire folding process. In order to record the dynamic changes of these feature points during the folding process, a multi-dimensional correlation matrix needs to be constructed, where each row represents the state of a feature point and each column represents a time step during the folding process. The elements of the matrix are used to store the position coordinates, rotation angle, and kinematic constraints of the feature point at this time step. For example, if a certain feature point is located on the folding axis, its coordinates may change before and after folding, but its relative rotation angle should remain the same. Therefore, this matrix can accurately describe the movement trajectory of each key point during the folding process and provide accurate input data for the subsequent folding path optimization.

[0026] After the feature point matrix is established, it is necessary to combine the feasible folding path optimization strategy to simulate and calculate the influence of different folding sequences. First, simulate all possible folding paths, and calculate the force conditions, displacement trajectories, and potential interference situations of the folding surfaces under different folding sequences through finite element analysis or rigid body dynamics simulation. For each folding sequence, calculate the energy consumption required for the packaging box during the folding process, and based on the principle of energy minimization, select the path with the optimal motion mode. For example, among multiple feasible folding sequences, select the scheme that requires the least rotation angle or the minimum displacement path to reduce the load on the execution device. For multiple folding surfaces that need to be folded sequentially, the optimal folding sequence can be determined by the topological sorting method, so that each folding step is based on the reasonable execution of the previous step. In addition, during the folding path optimization process, a constrained optimization method can be used to jointly optimize the folding angle, folding sequence, and spatial displacement to ensure that the final folding path not only conforms to the geometric topology of the packaging box but also can reduce energy consumption and motion interference during actual execution.

[0027] Finally, after the optimization calculation, a complete feature point matrix is generated, which contains all the key point motion information of the packaging box from the unfolded state to the final folded state. In the subsequent path optimization and execution stages, this matrix will be used as the core input parameter to guide the folding path calculation and ensure that the motion of each folding surface can proceed smoothly according to the optimized path during the execution process.

[0028] Step S102: According to the mathematical mapping model, construct an optimization function with the goals of the shortest folding path length, the least number of interference times, and the optimal folding action sequence.

[0029] In step S102, it is necessary to construct an optimization function based on the mathematical mapping model established in the previous step, with the goals of the shortest folding path length, the least number of interference times, and the optimal folding action sequence, to ensure the efficiency and executability of the folding process. The construction of the optimization function involves multiple aspects, including the mathematical representation of the folding path, the setting of the objective function for path optimization, and the strict definition of the constraint conditions to ensure that the optimization process meets the actual requirements of packaging box folding.

[0030] First, it is necessary to clarify the mathematical description of the folding path. The transformation between the unfolded state and the folded target state of the packaging box can be represented by a set of state variables, where each folding step corresponds to specific rotation and translation operations. Assume that the packaging box consists of multiple folding surfaces, and each folding surface rotates around a specific folding axis during the folding process, possibly accompanied by a certain displacement. A vector representation of the folding state of the packaging box can be defined, where the position and orientation of each folding surface can be represented by a quaternion or a rotation matrix, and the entire folding path consists of a series of state transitions. These state variables can be mapped to a high-dimensional state space, where different paths correspond to different folding sequences. To optimize the folding path, it is necessary to search for the optimal state transition sequence within this state space.

[0031] During the folding path optimization process, multiple objectives need to be considered. First, the minimization of the folding path length is one of the important optimization objectives. The length of the folding path can be measured by calculating the cumulative movement distance of the folding surface during the folding process. For each folding step, calculate the rotation angle and displacement amount of the folding surface from the current state to the target state, and accumulate the total amount of movement of the entire folding sequence to form the length metric of the folding path. By minimizing this metric, the complexity of the mechanical movement during folding can be reduced, and the folding efficiency can be improved.

[0032] In addition to the path length, the minimization of interference during the folding process is also a key optimization objective. The interference problem refers to the physical collision between different folding surfaces or mechanical structures during the folding process, which may lead to folding failure or damage to the packaging material. To measure the interference situation during the folding process, geometric collision detection methods can be used, such as collision detection based on bounding boxes or interference analysis based on distance fields. In the optimization function, an interference penalty term can be introduced, and the value of this penalty term increases as the number of detected interferences or the degree of interference during the folding process increases. The optimization objective is to minimize this interference penalty term so that the folding path can avoid structural interference as much as possible.

[0033] During the optimization process, it is also necessary to ensure the optimal order of the folding actions. The rationality of the folding order is crucial for ensuring that the packaging box can be folded into shape smoothly. If the folding order is unreasonable, it may cause some folding surfaces to be fixed in advance, hindering the subsequent folding. To optimize the folding order, a folding dependency graph can be established, which describes the sequential dependency relationships between different folding surfaces. For example, some folding surfaces must be folded after other folding surfaces are folded to avoid mutual obstruction. In the optimization function, a folding order constraint term can be defined, which ensures that all folding operations are executed in the sequential order in the dependency graph, thus avoiding operation failures caused by incorrect folding orders.

[0034] Based on the above optimization objectives, a comprehensive optimization function can be constructed, which consists of the folding path length, interference penalty term, and folding order constraint term. This optimization function can be expressed as a weighted objective function, where different optimization objectives are assigned different weights to balance the shortness of the folding path, non-interference, and reasonable folding order. The expression of the objective function can take the following form: ; where represents the total length of the folding path, represents the interference penalty term, represents the folding order constraint term, are the weight coefficients respectively, used to adjust the relative importance of different optimization objectives. By adjusting these weight coefficients, the focus of folding path optimization can be adjusted according to specific application requirements.

[0035] To ensure the solvability of the optimization problem, necessary constraint conditions need to be introduced. These constraint conditions include geometric constraints, kinematic constraints, and dynamic constraints. Geometric constraints ensure that during the folding process, the transformation of each folding surface conforms to the physical structure of the packaging box. For example, some folding surfaces may be restricted by the material thickness, and their maximum folding angles must be constrained. Kinematic constraints are used to ensure the smoothness of the folding path and avoid discontinuous motion states. Dynamic constraints consider the maximum folding speed and folding acceleration constraints caused by material elasticity or mechanical device limitations during the folding process.

[0036] The solution of the optimization problem can adopt intelligent optimization algorithms, such as genetic algorithms, ant colony algorithms, or deep reinforcement learning methods. Genetic algorithms can search for the global optimal folding path in the search space by simulating the process of natural selection and evolution. Ant colony algorithms can utilize the ability of artificial ant colonies to search for the shortest path in the folding state space and improve the optimization effect through a combination of local optimization and global search. Deep reinforcement learning methods can use neural networks to predict and optimize the folding path, enabling the optimization process to continuously improve with the accumulation of data. During the optimization process, the initial folding path can be generated by heuristic algorithms or existing folding path planning methods, and then the intelligent optimization algorithm is used to further optimize this path to achieve the optimal folding effect.

[0037] By constructing the above optimization function and solving it in combination with intelligent optimization algorithms, the optimal folding path of the packaging box from the unfolded state to the folded target state can be obtained, ensuring the shortest folding path length, the least number of interferences, and the optimal folding action sequence, providing an efficient and feasible optimization scheme for the subsequent execution of the folding path.

[0038] Furthermore, according to the mathematical mapping model, an optimization function is constructed with the goals of the shortest folding path length, the fewest interference times, and the optimal folding action sequence, including: Based on the relationship of feature points of the mathematical mapping model, a parametric description method of the folding path of the packaging box is established, and state variables of the folding path are defined, including the rotation angle of the folding surface, the position of the folding axis, and the folding sequence, and a path representation matrix for optimization calculation is generated; Using the path representation matrix, an optimization objective function for the folding path is constructed, where the shortest path length term is calculated from the folding rotation angle and the translation distance, the fewest interference times term is determined by a real-time collision detection function, and the optimal folding sequence term establishes a folding dependency relationship based on a topological sorting method, and a multi-objective optimization function is generated; Folding mechanical constraints and execution device constraints are introduced into the optimization function, a feasible folding angle range, a maximum stress threshold, and the motion boundary of the execution mechanism are set, a constrained optimization problem is formed, and a folding path evaluation index required for optimization solution is output for iterative optimization calculation by an intelligent optimization algorithm.

[0039] In the implementation process, first, based on the relationship of feature points of the mathematical mapping model, a parametric description method of the folding path of the packaging box needs to be established to quantify the geometric changes and motion characteristics during the folding process. The description of the folding path involves multiple state variables, including the rotation angle of the folding surface, the position of the folding axis, and the folding sequence, etc. The rotation angle of the folding surface is used to describe the rotation state of each surface around the folding axis, and the position of the folding axis determines the relative motion relationship between different folding surfaces. As a key variable, the folding sequence affects the executability of the folding path, and it must be ensured that a reasonable folding logic can be followed during the calculation. To ensure the calculation efficiency, a path representation matrix needs to be constructed, where each row represents a folding step, and the column vector contains the corresponding state variables, including the rotation angle, the folding axis parameters, and the folding sequence index. The construction of this matrix enables subsequent optimization algorithms to perform path optimization within a numerical calculation framework without relying on direct geometric modeling, improving the calculation efficiency and convergence speed.

[0040] After completing the parametric description of the folding path, it is necessary to construct an optimization objective function for the folding path based on the path representation matrix to ensure that the folding path meets the optimal criteria. The optimization objectives include requirements such as the shortest folding path length, the least number of interferences, and the optimal folding action sequence. The calculation of the folding path length is based on the cumulative measure of the rotation angle and the translation distance. Specifically, by calculating the change in the angle of rotation of the folding surface around the folding axis and the relative translation distance between each surface during the folding process, the total movement amount of the entire folding path is obtained and used as one of the objectives for path optimization. The optimization objective of interference detection is achieved through a real-time collision detection function. During the calculation process, each folding step is simulated, and it is detected whether structural interference occurs. If interference is detected, the corresponding penalty factor is increased, so that the optimization algorithm automatically avoids folding sequences that may cause interference when searching for paths. The optimization objective of the folding sequence establishes the folding dependency relationship through a topological sorting method to ensure that the folding process follows a reasonable execution logic. The construction of the folding dependency relationship is based on the geometric topology of the packaging box, defining which folding steps must be completed prior to other steps, and adding corresponding constraints to the optimization objective function to avoid selecting invalid or infeasible folding paths. Finally, these optimization objectives are combined into a multi-objective optimization function, and the weight coefficients can be dynamically adjusted during the solution process to balance the influence of different optimization objectives and ensure that the finally obtained folding path is optimal in terms of path length, number of interferences, and folding sequence.

[0041] After constructing the optimization objective function, it is also necessary to introduce folding mechanics constraints and actuator constraints to ensure the feasibility of the optimized folding path during actual execution. The folding mechanics constraints are used to limit the maximum stress value that the packaging box may withstand during the folding process to avoid damage or deformation caused by material properties. Specifically, during the calculation process, a feasible folding angle range is set according to the elastic modulus, thickness, and folding radius of the packaging box material, and a penalty is imposed on the folding path that exceeds this range during the optimization process, enabling the optimization algorithm to automatically select a folding path that complies with the material mechanics constraints. The actuator constraints are used to ensure that the folding path can be executed by existing automated equipment, including factors such as the motion boundary of the actuator, the maximum folding speed, and the positioning accuracy. For example, in the case of using a robot to perform the folding task, it is necessary to set the maximum motion angle of the robotic arm and the maximum grasping range of the end effector to ensure that the optimized folding path can be completed within the motion capabilities of the equipment. In addition, it is necessary to adjust the folding path optimization strategy according to the kinematic characteristics of different actuators. For example, in the case of using a joint robot to perform folding, inverse kinematics calculations can be introduced during the optimization process to ensure that the generated folding path can be directly converted into the control instructions of the equipment without additional path mapping operations. Finally, the optimized folding path will output a set of folding path evaluation indicators required for the optimization solution, including path length, interference degree, rationality of the folding sequence, and actuator adaptability, etc., for the intelligent optimization algorithm to perform iterative optimization calculations to ensure that the folding path not only meets the optimality requirements but also can be applied to the execution requirements of the actual folding equipment.

[0042] Furthermore, the optimization objective function adopts the following formula 1: ; where is the weight factor for folding path optimization, which determines the influence weight of the folding path length and motion cost in the overall optimization objective, and the recommended value is 0.5.

[0043] represents the total number of folding surfaces of the packaging box, that is, the number of folding surfaces participating in the motion during the entire folding process.

[0044] is the folding surface 's weight coefficient, which is usually related to factors such as the geometric characteristics and material stiffness of the folding surface, and the recommended value is 0.8.

[0045] is the folding surface 's rotation angle around the folding axis during the folding process; is the folding surface The translational displacement that occurs during the folding process is usually calculated as the Euclidean distance between the centroids of the folding surfaces before and after folding; is the interference optimization weight factor, and the recommended value is 1.0.

[0046] is the total number of folding steps that need to be checked for interference during the folding process, that is, the number of key folding steps that require geometric intersection checks throughout the folding process.

[0047] is the folding step is the volume of the folding surface at, usually calculated as the volume of the bounding box of the folding surface before and after folding. A larger value indicates that the movement of the folding surface has a greater impact on the overall folding structure.

[0048] is the folding step is the shortest Euclidean distance between the folding surface at and the previous folding surface, that is, the minimum distance between this folding surface and its adjacent folded and completed surfaces; is the folding step is the shortest Euclidean distance between the folding surface at and the unfolded surface, that is, the minimum distance between this folding surface and the surface that is still in the unfolded state when the folding operation is performed; is the folding order optimization weight factor, and the recommended value is 0.2; is the total number of folding order constraints involved in the folding path, that is, the number of all folding operations that must be performed in a specific order; represents the folding step is the actual time step executed after the optimization solution, that is, the true sequence number in the folding process.

[0049] represents the folding step in the time step of the theoretically optimal folding order; is the stress optimization weight factor, and the recommended value is 1.0; is the total number of folding surfaces involved in the stress analysis during the folding process, that is, the number of folding surfaces whose stress states need to be analyzed.

[0050] represents the folding surface in the folding process, the maximum normal stress it bears is usually calculated by solving the stress point with the maximum force on this folding surface through finite element analysis (FEA).

[0051] Indicates the folding surface The maximum shear stress borne during the folding process; Is the energy consumption optimization weight factor, recommended value 0.5; Is the total number of time steps involved in the execution of the folding path, that is, the number of discrete time steps for which energy consumption calculation is required during the folding process; Is the execution moment of the folding path The instantaneous power consumption at this moment, usually calculated as the input power of the actuator (such as a robotic arm or a folding machine) at this time step; Is the execution moment of the folding path The execution duration at this moment.

[0052] Through the optimization objective function Carry out intelligent optimization and solution. During the path planning process, continuously adjust the folding sequence, rotation angle and motion trajectory to obtain the optimal folding path, and ensure the least interference, the optimal folding sequence, uniform material stress and the lowest execution energy consumption during the folding process, so as to improve the feasibility and execution stability of the folding path planning.

[0053] Step S103: Use an intelligent optimization algorithm to solve the optimization function, and generate the optimal folding path of the packaging box from the unfolded state to the target state through iterative optimization.

[0054] In step S103, based on the previously constructed optimization function, it is necessary to use an intelligent optimization algorithm to solve the optimization problem, and generate the optimal folding path of the packaging box from the unfolded state to the target state in an iterative manner. The selection and solution process of the intelligent optimization algorithm are crucial. It must ensure that the optimal path can be efficiently searched during the complex folding process, while meeting the rationality of the folding sequence, avoiding structural interference and ensuring the executability of the folding path.

[0055] During the solution process, it is first necessary to initialize the search space of the optimization algorithm, that is, to define the initial solution of the folding path of the packaging box. The initial solution can be generated by heuristic methods or rule-based methods. For example, set the basic folding sequence based on geometric heuristic strategies, or use empirical rules to generate a preliminary folding path plan. In order to improve the search efficiency, the initial solution should be as close as possible to the optimal solution to avoid the optimization algorithm falling into a local optimum. During the initialization process, each folding path plan consists of a series of folding operations, and each folding operation can be represented by a rotation matrix and a translation vector, so as to ensure the mathematical describability of the path.

[0056] The core of the intelligent optimization algorithm lies in continuously improving the folding path through iterative optimization, gradually converging it to the optimal solution. Taking the genetic algorithm as an example, during the search process, a certain number of folding path schemes are first generated as the initial population. Each scheme is encoded as a set of folding sequences, and the fitness value is calculated based on the optimization goal. The fitness function evaluates according to the folding path length, the degree of structural interference, and the rationality of the folding order. Individuals with higher fitness represent better folding paths. During the iterative process of the genetic algorithm, operations such as crossover, mutation, and selection are used to optimize the population. For example, crossover is achieved by exchanging the folding order in different paths, or individual folding operations are fine-tuned to improve the path. After multiple generations of evolution, the algorithm finally converges to an optimal folding path, which ensures the optimal folding action order while minimizing unnecessary interference and additional movement during the folding process.

[0057] In addition to the genetic algorithm, the ant colony algorithm can also be used to optimize the folding path. The ant colony algorithm realizes global optimization by simulating the information transfer process of ants in path search. In this method, each possible folding path can be regarded as a route that an ant can walk on, and the selection probability of each folding step is jointly determined by the quality of the folding path and the pheromone concentration. During the iterative process, the pheromone concentration on high-quality folding paths gradually increases, making subsequent ants more inclined to choose these paths, thus forming the optimization process. This method is suitable for packaging boxes with complex multi-folding surfaces because it has strong global search capabilities, can effectively avoid local optimal traps, and improve the quality of the final folding path.

[0058] Another optional method is the deep reinforcement learning algorithm, which autonomously learns the optimal folding strategy by simulating the execution process of a large number of folding paths. Reinforcement learning is based on the state-action-reward model. Each folding step is regarded as an action, the current form of the packaging box during the folding process is regarded as the state, and the quality of the folding path determines the reward value. During the training process, the agent continuously tries different folding paths and adjusts the strategy according to the total cost of the folding path (such as folding time, path length, interference situation, etc.), and finally learns the optimal folding path. This method is suitable for path optimization of packaging boxes with complex deformations and many folding constraints, and can achieve highly adaptive folding path planning.

[0059] During the solution process, the iterative optimization of the folding path is a crucial step. It is necessary to set reasonable termination conditions to ensure that the optimization process can converge to the optimal solution within an acceptable time. The termination conditions can be set as the convergence threshold of the optimization function, that is, when the change in the optimization objective value is lower than the set threshold after several consecutive iterations, the optimization process is considered to have converged. At the same time, to avoid excessive calculation time, the maximum number of iterations or the calculation time limit can be set to ensure that the optimization process is completed within the specified time. In addition, to improve the robustness of the solution, multiple optimization algorithms can be used for hybrid solution. For example, combining the global search ability of the genetic algorithm with the fine-tuning ability of the local optimization algorithm enables the optimization process to have both global exploration ability and fine optimization in the local area of the search space.

[0060] Finally, through the iterative solution of the intelligent optimization algorithm, an optimal folding path is obtained. On the premise of ensuring the rationality of the folding sequence, this path minimizes the length of the folding path and reduces structural interference, enabling the packaging box to be folded from the unfolded state to the target state in an optimal manner. This path will serve as the basis for subsequent simulation analysis and automated folding execution to ensure the efficiency and stability of the packaging box folding.

[0061] Furthermore, the use of the intelligent optimization algorithm to solve the optimization function and generate the optimal folding path of the packaging box from the unfolded state to the target state through iterative optimization includes: Based on the objective constraints of the optimization function, initialize the search space of the folding path, and use the folding state encoding method to construct a computable set of folding path individuals from different folding sequences, rotation angles, and folding surface displacement parameters to form an initial population. For the initial population, use the intelligent optimization algorithm for path iterative optimization, calculate the fitness of each folding path, including path length calculation, interference detection scoring, and folding sequence rationality scoring, and select excellent paths for crossover, mutation, and update based on the fitness level to generate a new generation of folding paths. During the path optimization process, combined with the dynamic folding simulation feedback mechanism, the generated folding paths are evaluated in real time. If an infeasible path is detected, adjust the folding sequence or optimize the rotation angle constraint, and input the updated path into the next round of optimization iteration until converging to the optimal folding path that meets the optimization objective.

[0062] In the implementation process, it is first necessary to initialize the search space of the folding path based on the objective constraints of the optimization function to ensure that all possible folding paths can be covered during the optimization process. The construction of the search space involves the encoding method of the folding state, and it is necessary to structurally represent the folding steps of the packaging box so that the optimization algorithm can efficiently calculate and compare different path schemes. During the folding state encoding process, each folding sequence is represented as a state vector, which includes the rotation angle, the position of the folding axis, and the displacement parameters of the folding surface corresponding to the sequence. The state vector of each folding sequence is added to the initial population as an independent individual, enabling the optimization algorithm to search for paths within the complete search space and continuously optimize the feasibility and superiority of the folding path during the iterative process.

[0063] After the initialization of the search space is completed, the optimization algorithm needs to iteratively optimize the initial population to find the optimal folding path. During the optimization process, the fitness calculation of each folding path is a key link, which requires comprehensive evaluation based on multiple optimization objectives. The path length calculation is an important part of the fitness calculation. By accumulating the rotation angles and displacement amounts of each folding step, the total motion cost of the path is calculated and used as one of the measurement criteria for optimization. The interference detection score is used to judge whether structural interference occurs during the folding process. Based on the real-time collision detection algorithm, the contact situation of each folding surface in the folding state is analyzed. If the path crosses or overlaps during the folding process, the penalty weight is increased to avoid selecting infeasible paths. The rationality score of the folding order is evaluated based on the topological sorting method to ensure that the front-back order in the folding path conforms to the geometric constraints and physical feasibility of the packaging box. After the fitness calculation is completed, the optimization algorithm screens the paths according to the fitness level. Through crossover, mutation, and update operations, a new generation of folding paths is generated and introduced into the next round of optimization calculation, thereby continuously improving the quality of the folding path.

[0064] During the optimization process, it is necessary to combine a dynamic folding simulation feedback mechanism to evaluate the generated folding path in real time to ensure the feasibility of the path. The role of the simulation feedback is to detect whether an infeasible folding path is generated during the optimization process and make adaptive adjustments when an unreasonable path is detected. For example, if the folding path causes structural interference, it is necessary to adjust the folding order to exchange the folding surface order where the interference occurs, or to optimize the rotation angle constraint to adjust the rotation angle during the folding process to a feasible range. During the iterative process of path optimization, the simulation feedback can provide real-time path evaluation data, enabling the optimization algorithm to adjust the search strategy according to the feedback, thus avoiding falling into a local optimum. This iterative process continues until the optimization algorithm converges to a folding path that meets all optimization goals, that is, the final folding solution with the shortest path length, the fewest interference times, and the optimal folding order. The finally obtained folding path can be used as the control instruction input for the execution device to achieve efficient and accurate automatic control of the folding process of the packaging box.

[0065] Furthermore, the use of an intelligent optimization algorithm for path iterative optimization specifically uses a genetic algorithm for solution, including: Perform gene coding on each folding path individual in the initial population, using binary or real number coding methods to represent the folding sequence, rotation angle, and folding displacement, and define the individual length so that each path can be optimized and adjusted through gene bit operations; Calculate the fitness value of each folding path individual according to the optimization objective function. The fitness value is calculated by weighting the path length, interference detection score, and folding order rationality score to ensure that the folding path corresponding to the individual with higher fitness is better. And adopt the tournament selection strategy to randomly select several individuals for comparison and select the individuals with higher fitness to enter the next generation; Among the selected excellent individuals, perform crossover and mutation operations. Adjust the recombination method of the folding path sequence through an adaptive crossover rate to make some paths exchange the folding order and rotation angle. At the same time, set the mutation probability to randomly modify the rotation angle or adjust the folding order on the folding path individual to increase the diversity of the population, avoid convergence to a local optimum, and input the optimized new generation of paths into the next round of iterative calculation until convergence to the optimal folding path that meets the optimization goals.

[0066] In the implementation process, it is first necessary to perform gene coding on each folding path individual in the initial population to ensure that the genetic algorithm can effectively search for the optimal folding path. A folding path individual consists of three main parameters: the folding sequence, the rotation angle, and the folding displacement. Therefore, when coding, an appropriate representation method needs to be selected. When using binary coding, a fixed-length bit string can be used, and each bit segment corresponds to the rotation angle or displacement amount of a specific folding operation. This method is simple to calculate and easy to implement genetic operations. However, due to the limited numerical precision that binary coding may cause, in cases where higher resolution is required, a real-number coding method can be adopted, directly using floating-point numbers to represent the rotation angle and folding displacement, thereby improving the calculation accuracy. To ensure the diversity of the population, the individual length needs to be long enough to accommodate all possible folding path variations, while avoiding excessive growth that may lead to an increase in computational complexity. After coding, each folding path individual can be optimized by adjusting the gene bits, laying the foundation for genetic operations.

[0067] In the genetic optimization process, the quality of each folding path individual is determined by the fitness function. The fitness calculation is based on the optimization objective function, where the path length, interference detection score, and folding order rationality score are the core evaluation indicators. The path length is calculated based on the sum of the rotation angles and the sum of the translation distances of all folding steps. The shorter the folding path, the higher the fitness. The interference detection score calculates whether geometric conflicts occur during the folding process through simulation, such as whether the folding surfaces cross or are too close to each other. If interference is detected, the fitness decreases. The folding order rationality score analyzes the topological dependence relationship to determine whether the folding operations are executed in the correct order. For example, some folding surfaces must be completed before others, otherwise the path is unreasonable. After calculating the fitness value based on these scores, a tournament selection strategy is adopted. Several individuals are randomly selected from the current population for comparison, and the individuals with higher fitness are selected to enter the next generation. In this way, it can be ensured that high-quality folding paths are preferentially retained during the iteration process, while avoiding the reduction of population diversity caused by a simple optimal selection strategy.

[0068] During the optimization process, in order to further improve the path quality, it is necessary to perform crossover and mutation operations on the selected excellent individuals. The crossover operation is used to recombine the folding paths, enabling different path individuals to exchange folding orders or rotation angles with each other to explore new folding strategies. An adaptive crossover rate method is adopted, reducing the crossover rate for individuals with high fitness to reduce the possibility of destroying the optimized paths, while increasing the crossover rate for individuals with low fitness to increase the search space. The mutation operation is used to adjust the parameters of the folding path individuals, randomly modifying the rotation angle or adjusting the folding order in the folding path individuals to prevent the algorithm from falling into local optima. The mutation probability is set to a relatively low value, usually ranging from 0.01 to 0.05, to provide appropriate perturbations while ensuring the stability of the population and avoiding premature convergence of the search space. The optimized new generation of folding paths is input into the next round of calculations, and this process is repeated until the population converges, that is, the fitness changes of all paths tend to be stable, and finally the optimal folding path that meets the optimization goal is obtained.

[0069] Among the selected excellent individuals, crossover and mutation operations are performed to improve the optimization effect of the folding path. The crossover rate and the mutation rate are respectively implemented using the following formula 2 and formula 3: ; ; where, is the crossover probability of the current individual; is the mutation probability of the current individual; both are dynamically adjusted according to the fitness value of the current individual, so that the crossover rate of individuals with better fitness is reduced to avoid destroying the existing excellent paths, while the crossover rate of individuals with poorer fitness is higher to enhance the exploration ability. The fitness function can be implemented using the following formula: ; where, represents the fitness value; is the calculated value of the optimization objective function obtained according to formula 1.

[0070] At the same time, the mutation rate of individuals with poorer fitness is increased to increase the diversity of the search space and prevent the algorithm from falling into local optima.

[0071] is the maximum value of the crossover probability, indicating the highest crossover rate in the case of poorer fitness to encourage recombination of poorer individuals.

[0072] is the maximum value of the mutation probability, indicating that the mutation probability of individuals with lower fitness is larger to enhance the global search ability.

[0073] is the maximum fitness value in the current population; is the average fitness value of the current population; is the minimum fitness value in the current population; is the individual 's fitness value, which is used to calculate the relative fitness level of the current individual in the population; is a very small value, and the recommended value range is , which is used to prevent numerical calculation errors caused by a zero denominator.

[0074] is the mutation control parameter, and the recommended value is 1.5. This parameter is used to control the change range of the mutation probability. The larger the value, the faster the mutation probability of individuals with poor fitness grows, thereby enhancing the exploration ability of individuals with low fitness.

[0075] Through this adaptive crossover rate and mutation rate adjustment method, during the genetic algorithm optimization process, the optimization of the folding path is more stable, the genetic information of high-quality paths can be better retained, and the mutation of low-quality paths enhances the diversity of the search space, enabling the optimization process to converge more efficiently to the optimal folding path that meets the optimization goal.

[0076] Step S104: Perform a simulation analysis on the generated folding path, identify possible structural interferences during the folding process, and correct the path.

[0077] In step S104, the folding path generated based on the intelligent optimization algorithm needs to undergo a simulation analysis to ensure that no structural interference occurs during the folding process and to correct possible interference situations to improve the stability and executability of the folding process. Since the optimization process of the folding path mainly relies on mathematical models and computational optimization, there may be some complex physical interactions in practical applications that cannot be directly predicted by the optimization algorithm. Therefore, it is necessary to further verify the feasibility of the folding path through simulation analysis and make necessary adjustments.

[0078] The first step of the simulation analysis is to perform a three-dimensional modeling of the folding path and reproduce the folding process of the packaging box in a virtual environment. To ensure the accuracy of the simulation results, it is necessary to construct a dynamic model of the packaging box based on the calculation results of the folding path. This model should include the geometric information of all folding surfaces, the definition of folding axes, material properties, and kinematic constraints. The simulation system can use rigid body dynamics simulation tools, such as the method based on finite element analysis, to simulate the interaction between each surface during the folding process with high precision. During the folding process of the packaging box, each folding surface rotates around the folding axis. The simulation system needs to calculate the position and angle changes of each folding surface at different folding stages and detect whether geometric interference occurs during the folding process.

[0079] During the simulation analysis process, it is necessary to focus on detecting possible interference situations during the folding process. Interference detection can adopt methods based on the Bounding Volume Hierarchy (BVH), or perform precise contact analysis based on the finite element method. The bounding box detection method can quickly determine whether there are obvious structural conflicts in the folding path, such as two folding surfaces overlapping during the folding process. The finite element method can further analyze problems such as material deformation and stress concentration to ensure that irreversible damage will not occur due to material properties during the folding process. For example, in some cases, the folding path may cause excessive stress concentration on a certain folding surface, resulting in cracks or permanent deformation of the material. Through stress analysis, these risks can be identified in advance and adjusted.

[0080] If structural interference or unreasonable folding is detected during the simulation process, the folding path needs to be corrected. The correction methods can include adjusting the folding order, modifying the rotation angles in the folding path, adding intermediate buffer folding steps, or introducing additional auxiliary support structures. When adjusting the folding order, the dependency relationship of the folding surfaces can be recalculated, and the folding sequence can be optimized to avoid subsequent folding being blocked due to some surfaces folding too early. When adjusting the rotation angles, the rotation constraints can be reset for different folding surfaces to ensure that the folding angles do not exceed the limits allowed by the material. For cases where intermediate buffer steps need to be added, temporary stop points can be introduced so that some surfaces are partially folded first during the folding process and then continue to fold after other parts are folded, to reduce the interference risk.

[0081] The correction process can also be automatically optimized using intelligent optimization methods. For example, genetic algorithms or particle swarm optimization methods can be used to locally adjust the folding path with interference and continuously test the new path in the simulation environment until the optimal folding scheme is found. The corrected folding path needs to be re - simulated to verify whether the new path can eliminate structural interference and ensure the stability of the folding process. The entire simulation and correction process can be optimized through multiple rounds of iteration, so that the finally determined folding path not only meets the optimization objectives but also satisfies the feasibility of actual operation.

[0082] Through these steps of simulation analysis and path correction, it can be ensured that the folding path of the packaging box will not have mechanical interference or folding failure during execution, improving the reliability of the folding process and providing accurate folding path data for subsequent automated execution.

[0083] Furthermore, the simulation analysis of the generated folding path, identifying possible structural interference during the folding process and correcting the path, includes: Based on the optimized folding path results, a simulation model of the folding process of the packaging box is constructed, including the geometric information of the folding surfaces, the parameters of the folding axes, the folding sequence, and the kinematic constraints. The relative movement trajectories of the folding surfaces during the folding process are simulated using a physical simulation engine to generate an initial simulation folding path dataset; Perform dynamic interference detection in the simulated folding path dataset. Adopt a collision detection algorithm based on the bounding volume hierarchy to calculate the minimum distance between the folding surfaces during the folding process, and identify the infeasible states caused by the folding sequence to generate an interference marking matrix; Use the interference marking matrix to adjust the rotation angle, folding sequence, and intermediate pause points in the folding path. Iteratively correct the folding trajectory through a path optimization algorithm to generate a corrected interference-free optimal folding path, and output it to the subsequent automated execution device for folding operations.

[0084] Furthermore, the generated folding path is subjected to simulation analysis to identify possible structural interferences during the folding process and perform path correction, including: Based on the optimized folding path results, a simulation model of the folding process of the packaging box is constructed, including the geometric information of the folding surfaces, the parameters of the folding axes, the folding sequence, and the kinematic constraints. The relative movement trajectories of the folding surfaces during the folding process are simulated using a physical simulation engine to generate an initial simulation folding path dataset; Perform dynamic interference detection in the simulated folding path dataset. Adopt a collision detection algorithm based on the bounding volume hierarchy to calculate the minimum distance between the folding surfaces during the folding process, and identify the infeasible states caused by the folding sequence to generate an interference marking matrix; Use the interference marking matrix to adjust the rotation angle, folding sequence, and intermediate pause points in the folding path. Iteratively correct the folding trajectory through a path optimization algorithm to generate a corrected interference-free optimal folding path, and output it to the subsequent automated execution device for folding operations.

[0085] In the implementation process, it is first necessary to construct a simulation model of the folding process of the packaging box based on the calculation results of the optimized folding path to ensure that the folding path is fully verified before execution and can accurately reflect the physical interactions that may occur during the folding process. The construction of the simulation model involves multiple key parameters, including the geometric information of the folding surfaces, the spatial position of the folding axes, the execution order of each folding step, material properties, and kinematic constraint conditions. The geometric information of the folding surfaces includes the length, width, thickness, edge curvature of each folding surface, and the coordinates of the folding lines, which determine the movement trajectories of each surface during the folding process. The spatial position of the folding axes defines the center line around which each folding surface rotates, and an accurate rotation reference point needs to be established in combination with the topological structure of the packaging box. The setting of the folding order must ensure compliance with reasonable execution logic to avoid subsequent folding surfaces being blocked by the already folded surfaces, resulting in the inability to complete the folding action. Material properties include the elastic modulus, yield limit, bending strength, etc. of the folding surfaces, which directly affect the feasibility of the folding angle and folding order. When establishing kinematic constraints, it is necessary to consider the motion characteristics of the execution device, such as the maximum rotation angle of the robotic arm, the force range of the gripper, and the rebound effect that may occur during the folding process, to ensure that the optimized path can be executed by the actual device.

[0086] After constructing the simulation model, it is necessary to use a physical simulation engine to simulate the relative motion trajectories of each folding surface during the folding process to generate an initial simulation folding path dataset. During the simulation process, the force analysis of each folding surface is carried out according to the calculation results of the optimized path, simulating whether the folding surface is restricted or blocked by other surfaces during rotation and movement. The physical simulation engine can adopt the rigid body dynamics solution method to calculate the pose change of the folding surface at a specific time step and record the motion trajectories, rotation angles, force conditions, and deformation conditions of all folding surfaces. During the simulation process, it is also necessary to introduce a contact mechanics analysis module to detect the contact state between the folding surfaces and judge whether material rupture, rebound, or excessive deformation will occur during the folding process. Through multiple simulation iterations, a stable initial simulation folding path dataset can be generated. This dataset contains the time step change information, rotation matrix, displacement vector, and stress distribution of each folding surface, providing basic data for subsequent interference detection.

[0087] After the simulation folding path dataset is generated, dynamic interference detection needs to be performed to identify possible structural conflicts, motion interferences, or physically infeasible states during the folding process. The key to interference detection lies in calculating the spatial occupancy of each folding surface at different folding steps in real time and determining whether there is geometric intersection or mutual collision of the folding surfaces. The interference detection uses a collision detection algorithm based on the Bounding Volume Hierarchy (BVH). This algorithm can efficiently construct the hierarchical bounding boxes of the folding surfaces and calculate the minimum distance between each folding surface in real time during the folding process. Specifically, first, an initial bounding box is created for each folding surface, and the bounding box can be constructed using an Axis-Aligned Bounding Box (AABB) or an Oriented Bounding Box (OBB). During the folding process, whenever a folding surface rotates or displaces, the position of the bounding box is updated in real time, and the intersection of its bounding box with other folding surfaces is calculated. If it is detected that the bounding boxes overlap, it indicates the existence of structural interference. In addition, it is necessary to combine the dependency relationship of the folding path to identify infeasible states caused by the folding order. For example, when a folding surface is folded before its dependent surface is folded, the path is determined to be an invalid path and marked in the interference detection result. All detected interference situations are recorded in the interference marking matrix, which is used to store all possible folding conflict information, including collisions between folding surfaces, excessive rotation angles, incorrect folding path order, etc., providing input data for path correction.

[0088] After the interference detection is completed, the interference marking matrix needs to be used to adjust the folding path to ensure the executability of the final folding path and optimize the folding order, rotation angle, and intermediate stop points. For interference problems caused by excessive rotation angles, the maximum rotation angle can be adjusted based on the material properties of the folding surface, and the folding angle range can be constrained in the optimized path to make it conform to the bending limit of the material. For interference problems caused by unreasonable folding order, a topological sorting method can be used to rearrange the folding steps to ensure that all folding operations are performed in a reasonable order. For example, by recalculating the dependency relationship between the folding surfaces and adjusting the execution order of the folding surfaces to conform to the geometric topology of the packaging box. For cases where intermediate stop points need to be introduced, buffer operations can be introduced during the folding process to make some folding surfaces fold to an intermediate state first and then perform subsequent folding to reduce the risk of structural interference. In addition, intelligent optimization methods based on genetic algorithms or particle swarm optimization algorithms can be used during the path optimization process. During the optimization process, the folding path is continuously adjusted, and interference detection is performed after each round of optimization to ensure that the final folding path has no collisions, no order conflicts, and is executable. After the optimization is completed, a corrected interference-free optimal folding path is generated and output to the automated execution device to ensure that the folding path can be executed smoothly and finally achieve the efficient folding and forming of the packaging box.

[0089] Step S105: Import the corrected optimal folding path into the automated execution device, and drive the execution device to perform automated folding actions on the packaging box according to the path planning.

[0090] In step S105, based on the optimized and corrected optimal folding path, it is necessary to import the path data into the automated execution device so that the device can drive the folding operation of the packaging box according to the planned path. To ensure the precise execution of the folding process, the folding path needs to be converted into control instructions recognizable by the automated device and dynamically adjusted in combination with the mechanical characteristics of the execution device, so that the actual folding actions strictly follow the calculated optimal path and at the same time adapt to the kinematic limitations and operation accuracy requirements of the device.

[0091] First of all, it is necessary to convert the corrected folding path into control instructions applicable to the automated execution device. This conversion process involves the mapping of coordinate systems, that is, converting the folding angles, rotation axes, and folding sequences in the folding path into operable parameters of the automated device. Usually, the folding path is represented in three-dimensional coordinates during the optimization process, while the automated device may adopt different motion control methods. For example, a robotic arm may be based on joint angle control, while a linear actuator may be based on linear displacement control. Therefore, it is necessary to establish a mapping relationship from the folding path to the device control parameters to ensure that the execution device can correctly execute the folding operation according to the planned path. For example, in the case of using a six-axis robotic arm to perform folding, it is necessary to calculate the motion trajectories of the joints of the robotic arm according to the rotation angles of each folding surface of the packaging box and perform synchronous control in the time dimension to ensure that multiple folding surfaces are folded in the correct time sequence during the folding process and avoid physical interference between different folding steps.

[0092] After the conversion of the folding path is completed, it is necessary to transfer the path data to the automated control system and adjust it in combination with the dynamic characteristics of the execution device. The automated execution device may include different types of mechanisms such as robotic arms, folding molds, linear drive mechanisms, and pressing devices. Each mechanism has different response times, maximum motion speeds, and execution accuracies when performing folding tasks. For example, the motion inertia of the robotic arm may cause execution errors in the folding path, so a dynamic compensation mechanism needs to be added during the control process to eliminate errors caused by device inertia or elastic deformation. In addition, multiple different execution mechanisms may be involved in the folding process working together. For example, some folding operations require the robotic arm to perform the initial folding first, and then the pressing device to complete the final fixation. Therefore, during the execution of the folding path, it is also necessary to coordinate the actions of multiple execution mechanisms so that the execution of the folding path strictly follows the planned sequence.

[0093] During the execution of the folding path, it is also necessary to monitor the folding state in real time to ensure the accuracy and stability of the folding action. Various sensor technologies can be adopted, such as optical sensors, torque sensors, laser range sensors, etc., to detect the morphological changes of the packaging box in real time during the folding process, and compare the detection results with the folding path. If a deviation is detected between the actual folding state and the planned path, error compensation needs to be performed by adjusting the execution parameters in real time. For example, if the sensor detects that the folding angle deviation of a certain folding surface exceeds the allowable range, the folding angle can be corrected by adjusting the motion trajectory of the robotic arm or applying an additional pressing force. In addition, if an accidental interference occurs during the execution, for example, some folding surfaces do not fit completely due to material springback, the folding can be ensured to be successfully completed by adjusting the execution sequence or adding auxiliary jigs.

[0094] After the entire folding path is executed, it is also necessary to conduct quality inspection on the finally folded packaging box to ensure that the folding process meets the expected goals. The quality inspection can be carried out by using a computer vision system for three-dimensional scanning, comparing the morphology of the folded packaging box, and checking whether it matches the target folding state. If a large morphological deviation of the packaging box is detected, the folding path or the control parameters of the execution device can be adjusted to optimize the quality of subsequent folding. In addition, torque sensors can also be used to detect the folding force applied during the folding process to ensure that the material is not damaged or deformed due to excessive stress during the folding process.

[0095] Finally, through the precise control and real-time monitoring of the automated device, it is ensured that the folding path of the packaging box is executed according to the optimal plan, realizing efficient, stable, and precise folding operations, and improving the forming quality and production efficiency of the packaging box.

[0096] Furthermore, importing the corrected optimal folding path into the automated execution device to drive the execution device to perform automated folding actions on the packaging box according to the path planning includes: Converting the corrected optimal folding path into control instructions recognizable by the execution device, including the rotation angle of the folding surface, the folding sequence, the displacement path, and the target docking point, and performing motion trajectory interpolation based on the kinematic characteristics of the device to generate a folding path control data set; Loading the folding path control data set into the control system of the automated execution device, adjusting the folding execution parameters through a real-time feedback mechanism, using sensors to monitor the actual motion trajectory of the folding surface, detecting whether there is a deviation, and dynamically correcting the execution path when the deviation exceeds the set threshold; After folding, automatically detect the folding quality of the packaging box, collect the morphological data of the folded packaging box, and perform a matching comparison with the folding target state. If a morphological deviation is detected, adjust the folding path control data and update it to the automated execution device to optimize subsequent folding operations.

[0097] In the implementation process, it is first necessary to convert the corrected optimal folding path into control instructions recognizable by the automated execution device to ensure that the device can perform the folding task according to the optimized calculation results. The conversion of the folding path involves multiple parameters, including the rotation angle of the folding surface, the folding sequence, the displacement path, and the target docking point. The rotation angle of the folding surface determines the amplitude of rotation of each folding surface around its folding axis, and it is necessary to ensure that the folding angle is within the elastic limit of the packaging box material to avoid material damage caused by excessive folding. The folding sequence must be consistent with the optimized path to ensure that the folding operation is performed in the established order and prevent the folding surface from performing operations without completing the previous operations, resulting in path execution failure. The displacement path is used to describe the spatial displacement of each folding surface during the folding process to ensure that each folding surface is folded in the correct direction and avoids possible structural interference. The target docking point defines the final static position of the folding surface after completing the folding action to ensure that after folding, all parts of the packaging box can be correctly fitted to meet the requirements of the final form.

[0098] During the conversion of the folding path, it is also necessary to combine the kinematic characteristics of the automated execution device to perform motion trajectory interpolation to generate a folding path control data set that conforms to the motion capabilities of the device. Since different execution devices have different motion methods, for example, robotic arms usually use joint angle control, while linear actuators use linear displacement control, it is necessary to adapt the motion parameters in the folding path to meet the operation requirements of the execution device. Motion trajectory interpolation can be based on spline curve interpolation or quintic polynomial interpolation methods to ensure the smoothness of the folding path and avoid unstable device operation caused by sudden motion instructions. The finally generated folding path control data set contains the execution parameters of all folding steps and is stored in a format recognizable by the device as the input data for subsequent folding execution.

[0099] After the generation of the folding path control data set is completed, it needs to be loaded into the control system of the automated execution device to drive the device to perform the folding task. During the folding process, in order to ensure the precise execution of the folding path, it is necessary to use a real-time feedback mechanism to dynamically adjust the folding execution parameters. By installing various sensors on the execution device, such as optical sensors, torque sensors, and laser rangefinders, the actual motion trajectory of the folding surface can be monitored in real time, and the collected data can be compared with the folding path control data set. If it is detected that there is a deviation between the actual execution of the folding path and the predetermined path, such as insufficient folding angle or the folding surface not reaching the target docking point, it is necessary to dynamically correct the execution path. The correction methods can include adjusting the control parameters of the folding angle, compensating for displacement errors, or adjusting the clamping force of the execution device to ensure that the folding action is precisely executed according to the planned path.

[0100] After the folding task is completed, it is also necessary to automatically detect the folding quality of the packaging box to ensure that the final form is consistent with the target state. Quality inspection can be based on computer vision technology, using three-dimensional scanning or image processing methods to collect the morphological data of the folded packaging box and match it with the folding target state. If any deviation in the form of the packaging box is detected, such as misaligned folding edges, folding angle errors exceeding the set range, or slight deformation during the folding process, it is necessary to adjust the folding path control data and input the updated data into the automated execution device to optimize subsequent folding operations. The optimized folding path can be dynamically adjusted according to the detection feedback. For example, in the next round of execution, additional auxiliary clamping steps during the folding process can be added, or the compensation parameters for the folding angle can be optimized to improve folding accuracy and stability. Through this closed-loop control system, it can be ensured that the folding path reaches the optimal state during continuous optimization, and the folding quality of the packaging box always meets the expected standards.

[0101] The second embodiment of the present application provides an electronic device, and the electronic device includes: A processor; A memory for storing a program, which when read and executed by the processor, executes a method for planning the folding path of a packaging box based on an intelligent optimization algorithm provided in the first embodiment of the present application.

[0102] The third embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it executes a method for planning the folding path of a packaging box based on an intelligent optimization algorithm provided in the first embodiment of the present application.

[0103] Although the present application is disclosed above with preferred embodiments, it is not intended to limit the present application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the protection scope of the present application should be subject to the scope defined by the claims of the present application.

Claims

1. A method for planning the folding path of a packaging box based on an intelligent optimization algorithm, characterized in that, Including: Obtain the unfolded state data and the folded target state data of the packaging box, establish a mathematical mapping model between the unfolded state and the folded target state through feature point marking, and determine the state transition constraint conditions during the folding process of the packaging box; According to the mathematical mapping model, construct an optimization function with the goals of the shortest folding path length, the least number of interference times, and the optimal folding action sequence; Use an intelligent optimization algorithm to solve the optimization function, and generate the optimal folding path of the packaging box from the unfolded state to the target state through iterative optimization; Conduct a simulation analysis on the generated folding path, identify possible structural interferences during the folding process, and perform path correction; Import the corrected optimal folding path into an automated execution device, and drive the execution device to perform an automated folding action on the packaging box according to the path planning.

2. The method for planning the folding path of the packaging box based on the intelligent optimization algorithm according to claim 1, wherein, The obtaining of the unfolded state data and the folded target state data of the packaging box, establishing a mathematical mapping model between the unfolded state and the folded target state through feature point marking, and determining the state transition constraint conditions during the folding process of the packaging box includes: Obtain the unfolded form data of the packaging box, extract the geometric information of the edges of the folding surfaces, the endpoints of the folding lines, and the connection parts, and generate an initial data set containing the coordinates of all key feature points; Based on the initial data set, construct the topological relationship of the folding surfaces of the packaging box, and set unique identifiers at the endpoints of the folding lines, the junctions of the folding surfaces, and the target bonding positions, and generate a feature point matrix for describing the relative position changes of the folding surfaces; Using the feature point matrix, combined with the folding sequence constraint, the maximum folding angle constraint, and the boundary contact relationship, establish a mathematical mapping model between the states during the folding process, and generate a state transition matrix.

3. The method for planning the folding path of the packaging box based on the intelligent optimization algorithm according to claim 2, wherein The constructing of the topological relationship of the folding surfaces of the packaging box based on the initial data set, and setting unique identifiers at the endpoints of the folding lines, the junctions of the folding surfaces, and the target bonding positions, and generating a feature point matrix for describing the relative position changes of the folding surfaces includes: Perform geometric topological analysis on the initial data set, establish an adjacency relationship graph between the folding surfaces, calculate the normal vector angles between the folding surfaces using the spatial vector analysis method, and determine the priority of the folding axes based on the boundary collinearity rule of the folding surfaces to form a folding surface connection structure based on topological constraints; At the endpoints of the folding lines, the junctions of the folding surfaces, and the target bonding positions, use the unique identifier coding method to assign a globally unique index to each feature point, and establish a multi-dimensional correlation matrix to record the position change trajectory, rotation angle, and constraint state of the feature points during the folding process to ensure the traceability and computability of the mathematical mapping; Using the correlation matrix, combined with the feasible folding path optimization strategy, simulate the influence of different folding sequences, and calculate the optimal movement mode of the folding surfaces at each stage based on the principle of minimum energy to generate a feature point matrix.

4. The method for planning the folding path of the packaging box based on the intelligent optimization algorithm according to claim 1, characterized in that The constructing of an optimization function with the goals of the shortest folding path length, the least number of interference times, and the optimal folding action sequence according to the mathematical mapping model includes: Based on the relationship of feature points of the mathematical mapping model, a parametric description method of the folding path of the packaging box is established, and the state variables of the folding path are defined, including the rotation angle of the folding surface, the position of the folding axis and the folding order, and a path representation matrix for optimization calculation is generated; Using the path representation matrix, an optimization objective function for the folding path is constructed, where the shortest path length term is calculated from the folding rotation angle and the translation distance, the minimum interference times term is determined by a real-time collision detection function, and the optimal folding order term establishes the folding dependency relationship based on the topological sorting method, and a multi-objective optimization function is generated; Folding mechanical constraints and execution device constraints are introduced into the optimization function, a feasible folding angle range, a maximum stress threshold and the motion boundary of the execution mechanism are set, a constrained optimization problem is formed, and the folding path evaluation index required for the optimization solution is output for iterative optimization calculation by the intelligent optimization algorithm.

5. The method for planning the folding path of the packaging box based on the intelligent optimization algorithm according to claim 4, wherein The optimized objective function Adopts the following Formula 1: ; Among them, is the weight factor for folding path optimization, which determines the influence weights of the folding path length and the motion cost in the overall optimization objective; represents the total number of folding surfaces of the packaging box; is the folding surface 's weight coefficient; is the folding surface 's rotation angle around the folding axis during the folding process; is the folding surface 's translational displacement during the folding process; is the interference optimization weight factor; is the total number of folding steps that need to detect interference during the folding process; is the volume of the folding surface at the folding step ; is the folding step 's shortest Euclidean distance between the folding surface and the previous folding surface; is the folding step 's shortest Euclidean distance between the folding surface and the unfolded surface; is the folding order optimization weight factor; is the total number of folding order constraints involved in the folding path, that is, the number of all folding operations that must be performed in a specific order; represents the folding step 's actual execution time step after the optimization solution; represents the folding step 's time step in the theoretically optimal folding order; is the stress optimization weight factor; is the total number of folding surfaces involved in the stress analysis during the folding process; represents the folding surface 's maximum normal stress during the folding process; represents the folding surface 's maximum shear stress during the folding process; is the energy consumption optimization weight factor; is the total number of time steps involved in the execution of the folding path; is the instantaneous power consumption at the execution moment of the folding path ; is the execution duration at the execution moment of the folding path .

6. The folding path planning method of the packaging box based on the intelligent optimization algorithm according to claim 5, characterized in that Solving the optimization function by using the intelligent optimization algorithm, and generating the optimal folding path of the packaging box from the unfolded state to the target state through iterative optimization, including: Based on the objective constraints of the optimization function, the search space of the folding path is initialized, and a folding state encoding method is adopted to construct a computable folding path individual set from different folding sequences, rotation angles and folding surface displacement parameters to form an initial population; For the initial population, the intelligent optimization algorithm is used for path iterative optimization, and the fitness of each folding path is calculated, including path length calculation, interference detection scoring and folding order rationality scoring, and excellent paths are selected for crossover, mutation and update based on the fitness level, so as to generate a new generation of folding paths; During the path optimization process, combined with the dynamic folding simulation feedback mechanism, the generated folding path is evaluated in real time. If an infeasible path is detected, the folding order or the rotation angle constraint is adjusted, and the updated path is input into the next round of optimization iteration until it converges to the optimal folding path that meets the optimization goal.

7. The method for planning the folding path of the packaging box based on the intelligent optimization algorithm according to claim 6, characterized in that, Using the intelligent optimization algorithm for path iterative optimization, specifically using the genetic algorithm for solution, including: Gene encoding is performed on each folding path individual in the initial population, and binary or real number encoding methods are used to represent the folding sequence, rotation angle and folding displacement, and the individual length is defined so that each path can be optimized and adjusted through the operation of gene bits; Calculate the fitness value of each folding path individual according to the optimization objective function. The fitness value is calculated by weighting the path length, interference detection scoring and folding order rationality scoring, ensuring that the folding path corresponding to the individual with higher fitness is better, and adopting the tournament selection strategy, randomly selecting several individuals for comparison, and selecting the individuals with higher fitness to enter the next generation; Among the selected excellent individuals, perform crossover and mutation operations. Adjust the recombination method of the folding path sequence through an adaptive crossover rate, so that some paths exchange the folding order and rotation angle. At the same time, set the mutation probability, randomly modify the rotation angle or adjust the folding order on the folding path individuals to increase the diversity of the population, avoid convergence to a local optimum, and input the optimized new generation of paths into the next round of iterative calculation until convergence to the optimal folding path that meets the optimization goal.

8. The method for planning the folding path of the packaging box based on the intelligent optimization algorithm according to claim 1, wherein Perform simulation analysis on the generated folding path, identify possible structural interferences during the folding process and perform path correction, including: Based on the folding path optimization results, construct a simulation model of the folding process of the packaging box, which includes folding surface geometric information, folding axis parameters, folding order, and kinematic constraints, and use a physical simulation engine to simulate the relative movement trajectories of each folding surface during the folding process to generate an initial simulation folding path dataset; Perform dynamic interference detection in the simulation folding path dataset, use a collision detection algorithm based on the bounding volume hierarchy to calculate the minimum distance between each folding surface during the folding process, and identify the infeasible states caused by the folding order to generate an interference marking matrix; Use the interference marking matrix to adjust the rotation angle, folding order, and intermediate stop points in the folding path, iteratively correct the folding trajectory through a path optimization algorithm to generate a corrected interference-free optimal folding path, and output it to the subsequent automated execution device for folding operations.

9. The method for planning the folding path of a packaging box based on an intelligent optimization algorithm according to claim 1, wherein Import the corrected optimal folding path into the automated execution device, and drive the execution device to perform automated folding actions on the packaging box according to the path planning, including: Convert the corrected optimal folding path into control instructions recognizable by the execution device, including folding surface rotation angle, folding order, displacement path, and target docking point, and perform motion trajectory interpolation based on the kinematic characteristics of the device to generate a folding path control dataset; Load the folding path control dataset into the control system of the automated execution device, and adjust the folding execution parameters through a real-time feedback mechanism. Use sensors to monitor the actual movement trajectory of the folding surface, detect whether there are deviations, and dynamically correct the execution path when the deviation exceeds the set threshold; After folding is completed, automatically detect the folding quality of the packaging box, collect the morphological data of the folded packaging box, and match and compare it with the folding target state. If a morphological deviation is detected, adjust the folding path control data and update it to the automated execution device to optimize subsequent folding operations.

Citation Information

Cited By

  • Three-dimensional reconstruction system and method for three-dimensional expanded view

    CN120852696A

  • Lifting robot three-dimensional construction path planning method and system

    CN121209509A