Three-dimensional loading optimization method and equipment based on particle swarm optimization, and medium
By using the particle swarm optimization method, the problems of center of gravity instability, low space utilization, and low efficiency with multiple orders in the traditional manual loading mode have been solved, realizing an efficient and safe loading solution that improves space utilization and transportation efficiency.
Patent Information
- Application Number
- CN202511038705.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2025-11-11
AI Technical Summary
Traditional manual loading methods struggle to quantify complex physical constraints, leading to risks of center of gravity instability, low space utilization, and low efficiency in delivering multiple orders. Existing optimization algorithms lack the ability to collaboratively model pallet data encapsulation and multi-dimensional constraints.
A three-dimensional loading optimization method based on particle swarm optimization is adopted. By defining the size and volume of the car body, generating pallet data, calculating fitness, constructing a particle swarm, updating the optimal solution, and outputting the optimal loading scheme, the method achieves quantitative control over the center of gravity, space utilization, and order.
It improved loading safety, increased space utilization, simplified operating procedures, reduced transportation costs and employee training time, and improved the efficiency of mixed loading of multiple orders.
Smart Images

Figure CN120922636A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent loading technology, specifically to a three-dimensional loading optimization method, equipment, and medium based on particle swarm optimization algorithm. Background Technology
[0002] In the furniture logistics and transportation sector, loading schemes must simultaneously meet stringent requirements for cargo transportation safety, efficient utilization of truck space, and timely delivery of multiple orders. Traditional manual loading methods rely on experience-based decisions and suffer from systemic technical deficiencies: Firstly, they struggle to quantify complex physical constraints, such as controlling longitudinal center of gravity offset within ±10% of the truck's centerline and lateral offset ≤ ±5%, while the overall vehicle center of gravity height must not exceed 1 / 3 of the truck's height (e.g., ≤ 1.4 meters for a 4.2-meter truck). Manual placement is prone to instability risks due to disordered stacking of heavy furniture (such as solid wood wardrobes) and light furniture (such as fabric sofas). Secondly, this results in low space utilization (only 60%-70%), failing to achieve the industry target of ≥80%, especially inefficiently implementing rules such as vertical placement of rectangular furniture (gap ≤ 3cm) and curved furniture requiring symmetrical placement. Furthermore, when multiple orders are mixed, manual loading struggles to adhere to the "load first, unload later" principle, leading to a significant increase in time spent searching for goods during delivery. Existing optimization algorithms generally lack the ability to collaboratively model pallet data encapsulation (total volume / maximum load capacity / maximum package length, etc.) and multi-dimensional constraints (length priority / load capacity classification / bottom area limitation), and there is an urgent need to develop new intelligent algorithms to break through the technical bottleneck of loading scheme optimization. Summary of the Invention
[0003] In view of this, the present invention provides a three-dimensional loading optimization method, device and medium based on particle swarm optimization algorithm to solve the above problems.
[0004] To address the above technical problems, this invention provides a three-dimensional loading optimization method based on particle swarm optimization, comprising:
[0005] Define the dimensions and volume of the carriage, generate pallet data that matches the dimensions and volume of the carriage based on the package information of the pre-loaded vehicle, and extract the arrangement order and grouping information;
[0006] Calculate the volume ratio after pallets are loaded onto the truck, parse the position vectors to obtain the pallet arrangement order and grouping scheme, and obtain the total volume within each group, the maximum length within the group, the maximum bottom area within the group, and the required space length for each grouping scheme;
[0007] Calculate the constraints for total length, length priority, load-bearing priority, and bottom area respectively to obtain the fitness of individual groups and the overall fitness;
[0008] Construct a particle swarm, initialize particle positions and velocities, define position vectors, and set boundary constraints;
[0009] Update the individual optimal solution and the global optimal solution, and output the optimal loading plan.
[0010] As an optional method, pallet data includes the total number of pallets, pallet volume, maximum pallet length, maximum pallet bottom area, and pallet load rating.
[0011] As an optional method, extracting the permutation order and grouping information includes:
[0012] The extracted information is split into an array of sorted order, an array of grouped information, and an array of group numbers.
[0013] As an optional method, parsing the position vectors to obtain the tray arrangement order and grouping scheme includes:
[0014] Sort the position vectors, obtain the sorted indices, and perform group mapping;
[0015] Obtain the maximum package length, maximum package base area, total volume within the group, and required space length for each group. The required space length is defined based on the total volume of the group and the maximum package length.
[0016] As an optional approach, after constructing a particle swarm and initializing particle positions and velocities, the position vector is defined as follows:
[0017] Initialize the particle swarm and randomly generate the position and velocity of each particle;
[0018] Define the position vector of the preset particle; the position vector parameters include the size of the particle swarm, the problem dimension, and the position of the particle in the preset dimension.
[0019] Define the velocity vector of the preset particles; the velocity vector parameters include the size of the particle swarm, the problem dimension, and the velocity of the example in the preset dimension.
[0020] The issue dimension is determined based on the number of trays.
[0021] As an optional approach, the position of each particle is generated by uniform random generation within the boundary range of each dimension; the speed at which each example is generated is uniform random generation within the symmetric interval.
[0022] In addition to generating position and velocity, the fitness value of each particle is also calculated.
[0023] As an optional approach, updating the individual optimal solution and the global optimal solution includes:
[0024] For any particle, if the fitness value of its current position is less than the fitness value of its historical best position, then its individual best solution is updated to its current position.
[0025] For each particle, a calculation is performed, and the position with the minimum fitness is selected as the global optimal solution from all the individual optimal solutions of the particles.
[0026] As an alternative approach, when selecting the position with the minimum fitness as the global optimum from among all the individual optimal solutions of particles, the following also applies:
[0027] The position and velocity of the particle are updated, and inertial weight decay is set. After ensuring that the particle is within the preset range, its velocity is limited, and position limitation and mirror reflection processing are performed. Finally, the global optimal solution is returned.
[0028] On the other hand, the present invention also provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the three-dimensional loading optimization method based on the particle swarm optimization algorithm described above.
[0029] On the other hand, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the three-dimensional loading optimization method based on the particle swarm optimization algorithm described above.
[0030] The core advantages of the particle swarm optimization loading algorithm:
[0031] Compared to traditional manual methods and other algorithms, the core advantages of the particle swarm optimization loading algorithm are reflected in three aspects:
[0032] Modeling approach based on pallets
[0033] To better fit the actual storage scenario in a warehouse (where multiple identical pieces of furniture are placed on the same pallet), the "single piece of furniture" is simplified to "pallet" processing, reducing the amount of calculation by 60% while maintaining accuracy.
[0034] Multidimensional fitness function design
[0035] By using penalty terms P1 to P4, fuzzy rules such as "center of gravity, space, and order" are transformed into quantitative indicators, allowing the algorithm to directly judge the quality of the solution (traditional algorithms often ignore some constraints, such as only considering space and not the center of gravity).
[0036] Efficient optimization of particle swarm iteration
[0037] Guided by the principle of "individual optimality + global optimality", the optimal solution can be found from 5,000 solutions in 500 iterations, taking into account both "search range" and "convergence speed" (30% faster than genetic algorithm and more stable than simulated annealing algorithm).
[0038] The beneficial effects of this invention are as follows:
[0039] Taking into account multiple constraints, it offers higher security.
[0040] Manual loading can easily overlook details such as center of gravity and load-bearing capacity (for example, in one instance, a marble countertop was placed on the upper layer during manual loading, causing the center of gravity to shift by 12% and nearly causing the truck to tip over); while the algorithm, through penalty terms P1 to P4, forces all constraints such as center of gravity and length to be met, which can reduce the damage rate of goods by more than 60%.
[0041] Space utilization rate increased by 10% to 20%.
[0042] Traditional manual labor relies on experience, with a space utilization rate of 60%–70% (a 4.2-meter truck can carry approximately 11–13 cubic meters of cargo). 3 The algorithm, through "group filling + regular placement," can stably achieve a filling rate of over 80% (approximately 15-16m). 3 This reduces the cost of a single trip by 15%.
[0043] Mixed shipments of multiple orders improve efficiency by 30%.
[0044] When dealing with more than three mixed orders, it takes 20 to 30 minutes for manual planning of the order; the algorithm automatically sorts the orders according to the "unload first, load later" rule, reducing the planning time to 1 to 2 minutes, and there is no need to search for goods during unloading (for example, after a warehouse applied the algorithm, the average daily unloading time was reduced by 2 hours).
[0045] It's simpler to operate and requires no experience.
[0046] New employees need 1-2 weeks to familiarize themselves with the manual loading rules, while the algorithm directly outputs "sequence + position" instructions, allowing new employees to get started in just one day (after being applied in a warehouse, the training cycle for new employees was shortened by 70%). Attached Figure Description
[0047] Figure 1 This is a schematic diagram of the three-dimensional loading optimization method based on particle swarm optimization algorithm of the present invention;
[0048] Figure 2 This is a schematic diagram of the loading results of the three-dimensional loading optimization method based on particle swarm optimization algorithm of the present invention. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been presented in the various embodiments of the present invention to enable the reader to better understand the present invention. However, the technical solutions claimed in the present invention can be implemented even without these technical details and various changes and modifications based on the following embodiments.
[0050] like Figure 1 As shown in one embodiment, this embodiment provides a three-dimensional loading optimization method based on particle swarm optimization, including:
[0051] Define the dimensions and volume of the carriage, generate pallet data that matches the dimensions and volume of the carriage based on the package information of the pre-loaded vehicle, and extract the arrangement order and grouping information;
[0052] Calculate the volume ratio after pallets are loaded onto the truck, parse the position vectors to obtain the pallet arrangement order and grouping scheme, and obtain the total volume within each group, the maximum length within the group, the maximum bottom area within the group, and the required space length for each grouping scheme;
[0053] Calculate the constraints for total length, length priority, load-bearing priority, and bottom area respectively to obtain the fitness of individual groups and the overall fitness;
[0054] Construct a particle swarm, initialize particle positions and velocities, define position vectors, and set boundary constraints;
[0055] Update the individual optimal solution and the global optimal solution, and output the optimal loading plan.
[0056] In this embodiment, the above solution is broken down into the following process:
[0057] First, construct an optimization model and define the dimensions of the carriage (length, width, and height).
[0058] V box Total volume of the carriage (V) box =L×W×H)
[0059] Considering that in actual warehouse storage, similar materials are generally placed on the same pallet, and the proportion of different materials mixed on different pallets is relatively small, the materials placed on each pallet can be summarized and processed on a pallet-by-pallet basis. This involves summarizing the packages on each individual pallet, including summarizing the total volume of each package, obtaining the longest package length, the maximum load-bearing capacity of each package, and the maximum base area of each package, and generating information for each individual pallet (pallet number / total volume / load-bearing capacity / maximum package length / base area / site / customer). Then, the total volume of all pallets is calculated.
[0060]
[0061] And calculate the ratio of total volume to carriage volume.
[0062]
[0063] Where n is the total number of pallets, V i Let L be the volume of the i-th tray. i Let A be the maximum length of the i-th pallet. i Level represents the maximum base area of the i-th pallet. i represents the maximum load-bearing capacity of the i-th pallet.
[0064] Next, fitness assessment calculations are performed. First, the volume ratio after pallet loading is calculated. The position vector is parsed to obtain the pallet arrangement order and grouping scheme. The extracted information is then split into an arrangement order array, a grouping information array, and a grouping quantity.
[0065] Specifically, the int[]X array is split into three parts: a sorting order array (x1), a grouping information array (x2), and a group count gNum, where,
[0066] X = [x1, x2, ..., gNum] is used to represent the intention vector of particle position, where x1 represents the tray arrangement order and x2 represents the tray grouping information.
[0067] Therefore, calculate the overall volume ratio (total pallet volume / total carriage volume).
[0068]
[0069] Then, a tray grouping scheme is constructed based on the grouping information.
[0070] For x 1,i Sort the data and obtain the sorted indices:
[0071] order i =sortIndices(x 1,i )
[0072] The sortIndices() function returns the index positions of array elements after they have been sorted in ascending order.
[0073] Then group mapping:
[0074] group j =mapToN(x 2,j , gNum), j=1, 2,...,n
[0075] Here, mapToN(x,n) is a function that maps the value x to the integer range [1,n].
[0076]
[0077] Next, for each group, calculate the maximum package length, the maximum package base area, the total volume within the group, and the required space length (considering both the total volume and the maximum package length). For example,
[0078] For the k-th group, calculate the following statistics:
[0079] Total volume within the group:
[0080]
[0081] Maximum length within a group:
[0082]
[0083] Maximum base area within the group:
[0084]
[0085] Required space length
[0086]
[0087] The process of calculating the constraints of total length, length priority, load-bearing priority, and bottom area to obtain the fitness of individual groups and the overall fitness includes:
[0088] P1: Total length constraint (the sum of the lengths of all groups does not exceed the length of the carriage), P2: Length constraint (larger packages should be placed first), P3: Load-bearing constraint (heavier packages should be placed first), P4: Area constraint (packages with larger base areas should be placed first). Therefore, we have:
[0089] Total length constraint: If the sum of the required lengths of all groups exceeds the length of the carriage (e.g., for a 4.2-meter freight car, the total length of the group is 4.5 meters), a penalty of 10,000 points will be imposed (direct elimination); otherwise, 0 points will be awarded.
[0090]
[0091] Length constraint: If a shorter piece of furniture is placed in front of a longer piece of furniture (e.g., a 0.6-meter chair is placed in front of a 1.8-meter wardrobe, causing the wardrobe to not fit), points will be deducted based on the length difference (the larger the difference, the more points will be deducted).
[0092] Where m = |group k |
[0093] Weight-bearing constraints: If a lighter piece of furniture is placed under a heavier piece of furniture (e.g., a sofa is placed under a wardrobe, causing the wardrobe to crush the sofa), points will be deducted based on the weight difference.
[0094] Where m = |group k |
[0095] Area constraint: If furniture with a small base area is placed under furniture with a large base area (such as a small side table placed under a wardrobe, causing the wardrobe to be unstable), points will be deducted based on the area difference.
[0096] Where m = |group k |
[0097] Finally, the final fitness value is calculated by combining all constraints, and the fitness of a single group is:
[0098] fitness k =-P2 K -P3 K -P4 K
[0099] Overall fitness: The lower the fitness value, the better the solution (close to 1000 points when there is no penalty, which is the ideal solution).
[0100]
[0101] After completing the initial preparations, optimization was then performed using the particle swarm optimization algorithm.
[0102] Initialize the particle swarm, randomly generate the position and velocity of each particle, and define the position vector of the i-th particle:
[0103] X i =[x i1 x i2 , ..., x id (i = 1, 2, ..., N)
[0104] in:
[0105] N is the size of the particle swarm (e.g., 5000).
[0106] d represents the problem dimension (e.g., d = 2 × goodsn + 1, where goodsn is the number of trays).
[0107] x ij This represents the position of the i-th particle in the j-th dimension.
[0108] The position of each dimension is uniformly and randomly generated within the boundary range: x ij ~U(x) min,j x max,j U(a,b) represents a uniform distribution on the interval [a,b].
[0109] Define dimensional boundaries:
[0110] First goodsn dimension (sorted order): x min,j =1,x max,j =goodsn
[0111] Middle goodsn dimension (group information): x min,j =1,x max,j =100
[0112] Last dimension (number of groups): x min,d =1,x max,d =goodsn
[0113] Define the velocity vector of the i-th particle: V i =[v i1 v i2 , ..., v id (i = 1, 2, ..., N)
[0114] Where v ij Represents the velocity of the i-th particle in the j-th dimension.
[0115] The velocity is uniformly and randomly generated within a symmetrical interval and is related to the dimensional range: v ij ~U(-v max,j v max,j )
[0116] The maximum speed V max Defined as v max,j =0.1×(x max,j -x min,j )
[0117] Calculate the fitness value for each particle (by taking an array containing sorting order, grouping information, and number of groups, as well as the model as parameters, and returning a result object containing the fitness value and the optimal solution).
[0118] Next, calculate the overall fitness function:
[0119]
[0120] in:
[0121] P1 i Total length constraint penalty term
[0122] singleFit i,k The fitness contribution of the i-th particle to the k-th group
[0123] Perform single-group fitness calculation:
[0124] singleFit i,k =-P2 i,k -P3 i,k -P4 i,k
[0125] P2 i,k Length constraint penalty
[0126] P3 i,k Load-bearing constraint penalty
[0127] P4 i,k Area constraint penalty
[0128] Finally, the individual optimal solutions and the global optimal solutions are updated, and the optimal loading scheme is output. Considering that the individual optimal solution (pbest) of each particle and the global optimal solution (gbest) of the swarm need to be continuously updated during the PSO iteration process, the update logic in this embodiment is as follows:
[0129] For updating the individual optimal solution:
[0130] For the i-th particle, if the fitness value at the current position is f(x) i The fitness value f(pbest) is better than its historical best position. i If pbest is updated, then update pbest. i Current location:
[0131] Current location:
[0132] For updating the global optimal solution:
[0133] Among all the pbest solutions for all particles, the position with the minimum fitness value is found as the global optimal solution gbest.
[0134] gbest=argmin i=1,...,N f(pbest i )
[0135] Afterwards, the particle positions need to be updated iteratively. In this embodiment,
[0136] The speed update formula is:
[0137]
[0138] The position update formula is:
[0139]
[0140] in:
[0141] The velocity of particle i in dimension d
[0142] The position of particle i in dimension 1
[0143] p id The historical best position of particle i
[0144] g d Global optimal position
[0145] ω: Inertia weight (ω=0.9)
[0146] c1, c2: acceleration constants (c1 = 1.5, c2 = 1.2)
[0147] r1, r2: Random numbers (0≤r1, r2≤1)
[0148] Inertia weight decay:
[0149] ω t+1 =ω t • wdamp, (wdamp = 0.99)
[0150] Boundary handling: Ensure particle positions are within legal range
[0151] Speed limit:
[0152]
[0153] Position constraints and mirror reflection:
[0154]
[0155] Where, x min,d and x max,d These are the lower and upper bounds of the variable in dimension d, respectively.
[0156] Finally, the globally optimal solution is returned, generating a solution like this: Figure 2 The loading effect scheme shown is as follows.
[0157] Furthermore, the method described in this embodiment can be divided into three levels, each of which is closely related to the actual loading operation:
[0158] First, at the input level, it relies entirely on actual item data. All calculations by the algorithm are based on real data such as the weight, dimensions, delivery address, and length, width, and height of the transport vehicle. Without this actual data, it is impossible to generate a loading plan.
[0159] Secondly, at the computational level, it simulates the logic of actually loading goods. The algorithm imitates the actual manual loading process through grouping, sorting, and constraint penalties, thereby ensuring that the algorithm's logic conforms to the physical laws of actual loading—for example, heavy items are placed at the bottom and large items are loaded onto the vehicle first.
[0160] Finally, at the output level, it directly guides the actual loading operation. The algorithm's final result is transformed into specific instructions, specifying which item to load, where to place it, and how to place it. Staff can follow these instructions to accurately load the items into the carriage, thus forming a complete process of calculation before implementation.
[0161] Furthermore, this embodiment can be continuously iterated and optimized to ultimately provide specific loading instructions, including loading order and placement location. With this, there's no need for repeated adjustments like manual loading (which typically requires 3-5 adjustments); the algorithm-generated solution is perfect the first time. Workers only need to place the load according to the instructions, and the loading time for a single vehicle is reduced from 40 minutes to 25 minutes.
[0162] The embodiments of the present invention have been described in detail above. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to the present invention without departing from the principles of the invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims
1. A three-dimensional loading optimization method based on particle swarm optimization algorithm, characterized in that, include: Define the dimensions and volume of the carriage, generate pallet data that matches the dimensions and volume of the carriage based on the package information of the pre-loaded vehicle, and extract the arrangement order and grouping information; Calculate the volume ratio after pallets are loaded onto the truck, parse the position vectors to obtain the pallet arrangement order and grouping scheme, and obtain the total volume within each group, the maximum length within the group, the maximum bottom area within the group, and the required space length for each grouping scheme; Calculate the constraints for total length, length priority, load-bearing priority, and bottom area respectively to obtain the fitness of individual groups and the overall fitness; Construct a particle swarm, initialize particle positions and velocities, define position vectors, and set boundary constraints; Update the individual optimal solution and the global optimal solution, and output the optimal loading plan.
2. The three-dimensional loading optimization method based on particle swarm optimization algorithm according to claim 1, characterized in that, The pallet data includes the total number of pallets, pallet volume, maximum pallet length, maximum pallet bottom area, and pallet weighing class.
3. The three-dimensional loading optimization method based on particle swarm optimization algorithm according to claim 1, characterized in that, The extracted sorting order and grouping information includes: The extracted information is split into an array of sorted order, an array of grouped information, and an array of group numbers.
4. The three-dimensional loading optimization method based on particle swarm optimization algorithm according to claim 1, characterized in that, The process of parsing the position vector to obtain the tray arrangement order and grouping scheme includes: Sort the position vectors, obtain the sorted indices, and perform group mapping; Obtain the maximum package length, maximum package base area, total volume within the group, and required space length for each group, where the required space length is defined based on the total volume of the group and the maximum package length.
5. The three-dimensional loading optimization method based on particle swarm optimization algorithm according to claim 1, characterized in that, The process of constructing a particle swarm, initializing particle positions and velocities, and defining position vectors includes: Initialize the particle swarm and randomly generate the position and velocity of each particle; Define a preset particle position vector; the position vector parameters include the size of the particle swarm, the problem dimension, and the position of the particle in the preset dimension. Define a preset velocity vector for the particles; the velocity vector parameters include the size of the particle swarm, the problem dimension, and the velocity of the example in the preset dimension. The problem dimension is determined based on the number of trays.
6. The three-dimensional loading optimization method based on particle swarm optimization algorithm according to claim 5, characterized in that, The position of each particle is generated uniformly and randomly within the boundary range of each dimension; the speed at which each example is generated is uniformly and randomly generated within a symmetrical interval. In addition to generating position and velocity, the fitness value of each particle is also calculated.
7. The three-dimensional loading optimization method based on particle swarm optimization algorithm according to claim 6, characterized in that, The updated individual optimal solution and global optimal solution include: For any particle, if the fitness value of its current position is less than the fitness value of its historical best position, then its individual best solution is updated to its current position. For each particle, a calculation is performed, and the position with the minimum fitness is selected as the global optimal solution from all the individual optimal solutions of the particles.
8. The three-dimensional loading optimization method based on particle swarm optimization algorithm according to claim 7, characterized in that, When selecting the position with the minimum fitness as the global optimum from all the individual optimal solutions of particles, the following also applies: The position and velocity of the particle are updated, and inertial weight decay is set. After ensuring that the particle is within the preset range, its velocity is limited, and position limitation and mirror reflection processing are performed. Finally, the global optimal solution is returned.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the three-dimensional loading optimization method based on particle swarm optimization as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the three-dimensional loading optimization method based on the particle swarm optimization algorithm as described in any one of claims 1 to 8.
Citation Information
Cited By
Intelligent anti-blocking method and system for material conveying
CN121158460A
Intelligent anti-blocking method and system for material conveying
CN121158460B
