Vehicle stowage method
By pre-stacking and meshing, combined with complexity metrics and hybrid strategies, and utilizing the CP-SAT solver and GRASP algorithm to optimize vehicle loading, the problem of obtaining high-quality and efficient loading schemes in traditional methods is solved, achieving more efficient vehicle utilization and cost reduction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-07
AI Technical Summary
Traditional vehicle loading methods struggle to achieve high-quality loading solutions under complex constraints, and it is difficult to balance efficiency and speed.
The system generates stacking cells through pre-stacking operations, divides the grid and determines safety margins, generates candidate slots, and combines global maximum vehicle count and complexity metrics. It employs a hybrid strategy, including heuristics and exact algorithms, and utilizes the CP-SAT solver and GRASP algorithm to optimize vehicle loading.
It improved vehicle loading quality and efficiency, reduced transportation costs, decreased the number of vehicles used, and enhanced transportation safety and solution speed.
Smart Images

Figure CN121810149A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of logistics transportation and supply chain optimization technology, and in particular to a vehicle loading method. Background Technology
[0002] With the growth of e-commerce and manufacturing shipments, truck transportation costs account for a significant portion of overall logistics expenses. Loading strategies directly impact the number of vehicles used, space and load utilization rates, and transportation safety.
[0003] Traditional loading methods often use heuristics or rule bases for rapid assembly. Although simple to implement, they are prone to local optima such as the "sieve effect" and are difficult to obtain high-quality solutions under complex constraints (stackability, compatibility, axle load, loading and unloading sequence, edge distance, etc.).
[0004] Exact algorithms (integer programming / constrained programming) can provide better or even optimal solutions, but direct modeling can lead to a search space explosion at large scales.
[0005] Existing technologies struggle to balance high quality and speed in implementing load allocation schemes. Summary of the Invention
[0006] This embodiment provides a vehicle loading method to improve the solvability and loading quality, and reduce the number of vehicles used and transportation costs.
[0007] Firstly, this application provides a vehicle loading method, comprising: Obtain parameters of the goods and equipment to be loaded, vehicle compartment information, and vehicle model template; the compartment information includes the internal dimensions and load limits of the compartment; the vehicle model template includes the vehicle dimensions, load capacity, and maximum quantity; the equipment parameters include the maximum stacking parameters of the equipment. Based on the vehicle's interior dimensions and the maximum stacking parameters of the equipment, a pre-stacking operation is performed to obtain several stacking units; Divide the target loading space into a regular grid according to a preset minimum unit; The safety margin is determined based on the vehicle's cargo compartment information, vehicle model template, and target loading space. The vehicle model dimensions of the carriage are processed based on the grid and the safety margin to generate candidate slots for the vehicle model; The indicators corresponding to the candidate slots are determined based on the candidate slots for the vehicle models, the global maximum number of vehicles, the upper limit of vehicle models, the multi-vehicle capacity prefix and lower limit, and the slot relaxation amount. The complexity index is determined based on the indexes corresponding to the stacking unit and the candidate slot, as well as the orientation of the instrument. The loading strategy is determined based on the complexity index and the preset threshold.
[0008] In some embodiments, the indicators corresponding to the candidate slots are determined based on the candidate slots for each vehicle model, the global maximum number of vehicles, the upper limit of vehicle models, the capacity prefix and lower bound of multiple vehicle models, and the slot slack. This includes: arranging the area capacity or load capacity of each candidate slot for each vehicle model in descending order; calculating the minimum number of slots whose sum of capacities of the first few candidate slots can cover the total demand; using this minimum number as a basis, plus a configurable slack, to obtain the suggested upper limit for slot replication per vehicle model; and then taking the smaller value between this and the global maximum number of vehicles and the upper limit of the vehicle model itself as the number of candidate slots for the corresponding vehicle model.
[0009] In some embodiments, a complexity index is determined based on the indices corresponding to the stacking units and the candidate slots, as well as the orientation of the implement. A loading strategy is then determined based on the complexity index and a preset threshold, including: determining a feasible triplet count based on the indices corresponding to the stacking units and the candidate slots, as well as the orientation of the implement; calculating the complexity index based on the feasible triplet count; determining a target strategy among heuristic, hybrid, and precise strategies based on the complexity index and the preset threshold; determining the number of vehicles based on the target strategy; after determining the number of vehicles, introducing auxiliary variables of the maximum used length and width for each candidate slot, constraining the endpoint of all selected stacking units to not exceed this maximum value, and then minimizing the sum of tail blanks; and outputting a target loading scheme that includes vehicle identification, stacking unit placement position, and orientation.
[0010] In some embodiments, the precise strategy includes a unified multi-vehicle optimization mode and a single-vehicle batch loading mode. The specific steps of the unified multi-vehicle optimization mode are as follows: Under the unified multi-vehicle optimization mode, using candidate slots as carriers, an allocation variable is established for each stacking unit in each slot for each feasible orientation; the car body is divided into several segments along the length of the vehicle, and a two-dimensional non-overlapping constraint is applied within each segment; a safety margin variable is introduced in the length and width of the vehicle to maintain a preset distance between the stacking unit and the vehicle wall and the segment boundary; by comparing the center of the stacking unit with the midpoint of the vehicle length, a binary variable is used to indicate whether it belongs to the front half or the rear half of the vehicle, and the cumulative load of the front half and the rear half of the vehicle is limited to not exceeding a preset ratio; slots are used sequentially according to the index order within the same vehicle model; upper and lower bound constraints are applied to the slot activation variable by combining the multi-vehicle capacity prefix and lower bound as the lower bound of the number of vehicles and the heuristic number of vehicles as the upper bound; The specific steps of the single-vehicle batch loading mode are as follows: when it is detected that only a single vehicle model is included and the complexity index is higher than the preset value, a single-vehicle two-dimensional packing CP-SAT model is constructed; all remaining unloaded stacking units are regarded as candidate items, and the solution is performed with the goal of maximizing the total area or total volume of the stacking units loaded into the current vehicle; the loaded stacking units are removed from the remaining set, and the single-vehicle model of the next vehicle is repeatedly constructed until all stacking units are loaded or the vehicle limit is reached.
[0011] In some of these embodiments, when a hybrid strategy is employed, a heuristic binning method is first executed to generate an initial scheme and an upper bound on the number of vehicles, and the variables corresponding to the upper bound and the initial scheme are injected into the optimization model; a mathematical model based on constrained programming CP-SAT is constructed and solved according to the selected mode.
[0012] In some embodiments, the heuristic binning includes a first-level heuristic and a second-level heuristic, which can be configured to be enabled: the first-level heuristic employs a greedy strategy based on row division or layer division; the second-level heuristic employs a strategy based on the maximum rectangle MaxRects and the greedy random adaptive search GRASP, maintains a set of empty rectangles in the carriage, randomly selects the insertion position through the restricted candidate list RCL, and cuts and updates the intersecting empty rectangles after insertion.
[0013] In some embodiments, the row-based or layer-based greedy heuristic strategy includes: dividing the width of the carriage into several rows, with the row height being the width of the first stacking unit of the equipment; placing stacking units sequentially along the length of the carriage in each row, prioritizing stacking units with large floor space and high stacking height; if a stacking unit cannot be placed in any of the existing rows, then a new row is started to place the stacking unit; if all the opened vehicles cannot accommodate the stacking unit, then a new vehicle with the smallest area that can accommodate it is opened.
[0014] In some embodiments, the advanced heuristic strategy based on maximum rectangle and greedy random adaptive search includes: maintaining a set of free rectangles for each vehicle to represent the current remaining available space; enumerating all feasible insertion positions of free rectangles for each stacking unit and its feasible orientation, and applying an evaluation function to score them; constructing a restricted candidate list from the candidates with better scores, and randomly selecting an insertion scheme from it; after each insertion, cutting the free rectangles intersecting with the stacking unit rectangle according to the MaxRects rule and removing redundant rectangles; repeating multiple rounds, combining a preset random seed and the number of iterations, and finally selecting the scheme with the fewest number of vehicles and the smallest remaining area from the multiple rounds of schemes as the advanced heuristic output.
[0015] In some embodiments, the pre-stacking operation includes: dividing similar appliances into several stacking units based on the minimum of the maximum number of stacking layers of the appliances and the available height of the vehicle, assigning a globally unique identifier to each stacking unit, and prioritizing the stacking units by descending order of their bottom area and height.
[0016] In some embodiments, the variable hint injection includes: using the globally unique identifier of the stacking unit to establish a mapping between the stacking unit and the optimization model variable in the heuristic scheme, and writing the vehicle activation status, the allocation relationship between the stacking unit and the slot, and the coordinate value obtained heuristically as a hint value into the solver.
[0017] Compared with related technologies, this application provides a vehicle loading method, characterized by including: acquiring parameters of the goods and equipment to be loaded, vehicle compartment information, and vehicle model template; the compartment information includes the internal dimensions and load limits of the compartment; the vehicle model template includes vehicle model dimensions, load capacity, and quantity limit; the equipment parameters include the maximum stacking parameters of the equipment; performing a pre-stacking operation based on the vehicle compartment internal dimensions and the maximum stacking parameters of the equipment to obtain several stacking units; dividing the target loading space into a regular grid according to a preset minimum unit; determining a safety margin based on the vehicle compartment information, vehicle model template, and the target loading space; processing the vehicle model dimensions of the compartment based on the grid and the safety margin to generate candidate slots for vehicle models; determining the index corresponding to the candidate slots based on the candidate slots, the global maximum number of vehicles, the upper limit of vehicle models, the multi-vehicle model capacity prefix and lower bound, and the slot slack; determining a complexity index based on the stacking units, the index corresponding to the candidate slots, and the orientation of the equipment; and determining a loading strategy based on the complexity index and a preset threshold, which can balance the solution speed and the quality of the vehicle loading scheme.
[0018] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of the vehicle loading method described in this application; Figure 2 This is a schematic diagram of the vehicle loading scheme output in this application. Detailed Implementation
[0020] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0021] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these” used in this application do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to these processes, methods, products, or devices. Words such as “connected,” “linked,” and “coupled” used in this application are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. Normally, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," "third," etc., used in this application are merely to distinguish similar objects and do not represent a specific order of objects.
[0022] This application can be used in a wide variety of general-purpose or special-purpose computing environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor devices, distributed computing environments including any of the above devices or equipment, etc.
[0023] To facilitate understanding, the technical terms used in this application will be explained and described below.
[0024] "Equipment" refers to the basic unit that carries components, and its attributes include length, width, height, weight, maximum number of stacking layers, and default placement orientation.
[0025] A "StackUnit" refers to a two-dimensional rectangular area formed by stacking several similar devices according to rules, along with its height and weight, and also serves as the basic packing object in the optimization model. This invention assigns a globally unique identifier (uid) to each stack unit.
[0026] "Vehicle template" refers to the set of parameters for available vehicle types, including cargo box size, load capacity and quantity limit, and optionally parameters such as axle load limit and loading / unloading direction.
[0027] "Candidate slots" refer to vehicle instances used to accommodate loading layouts in the optimization model. Each vehicle model can replicate several slots, with the replication limit being the smaller of the global maximum number of vehicles, the vehicle model's own maximum number, and the automatic slot control recommendation value.
[0028] "CP-SAT Solver": CP-SAT (Constraint Programming–Satisfiability) is a constraint programming solver based on Boolean satisfiability techniques, suitable for large-scale combinatorial optimization problems with 0-1 variables and integer constraints. This application employs a CP-SAT solver that supports pseudo-Boolean constraints, integer linear constraints, and optional intervals to implement constraints such as two-dimensional non-overlapping, load, axle load, and symmetry breaking.
[0029] The "MaxRects Algorithm" uses MaxRects (Maximum Rectangles) as a classic 2D bin packing heuristic. It maintains a set of remaining free rectangles. After each stacking unit rectangle is placed, the intersecting free rectangles are cut to obtain new non-overlapping free areas, and completely contained free rectangles are deleted. This application uses MaxRects as the core of the advanced heuristic for managing the space within the bin, enabling the heuristic bin packing to adapt to complex shapes of remaining space, rather than relying solely on regular row / column filling.
[0030] "GRASP (Greedy Randomized Adaptive Search Procedures)": GRASP is a metaheuristic framework that combines multiple constructions with local search. Its core idea is: first, a greedy evaluation function scores each candidate insertion position; then, a "Restricted Candidate List" (RCL) with good scores is constructed; a candidate is randomly selected from the RCL, forming a construction that incorporates both greediness and randomness; this process is repeated multiple times, and finally, the best-quality solution is selected from the multiple solutions. This invention introduces GRASP on top of MaxRects space management, controlling the size of the RCL and the number of iterations through configuration parameters, obtaining high-quality, compact multi-vehicle heuristic solutions within an acceptable timeframe.
[0031] "Automatic Slot Cap Control (auto_slot_cap)": In multi-vehicle scenarios, simply copying slots according to "maximum number of vehicles × vehicle type" can easily lead to an excessively large total number of candidate slots S and a sharp increase in feasible triples F. This application sorts the area capacity or load capacity of slots for each vehicle type in descending order; calculates the minimum number of slots whose sum of capacities can cover the total demand; based on this minimum number, plus a configurable slack, it derives a suggested upper limit for slot copying per vehicle type; then, it takes the smaller value between the maximum number of vehicles and the upper limit of the vehicle type itself. Through this mechanism, sufficient capacity is ensured while significantly compressing the number of slots and the size of triples in the unified model.
[0032] "Single-vehicle batch CP-SAT maximum loading mode": When all vehicles belong to the same vehicle model and the demand is large, building a "multi-vehicle unified minimum vehicle number model" all at once will lead to an exponential increase in the search space. This application automatically switches to the following mode when the condition of "single vehicle model + high complexity" is detected: build a two-dimensional bin packing CP-SAT model for only one vehicle at a time; allow some stacking units not to be loaded into the current vehicle, with the goal of "maximizing the total area or volume of the stacking units"; after finding the optimal loading of the current vehicle, delete the loaded stacking units from the remaining set and build the model for the next vehicle; iterate until the termination condition is met. In this way, a very large-scale "multi-vehicle joint minimum vehicle number" problem is approximately decomposed into multiple smaller-scale "single-vehicle maximum loading" problems, which significantly reduces the solution time and memory usage in engineering practice, while still maintaining a high loading rate and a vehicle number close to the optimum.
[0033] "Globally Unique StackUnit Identifier and Hint Injection": This application assigns a globally unique ID (uid) to each stack unit and establishes a mapping between uid and model index during the construction of the heuristic results and the CP-SAT model. Under the hybrid strategy: the heuristic determines which slot a stack unit is placed in, its orientation, and approximate coordinates; after finding the corresponding CP-SAT variables through the uid, the "whether to use the slot," "the selection variable of the stack unit in the slot," "coordinate variables," and "segmentation selection variables" are set as Hints (initial solution hints); the solver searches starting from the Hints, which helps to quickly find feasible solutions that are similar to or even better than the heuristics. This "precise Hint injection based on global ID" has a stronger convergence acceleration effect compared to the simple "only injecting the upper bound of the vehicle" scheme.
[0034] "Symmetry breaking": This means that vehicles of the same specifications must be used in the order of their indices (for example, vehicle No. 1 must be used before vehicle No. 2 can be used), to prevent the solver from wasting computational resources in permutations and combinations of essentially the same vehicles (such as 'vehicle A loaded with cargo X' and 'vehicle B loaded with cargo X' being considered different solutions).
[0035] Inputs can be loaded via configuration: tool set, vehicle type set, requirement details, and solution parameters (mesh step size, number of segments, margin, time limit, parallelism, strategy mode, etc.). Outputs include: vehicle-stacked cell-coordinate scheme data, vehicle count statistics, and text visualization. Figure 2 This is a schematic diagram of the vehicle loading scheme for this application.
[0036] Next, combine Figure 1 The vehicle loading method described in this application is detailed, including the following steps: Obtain parameters of the goods and equipment to be loaded, vehicle compartment information, and vehicle model template; the compartment information includes the internal dimensions and load limits of the compartment; the vehicle model template includes the vehicle dimensions, load capacity, and maximum quantity; the equipment parameters include the maximum stacking parameters of the equipment. Based on the vehicle's interior dimensions and the maximum stacking parameters of the equipment, a pre-stacking operation is performed to obtain several stacking units; Divide the target loading space into a regular grid according to a preset minimum unit; The safety margin is determined based on the vehicle's cargo compartment information, vehicle model template, and target loading space. The vehicle model dimensions of the carriage are processed based on the grid and the safety margin to generate candidate slots for the vehicle model; The indicators corresponding to the candidate slots are determined based on the candidate slots for the vehicle models, the global maximum number of vehicles, the upper limit of vehicle models, the multi-vehicle capacity prefix and lower limit, and the slot relaxation amount. The complexity index is determined based on the indexes corresponding to the stacking unit and the candidate slot, as well as the orientation of the instrument. The loading strategy is determined based on the complexity index and the preset threshold.
[0037] The complexity index is determined based on the index corresponding to the stacking unit and the candidate slot, as well as the orientation of the equipment; the loading strategy is determined based on the complexity index and the preset threshold, which can balance the solution speed and the quality of the vehicle loading scheme.
[0038] The indicators corresponding to the candidate slots are determined based on the candidate slots for the vehicle models, the global maximum number of vehicles, the upper limit of the vehicle models, the capacity prefix and lower limit of the multi-vehicle models, and the slot slack. This includes: sorting the area capacity or load capacity of the candidate slots for each vehicle model in descending order; calculating the minimum number of slots whose sum of capacity of the first few candidate slots can cover the total demand; using this minimum number as a basis, plus a configurable slack, to obtain the suggested upper limit for slot replication per vehicle model; and then taking the smaller value between this and the global maximum number of vehicles and the upper limit of the vehicle model itself as the number of candidate slots for the corresponding vehicle model.
[0039] The complexity index is determined based on the indicators corresponding to the stacking units and the candidate slots, as well as the orientation of the equipment. A loading strategy is then determined based on the complexity index and a preset threshold, including: determining a feasible triplet count based on the indicators corresponding to the stacking units and the candidate slots, as well as the orientation of the equipment; calculating the complexity index based on the feasible triplet count; determining a target strategy among heuristic, hybrid, and precise strategies based on the complexity index and the preset threshold; determining the number of vehicles based on the target strategy; after determining the number of vehicles, introducing auxiliary variables of the maximum used length and width for each candidate slot, constraining the endpoint of all selected stacking units to not exceed this maximum value, and then minimizing the sum of tail blanks; and outputting a target loading scheme that includes vehicle identification, stacking unit placement position, and orientation.
[0040] After determining the number of vehicles, auxiliary variables of the maximum used length and width of each slot are introduced to constrain the endpoint of all selected stacking units to not exceed the maximum value, and then the sum of the tail blanks is minimized. This can further reduce the tail blanks while ensuring the minimum number of vehicles, thereby improving loading and unloading efficiency, stability and on-site operability.
[0041] The precise strategy includes a unified multi-vehicle optimization mode and a single-vehicle batch loading mode. The specific steps of the multi-vehicle optimization mode are as follows: Under the unified multi-vehicle optimization mode, using candidate slots as carriers, an allocation variable is established for each stacking unit in each slot for each feasible orientation; the car body is divided into several segments along the length of the vehicle, and a two-dimensional non-overlapping constraint is applied within each segment; a safety margin variable is introduced in the length and width of the vehicle to maintain a preset distance between the stacking unit and the vehicle wall and the segment boundary; by comparing the center of the stacking unit with the midpoint of the vehicle length, a binary variable is used to indicate whether it belongs to the front half or the rear half of the vehicle, and the cumulative load of the front half and the rear half of the vehicle is limited to not exceeding a preset ratio; slots are used sequentially according to the index order within the same vehicle model; and upper and lower bound constraints are applied to the slot activation variable by combining the multi-vehicle capacity prefix and lower bound as the lower bound of the number of vehicles and the heuristic number of vehicles as the upper bound. The specific steps of the single-vehicle batch loading mode are as follows: when it is detected that only a single vehicle model is included and the complexity index is higher than the preset value, a single-vehicle two-dimensional packing CP-SAT model is constructed; all remaining unloaded stacking units are regarded as candidate items, and the solution is performed with the goal of maximizing the total area or total volume of the stacking units loaded into the current vehicle; the loaded stacking units are removed from the remaining set, and the single-vehicle model of the next vehicle is repeatedly constructed until all stacking units are loaded or the vehicle limit is reached.
[0042] The carriage is divided into several segments along the length of the vehicle. Two-dimensional non-overlapping constraints are applied within each segment to effectively reduce global coupling and improve the solution stability and scalability of the unified multi-vehicle model.
[0043] When a hybrid strategy is adopted, heuristic bin packing is first executed to generate an initial scheme and an upper bound on the number of vehicles, and the variables corresponding to the upper bound and the initial scheme are injected into the optimization model; a mathematical model based on constrained programming CP-SAT is constructed and solved according to the selected mode.
[0044] The heuristic bin packing includes a first-level heuristic and a second-level heuristic, which can be configured to be enabled: the first-level heuristic adopts a greedy strategy based on row division or layer division; the second-level heuristic adopts a strategy based on the maximum rectangle MaxRects and the greedy random adaptive search GRASP, maintains a set of empty rectangles in the carriage, randomly selects the insertion position through the restricted candidate list RCL, and cuts and updates the intersecting empty rectangles after insertion.
[0045] The row-based or layer-based greedy heuristic strategy includes: dividing the width of the carriage into several rows, with the row height being the width of the first stacking unit of the equipment; placing stacking units sequentially along the length of the carriage in each row, prioritizing stacking units with large floor space and high stacking height; if a stacking unit cannot be placed in any of the existing rows, then a new row is started to place the stacking unit; if all the opened vehicles cannot accommodate the stacking unit, then a new vehicle with the smallest area that can accommodate it is opened.
[0046] The advanced heuristic strategy based on maximum rectangle and greedy random adaptive search includes: maintaining a set of free rectangles for each vehicle to represent the current remaining available space; enumerating all feasible insertion positions of free rectangles for each stacking unit and its feasible orientation, and applying an evaluation function to score them; constructing a restricted candidate list from the candidates with better scores, and randomly selecting an insertion scheme from it; after each insertion, cutting the free rectangles intersecting with the rectangle of that stacking unit according to the MaxRects rule and removing redundant rectangles; repeating multiple rounds, combining a preset random seed and the number of iterations, and finally selecting the scheme with the fewest number of vehicles and the smallest remaining area from the multiple rounds of schemes as the advanced heuristic output.
[0047] The pre-stacking operation includes: dividing similar appliances into several stacking units according to the minimum value of the maximum number of stacking layers of the appliances and the available height of the vehicle, assigning a globally unique identifier to each stacking unit, and using the descending order of the bottom area and height of the stacking units as the packing priority.
[0048] The variable hint injection includes: using the globally unique identifier of the stacked unit to establish a mapping between the stacked unit and the optimization model variables in the heuristic scheme, and writing the vehicle activation status, the allocation relationship between the stacked unit and the slot, and the coordinate value obtained heuristically as hint values into the solver.
[0049] By injecting both a heuristic upper bound on the number of vehicles and a variable hint (initial solution hint) based on the global ID of StackUnit into the accurate model, the search space and convergence time are significantly reduced, and the convergence effect is better than that of injecting only the upper bound on the number of vehicles.
[0050] Specifically, this application proposes a vehicle loading method, including the following steps: S100: Acquire input data; S200: Pre-stack generation; S300: Candidate slots and meshing; S400: Complexity assessment and strategy selection; S500: Heuristic guidance; S600: Unified multi-vehicle CP-SAT optimization modeling and solution (suitable for scenarios with multiple vehicle models or a small number of vehicles, path one is optional); S700: Single-vehicle batch CP-SAT maximum loading mode (suitable for single-vehicle models and high complexity scenarios, path two is optional, used to replace S600); S800: Two-stage compaction; S900: Solution output and visualization.
[0051] S100: Obtain parameters of the cargo and equipment to be loaded, target wagon information, and vehicle model template. Target wagon information includes at least the wagon's internal dimensions and load limits; the vehicle model template includes vehicle dimensions, load capacity, and maximum quantity. Required data may include the quantity of various components and corresponding equipment models.
[0052] S200: Pre-stack the equipment based on the maximum usable height of the vehicle and the maximum stacking limit to obtain several stack units. Each stack unit has a globally unique identifier, which is used to establish a one-to-one mapping between the heuristic scheme and the constraint model. The stack units are prioritized for packing in descending order of bottom area and height to improve the degree of freedom and compactness of two-dimensional packing.
[0053] S300: Candidate Slots and Meshing: Discretize the length and width of the vehicle body with millimeter-level mesh and safety margin to generate candidate vehicle slots. For each vehicle model, the number of slots is constrained by the smaller of the "global maximum number of vehicles" and the "vehicle model upper limit". At the same time, based on the multi-vehicle model capacity prefix and lower bound, an automatic upper limit for slot replication for each vehicle model is given. Combined with the configurable "slot relaxation amount", an automatic slot upper limit control is formed to reduce invalid slots and reduce the model size while ensuring coverage requirements.
[0054] S400: Calculates the number of feasible triples F based on "stacked cell - slot - orientation", and statistically analyzes indicators such as the average number of selectable rectangles for slots, the proportion of rotatable stacked cells, the capacity prefix and lower bound LB for multiple vehicle models, and the suggested upper limit of slots. Based on F and a threshold OR, F and a threshold, and the user-configured "automatic / speed priority / precision priority / hybrid" strategy mode, it adaptively selects from multiple solution paths such as simple greedy heuristic, advanced heuristic (MaxRects+GRASP), unified multi-vehicle CP-SAT, and single-vehicle batch CP-SAT.
[0055] S500: First, a heuristic bin packing process is executed. The heuristic is divided into two levels, which can be enabled based on parameters: Level 1: A row-based (shelf-based) greedy heuristic, filling stacking units according to row height and remaining length; Level 2: An advanced heuristic based on MaxRects and Greedy Random Adaptive Search (GRASP). By maintaining a "set of free rectangles" for the car, insertion schemes under different orientations are evaluated in each free rectangle. A Restricted Candidate List (RCL) is used for randomized selection and multi-round iterative construction to obtain a more compact multi-car loading scheme. The heuristic outputs the initial loading scheme and the upper bound K of the number of vehicles. The vehicle activation, stacking unit allocation, and coordinate information are injected as hints into the unified optimization model via the StackUnit global ID to guide subsequent precise searches.
[0056] S600: In situations involving multiple vehicle models and / or a relatively limited expected number of vehicles, a unified integer optimization / constraint programming model (e.g., based on the CP-SAT solver) is constructed, imposing constraints such as piecewise two-dimensional non-overlapping, total vehicle load, axle load approximation, linearization of incompatible materials, breaking of chain-like symmetry in slots of the same vehicle model, and capacity prefix and lower bound pruning for multiple vehicle models; the primary objective is to minimize the number of vehicles. Under the hybrid strategy, the unified model simultaneously uses the heuristically given upper bound on the number of vehicles and the variable Hint for dual acceleration.
[0057] S700: When a vehicle model is detected to be of a single type and the complexity index F is large, and the lower bound of the theoretical number of vehicles is high, step S600 can be substituted to execute the single-vehicle batch CP-SAT maximum loading mode: Instead of modeling all potential slots uniformly at once, a single-vehicle two-dimensional packing CP-SAT model is constructed, treating all stacked units as candidate items, and solving the single-vehicle loading scheme with the objective of "maximizing loading area or volume"; after removing the already loaded stacked units from the remaining set, the single-vehicle model of the next vehicle is iteratively constructed until all goods are loaded, the vehicle limit is reached, or the single-vehicle model can no longer load effective stacked units. This mode significantly reduces the search space of a single CP-SAT while maintaining the constraint system, and is suitable for engineering scenarios of "one type of vehicle, many trips".
[0058] S800: With a fixed number of vehicles, minimize the sum of the rear blank space in the length and width directions of the vehicle to improve layout compactness and operability. Under the unified multi-vehicle model, this is achieved by introducing the maximum used span variable for each slot; under the single-vehicle batch mode, a similar idea can be used within each vehicle to achieve local compactness within each vehicle.
[0059] S900: Outputs a loading scheme for vehicle-stacked units-coordinates, including placement order, orientation, and bottom coordinates. It can also generate ASCII art and machine-readable data for on-site execution and verification, while retaining intermediate complexity assessment reports and strategy selection instructions to facilitate diagnosis and optimization by engineers.
[0060] Furthermore, in step S200: First, the part requirements are converted into equipment requirements; Combining the maximum height of the vehicle and the maximum stacking limit of the equipment, the units are divided according to the rule of "taking the minimum value" to generate multiple stacking units; To improve the degree of freedom of two-dimensional packing, the stacking units are arranged in descending order of bottom area and height, and the stacking units with larger footprints are placed first.
[0061] In step S300: the length and width of the car body are discretized in millimeter increments; a safety margin step number is set in both the length and width directions; the number of slots copied for each car model does not exceed the smaller of its upper limit and the global maximum number of vehicles; for infinitely heavy-duty car models, a capacity of not less than the total demand plus 1 is used for simulation to ensure the correctness of the load constraint. Combined with automatic slot upper limit control, redundant slots are further reduced.
[0062] In step S400: the complexity index F is calculated; auxiliary indices such as the average number of selectable rectangles for slots, the proportion of rotatable stackable units, and heuristic time band estimation can be calculated; a strategy is selected based on F and two or more preset thresholds: when F is low, a simple greedy heuristic or an advanced heuristic is used; when F is medium, a hybrid strategy combining heuristics and unified multi-vehicle CP-SAT is used; when F is high, a precise solution path of unified multi-vehicle CP-SAT or single-vehicle batch CP-SAT is used. The strategy can also be affected by modes such as "automatic / speed priority / precision priority / hybrid".
[0063] In step S500: In scenarios with low or medium complexity, in order to make full use of the advantage of fast heuristic speed, the heuristic bin packing algorithm is executed first, which is divided into two levels: "simple greedy heuristic" and "advanced MaxRects+GRASP heuristic", which can be enabled by parameter selection.
[0064] A simple greedy heuristic employs a shelf-based strategy: the width of the carriage is divided into several "rows," with the row height equal to the width of the first stacked unit. Stacked units are placed sequentially along the length of the carriage within each row, prioritizing units with larger footprints and greater stacking height. If a stacked unit cannot fit in any of the existing rows, a new row is started (the row's starting y-coordinate is the currently used width). If all currently opened vehicles cannot accommodate the stacked unit, a new vehicle of the smallest available size is opened. This strategy is computationally simple, efficient, and suitable for scenarios with small-scale requirements or moderate solution quality requirements.
[0065] The advanced heuristic is based on MaxRects and Greedy Random Adaptive Search (GRASP): Each vehicle maintains a set of free rectangles to represent the current remaining available space; for each stacking unit and its feasible orientation, all feasible insertion positions of free rectangles are enumerated, and evaluation functions (such as minimum remaining area, minimum shortest side difference, etc.) are applied to score them; a subset of candidates with better scores are formed into a restricted candidate list (RCL), from which an insertion scheme is randomly selected to achieve a balance between "local greediness and global randomness"; after each insertion, the free rectangles intersecting with the rectangle of the stacking unit are cut according to the MaxRects rule and redundant rectangles are removed, thereby maintaining the integrity and non-overlapping nature of the free space description; after multiple rounds of construction, combined with a preset random seed and number of iterations, the scheme with the fewest number of vehicles and the smallest remaining area is finally selected from the multiple rounds of schemes as the advanced heuristic output.
[0066] Advanced heuristics can be configured via parameters such as iteration count, RCL ratio, and evaluation strategy, allowing for continuous adjustment between time and quality. Compared to a single greedy method, the MaxRects+GRASP heuristic makes better use of fragmented space in the carriage, reduces fragmented waste, and significantly improves cargo load and vehicle utilization.
[0067] Whether using a simple greedy approach or an advanced heuristic, both are based on the globally unique ID of the stacked unit. The number of vehicles, vehicle activation status, stacked unit-slot-orientation allocation, and coordinates obtained from the heuristic are injected as hints into the unified optimization model, forming a dual acceleration mechanism of "upper bound constraints + variable hints".
[0068] In steps S600 and S700: In scenarios with high complexity and a large number of vehicle models or a small expected number of vehicles, a unified multi-vehicle CP-SAT optimization model is constructed: using candidate slots as carriers, 0-1 allocation variables are established for each stacking unit in each slot for each feasible orientation; the car body is divided into several segments along the vehicle length direction, and two-dimensional non-overlapping constraints are applied within each segment to effectively reduce global coupling; safety margin variables are introduced in the vehicle length and width directions to maintain a preset distance between the stacking unit and the vehicle wall and segment boundaries; load constraints are added to each slot; if an upper limit for axle load ratio is configured, the axle load distribution is approximately controlled by Boolean variables of the front / rear half of the vehicle; linearization constraints are used to prevent incompatible material pairs from falling into the same slot; chain-like symmetry breaking is applied to slots within the same vehicle model to ensure that low-index slots must be enabled before high-index slots are enabled, thereby reducing equivalent solutions; combining the multi-vehicle capacity prefix and lower bound as the lower bound of the number of vehicles and the heuristic number of vehicles as the upper bound, upper and lower bound constraints are applied to the slot activation variable to further shrink the feasible region.
[0069] In the unified model, this application adopts a two-stage objective: the first stage aims to minimize the number of vehicles; the second stage, under the condition of a fixed number of vehicles, introduces the auxiliary variable of "maximum used vehicle length / vehicle width" for each slot to minimize the sum of the rear blank space, thereby achieving compact two-dimensional layout and improved operability.
[0070] When a scenario with only a single vehicle model and a large complexity index F and a high theoretical lower bound on the number of vehicles is detected, this application can replace the unified multi-vehicle model and switch to a single-vehicle batch CP-SAT maximum loading mode: construct a single-vehicle CP-SAT model, treat all remaining stacked units as candidate items, and aim at "maximizing loading area or volume" rather than directly minimizing the number of vehicles; the model still includes engineering constraints such as two-dimensional non-overlap, load, axle load, and incompatibility; after the first vehicle is loaded, the loaded stacked units are removed from the remaining set; the single-vehicle model of the next vehicle is repeatedly constructed until the termination condition is met.
[0071] This batch-by-batch single-vehicle mode mathematically decomposes the problem of minimum number of vehicles in a multi-vehicle joint operation into a series of maximum single-vehicle loading problems, which greatly alleviates the combinatorial explosion of the multi-vehicle unified model in the case of single vehicle type and multiple vehicle trips, and ensures that high-quality, industrially applicable solutions can still be provided under limited computing resources.
[0072] In step S800: After fixing the number of vehicles obtained in the first stage, auxiliary variables of the maximum used length and width of each slot are introduced to constrain the endpoint of all selected stacking units to not exceed this maximum value. Then, the sum of the tail blanks is minimized to achieve layout compaction and improved operability. In single-vehicle batch mode, local compaction can be performed for each vehicle separately.
[0073] In step S900: the output includes scheme identifier, summary statistics (total number of vehicles, total number of basic equipment), and vehicle-by-vehicle list (vehicle type, carriage size, stacking unit placement order, orientation, stacking information, bottom coordinates). It can generate a top-down view of text characters for frontline personnel to visually verify, and can also output machine-readable data for system linkage. It can also include a complexity assessment report and strategy selection records for subsequent intervention and diagnosis.
[0074] Parameters and options: Grid step size: 50 mm is preferred, but can also be adjusted between 10 and 100 mm depending on the business accuracy and computing power.
[0075] Number of segments: 1-4 segments are preferred, and ≥2 segments are recommended for long carriages to improve convergence.
[0076] Safety margin: The number of steps can be set from 0 to 200 mm according to loading and unloading requirements.
[0077] Upper limit of axle load ratio: can be configured according to vehicle compliance requirements, usually 0.5-0.7.
[0078] Strategy modes: Supports automatic, speed-first, accuracy-first, and hybrid modes.
[0079] Parallelism and time limit: set according to hardware configuration and real-time requirements.
[0080] The invention has been described in particular detail above with respect to possible scenarios, and those skilled in the art will recognize that the invention can be practiced through other embodiments. Specific naming of components, capitalization of terms, attributes, data structures, or any other programming or structural aspects are not mandatory or important, and the mechanisms or features of implementing the invention may have different names, forms, or procedures. The system can be implemented through a combination of hardware and software (as described), entirely through hardware elements, or entirely through software elements. The specific division of functions among the various system components described herein is merely exemplary and not mandatory; rather, the functions performed by a single system component can be performed by multiple components, or the functions performed by multiple components can be performed by a single component.
[0081] Those skilled in the art should understand that the various steps of the disclosed methods can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using device-executable program code, which can then be stored in a storage device for execution by the computing device. Alternatively, they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Therefore, the embodiments disclosed in this invention are not limited to any specific hardware and software combination.
[0082] The programs (also referred to as programs, software, software applications, or code) executable by these computing devices include machine instructions of a programmable processor and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms “machine-readable medium” and “computer-readable medium” refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) used to provide machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term “machine-readable signal” refers to any signal used to provide machine instructions and / or data to a programmable processor.
[0083] Certain aspects of this invention include the process steps and instructions described herein in algorithmic form. It should be noted that the process steps and instructions of this invention can be implemented in software, firmware, and / or hardware, and when implemented in software, they can be downloaded, stored on various operating systems and operated from said platforms.
[0084] Those skilled in the art will understand that the structures shown in the figures are merely block diagrams of some structures related to the present application and do not constitute a limitation on the terminal device to which the present application is applied. Specific terminal devices may include more or fewer components than those shown in the figures, or combine certain components, or have different component arrangements.
[0085] In the description of this specification, the use of terms such as "one embodiment," "some embodiments," "example," "specific example," or "possible design," etc., refers to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0086] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0087] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A vehicle loading method, characterized in that, include: Obtain parameters of the goods and equipment to be loaded, vehicle compartment information, and vehicle model template; The carriage information includes the carriage's internal dimensions and load limits; the vehicle model template includes the vehicle model dimensions, load capacity, and quantity limit. The appliance parameters include the maximum stacking parameter of the appliance; Based on the vehicle's interior dimensions and the maximum stacking parameters of the equipment, a pre-stacking operation is performed to obtain several stacking units; Divide the target loading space into a regular grid according to a preset minimum unit; The safety margin is determined based on the vehicle's cargo compartment information, vehicle model template, and target loading space. The vehicle model dimensions of the carriage are processed based on the grid and the safety margin to generate candidate slots for the vehicle model; The indicators corresponding to the candidate slots are determined based on the candidate slots for the vehicle models, the global maximum number of vehicles, the upper limit of vehicle models, the multi-vehicle capacity prefix and lower limit, and the slot relaxation amount. The complexity index is determined based on the indexes corresponding to the stacking unit and the candidate slot, as well as the orientation of the instrument. The loading strategy is determined based on the complexity index and the preset threshold.
2. The loading method according to claim 1, characterized in that, The indicators corresponding to the candidate slots are determined based on the candidate slots for the vehicle models, the global maximum number of vehicles, the upper limit of the vehicle models, the capacity prefix and lower limit of the multi-vehicle models, and the slot slack. This includes: sorting the area capacity or load capacity of the candidate slots for each vehicle model in descending order; calculating the minimum number of slots whose sum of capacity of the first few candidate slots can cover the total demand; using this minimum number as a basis, plus a configurable slack, to obtain the suggested upper limit for slot replication per vehicle model; and then taking the smaller value between this and the global maximum number of vehicles and the upper limit of the vehicle model itself as the number of candidate slots for the corresponding vehicle model.
3. The loading method according to claim 2, characterized in that, The complexity index is determined based on the indexes corresponding to the stacking unit and the candidate slot, as well as the orientation of the instrument. The loading strategy is determined based on the complexity index and a preset threshold, including: determining the number of feasible triplets based on the indexes corresponding to the stacking units and the candidate slots, as well as the orientation of the equipment; calculating the complexity index based on the number of feasible triplets; determining the target strategy among heuristic strategy, hybrid strategy, and precise strategy based on the complexity index and the preset threshold; determining the number of vehicles based on the target strategy; after determining the number of vehicles, introducing auxiliary variables of the maximum used length and width of each candidate slot, constraining the endpoint of all selected stacking units to not exceed the maximum value, and then minimizing the sum of the tail blanks; and outputting the target loading scheme including vehicle identification, stacking unit placement position, and orientation.
4. The loading method according to claim 3, characterized in that, The precise strategy includes a unified multi-vehicle optimization mode and a single-vehicle batch loading mode. The specific steps of the unified multi-vehicle optimization mode are as follows: Under the unified multi-vehicle optimization mode, using candidate slots as carriers, an allocation variable is established for each stacking unit in each slot for each feasible orientation; the car body is divided into several segments along the length of the vehicle, and a two-dimensional non-overlapping constraint is applied within each segment; a safety margin variable is introduced in the length and width of the vehicle to maintain a preset distance between the stacking unit and the vehicle wall and the segment boundary; by comparing the center of the stacking unit with the midpoint of the vehicle length, a binary variable is used to indicate whether it belongs to the front half or the rear half of the vehicle, and the cumulative load of the front half and the rear half of the vehicle is limited to not exceeding a preset ratio; slots are used sequentially according to the index order within the same vehicle model; upper and lower bound constraints are applied to the slot activation variable by combining the multi-vehicle capacity prefix and lower bound as the lower bound of the number of vehicles and the heuristic number of vehicles as the upper bound. The specific steps of the single-vehicle batch loading mode are as follows: when it is detected that only a single vehicle model is included and the complexity index is higher than the preset value, a single-vehicle two-dimensional packing CP-SAT model is constructed; all remaining unloaded stacking units are regarded as candidate items, and the solution is performed with the goal of maximizing the total area or total volume of the stacking units loaded into the current vehicle. Remove the loaded stacked units from the remaining set and repeat the process of building the next vehicle model until all stacked units are loaded or the vehicle limit is reached.
5. The loading method according to claim 4, characterized in that, When a hybrid strategy is adopted, heuristic bin packing is first executed to generate an initial scheme and an upper bound on the number of vehicles, and the variables corresponding to the upper bound and the initial scheme are injected into the optimization model; a mathematical model based on constrained programming CP-SAT is constructed and solved according to the selected mode.
6. The loading method according to claim 5, characterized in that, The heuristic bin packing includes a first-level heuristic and a second-level heuristic, which can be configured to be enabled: the first-level heuristic adopts a greedy strategy based on row division or layer division; the second-level heuristic adopts a strategy based on the maximum rectangle MaxRects and the greedy random adaptive search GRASP, maintains a set of empty rectangles in the carriage, randomly selects the insertion position through the restricted candidate list RCL, and cuts and updates the intersecting empty rectangles after insertion.
7. The loading method according to claim 6, characterized in that, The row-based or layer-based greedy heuristic strategy includes: dividing the width of the carriage into several rows, with the row height being the width of the first stacking unit of the equipment; placing stacking units sequentially along the length of the carriage in each row, prioritizing stacking units with large floor space and high stacking height; if a stacking unit cannot be placed in any of the existing rows, then a new row is started to place the stacking unit; if all the opened vehicles cannot accommodate the stacking unit, then a new vehicle with the smallest area that can accommodate it is opened.
8. The loading method according to claim 7, characterized in that, The advanced heuristic strategy based on maximum rectangle and greedy random adaptive search includes: maintaining a set of free rectangles for each vehicle to represent the current remaining available space; enumerating all feasible insertion positions of free rectangles for each stacking unit and its feasible orientation, and applying an evaluation function to score them; constructing a restricted candidate list from the candidates with better scores, and randomly selecting an insertion scheme from it; after each insertion, cutting the free rectangles intersecting with the rectangle of that stacking unit according to the MaxRects rule and removing redundant rectangles; repeating multiple rounds, combining a preset random seed and the number of iterations, and finally selecting the scheme with the fewest number of vehicles and the smallest remaining area from the multiple rounds of schemes as the advanced heuristic output.
9. The loading method according to claim 8, characterized in that, The pre-stacking operation includes: dividing similar appliances into several stacking units according to the minimum value of the maximum number of stacking layers of the appliances and the available height of the vehicle, assigning a globally unique identifier to each stacking unit, and using the descending order of the bottom area and height of the stacking units as the packing priority.
10. The loading method according to claim 9, characterized in that, The variable hint injection includes: using the globally unique identifier of the stacked unit to establish a mapping between the stacked unit and the optimization model variables in the heuristic scheme, and writing the vehicle activation status, the allocation relationship between the stacked unit and the slot, and the coordinate value obtained heuristically as hint values into the solver.