Automatic container loading method and device, medium and computer equipment
Through genetic algorithm calculation and attitude adjustment module adjustment, the problem that cargo loading equipment can only stack packaging boxes in a fixed direction is solved, and the flexible placement of packaging boxes is realized, which improves the space utilization and stability of containers, improves transportation safety and efficiency.
Patent Information
- Application Number
- CN202411260489.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-03
AI Technical Summary
Existing cargo loading equipment can only be stacked in a fixed direction, causing the cargo to dump when the vehicle vibrates or bumps, affecting transportation safety and efficiency.
Genetic algorithms are used to calculate the placement of packaging boxes, and the attitude adjustment module is used to adjust the attitude of packaging boxes. The cargo loading equipment is used to realize the flexible placement of packaging boxes, meeting different constraints to improve space utilization and stability.
It effectively improves the space utilization rate of containers and the stability of packaging boxes, avoids the problem of cargo dumping caused by vehicle vibration, and improves transportation safety and efficiency.
Smart Images

Figure CN119067530A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of loading and unloading equipment, and more specifically, to a method, device, medium and computer equipment for automatic loading of containers. Background Art
[0002] In the prior art, the automatic loader is a new type of professional loading and unloading equipment, which can be equipped with hydraulic lifting, mobile casters, etc. for operation. It is an automated logistics and transportation equipment that is very user-friendly to operate. The automatic loader is mainly used in postal, express delivery, airports, docks, medicine, chemical, tobacco and other industries.
[0003] The Chinese invention patent application (patent number: 2023115254211) proposes a fully automatic cargo loading equipment, including: a first transmission device, a destacking device, a second transmission device for transmitting the destacking cargo to the carriage, and an arranging device for arranging and placing the cargo in the carriage; the arranging device includes: a fixed frame; the fixed frame is fixedly connected to the output end of the second transmission device; a support frame is rotatably arranged on the fixed frame; the support frame is provided with a plurality of first transmission rollers for receiving the cargo transmitted by the second transmission device, a push plate assembly for pushing the cargo on the first transmission roller to both sides to realize cargo arrangement, and two push-off assemblies for pushing the arranged cargo as a whole away from the arranging device; the cargo packing equipment recorded in the application can automatically destacking the stacked cargo and neatly stack it in the carriage, without the need for porters to carry and place the cargo in the carriage for a second time, thereby improving the handling efficiency and reducing the labor intensity of cargo handling.
[0004] However, the device still has the following defects: the device can only stack the boxes inside the container in a fixed direction. When the height of the boxes stacked in one direction exceeds a threshold, they will fall over due to the vibration and bumps of the vehicle, affecting the safety and efficiency of cargo transportation. Summary of the invention
[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a method, device, medium and computer equipment for automatic loading of containers to overcome the disadvantage that the cargo loading equipment in the prior art can only stack cargo in a predetermined direction.
[0006] The above technical objectives of the present invention are achieved through the following technical solutions: a method for automatic loading of containers, applied to cargo loading equipment, wherein the cargo loading equipment is provided with a posture adjustment module for adjusting the posture of the packaging box; the method comprises:
[0007] Obtain the first size of the container and the second size of the packaging box to be loaded; obtain the loading constraints;
[0008] Based on the first size, the second size and the constraint condition, using a genetic algorithm to calculate a placement method of the packaging box;
[0009] Based on the placement method, after the posture of the packaging box is adjusted by using the posture adjustment module, the packaging box is stacked into the interior of the container by using the cargo loading equipment.
[0010] In one embodiment, the constraints specifically include:
[0011] The total number of boxes;
[0012] The types of boxes in each row are the same;
[0013] The arrangement of the packaging boxes on two adjacent layers is different.
[0014] In one embodiment, the calculating the placement of the packaging box by using a genetic algorithm based on the first size, the second size and the constraint condition specifically includes:
[0015] According to the constraints, randomly generate several initial placements of packaging boxes;
[0016] According to the posture and position of each packaging box in the initial placement mode, each packaging box is encoded respectively to generate a plurality of initial encoding strings corresponding to the plurality of initial placement modes;
[0017] Selecting some parent code strings from a number of initial code strings according to a predetermined rule;
[0018] Based on the constraint condition, performing a crossover operation on a plurality of the parent code strings to generate a plurality of child code strings;
[0019] Determine whether a preset termination condition is met based on the plurality of child code strings, and if so, execute the next step;
[0020] The space utilization rates of the child code strings are calculated respectively, and the packaging boxes are stacked according to the child code strings corresponding to the maximum space utilization rates.
[0021] In one embodiment, selecting some parent code strings from a number of initial code strings according to a predetermined rule specifically includes:
[0022] Calculate the space utilization rate η of the container in each placement mode based on the first size, the second size and the total number of the packaging boxes;
[0023] Based on the first size, the second size and the weight of each packaging box, calculate the center of gravity balance γ of the packaging boxes in the stacked state in each placement mode;
[0024] Based on the space utilization rate η and the center of gravity balance γ, calculate the fitness score F corresponding to each placement method;
[0025] The initial coding string whose fitness score F is greater than the score threshold is recorded as the parent coding string.
[0026] In one embodiment, the calculation of the fitness score F corresponding to each placement method based on the space utilization rate η and the center of gravity balance γ specifically includes:
[0027] F(θ)=ω1η+ω2γ(θ);
[0028] Among them, ω1 represents the weight of space utilization; ω2 represents the weight of center of gravity balance; θ represents the placement of packaging boxes; η represents space utilization; γ(θ) represents the center of gravity balance under the θ placement method; F(θ) represents the fitness score under the θ placement method.
[0029] In one embodiment, the calculating the space utilization rate η of the container based on the first size, the second size and the total number of the packaging boxes specifically includes:
[0030]
[0031] Among them, w i Indicates the width of the i-th packaging box; h i represents the height of the i-th packaging box; l i represents the length of the i-th packaging box; a i represents the number of the i-th type of packaging boxes; H represents the height of the container; W represents the width of the container; L represents the length of the container; n represents the number of types of packaging boxes.
[0032] In one embodiment, the calculating the center of gravity balance γ of the stacked packaging boxes based on the first size, the second size, and the weight of each packaging box specifically includes:
[0033]
[0034] Among them, G x (θ) represents the x-axis weighted average of the centers of all packaging boxes in the θ placement mode; G y (θ) represents the y-axis weighted average of the centers of all packaging boxes in the θ placement mode; G z (θ) represents the z-axis weighted average of the centers of all packaging boxes in the θ placement mode; C x Indicates the center coordinate of the container in the x-axis direction; C y Indicates the center coordinate of the container in the y-axis direction; C zIt represents the center coordinate of the container in the z-axis direction; H represents the height of the container; W represents the width of the container; L represents the length of the container.
[0035] In one embodiment, the determining whether a preset termination condition is satisfied based on the plurality of the child code strings specifically includes:
[0036] Calculate the offspring fitness score corresponding to each offspring encoding string, and select the maximum offspring fitness score F 子 ;
[0037] Calculate the parent fitness score corresponding to each parent encoding string and select the maximum parent fitness score F 父 ;
[0038] According to the maximum offspring fitness score F 子 And the maximum parent fitness score F 父 , determine whether F is satisfied 子 ≤(1+1%)F 父 ; If satisfied, it is determined that the preset termination condition is satisfied; if not satisfied, it is determined that the preset termination condition is not satisfied.
[0039] In one embodiment, when it is determined that the preset termination condition is not met, each child code string is recorded as a parent code string, and the steps are re-executed: based on the constraint conditions, a cross operation is performed on several parent code strings to generate several child code strings.
[0040] A container automatic loading device, comprising:
[0041] Acquisition unit: used to acquire the first size of the container and the second size of the packaging box to be loaded; acquire the loading constraint conditions;
[0042] A calculation unit, configured to calculate a placement method of the packaging box by using a genetic algorithm based on the first size, the second size and the constraint condition;
[0043] A placing unit is used to stack the packaging boxes into the interior of the container using the cargo loading equipment after adjusting the posture of the packaging boxes using the posture adjustment module based on the placing method.
[0044] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processor.
[0045] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0046] In summary, the present invention has the following beneficial effects: a method for automatic loading of containers, comprising: obtaining a first dimension of the container and a second dimension of a packaging box to be loaded; obtaining loading constraints; based on the first dimension, the second dimension and the constraints, calculating the placement of the packaging boxes using a genetic algorithm; based on the placement, after adjusting the posture of the packaging boxes using the posture adjustment module, stacking the packaging boxes inside the container using the cargo loading equipment; using the method of the present invention, the placement of the packaging boxes in the container can be automatically calculated, which effectively improves the space utilization of the container and can also improve the placement stability of the packaging boxes. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a flow chart of an automatic container loading method of the present invention;
[0048] Figure 2 is a structural diagram of an automatic container loading device in an embodiment of the present invention;
[0049] Figure 3 is an internal structure diagram of a computer device in an embodiment of the present invention;
[0050] Figure 4 It is a schematic diagram of the three-dimensional structure of the loading equipment in the embodiment of the present invention;
[0051] Figure 5 This is a schematic diagram of the mechanical arm of the present invention detecting the angle of the carriage.
[0052] In the figure, 1. Acquisition unit; 2. Calculation unit; 3. Placement unit. DETAILED DESCRIPTION
[0053] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. Several embodiments of the present invention are shown in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein.
[0054] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances. The terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.
[0055] In the present invention, unless otherwise clearly specified and limited, the first feature being "above" or "below" the second feature may include the first and second features being in direct contact, or may include the first and second features being in contact not directly but through another feature between them. Moreover, the first feature being "above", "above" and "above" the second feature includes the first feature being directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. The first feature being "below", "below" and "below" the second feature includes the first feature being directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature. The terms "vertical", "horizontal", "left", "right", "above", "below" and similar expressions are for illustrative purposes only, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0056] Embodiment 1
[0057] In order to solve the above problems, the present invention provides a method for automatically loading containers, such as Figure 1 As shown, it is applied to cargo loading equipment, and the cargo loading equipment is provided with a posture adjustment module for adjusting the posture of the packaging box; the method includes:
[0058] S1. Obtain the first size of the container and the second size of the packaging box to be loaded; obtain the loading constraint conditions;
[0059] S2. Calculating a placement method of the packaging box using a genetic algorithm based on the first size, the second size and the constraint condition;
[0060] S3. Based on the placement method, after adjusting the posture of the packaging box by using the posture adjustment module, the packaging box is stacked into the interior of the container by using the cargo loading equipment.
[0061] Specifically, in this application, the first dimension of the container is the volume dimension of the container; the second dimension of the packing box is the volume dimension of the packing box. In this application, the main focus is on rectangular containers and rectangular packing boxes. How to place the packing boxes inside the container in a way that maximizes space utilization is a problem that this application needs to solve. In order to improve space utilization, it is first necessary to calculate a random way of placing the packing boxes. Based on pre-set conditions, some ways of placing the packing boxes can be randomly selected, and then a genetic algorithm is used to iterate the way the packing boxes are placed. Taking space utilization as an indicator, the space utilization of each way of placing is further calculated. Finally, the way of placing the packing boxes with the highest space utilization is selected as the final result, and according to the way the packing boxes are placed, the loading equipment is controlled to place the packing boxes in the container.
[0062] In the present application, a genetic algorithm is used to calculate the placement of packaging boxes, mainly for the situation where different packaging boxes are placed in the same container. For example, when there are two types of packaging boxes, there may be multiple placement methods. Then, by using genetic coding, by crossing the placement methods of each row of packaging boxes between each level, as many placement methods as possible can be calculated, and the arrangement with the highest space utilization can be obtained as much as possible.
[0063] During loading, if Figure 4 The loading equipment shown in the figure first uses a destacking device to disassemble the stacked packaging boxes layer by layer and place them on a conveyor belt. The conveyor belt and transmission rollers transmit the packaging boxes to the end of the loading equipment. The end of the loading equipment can arrange the transmitted packaging boxes to the left and right sides so that the packaging boxes can be arranged in a row. Finally, the arranged packaging boxes are pushed into the carriage to complete the loading of a row of goods. However, in this process, the loading equipment in the prior art cannot automatically adjust the placement direction of the packaging boxes according to actual needs. Therefore, on the basis of the loading equipment in the prior art, an additional device that can adjust the placement direction of the packaging boxes can be set. A manipulator, a clamping claw cylinder, etc. can be used to move the goods to achieve reversal. It can also be provided by setting structures such as blocking blocks and blocking plates to cooperate with the conveyor belt. When the packaging boxes are transmitted on the conveyor belt, the mutual collision between the blocking blocks and blocking plates is used to achieve the purpose of steering the packaging boxes. These technical means can all be achieved through the prior art, so they will not be described in detail in this application.
[0064] In summary, the present application utilizes a genetic algorithm to automatically calculate the placement of packaging boxes in a container, thereby effectively improving the space utilization of the container and also improving the placement stability of the packaging boxes.
[0065] In one embodiment, the constraint conditions specifically include: the total number of packaging boxes; the types of packaging boxes in each row are the same; and the arrangement of packaging boxes in two adjacent layers is different.
[0066] In order to ensure that the boxes are arranged more neatly and avoid different types of boxes being arranged in a chaotic manner, which affects the neatness of the boxes, multiple staggered arrangements will also make it difficult to obtain the goods. Therefore, it is necessary to limit the types of boxes in each row to be the same. And if the arrangement of the adjacent upper and lower layers of boxes is the same, there will be no interaction force between the upper and lower layers of boxes, which will affect the stability of the box stacking. Therefore, it is necessary to set the placement of the upper and lower layers of boxes in the constraints to be different. The total number of boxes can determine whether the boxes exceed the capacity limit of the container. If it exceeds the capacity limit of the container, an alarm needs to be issued to prompt relevant personnel to replace the container, or recalculate the number that can be loaded based on the volume of the existing container.
[0067] In one embodiment, the genetic algorithm is used to calculate the placement of the packaging boxes based on the first size, the second size and the constraints, specifically including: randomly generating several initial placement methods of the packaging boxes according to the constraints; encoding each packaging box according to the posture and position of each packaging box in the initial placement method, and generating several initial code strings corresponding to the several initial placement methods; selecting some parent code strings from the several initial code strings according to predetermined rules; based on the constraints, performing cross operations on several parent code strings to generate several child code strings; judging whether the preset termination conditions are met based on several child code strings, and if so, executing the next step; calculating the space utilization rate of each child code string respectively, and stacking the packaging boxes according to the child code strings corresponding to the maximum space utilization rate.
[0068] The fitness score indicates the ability of the placement to adapt to the environment. The higher the fitness score, the stronger the survival ability of the individual, and the more likely it is to be inherited to the next generation. In actual use, the corresponding method can be selected as the parent sample in each generation of samples according to the fitness score, and the coding string is exchanged based on the parent sample to obtain several offspring samples. In the genetic algorithm, the crossover operation is a key step to generate new offspring individuals by exchanging part of the coding sequence of the parent individual. This operation simulates the gene recombination process in biological inheritance, so that the offspring inherits the characteristics of the parent, and introduces new combinations, so as to have the opportunity to obtain a better solution. There are many ways to cross, and single-point crossover is the most commonly used one. It selects a certain point in the coding string as the crossover point, and then exchanges all the coding information after the crossover point to generate two new offspring. Multi-point crossover is an extension of single-point crossover, and multiple crossover points are selected for exchange. This method further increases diversity, but also increases complexity. Uniform crossover is different from single-point or multi-point crossover. It randomly decides whether to exchange the parent's coding at each position. This method increases the probability of mutation of each coding position. Cyclic crossover is also a method used for permutation problems. The basic idea is to start from the parent generation A, find a cycle, and exchange the genes in the cycle into the offspring, while retaining the rest. Sequential crossover is used for permutation problems to generate new offspring by maintaining the order of elements in the parent generation. This method ensures that the genes in the offspring are arranged in the order of the parents. Fuzzy crossover is used to deal with problems with continuous variables. It generates offspring by weighted mixing of the gene values of the parents.
[0069] In the present application, the coding string can adopt position coordinate coding, direction vector coding and placement order coding, wherein the position coordinate is usually expressed as the coordinate (x, y, z) in three-dimensional space, which defines the exact position of the box in the carriage. x represents the position of the box in the length direction of the carriage. y represents the position of the box in the width direction of the carriage. z represents the position of the box in the height direction of the carriage. Assuming that the position coordinate of a box is (2,3,1), it means that the box is placed in the second position from front to back, the third position from left to right, and the first level from bottom to top inside the carriage. The direction vector is used to indicate the orientation of the box at the current position. Since the box can be rotated in three dimensions, the direction vector is usually represented by a set of symbols or numbers, indicating the length, width, and height of the box. (1,0,0): Indicates that the long side of the box faces the length direction of the carriage, the wide side faces the width direction of the carriage, and the height direction is normal vertical. (0,1,0): Indicates that the wide side of the box faces the length direction of the carriage, the long side faces the width direction of the carriage, and the height direction remains unchanged. The placement order indicates the order in which the boxes are placed in the carriage during the entire packing process. The placement order affects the stability between boxes and the overall space utilization in some cases. Assume that the placement order of the boxes is [B, A, C], which means that during the packing process, box B is placed first, followed by A, and finally C. Assume that there are three boxes A, B, and C, and the encoding is as follows: Box A: position (2,3,1), direction (1,0,0), placement order 1. Box B: position (4,1,2), direction (0,1,0), placement order 2. Box C: position (1,5,3), direction (1,0,0), placement order 3. The encoding can be expressed as: encoding string = [((2,3,1), (1,0,0), 1), ((4,1,2), (0,1,0), 2), ((1,5,3), (1,0,0), 3)] This encoding string clearly describes the placement position, direction, and order of each box.
[0070] The encoding method of the above-mentioned coding string is to encode according to each packaging box. Since in the present application, the type and arrangement of packaging boxes in each row are the same, encoding can be performed according to the method of each row to obtain the placement method of different rows of packaging boxes.
[0071] In one embodiment, the selecting of some parent code strings from a number of initial code strings according to a predetermined rule specifically includes: calculating the space utilization η of the container in each placement method based on the first size, the second size and the total number of the packaging boxes; calculating the center of gravity balance γ of the stacked packaging boxes in each placement method based on the first size, the second size and the weight of each packaging box; calculating the fitness score F corresponding to each placement method based on the space utilization η and the center of gravity balance γ; and recording the initial code string with a fitness score F greater than a score threshold as a parent code string.
[0072] Specifically, the fitness evaluation not only considers the single space utilization, but also combines multiple dimensions such as center of gravity balance and box placement rules, making the evaluation more comprehensive. By setting up a multi-dimensional evaluation, the space utilization can be maximized: by evaluating the space utilization of each solution, the algorithm ensures that the internal space of the carriage is maximized, reduces the empty space, and optimizes logistics efficiency. The center of gravity balance evaluation ensures that the boxes are evenly distributed in the carriage, avoids excessive center of gravity deviation, improves the stability after loading, and reduces safety hazards during transportation. By adding user-specified placement rule constraints, the algorithm can generate solutions that meet actual operational requirements to ensure that the packing process is feasible. The fitness evaluation combines the idea of multi-objective optimization. By optimizing multiple indicators such as space utilization and center of gravity distribution at the same time, it can avoid the genetic algorithm from falling into local optimality. The fitness evaluation scheme can be easily expanded to introduce new constraints, such as temperature control, transportation distance, priority of specific types of items, etc., to further enhance the applicability of the algorithm.
[0073] In one embodiment, the calculation of the fitness score F corresponding to each placement method based on the space utilization rate η and the center of gravity balance γ specifically includes:
[0074] F(θ)=ω1η+ω2γ(θ);
[0075] Among them, ω1 represents the weight of space utilization; ω2 represents the weight of center of gravity balance; θ represents the placement of packaging boxes; η represents space utilization; γ(θ) represents the center of gravity balance under the θ placement method; F(θ) represents the fitness score under the θ placement method.
[0076] In one embodiment, the calculating the space utilization rate η of the container based on the first size, the second size and the total number of the packaging boxes specifically includes:
[0077]
[0078] Among them, w i Indicates the width of the i-th packaging box; hi represents the height of the i-th packaging box; l i represents the length of the i-th packaging box; a i represents the number of the i-th type of packaging boxes; H represents the height of the container; W represents the width of the container; L represents the length of the container; n represents the number of types of packaging boxes.
[0079] In one embodiment, the calculating the center of gravity balance γ of the stacked packaging boxes based on the first size, the second size, and the weight of each packaging box specifically includes:
[0080]
[0081] Among them, G x (θ) represents the x-axis weighted average of the centers of all packaging boxes in the θ placement mode; G y (θ) represents the y-axis weighted average of the centers of all packaging boxes in the θ placement mode; G z (θ) represents the z-axis weighted average of the centers of all packaging boxes in the θ placement mode; C x Indicates the center coordinate of the container in the x-axis direction; C y Indicates the center coordinate of the container in the y-axis direction; C z It represents the center coordinate of the container in the z-axis direction; H represents the height of the container; W represents the width of the container; L represents the length of the container.
[0082] In one embodiment, the determining whether the preset termination condition is satisfied based on the plurality of the offspring code strings specifically includes: calculating the offspring fitness score corresponding to each offspring code string, selecting the offspring fitness score with the maximum offspring fitness score F 子 ; Calculate the parent fitness score corresponding to each parent encoding string, and select the maximum parent fitness score F 父 ; According to the maximum offspring fitness score F 子 And the maximum parent fitness score F 父 , determine whether F is satisfied 子 ≤(1+1%)F 父 ; If satisfied, it is determined that the preset termination condition is satisfied; if not satisfied, it is determined that the preset termination condition is not satisfied.
[0083] In one embodiment, when it is determined that the preset termination condition is not met, each child code string is recorded as a parent code string, and the steps are re-executed: based on the constraint conditions, a cross operation is performed on several parent code strings to generate several child code strings.
[0084] In practical applications, the termination condition can be set to the maximum number of loop crossovers. When the number of generations calculated by the server exceeds a predetermined threshold, the algorithm terminates directly. In many cases, the algorithm will tend to stabilize after reaching a certain number of iterations, and continued iteration may not bring significant improvements. Therefore, setting an upper limit can avoid unnecessary calculations. On this basis, if the optimal fitness value of the two adjacent generations has not been significantly improved, that is, the improvement is lower than a certain threshold, the algorithm can be considered to have converged and terminated early. If the fitness is no longer significantly improved, it usually means that the algorithm has found a solution close to the optimal solution, and continued iteration may only bring minor improvements or even fall into a local optimum. If the fitness value of a packing solution exceeds the preset target value, the algorithm can terminate immediately. If a good enough solution has been found, continued iteration may waste resources, so it can be terminated early.
[0085] In this application, the maximum number of cycles is used as the lowest priority judgment condition. When the optimal fitness scores of two adjacent generations have not improved, it means that the corresponding placement method can be selected based on the current sample.
[0086] In one embodiment, a data transmission method is also provided. After obtaining the optimal packaging box placement method, the algorithm software sends the algorithm result to the PLC according to specific rules. After the PLC parses the data, it controls the tooling to reach the set position, and automatically controls the start and stop of the conveyor belt, the operation of the marshalling station, etc., to achieve the requirement of stacking according to the position calculated by the algorithm software.
[0087] In one embodiment, Figure 5 As shown, a method for aligning a loading device is also provided, which specifically includes: monitoring the relative position of the tooling and the carriage wall in real time through a 3D camera and a laser radar installed on the head of the tooling, and comparing and correcting with the results calculated by the algorithm software to achieve the purpose of fine-tuning the position, avoiding collisions, and detecting abnormalities; first, the host computer obtains the width and height of the carriage entrance and the length of the carriage through the electric eye / radar, and compares them with the manually input carriage specifications. If they are the same, continue, and if they are different, an alarm is issued to stop the machine. Since the position where the carriage is parked may not be on the same line as the cantilever Y axis, and the current coordinate point at the entrance of the carriage cannot be judged, the cantilever needs to be extended a distance in the Y-axis original direction first, and this position is sent by the host computer to the PLC to control the cantilever action.
[0088] After reaching the detection position, the host computer receives and records the coordinates of this position and the distance data from the car in all directions collected by the electric eye / radar, and then controls the cantilever to go a certain distance deeper through the PLC to reach the guide position. The host computer records the coordinates of this guide position and the distance data in all directions collected by the electric eye / radar, and can calculate the deviation distance and angle between the center line of the car and the center line of the base coordinate Y axis. Then, based on the front distance data collected by the electric eye / radar, the coordinate origin position of the stacking can be calculated.
[0089] When the electric eye or laser radar obtains the width of the car (W measured ), height (H measured ) and length (L measured ), these data are compared with the preset manual input value (W input ,H input ,L input ) for comparison.
[0090] formula:
[0091] ΔW=W measured -W input ;
[0092] ΔH=H measured -H input ;
[0093] ΔL=L measured -L input ;
[0094] If ΔW=0, ΔH=0 and ΔL=0, it means the actual size of the car is consistent with the preset value and the system continues to operate. If any difference is not 0, an alarm is issued and the system stops.
[0095] After the cantilever is extended into the car for a distance d1, the relative distance between the cantilever and the car wall is obtained by the electric eye / laser radar. Assume that the coordinates of the cantilever at the extended position are Pprobe = (x p ,y p ,z p ), the distance data of the carriage wall is (D left ,D right ,D top ,D bottom ).
[0096] Formula: The distance between the cantilever position and the carriage wall:
[0097] x left =x p -D left ;
[0098] x right =x p +Dright ;
[0099] z top =z p +D top ;
[0100] z bottom =z p -D bottom ;
[0101] This data will help determine whether the boom is within the predetermined range of the car. If these distances are outside the preset safety range, the system will make position adjustments.
[0102] Calculation of the deviation between the center line of the carriage and the center line of the cantilever: The distance data D of the two side walls of the carriage collected at the detection position and the guidance position left and D right It can be used to calculate the deviation between the center line of the carriage and the center line of the cantilever.
[0103] Assume that the ideal centerline of the carriage is The actual measured center line of the carriage is
[0104]
[0105] Then the deviation between the center line of the carriage and the center line of the reference Y axis is:
[0106] ΔC y =C measured -C y ;
[0107] The deviation angle θ can also be calculated by the difference in distance between the two sides:
[0108]
[0109] The deviation ΔC calculated above y and angle θ y , PLC can control the cantilever to make corresponding adjustments to ensure that the cantilever is aligned with the center line of the carriage. The cantilever coordinates P after fine-tuning adjusted It can be expressed as:
[0110] x adjusted =x p +Δx;
[0111] y adjusted =y p +Δy;
[0112] where Δx; and Δy are the corrections calculated based on the deviation and angle adjustment.
[0113] After completing the position fine-tuning, the data of the detection position and the guide position are used to determine the starting position of the stacking operation; assuming that the stacking origin position is P start =(x s ,y s ,z s ), the front distance data D collected by the electric eye / radar front The position of this origin can be calculated:
[0114] P start =(x p +D front ,y p ,z p );
[0115] This coordinate point will serve as the starting point for the automatic stacking operation, and subsequent boxes will be placed in the carriage based on this point.
[0116] During the entire process of the cantilever entering the car, the 3D camera and lidar continuously monitor the relative position of the cantilever and the car wall. If the real-time monitoring data deviates from the preset ideal position, the system will immediately issue an alarm and automatically adjust the cantilever position to avoid collision.
[0117] Deviation detection formula:
[0118] ΔP x =x measured -x ideal ;
[0119] ΔP y =y measured -y ideal ;
[0120] ΔP z =z measured -z ideal ;
[0121] If ΔP x ,ΔP y ,ΔP z If any value exceeds the safe range, the system will trigger an alarm mechanism and adjust the movement of the cantilever in real time.
[0122] Embodiment 2
[0123] See also Figure 2 , a container automatic loading device, the container automatic loading device comprising:
[0124] Acquisition unit 1: used to acquire the first size of the container and the second size of the packaging box to be loaded; and acquire the loading constraint conditions;
[0125] A calculation unit 2, configured to calculate a placement method of the packaging box by using a genetic algorithm based on the first size, the second size and the constraint condition;
[0126] The placing unit 3 is used to stack the packaging boxes into the interior of the container by using the cargo loading equipment after adjusting the posture of the packaging boxes by using the posture adjustment module based on the placing method.
[0127] The specific definition of the automatic container loading device can be found in the definition of the automatic container loading method above, which will not be repeated here. Each module in the above automatic container loading device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0128] Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure related to the present application scheme, and does not constitute a limitation of the present application scheme. The specific container automatic loading device may include more or less components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0129] Embodiment 3
[0130] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the automatic container loading method as described in Example 1 is implemented.
[0131] Embodiment 4
[0132] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the computer program is executed by the processor, a method for automatically loading a container is implemented.
[0133] Those skilled in the art will understand that Figure 3The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0134] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: applied to a cargo loading device, wherein a posture adjustment module for adjusting the posture of a packaging box is provided on the cargo loading device; the method comprises:
[0135] Obtain the first size of the container and the second size of the packaging box to be loaded; obtain the loading constraints;
[0136] Based on the first size, the second size and the constraint condition, using a genetic algorithm to calculate a placement method of the packaging box;
[0137] Based on the placement method, after the posture of the packaging box is adjusted by using the posture adjustment module, the packaging box is stacked into the interior of the container by using the cargo loading equipment.
[0138] In one embodiment, the constraint conditions specifically include: the total number of packaging boxes; the types of packaging boxes in each row are the same; and the arrangement of packaging boxes in two adjacent layers is different.
[0139] In one embodiment, the genetic algorithm is used to calculate the placement of the packaging boxes based on the first size, the second size and the constraints, specifically including: randomly generating several initial placement methods of the packaging boxes according to the constraints; encoding each packaging box according to the posture and position of each packaging box in the initial placement method, and generating several initial code strings corresponding to the several initial placement methods; selecting some parent code strings from the several initial code strings according to predetermined rules; based on the constraints, performing cross operations on several parent code strings to generate several child code strings; judging whether the preset termination conditions are met based on several child code strings, and if so, executing the next step; calculating the space utilization rate of each child code string respectively, and stacking the packaging boxes according to the child code strings corresponding to the maximum space utilization rate.
[0140] In one embodiment, the selecting of some parent code strings from a number of initial code strings according to a predetermined rule specifically includes: calculating the space utilization η of the container in each placement method based on the first size, the second size and the total number of the packaging boxes; calculating the center of gravity balance γ of the stacked packaging boxes in each placement method based on the first size, the second size and the weight of each packaging box; calculating the fitness score F corresponding to each placement method based on the space utilization η and the center of gravity balance γ; and recording the initial code string with a fitness score F greater than a score threshold as a parent code string.
[0141] In one embodiment, the calculation of the fitness score F corresponding to each placement method based on the space utilization rate η and the center of gravity balance γ specifically includes:
[0142] F(θ)=ω1η+ω2γ(θ);
[0143] Among them, ω1 represents the weight of space utilization; ω2 represents the weight of center of gravity balance; θ represents the placement of packaging boxes; η represents space utilization; γ(θ) represents the center of gravity balance under the θ placement method; F(θ) represents the fitness score under the θ placement method.
[0144] In one embodiment, the determining whether a preset termination condition is satisfied based on the plurality of the child code strings specifically includes:
[0145] Calculate the offspring fitness score corresponding to each offspring encoding string, and select the maximum offspring fitness score F 子 ;
[0146] Calculate the parent fitness score corresponding to each parent encoding string and select the maximum parent fitness score F 父 ;
[0147] According to the maximum offspring fitness score F 子 And the maximum parent fitness score F 父 , determine whether F is satisfied 子 ≤(1+1%)F 父 ; If satisfied, it is determined that the preset termination condition is satisfied; if not satisfied, it is determined that the preset termination condition is not satisfied.
[0148] In one embodiment, when it is determined that the preset termination condition is not met, each child code string is recorded as a parent code string, and the steps are re-executed: based on the constraint conditions, a cross operation is performed on several parent code strings to generate several child code strings.
[0149] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0150] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0151] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for automatic loading of containers, characterized in that: Applied to cargo loading equipment, the cargo loading equipment is provided with a posture adjustment module for adjusting the posture of the packaging box; the method comprises: Obtain the first size of the container and the second size of the packaging box to be loaded; obtain the loading constraints; Based on the first size, the second size and the constraint condition, using a genetic algorithm to calculate a placement method of the packaging box; Based on the placement method, after the posture of the packaging box is adjusted by using the posture adjustment module, the packaging box is stacked into the interior of the container by using the cargo loading equipment.
2. The method for automatic container loading according to claim 1, characterized in that: The constraints specifically include: The total number of boxes; The types of boxes in each row are the same; The arrangement of the packaging boxes on two adjacent layers is different.
3. The automatic container loading method according to claim 2, characterized in that: The calculating the placement of the packaging box by using a genetic algorithm based on the first size, the second size and the constraint condition specifically includes: According to the constraints, randomly generate several initial placements of packaging boxes; According to the posture and position of each packaging box in the initial placement mode, each packaging box is encoded respectively to generate a plurality of initial encoding strings corresponding to the plurality of initial placement modes; Selecting some parent code strings from a number of initial code strings according to a predetermined rule; Based on the constraint condition, performing a crossover operation on a plurality of the parent code strings to generate a plurality of child code strings; Determine whether a preset termination condition is met based on the plurality of child code strings, and if so, execute the next step; The space utilization rates of the child code strings are calculated respectively, and the packaging boxes are stacked according to the child code strings corresponding to the maximum space utilization rates.
4. The automatic container loading method according to claim 3, characterized in that: The selecting of some parent code strings from a plurality of initial code strings according to a predetermined rule specifically includes: Calculate the space utilization rate η of the container in each placement mode based on the first size, the second size and the total number of the packaging boxes; Based on the first size, the second size and the weight of each packaging box, calculate the center of gravity balance γ of the packaging boxes in the stacked state in each placement mode; Based on the space utilization rate η and the center of gravity balance γ, calculate the fitness score F corresponding to each placement method; The initial coding string whose fitness score F is greater than the score threshold is recorded as the parent coding string.
5. The automatic container loading method according to claim 4, characterized in that: The calculation of the fitness score F corresponding to each placement method based on the space utilization rate η and the center of gravity balance γ specifically includes: F(θ)=ω1η+ω2γ(θ); Among them, ω1 represents the weight of space utilization; ω2 represents the weight of center of gravity balance; θ represents the placement of packaging boxes; η represents space utilization; γ(θ) represents the center of gravity balance under the θ placement method; F(θ) represents the fitness score under the θ placement method.
6. The automatic container loading method according to claim 3, characterized in that: The determining whether a preset termination condition is satisfied based on the plurality of child code strings specifically includes: Calculate the offspring fitness score corresponding to each offspring encoding string, and select the offspring with the maximum fitness score Fson; Calculate the parent fitness score corresponding to each parent encoding string, and select the maximum parent fitness score F parent; According to the maximum offspring fitness score Fson and the maximum parent fitness score Fparent, determine whether Fson≤(1+1%)Fparent is satisfied; if satisfied, determine that the preset termination condition is satisfied; if not satisfied, determine that the preset termination condition is not satisfied.
7. The automatic container loading method according to claim 6, characterized in that: When it is determined that the preset termination condition is not met, each child code string is recorded as a parent code string, and the steps are re-executed: based on the constraint conditions, a cross operation is performed on several parent code strings to generate several child code strings.
8. A container automatic loading device, characterized in that: include: Acquisition unit: used to acquire the first size of the container and the second size of the packaging box to be loaded; acquire the loading constraint conditions; A calculation unit, configured to calculate a placement method of the packaging box by using a genetic algorithm based on the first size, the second size and the constraint condition; A placing unit is used to stack the packaging boxes into the interior of the container using the cargo loading equipment after adjusting the posture of the packaging boxes using the posture adjustment module based on the placing method.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the automatic container loading method according to any one of claims 1 to 7 is implemented.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the automatic container loading method according to any one of claims 1 to 7 is implemented.
