Vehicle hook butt joint method and device, equipment, storage medium and program product
By defining a sector-shaped area within the trailer and using a model predictive control algorithm to generate a control sequence, the problem of collision between the tractor and the trailer was solved, achieving safe and efficient hook-up.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- UBTECH ROBOTICS CORP LTD
- Filing Date
- 2025-12-12
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, collisions are prone to occur between tractor trucks and trailers during the hook-up process, leading to automated docking failure and potential equipment damage.
By defining a sector-shaped region with the first hook as its vertex in the trailer and generating a control sequence based on a model predictive control algorithm, the tractor is guided to move within this region to achieve hook docking. The control commands are optimized using penalty values to avoid collisions.
It effectively reduces the probability of collisions between the tractor and the trailer, improves the safety and efficiency of hook-up, and ensures the smoothness and accuracy of the hook-up process.
Smart Images

Figure CN121848867A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automation technology, and in particular to a vehicle hook docking method, device, equipment, storage medium, and program product. Background Technology
[0002] Tractor-trailer systems are a common form of ground transportation organization that can efficiently complete the transfer of containers, bulk cargo and various standardized goods. They are widely used in logistics transportation, engineering construction, agricultural production, port operations and special transportation and other fields.
[0003] In related technologies, algorithms are used to control the tractor to move to the trailer position and achieve hook-up. However, this method of hook-up can easily lead to collisions between the tractor and the trailer. Summary of the Invention
[0004] This application provides a vehicle hook-and-trailer docking method, device, equipment, storage medium, and program product that can reduce the probability of collisions between the tractor and the trailer.
[0005] The technical solution of this application embodiment is implemented as follows: This application provides a vehicle hook docking method, the method comprising: Based on the position of the first hook in the trailer, a first region is determined, wherein the first region is a sector with the position of the first hook as its vertex; Based on the first position of the first hook and the second position of the second hook in the tractor, a control sequence is determined, wherein the control sequence includes at least one control command for controlling the tractor to move within the first area, so as to move the second hook to the position of the first hook; The following iterative process is performed to move the second hook to the first position of the first hook: the first control instruction in the control sequence is executed, and a control sequence for the next iteration is generated based on the first position of the first hook and the third position of the second hook in the tractor after the movement. Perform docking between the first hook and the second hook.
[0006] This application provides a vehicle hook docking device, including: The determination module is used to determine a first region based on the position of the first hook in the trailer, wherein the first region is a sector with the position of the first hook as the vertex; The prediction module is used to determine a control sequence based on a first position of the first hook and a second position of the second hook in the tractor, wherein the control sequence includes at least one control command for controlling the tractor to move within the first area to move the second hook to the position of the first hook; An iterative module is configured to perform the following iterative process for moving the second hook to a first position of the first hook: executing the first control instruction in the control sequence, and generating a control sequence for the next iteration based on the first position of the first hook and the third position of the second hook in the tractor after the movement; The docking module is used to dock the first hook and the second hook.
[0007] In the above embodiments, the prediction module is further configured to calculate a first penalty value based on the position of the first hook and the difference between the fourth position of the second hook after executing the Nth control command, where N is the number of control commands in the control sequence; For each of the first N-1 control commands, a second penalty value is calculated based on the first position of the first hook and the third position of the second hook; Based on the first penalty value and multiple second penalty values, the objective function is determined; Solving the objective function yields the third position of the second hook after each control command is executed, and the velocity change carried in each control command.
[0008] In the above embodiments, the prediction module is further configured to calculate a third penalty value based on the difference between the first position of the first hook and the third position of the second hook; Calculate the fourth penalty value based on the speed change carried in each of the control commands; A fifth penalty value is calculated based on the relative position of the third position of the second hook to the boundary of the first region after each of the control commands is executed; The second penalty value is obtained by combining the third penalty value, the fourth penalty value, and the fifth penalty value.
[0009] In the above embodiments, the prediction module is further configured to obtain a pre-set relaxation vector; The fifth penalty value is calculated based on the first distance between the third position and the first boundary of the first region, the second distance between the third position and the second boundary of the first region, and the sum of the relaxation vector.
[0010] In the above embodiments, the prediction module is further configured to extend the first region by the third position and the first boundary and the second boundary of the first region based on the relaxation vector, to obtain a second region; When the third position is outside the first region but within the second region, the fifth penalty value is calculated based on the first distance between the third position and the first boundary of the first region, the second distance between the third position and the second boundary of the first region, and the sum of the relaxation vector.
[0011] In the above embodiments, the prediction module is further configured to predict a first pose based on the first position of the first hook, wherein the first pose is the pose of the tractor when the fourth position of the second hook coincides with the position hook of the first hook; The deviation vector between the current second pose of the tractor and the first pose is determined as the difference between the first position of the first hook and the third position of the second hook; The calculation of the third penalty value based on the difference between the first position of the first hook and the third position of the second hook includes: The difference between the first position of the first hook and the third position of the second hook is converted into a scalar, and the scalar is used as the third penalty value.
[0012] This application provides an electronic device, the electronic device comprising: Memory is used to store executable instructions or computer programs. The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the vehicle hook docking method provided in the embodiments of this application.
[0013] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the vehicle hook docking method provided in this application when executed by a processor.
[0014] This application provides a computer program product, including a computer program or computer-executable instructions. When the computer program or computer-executable instructions are executed by a processor, they implement the vehicle hook docking method provided in this application.
[0015] The embodiments of this application have the following beneficial effects: By defining a first sector-shaped region based on the position of the first hook in the trailer, and then using control commands to move the tractor unit within this region to the trailer position, hook-up is achieved. Since the sector-shaped region is determined based on the position of the first hook, the probability of a collision between the tractor unit and the trailer is reduced when the tractor unit is within this region. By moving the tractor unit to the trailer position within this region, collisions are prevented during the hook-up process, thus improving the safety and overall efficiency of the hook-up process. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the vehicle hook docking system architecture provided in the embodiments of this application. Figure 1 ; Figure 2 This is a schematic diagram of the vehicle hook docking system architecture provided in the embodiments of this application. Figure 2 ; Figure 3 This is a schematic diagram of the vehicle hook docking device provided in the embodiments of this application; Figure 4 This is a schematic diagram of the first process of the vehicle hook docking method provided in the embodiments of this application; Figure 5 This is a second flowchart illustrating the vehicle hook docking method provided in this application embodiment; Figure 6 This is a schematic diagram of the third process of the vehicle hook docking method provided in the embodiments of this application; Figure 7 This is a schematic diagram of the fourth process of the vehicle hook docking method provided in the embodiments of this application; Figure 8 This is a schematic diagram of the fifth process of the vehicle hook docking method provided in the embodiments of this application; Figure 9 A flowchart illustrating a vehicle hook docking method in an application scenario provided by an embodiment of this application is shown. Figure 10 This is a schematic diagram illustrating the principle of setting a sector-shaped area based on the trailer position in this embodiment of the application.
[0017] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0020] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0021] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0022] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.
[0023] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0024] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0025] 1) A trailer is a type of transport vehicle that relies on external traction to move. It does not possess its own power unit, driving control system, or complete running gear required for autonomous driving. The core function of a trailer is to carry goods or specific equipment, and its movement depends entirely on its mechanical connection and power transmission with the towing vehicle. Examples include box semi-trailers and flatbed trailers commonly used in road transport, fertilizer spreading trailers used in agriculture, and low-bed trailers used in industrial settings to transport heavy equipment.
[0026] 2) A tractor unit is a motor vehicle that provides traction power, driving control, and necessary support to a trailer. Its core function is to generate and output traction force, control the driving state of the entire vehicle assembly, and form a stable mechanical coupling with the trailer through a dedicated coupling device. A tractor unit typically has a complete power system, cab, control mechanism, and a support structure that bears part of the trailer's weight (such as a towing seat). For example, common semi-trailer tractors, full-trailer tractors, agricultural tractors, and certain special engineering vehicles all act as tractor units when performing traction tasks.
[0027] 3) Model Predictive Control (MPC) is an advanced process control method. Its core idea is to use the dynamic mathematical model of the system to predict the system's behavior in real time over a period of time, and to calculate a series of optimal control commands by solving an optimization problem.
[0028] When executing the MPC algorithm and optimizing the control sequence, it only implements the calculated first-step optimal control command (such as slight steering). At the next instant (e.g., 0.1 seconds later), the system acquires the new vehicle state and then re-predicts and optimizes the control command, forming a "rolling time domain" closed-loop control. This allows it to continuously adapt to minute changes in vehicle state and road environment, achieving precise and smooth control.
[0029] 4) The objective function, a core concept in mathematical optimization and control theory, refers to a mathematical expression or criterion used to quantitatively evaluate the merits of a solution. It defines the objective of optimization, measuring the difference between the candidate solution and the ideal state by calculating a scalar value (i.e., "cost" or "benefit"). In each rolling optimization step of the MPC algorithm, the controller tries different sequences of future control inputs (such as a series of direction and acceleration commands). For each assumed control sequence, MPC uses a predictive model to deduce the future state of the tractor and substitutes it into the objective function for calculation. Ultimately, the algorithm selects the control sequence that minimizes (for the cost function) or maximizes (for the benefit function) the objective function value as the optimal solution.
[0030] 5) Soft constraints refer to a class of constraints in optimization and control problems that are allowed to be violated but will result in performance loss or penalty. They are not absolutely insurmountable boundaries, but rather represent requirements that the system hopes to satisfy as much as possible during runtime, but can be compromised when necessary to obtain a solution to the problem or better overall performance.
[0031] 6) Relaxation vectors are a set of auxiliary variables introduced in mathematical optimization and control problems to achieve "soft constraints". Their core function is to quantitatively represent the degree to which one or more soft constraints are violated, and to directly incorporate such violations into the mathematical framework of the optimization problem for management and punishment.
[0032] In related technologies, controlling a tractor unit to automatically move to the trailer position and complete hook-up by setting an algorithm typically relies on an integrated perception, planning, and control system. This system first identifies specific markings or features on the trailer using radar or sensors to obtain the attitude information of the trailer's hook, such as the traction pin. Based on this, the planning algorithm calculates a driving trajectory that conforms to vehicle kinematic constraints according to the relative pose of the tractor unit and trailer. The ultimate goal of this trajectory is to precisely align the tractor unit's hook with the trailer's hook. Subsequently, the vehicle's drive-by-wire system executes this planned trajectory, guiding the tractor unit smoothly along the predetermined path at low speed by controlling the steering wheel angle, throttle, and brakes, ultimately achieving hook-up.
[0033] However, the above solutions rely heavily on the accuracy of the planning algorithm. While this algorithm can typically identify obstacles on the road and generate a path to avoid them, it is prone to collisions between the tractor and trailer. The root cause is that when planning the tractor's docking trajectory, traditional algorithms usually only consider the trailer's "docking point" (such as the towing pin or hook) as a static target location to be reached, failing to incorporate the trailer's massive "body structure" as a three-dimensional obstacle that must be avoided into the planning model. This results in a trajectory that, while mathematically perfectly connecting the tractor's starting point to the trailer's docking point, may directly "pass through" the trailer's frame, tires, or cargo box side. In other words, the planning algorithm only solves the problem of "how to get to that point," neglecting the fundamental safety constraint that "the tractor's own body must not scrape against the target object during the journey." When the tractor follows such a "theoretically optimal" but "physically infeasible" path, it will collide with the stationary trailer during the movement, leading to automated docking failure and potential equipment damage.
[0034] To address the problems existing in related technologies, this application provides a vehicle hook-and-tie method, apparatus, device, storage medium, and program product. This method can set an area to accommodate the movement of the tractor unit based on the position of the hook in the trailer, completing the hook-and-tie without collision between the tractor unit and the trailer. The following describes an exemplary application of the vehicle hook-and-tie device provided in this application, which is an electronic device used to implement the vehicle hook-and-tie method. The electronic device provided in this application can be implemented as various types of terminals such as laptops, tablets, desktop computers, set-top boxes, smartphones, and tractor unit onboard terminals, or it can be implemented as a server. The following will describe exemplary applications when the device is implemented as a terminal or server.
[0035] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the vehicle hook-and-connection system provided in this application embodiment. To perform the vehicle hook-and-connection operation, a vehicle hook-and-connection application can be provided. For example, this application can be dedicated to vehicle hook-and-connection or a functional module in other applications (such as a vehicle hook-and-connection module in the unmanned vehicle control application of a logistics warehouse management system). The vehicle hook-and-connection system 100 in this application embodiment includes at least a trailer terminal 500, a tractor terminal 400, a network 300, and a server 200, where the server 200 is the server for the vehicle hook-and-connection application. The server 200 can constitute the vehicle hook-and-connection device of this application embodiment, that is, the vehicle hook-and-connection method of this application embodiment is implemented through the server 200. The trailer terminal 500 and the tractor terminal 400 are connected to the server 200 through the network 300, which can be a wide area network (WAN), a local area network (LAN), or a combination of both.
[0036] See Figure 1Users can perform interactive operations on the client side of the vehicle hook docking application through the tractor terminal 400. After receiving the docking request generated by the interactive operation, the tractor terminal 400 can send the docking request to the server 200. Based on the docking request, the server 200 performs the following steps: First, it determines a first region based on the position of the first hook in the trailer, where the first region is a sector with the position of the first hook as its vertex; second, it determines a control sequence based on the first position of the first hook and the second position of the second hook in the tractor, where the control sequence includes at least one control instruction for controlling the tractor to move within the first region to move the second hook to the position of the first hook; third, it performs the following iterative processing to move the second hook to the first position of the first hook: executing the first control instruction in the control sequence, generating a control sequence for the next iteration based on the first position of the first hook and the third position of the second hook in the tractor after the movement; finally, it controls the tractor terminal 400 to dock the first hook and the second hook.
[0037] In some embodiments, see Figure 2 The data processing method of this application embodiment can also be executed by the tractor terminal 400. That is, the user can interact with the client of the vehicle hook docking application through the tractor terminal 400. After the tractor terminal 400 receives the docking request generated by the interaction operation, the tractor terminal 400 downloads the position of the trailer terminal 500 from the network 300, and determines a first region based on the position of the first hook in the trailer, wherein the first region is a sector with the position of the first hook as the vertex; the tractor terminal 400 determines a control sequence based on the first position of the first hook and the second position of the second hook in the tractor, wherein the control sequence includes at least one control command for controlling the tractor to move within the first region to move the second hook to the position of the first hook; the tractor terminal 400 performs the following iterative processing for moving the second hook to the first position of the first hook: executing the first control command in the control sequence, generating a control sequence for the next iteration based on the first position of the first hook and the third position of the second hook in the tractor after the movement; the tractor terminal 400 docks the first hook and the second hook.
[0038] In some embodiments, the electronic device may be Figure 1 or Figure 2 The tractor terminal 400 in the middle, see Figure 3 , Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Figure 3The illustrated electronic device includes at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components of the electronic device are coupled together via a bus system 440. It is understood that the bus system 440 is used to implement communication between these components. In addition to a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 3 The general labeled all buses as Bus System 440.
[0039] Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0040] User interface 430 includes one or more output devices 431 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0041] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices physically located away from the processor 410.
[0042] The memory 450 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 450 described in this application embodiment is intended to include any suitable type of memory.
[0043] In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0044] Operating system 451 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks; The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc. The presentation module 453 enables the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 associated with the user interface 430 (e.g., a display screen, a speaker, etc.). The input processing module 454 is used to detect and translate one or more user inputs or interactions from one or more input devices 432.
[0045] In some embodiments, the apparatus provided in this application can be implemented in software. Figure 3 A vehicle hook docking device 455 stored in memory 450 is shown. This device can be software in the form of programs and plug-ins, including the following software modules: a determination module 4551, a prediction module 4552, an iteration module 4553, and a docking module 4554. These modules are logically linked and can therefore be arbitrarily combined or further separated according to the functions they implement. The functions of each module will be described below.
[0046] In other embodiments, the apparatus provided in this application can be implemented in hardware. For example, the apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the data processing method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0047] See Figure 4 , Figure 4 This is a flowchart illustrating the vehicle hook docking method provided in the embodiments of this application. Figure 1 , will combine Figure 4 The steps shown are explained as follows: Figure 4As shown, the method of vehicle hook-and-connection is illustrated using the tractor terminal as the executing entity. The method includes the following steps 101 to 104.
[0048] In step 101, a first region is determined based on the position of the first hook in the trailer.
[0049] The first region is a sector with the position of the first hook as its vertex.
[0050] Here, the first hook, also known as the towing pin, is a core load-bearing component typically installed below the front of the trailer to mechanically connect with the tractor unit's saddle. Its main body is a sturdy cylindrical steel pin, vertically mounted on the trailer's towing plate. During docking, the tractor unit's saddle lowers and locks this towing pin, thus forming a movable articulated connection. This component not only bears the core function of transmitting traction and braking forces to drive the trailer, but also supports part of the vertical load at the front of the trailer, making it the mechanical core connection point and power transmission hub of the entire tractor-trailer assembly.
[0051] It should be noted that the towing pin is usually not a simple cylinder; its top is typically designed with a conical or spherical guide surface. The tractor unit's saddle inlet is a matching, large-opening "trumpet mouth" or funnel-shaped guide groove. When the tractor unit approaches with a certain lateral or angular deviation, the conical tip of the towing pin first contacts the inclined guide surface of the saddle. At this point, the horizontal thrust generated by the vehicle's continued slow movement is decomposed into two components along the contact surface: an axial component slightly moves the trailer or causes a small deformation in the tractor unit's rear suspension; the other radial component (i.e., lateral force) forces the towing pin to slide along the inclined surface towards the center of the saddle. Simultaneously, a slight relative rotation occurs between the tractor unit and the trailer, automatically correcting the initial angular deviation. This mechanical structure is essentially a physical servo mechanism that converts initial angular and positional errors into guiding motion through contact force, ultimately achieving precise locking. Therefore, the lateral or angular deviation can be used to set a first zone, controlling the tractor unit's movement within that zone and achieving hook engagement.
[0052] In the embodiments of this application, the angle of the sector can be selected according to the size of the trailer and the tractor, and the shape of the towing pin, typically 30° or 60°.
[0053] As an example, the boundary of the first region can be defined in coordinate space by rays represented by two vectors; for instance, the vertices of the sector can be represented as... The points on the first boundary of the first region are represented as The points on the second boundary of the first region are represented as Move the second hook on the tractor to the coupling node to achieve vehicle hook-and-tie. The coupling node is then... Because the position of the second hook needs to coincide with the position of the first hook to achieve hook connection, there is usually... .in, , , , These represent the coordinates of the vertex of the first region, the point on the first boundary, the point on the second boundary, and the attachment point on the X-axis, respectively. , , , These represent the coordinates of the vertex of the first region, the point on the first boundary, the point on the second boundary, and the attachment point on the Y-axis, respectively. This indicates the heading angle of the tractor unit during coupling. The vehicle status of the tractor unit is represented as... ,in, This represents the X-axis position of the rear axle center of the tractor unit. This represents the Y-axis position of the rear axle center of the tractor unit. This represents the steering angle of the tractor unit.
[0054] In step 102, a control sequence is determined based on the first position of the first hook and the second position of the second hook in the tractor.
[0055] The control sequence includes at least one control command for controlling the movement of the tractor within the first area, so as to move the second hook to the position of the first hook.
[0056] Here, the control sequence refers to the set of control commands in a model predictive control-based automated docking process. For example, it is a set of future control commands arranged in chronological order, calculated by the MPC controller in each control cycle. This sequence defines each specific action that the tractor unit needs to perform to achieve a precise docking target within a certain period of time from the current moment.
[0057] Specifically, in the scenario of automatic tractor-trailer coupling, a typical control sequence includes a complete and continuous action plan for the vehicle's underlying actuators (such as steering wheel angle, drive torque, and braking force) over several time steps in the future (e.g., within the next 3 seconds, at 0.1-second intervals). It is not a single instruction, but an action blueprint that considers system dynamics, satisfies all constraints, and optimizes overall performance. MPC generates this sequence by solving an optimization problem. Its core is: based on the currently perceived relative state of the vehicle and trailer, using a vehicle dynamics model, predicting the future trajectory that different control sequences will lead to, and selecting the sequence that allows the predicted trajectory to reach the docking point most smoothly and accurately (while satisfying safety constraints) as the optimal solution.
[0058] In some embodiments, see Figure 5 , Figure 5 The control sequence is determined in step 102 based on the first position of the first hook and the second position of the second hook in the tractor, which can be achieved through steps 1021 to 1024.
[0059] In step 1021, a first penalty value is calculated based on the difference between the position of the first hook and the fourth position of the second hook after the Nth control command is executed.
[0060] Where N is the number of control instructions in the control sequence.
[0061] Here, the control sequence can be directly obtained by solving the optimization problem of the objective function. In the MPC framework, the objective function is a mathematical criterion used to quantitatively evaluate the quality of future behavior, and the control sequence is the direct solution that optimizes (usually minimizes) this function. Within each control cycle, MPC repeatedly "predicts and evaluates" the system behavior corresponding to different future control sequences, while satisfying the vehicle dynamics model, actuator physical limits (hard constraints), and safety boundaries. Ultimately, the future control command sequence that minimizes the objective function value is selected as the optimal control sequence output for the current moment. Therefore, the objective function is the "navigation map" and "evaluation criterion" for searching and generating control sequences, while the control sequence is the optimal solution obtained by solving this optimization problem, guiding the vehicle's future actions.
[0062] In this embodiment, the first penalty value reflects the positional deviation between the second hook in the tractor and the second hook (traction pin) of the trailer after executing the complete control sequence. Minimizing the first penalty value ensures that the goal of the entire control action is accurate docking, preventing the tractor from following a smooth path but stopping at the wrong position. For example, in this embodiment, the first penalty value is set as follows: ,in, This indicates the vehicle status of the tractor after executing N control commands. This indicates the ideal vehicle condition for the tractor unit to achieve accurate docking. This represents the weight of the vehicle state after executing N control commands.
[0063] In step 1022, for each of the first N-1 control commands, a second penalty value is calculated based on the first position of the first hook and the third position of the second hook.
[0064] In this embodiment, the second penalty value reflects the smooth state of the entire control sequence execution process after each control command in the control sequence is executed. It penalizes the deviation between the predicted state and the expected reference path at each step from the current moment to the final moment. Minimizing this term ensures that the tractor tracks the path smoothly and consistently throughout the process of approaching the trailer, without unnecessary back-and-forth swaying or significant deviations. This directly relates to driving safety, comfort, and energy consumption.
[0065] In some embodiments, see Figure 6 , Figure 6 The calculation of the second penalty value based on the first position of the first hook and the third position of the second hook in step 1022 is shown and can be achieved through steps 10221 to 10224.
[0066] In step 10221, a third penalty value is calculated based on the difference between the first position of the first hook and the third position of the second hook.
[0067] Here, the third penalty value is used to penalize the deviation between the tractor's position at each step on the path and the preset, ideal reference trajectory. By minimizing the third penalty value, the Zener tractor can be forced to closely follow the reference path, avoiding unnecessary detours.
[0068] It should be noted that if the weight of the third penalty value is too high, and there is a large deviation in the initial position of the tractor or disturbance during the movement, the MPC controller may generate an overly aggressive control command (the speed change carried in the control command is too large, which will lead to, for example, an excessively high fourth penalty term) to forcibly "pull back" the path, sacrificing smoothness and energy consumption.
[0069] In some embodiments, see Figure 7 , Figure 7 It is shown that before step 10221, steps 102211 to 102212 are performed to obtain the difference between the first position of the first hook and the third position of the second hook. After the difference between the first position of the first hook and the third position of the second hook is determined, step 10221 can be implemented in the manner of step 102213.
[0070] In step 102211, the first pose is predicted based on the first position of the first hook.
[0071] The first position refers to the position of the tractor when the fourth position of the second hook coincides with the position of the first hook.
[0072] Here, the first posture refers to the ideal vehicle state of the tractor when achieving accurate docking in the above embodiments. It can be calculated using the following formula (1); Formula (1); in, This indicates the coordinates of the attachment point on the X-axis. This indicates the coordinates of the attachment point on the Y-axis. This indicates the steering angle of the tractor unit during the coupling process. This indicates the distance between the second hook in the tractor and the center of the rear axle of the tractor.
[0073] In step 102212, the deviation vector between the current second pose and the first pose of the tractor is determined as the difference between the first position of the first hook and the third position of the second hook.
[0074] Here, the second pose is the vehicle state of the tractor after executing the i-th control command. .
[0075] In step 102213, the difference between the first position of the first hook and the third position of the second hook is converted into a scalar, and the scalar is used as the third penalty value.
[0076] Here, since the difference between the first position of the first hook and the third position of the second hook is a column vector, and the optimization algorithm needs to process a single, minimizeable objective function value, the multidimensional, directional error information can be fused into a scalar representing the overall error cost by multiplying the difference vector by the weight and then by the transpose of the difference vector.
[0077] In this embodiment of the application, the third penalty value is set as follows: ,in, This indicates the vehicle status of the tractor after executing the i-th control command. This represents the ideal vehicle state of the tractor unit when accurate docking is achieved, and N represents the number of control commands in the control sequence. This represents the weight of the vehicle state after executing the first N-1 control commands.
[0078] This application embodiment calculates the deviation vector between the current second pose and the first pose of the tractor, and then obtains the position deviation (third penalty term) after executing each control command based on the deviation vector. By optimizing the third penalty term, the MPC algorithm generates a control sequence that can instruct the tractor to move along the reference path, avoiding unnecessary detours, and improving the smoothness and accuracy of the vehicle hooking process.
[0079] In step 10222, a fourth penalty value is calculated based on the speed change carried in each control command.
[0080] Here, the speed change carried by the control command is expressed as , This indicates the change in linear velocity carried by the control command. The change in angular velocity carried by the control command, also known as the rudder angle command, is represented by the fourth penalty value. This penalty value is used to control the linear and angular vehicular speeds of the tractor by penalizing the absolute values of the steering wheel angle and throttle / brake opening. Optimizing the fourth penalty value helps save energy, reduce actuator wear, and prevent output saturation. For example, it effectively avoids vehicle swaying and driver discomfort caused by sudden steering wheel movements. The fourth penalty value can be expressed as... ,in, This represents the constraint term used to calculate the fourth penalty value after the execution of the i-th control instruction. This represents the weight in the fourth penalty value after executing the i-th control instruction.
[0081] It should be noted that increasing the weight of the fourth penalty value will result in extremely smooth and gentle control, but may come at the cost of slightly reducing the response speed of the ideal path following. It is the core component for suppressing high-frequency system jitter and improving ride and driving quality.
[0082] In step 10223, a fifth penalty value is calculated based on the relative position of the third position of the second hook after each control command is executed with respect to the boundary of the first region.
[0083] Here, the fifth penalty value is a key term that mathematically integrates safety, geometric feasibility, and overall optimization feasibility. It does not directly compare "deviations," but rather defines a region that is "undesirable to enter but allowed to briefly enter under penalty." In the embodiments of this application, the fifth penalty value is used to restrict the movement range of the tractor unit to a set range (i.e., the second region) outside the first region, thereby establishing a collision avoidance safety distance between the tractor unit body and the stationary trailer body.
[0084] In some embodiments, see Figure 8 , Figure 8 The calculation of the fifth penalty value in step 10223, based on the relative position of the third position of the second hook after each control command is executed with respect to the boundary of the first region, can be achieved through steps 102231 to 102232.
[0085] In step 102231, a pre-set relaxation vector is obtained.
[0086] Here, by introducing slack variables, hard safety boundaries (such as "the distance must be greater than 0.5 meters") are transformed into soft constraints that allow minor violations but incur high penalty costs. This ensures that even in extreme cases (such as when the initial position is very close to the trailer), the optimization problem always has a solution. The controller automatically trades off between "minor violations of safety clearances (incurring costs)" and "taking extreme obstacle avoidance actions that may lead to loss of control (surge in costs for other deviation terms)," thus always finding a safe and feasible compromise control sequence, albeit an imperfect one.
[0087] As an example, set the relaxation vector to ,in, Denotes the first subvector of the relaxation vector. It is the second sub-vector of the relaxation vector.
[0088] In step 102232, the fifth penalty value is calculated based on the first distance between the third position and the first boundary of the first region, the second distance between the third position and the second boundary of the first region, and the sum of the relaxation vector.
[0089] This application's embodiments transform the limitation on the tractor's movement range from a hard constraint to a soft constraint by introducing a relaxation vector, ensuring the feasibility and practicality of the control system in complex real-world scenarios. This method provides a crucial "elastic buffer" for the optimization algorithm by allowing the movement range to be violated to a limited extent at a corresponding cost, thus ensuring that the model predictive controller can always calculate a feasible control sequence under any initial position or sudden disturbance. This not only avoids system shutdowns caused by unsolvable constraints but also achieves an intelligent quantitative trade-off between safety and accuracy—the controller can autonomously decide whether to temporarily and slightly approach the safety boundary to complete the critical docking action, or to strictly maintain the distance at a greater control cost, improving the overall robustness and reliability of the automatic docking function.
[0090] In the MPC control of tractor-trailer systems, soft constraints are a crucial realistic design tool. They transform idealized performance and safety expectations that may conflict with reality or with the harsh environment into quantifiable, flexible boundaries. By introducing soft constraints, the control system gains vital flexibility and robustness, enabling it to consistently find a "not perfect but overall optimal and feasible" control strategy in complex, non-ideal real-world scenarios, thereby significantly improving the system's practical usability and safety. This is particularly important in safety-critical applications such as autonomous driving.
[0091] In the MPC control of a tractor-trailer system, the relaxation vector is the mathematical embodiment and implementation hub of the soft constraint concept. It transforms the flexible requirement of "appropriate compromise" into a set of variables that can participate in optimization calculations. By incorporating the relaxation variables and their penalty terms into the objective function, the system acquires an intelligent compromise mechanism: it not only ensures that the control problem has a solution under any complex operating condition, but also automatically and quantitatively decides when, to what extent, and which constraint to violate to achieve optimal global performance. This greatly enhances the system's robustness and practicality in real, uncertain environments.
[0092] In some embodiments, step 102232 can be implemented by performing the following steps.
[0093] First, based on the relaxation vector, the third position is extended with the first boundary and the second boundary of the first region to obtain the second region.
[0094] As an example, the second region can be determined by the following formula (2); Formula (2); in, To determine the vehicle status of the tractor after executing the k-th control command, The fifth penalty value, A point on the first boundary of the first region. To make the vertices of the sector, A point on the second boundary of the first region. This indicates the position of the tractor unit when the k-th control command is executed. This represents the fault tolerance vector of the tractor when executing the k-th control command. , .
[0095] Wherein, the position of the tractor after executing the k-th control command It can be calculated using formula (3); Formula (3); in, This indicates the tractor's heading angle after executing the k-th control command. This represents the coordinates of the tractor's position on the X-axis after executing the k-th control command. This represents the coordinates of the tractor's position on the Y-axis after executing the k-th control command. This indicates the distance between the second hook in the tractor and the center of the rear axle of the tractor.
[0096] In formula (2) It can be simplified to That is, we obtain the vectors representing the first boundary and the second boundary of the first region; through formula (2) Rotating the vectors of the first boundary and the second boundary clockwise by 90° yields a vector that can be used to ensure... It lies within the region enclosed by the rotated vectors, i.e., the first region.
[0097] The second region is determined by adding a word vector of the fault-tolerant vector to the distance between the position of the tractor and the first or second boundary after the execution of the k-th control command.
[0098] Then, in the case where the third position is outside the first region but within the second region, the fifth penalty value is calculated based on the sum of the first distance between the third position and the first boundary of the first region, the second distance between the third position and the second boundary of the first region, and the relaxation vector.
[0099] Here, it can be set so that when the third position (the position of the tractor after executing the k-th control command) is within the first area, the fifth penalty value is not calculated; when it is within the second area, the fifth penalty value is calculated based on the distance beyond the first area, and the tractor is not allowed to exceed the second area. The fifth penalty value can be represented as... , This represents the constraint term used to calculate the fifth penalty value after the execution of the i-th control instruction. The weight in the fifth penalty value after executing the i-th control instruction.
[0100] This application embodiment determines a second region larger than the first region based on relaxation vectors, and requires the tractor to move to the trailer position within this region and complete the docking. By expanding the terminal feasible solution space, it significantly improves the success rate and efficiency of path planning, and enhances the overall robustness and fault tolerance of the system to sensor noise, execution errors and environmental uncertainties. At the same time, this method supports the generation of smoother and more natural trajectories, avoiding the operational risks and time consumption caused by frequent fine adjustments in narrow spaces. Thus, while improving the reliability and safety of the system, it ultimately achieves a more efficient, stable and more realistic autonomous docking process.
[0101] In step 10224, the third penalty value, the fourth penalty value, and the fifth penalty value are merged to obtain the second penalty value.
[0102] As an example, the second penalty value obtained is ,in, The third penalty value is L3. The fourth penalty value is L4. The fifth penalty value is L5. This indicates the vehicle status of the tractor after executing N control commands. This indicates the ideal vehicle condition for the tractor unit to achieve accurate docking. This represents the weight of the vehicle state after executing N control commands. This represents the vehicle state of the tractor after executing the i-th control command, and N represents the number of control commands in the control sequence. This represents the weight of the vehicle state after executing the first N-1 control commands. This represents the constraint term used to calculate the fourth penalty value after the execution of the i-th control instruction. This represents the weight in the fourth penalty value after executing the i-th control instruction. This represents the constraint term used to calculate the fifth penalty value after the execution of the i-th control instruction. The weight in the fifth penalty value after executing the i-th control instruction.
[0103] It should be noted that when solving the objective function to obtain the control sequence, the physical limit of the actuator (hard constraint) must be satisfied, which can be expressed as the following formula (4); Formula (4); in, Indicates the steering angle of the tractor unit. This indicates the change in linear velocity carried by the control command. This indicates the change in angular velocity carried by the control command. This indicates the wheelbase of the tractor unit. This indicates the vehicle status of the tractor unit. Indicates control commands. This indicates that the subsequent constraints are satisfied. This indicates a constraint condition.
[0104] Furthermore, in this embodiment, a third penalty value is constructed by considering multiple positional deviations during the movement of the tractor, a fourth penalty value is constructed by considering the control quantity deviation of each control command, and a fifth penalty value is constructed by considering the movement range of the tractor. The third, fourth, and fifth penalty values are then fused to obtain a second penalty value. By solving the objective function with the second penalty value, a control sequence that balances precise guidance, smooth execution, and safety tolerance can be obtained, thereby improving the efficiency and safety of vehicle hook-up.
[0105] In step 1023, the objective function is determined based on the first penalty value and multiple second penalty values.
[0106] Here, the objective function is shown in formula (5); Formula (5); in, The first penalty value is L1. The second penalty value is L2. The third penalty value is L3. The fourth penalty value is L4. The fifth penalty value is L5. This indicates the vehicle status of the tractor after executing N control commands. This indicates the ideal vehicle condition for the tractor unit to achieve accurate docking. This represents the weight of the vehicle state after executing N control commands. This represents the vehicle state of the tractor after executing the i-th control command, and N represents the number of control commands in the control sequence. This represents the weight of the vehicle state after executing the first N-1 control commands. This represents the constraint term used to calculate the fourth penalty value after the execution of the i-th control instruction. This represents the weight in the fourth penalty value after executing the i-th control instruction. This represents the constraint term used to calculate the fifth penalty value after the execution of the i-th control instruction. The weight in the fifth penalty value after executing the i-th control instruction.
[0107] In step 1024, the objective function is solved to obtain the third position of the second hook after each control command is executed, as well as the speed change carried in each control command.
[0108] Here, solving the objective function in MPC essentially transforms an optimal control problem with system dynamics models, state and control constraints into a structured numerical optimization problem within a finite prediction time domain, which is then solved online in real time. Specifically, the objective function is usually designed as a quadratic form to balance the tracking error of the reference trajectory, the magnitude of the control input, and its rate of change. During the solution process, the future state prediction is first represented as a function of the initial state and a series of control inputs using a discretized system model. This is then substituted into the objective function, transforming the original problem into a mathematical programming problem with the future control sequence as the decision variable, minimizing the objective function, and constrained by linear or nonlinear equality (dynamics) and inequality (operational constraints). Finally, iterative solutions are obtained using efficient numerical optimization algorithms (such as the interior-point method or effective set method of quadratic programming QP, or sequential quadratic programming SQP or interior-point method IPOPT for nonlinear problems). However, only the first element of the obtained control sequence is implemented each time, and the optimization is re-executed at the next sampling time using new measurements, thus achieving closed-loop feedback control.
[0109] This application embodiment sets an objective function including a first penalty value and a second penalty value, enabling the MPC controller to adjust the predicted control sequence, while optimizing the accuracy of the final state after the control sequence is completed and the smoothness during the execution of the control sequence. This allows the tractor to achieve a smooth and safe approach to the target and ensures that the first and second hooks can be accurately docked when the tractor is in motion.
[0110] In step 103, the following iterative process is performed to move the second hook to the first position of the first hook: the first control instruction in the control sequence is executed, and a control sequence for the next iteration is generated based on the first position of the first hook and the third position of the second hook in the tractor after the movement.
[0111] Here, the control sequence obtained through the MPC method does not require the tractor to execute the entire sequence at once. It employs a "rolling time domain" strategy: only the first control command in the control sequence (i.e., the one at the current moment) is executed. In the next instant, the sensors acquire a new system state, and MPC then re-predicts and optimizes based on the new state, generating an updated control sequence starting from that new moment, and executing its first command again. This process is repeated continuously, allowing the control to continuously adapt to real-time state changes and external disturbances, ultimately guiding the tractor to smoothly and safely complete the docking along the constantly updated optimal path. Therefore, the control sequence is the core carrier and direct output of MPC's proactive and optimized control.
[0112] In step 104, the first hook and the second hook are docked.
[0113] This embodiment of the application determines a first fan-shaped region based on the position of the first hook in the trailer, and uses control commands to move the tractor unit within the determined first region to the trailer position to achieve hook-up. Since the fan-shaped region is determined based on the position of the first hook, the probability of collision with the trailer is reduced when the tractor unit is within the first region. By moving the tractor unit to the trailer position within the first region, it is ensured that no collision occurs during the hook-up process, thus improving the safety and overall efficiency of the hook-up process.
[0114] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.
[0115] In related technologies, controlling a tractor unit to automatically move to the trailer position and complete hook-up by setting an algorithm typically relies on an integrated perception, planning, and control system. This system first identifies specific markings or features on the trailer using radar or sensors to obtain the attitude information of the trailer's hook, such as the traction pin. Based on this, the planning algorithm calculates a driving trajectory that conforms to vehicle kinematic constraints according to the relative pose of the tractor unit and trailer. The ultimate goal of this trajectory is to precisely align the tractor unit's hook with the trailer's hook. Subsequently, the vehicle's drive-by-wire system executes this planned trajectory, guiding the tractor unit smoothly along the predetermined path at low speed by controlling the steering wheel angle, throttle, and brakes, ultimately achieving hook-up.
[0116] However, the above solutions rely heavily on the accuracy of the planning algorithm. While this algorithm can typically identify obstacles on the road and generate a path to avoid them, it is prone to collisions between the tractor and trailer. The root cause is that when planning the tractor's docking trajectory, traditional algorithms usually only consider the trailer's "docking point" (such as the towing pin or hook) as a static target location to be reached, failing to incorporate the trailer's massive "body structure" as a three-dimensional obstacle that must be avoided into the planning model. This results in a trajectory that, while mathematically perfectly connecting the tractor's starting point to the trailer's docking point, may directly "pass through" the trailer's frame, tires, or cargo box side. In other words, the planning algorithm only solves the problem of "how to get to that point," neglecting the fundamental safety constraint that "the tractor's own body must not scrape against the target object during the journey." When the tractor follows such a "theoretically optimal" but "physically infeasible" path, it will collide with the stationary trailer during the movement, leading to automated docking failure and potential equipment damage.
[0117] See Figure 9 , Figure 9 The illustration shows a flowchart of a vehicle hook docking method in an application scenario provided by an embodiment of this application. The vehicle hook docking method includes the following steps 201 to 204.
[0118] In step 201, the sector area is determined based on the trailer position.
[0119] In this embodiment, the angle of the sector can be set to 60° according to the welcoming structure of the trailer's traction pin, and the vertex of the sector can be set at the first hook of trailer #1, while the vertex of the sector can be set as the hooking point.
[0120] It should be noted that if it is necessary to control the docking of the nth trailer (e.g., trailer 2#) with the (n+1)th trailer (e.g., trailer 1#), the actively controlled nth trailer can be regarded as the tractor.
[0121] In step 202, the tractor is moved into the sector area.
[0122] See Figure 10 , Figure 10 This is a schematic diagram illustrating the principle of setting a fan-shaped area based on the trailer's position in an embodiment of this application. Figure 10 In this process, part of the tractor unit is outside the fan-shaped area. The tractor unit can be moved from position 0 to position 1 within the fan-shaped area by any means. The process does not require high precision in moving the tractor unit, and the tractor unit can be moved into the fan-shaped area by any navigation method (including the MPC method) or by manual driving.
[0123] In step 203, based on the position of the tractor, an objective function containing multiple control commands is constructed to move the tractor to the trailer position within the sector area.
[0124] In the embodiments of this application, an objective function as shown in formula (6) can be constructed; Formula (6); in, This indicates the vehicle status of the tractor after executing N control commands. This indicates the ideal vehicle condition for the tractor unit to achieve accurate docking. This represents the weight of the vehicle state after executing N control commands. This represents the vehicle state of the tractor after executing the i-th control command, and N represents the number of control commands in the control sequence. This represents the weight of the vehicle state after executing the first N-1 control commands. This represents the constraint term used to calculate the fourth penalty value after the execution of the i-th control instruction. This represents the weight in the fourth penalty value after executing the i-th control instruction. This represents the constraint term used to calculate the fifth penalty value after the execution of the i-th control instruction. The weight in the fifth penalty value after executing the i-th control instruction.
[0125] In formula (6), The first penalty value is L1. The second penalty value is L2. The third penalty value is L3. The fourth penalty value is L4. The fifth penalty value is L5.
[0126] The first penalty value reflects the positional deviation between the second hook in the tractor and the second hook (traction pin) of the trailer after executing the complete control sequence. Minimizing the first penalty value ensures that the goal of the entire control action is accurate docking, preventing the tractor from following a smooth path but stopping at the wrong position.
[0127] The second penalty value reflects the smoothness of the entire control sequence execution process after each control command is executed. It penalizes the deviation between the predicted state and the expected reference path at each step from the current moment to the final moment. Minimizing this term ensures that the tractor tracks the path smoothly and consistently throughout its approach to the trailer, without unnecessary back-and-forth swaying or significant deviations. This directly relates to driving safety, comfort, and energy consumption.
[0128] The third penalty value is used to penalize the deviation between the tractor's position at each step of the path and the preset, ideal reference trajectory. By minimizing the third penalty value, the Zener tractor can be forced to closely follow the reference path, avoiding unnecessary detours.
[0129] The fourth penalty value is used to control the linear and angular velocities of the tractor by penalizing the absolute values of the steering wheel angle and throttle / brake opening. Optimizing the fourth penalty value helps save energy, reduce actuator wear, and prevent output saturation. For example, it can effectively avoid vehicle swaying and driver discomfort caused by sudden steering wheel movements.
[0130] The fifth penalty value is used to restrict the movement range of the tractor unit to a sector to establish a safe collision avoidance distance between the tractor unit body and the stationary trailer body.
[0131] The ideal vehicle state of the tractor when achieving accurate docking in formula (6) It can be calculated using formula (7); Formula (7); in, This indicates the coordinates of the attachment point on the X-axis. This indicates the coordinates of the attachment point on the Y-axis. This indicates the steering angle of the tractor unit during the coupling process. This indicates the distance between the second hook in the tractor and the center of the rear axle of the tractor.
[0132] The position of the tractor after executing the k-th control command in formula (6) It can be calculated using formula (8); Formula (8); in, This indicates the tractor's heading angle after executing the k-th control command. This represents the coordinates of the tractor's position on the X-axis after executing the k-th control command. This represents the coordinates of the tractor's position on the Y-axis after executing the k-th control command. This indicates the distance between the second hook in the tractor and the center of the rear axle of the tractor.
[0133] The constraint term in formula (6) used to calculate the fifth penalty value This can be expressed as formula (9); Formula (9); in, To determine the vehicle status of the tractor after executing the k-th control command, The fifth penalty value, A point on the first boundary of the first region. To make the vertices of the sector, A point on the second boundary of the first region. This indicates the position of the tractor unit when the k-th control command is executed. This represents the fault tolerance vector of the tractor when executing the k-th control command. , .
[0134] It should be noted that when solving formula (6), the physical limit of the actuator (hard constraint) must be satisfied, and the hard constraint can be expressed as the following formula (10). Formula (10); in, Indicates the steering angle of the tractor unit. This indicates the change in linear velocity carried by the control command. This indicates the change in angular velocity carried by the control command. This indicates the wheelbase of the tractor unit. This indicates the vehicle status of the tractor unit. Indicates control commands. This indicates that the subsequent constraints are satisfied. This indicates a constraint condition.
[0135] In step 204, the tractor is controlled to move according to the control sequence obtained by solving the objective function, and the hook docking is completed.
[0136] In this embodiment, the future state prediction is first represented as a function of the initial state and a series of control inputs using a discretized system model. This function is then substituted into the objective function, transforming the original problem into a mathematical programming problem with the future control sequence as the decision variable, minimizing the objective function as the goal, and constrained by linear or nonlinear equations (dynamics) and inequalities (operational constraints). Finally, an efficient numerical optimization algorithm (such as the interior-point method or effective set method of quadratic programming QP, or sequential quadratic programming SQP or interior-point method IPOPT for nonlinear problems) is used for iterative solution. However, only the first element of the obtained control sequence is implemented each time, and the above optimization is re-executed at the next sampling time in combination with the new measurement value, thereby achieving closed-loop feedback control.
[0137] It should be noted that each control sequence typically includes multiple control commands (only during the last control operation is a control sequence consisting of a single control command generated). The tractor unit executes only the first control command to change its vehicle state. After the tractor unit executes the first control command, it re-enters step 203 to regenerate the control sequence until the tractor unit reaches the trailer position and completes the vehicle hook-up.
[0138] The following description continues to illustrate the exemplary structure of the vehicle hook docking device 455 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 3 As shown, the software module stored in the vehicle hook docking device 455 in the memory 450 may include: The determination module 4551 is used to determine a first region based on the position of the first hook in the trailer, wherein the first region is a sector with the position of the first hook as the vertex; The prediction module 4552 is used to determine a control sequence based on the first position of the first hook and the second position of the second hook in the tractor, wherein the control sequence includes at least one control command for controlling the tractor to move within a first area to move the second hook to the position of the first hook. The iteration module 4553 is used to perform the following iterative process for moving the second hook to the first position of the first hook: executing the first control instruction in the control sequence, and generating a control sequence for the next iteration based on the first position of the first hook and the third position of the second hook in the tractor after the movement; The docking module 4554 is used to dock the first hook and the second hook.
[0139] In some embodiments, the prediction module 4552 is further configured to calculate a first penalty value based on the position of the first hook and the difference between the fourth position of the second hook after the Nth control instruction is executed, where N is the number of control instructions in the control sequence; For each of the first N-1 control commands, calculate the second penalty value based on the first position of the first hook and the third position of the second hook; The objective function is determined based on the first penalty value and multiple second penalty values; Solve the objective function to obtain the third position of the second hook after each control command is executed, as well as the velocity change carried in each control command.
[0140] In some embodiments, the prediction module 4552 is further configured to calculate a third penalty value based on the difference between the first position of the first hook and the third position of the second hook; Calculate the fourth penalty value based on the speed change carried in each control command; The fifth penalty value is calculated based on the relative position of the third position of the second hook after each control command is executed and the boundary of the first region. The second penalty value is obtained by combining the third, fourth, and fifth penalty values.
[0141] In some embodiments, the prediction module 4552 is further configured to obtain a pre-set relaxation vector; The fifth penalty value is calculated based on the sum of the first distance between the third position and the first boundary of the first region, the second distance between the third position and the second boundary of the first region, and the relaxation vector.
[0142] In some embodiments, the prediction module 4552 is further configured to extend the first region based on the relaxation vector by the third position and the first boundary and the second boundary of the first region to obtain the second region; When the third position is outside the first region but within the second region, the fifth penalty value is calculated based on the sum of the first distance between the third position and the first boundary of the first region, the second distance between the third position and the second boundary of the first region, and the relaxation vector.
[0143] In some embodiments, the prediction module 4552 is further configured to predict a first pose based on the first position of the first hook, wherein the first pose is the pose of the tractor when the fourth position of the second hook coincides with the position hook of the first hook. The deviation vector between the current second pose and the first pose of the tractor is determined as the difference between the first position of the first hook and the third position of the second hook. Based on the difference between the first position of the first hook and the third position of the second hook, a third penalty value is calculated, including: The difference between the first position of the first hook and the third position of the second hook is converted into a scalar, and the scalar is used as the third penalty value.
[0144] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the vehicle hook docking method described above in this application.
[0145] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the vehicle hook docking method provided in this application. For example, ... Figure 4 The method for connecting vehicle hooks is shown.
[0146] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0147] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
[0148] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.
[0149] In summary, this application's embodiments determine a fan-shaped first region based on the position of the first hook in the trailer, and use control commands to move the tractor unit within this determined first region to the trailer position to achieve hook-up. Since the fan-shaped region is determined based on the position of the first hook, the probability of collision with the trailer is reduced when the tractor unit is within this first region. By moving the tractor unit to the trailer position within the first region, collisions are prevented during hook-up, improving the safety and overall efficiency of the hook-up process. Furthermore, by introducing a relaxation vector, the limitation on the tractor unit's movement range is transformed from a hard constraint to a soft constraint, ensuring the feasibility and practicality of the control system in complex real-world scenarios. This method, by allowing the movement range to be violated to a limited extent at a corresponding cost, provides a crucial "elastic buffer space" for the optimization algorithm, thereby ensuring that the model predictive controller can always calculate a feasible control sequence under any initial position or sudden disturbance. This not only avoids system shutdowns caused by unsolvable constraints, but also achieves an intelligent quantitative trade-off between safety and accuracy—the controller can autonomously decide whether to temporarily and slightly approach the safety boundary to complete the critical docking action, or to strictly maintain the distance at a greater control cost, thus improving the overall robustness and reliability of the automatic docking function.
[0150] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A method for docking vehicle hooks, characterized in that, The method includes: Based on the position of the first hook in the trailer, a first region is determined, wherein the first region is a sector with the position of the first hook as its vertex; Based on the first position of the first hook and the second position of the second hook in the tractor, a control sequence is determined, wherein the control sequence includes at least one control command for controlling the tractor to move within the first area, so as to move the second hook to the position of the first hook; The following iterative process is performed to move the second hook to the first position of the first hook: the first control instruction in the control sequence is executed, and a control sequence for the next iteration is generated based on the first position of the first hook and the third position of the second hook in the tractor after the movement. Perform docking between the first hook and the second hook.
2. The vehicle hook docking method according to claim 1, characterized in that, The determination of the control sequence based on the first position of the first hook and the second position of the second hook in the tractor includes: Based on the position of the first hook and the difference between the fourth position of the second hook after the Nth control command is executed, a first penalty value is calculated, where N is the number of control commands in the control sequence; For each of the first N-1 control commands, a second penalty value is calculated based on the first position of the first hook and the third position of the second hook; Based on the first penalty value and multiple second penalty values, the objective function is determined; Solving the objective function yields the third position of the second hook after each control command is executed, and the velocity change carried in each control command.
3. The vehicle hook docking method according to claim 2, characterized in that, The calculation of the second penalty value based on the first position of the first hook and the third position of the second hook includes: A third penalty value is calculated based on the difference between the first position of the first hook and the third position of the second hook; Calculate the fourth penalty value based on the speed change carried in each of the control commands; A fifth penalty value is calculated based on the relative position of the third position of the second hook to the boundary of the first region after each of the control commands is executed; The second penalty value is obtained by combining the third penalty value, the fourth penalty value, and the fifth penalty value.
4. The vehicle hook docking method according to claim 3, characterized in that, The calculation of the fifth penalty value based on the relative position of the third position of the second hook after each control command is executed with respect to the boundary of the first region includes: Obtain the pre-set relaxation vector; The fifth penalty value is calculated based on the first distance between the third position and the first boundary of the first region, the second distance between the third position and the second boundary of the first region, and the sum of the relaxation vector.
5. The vehicle hook docking method according to claim 4, characterized in that, The calculation of the fifth penalty value based on the sum of the first distance between the third position and the first boundary of the first region, the second distance between the third position and the second boundary of the first region, and the relaxation vector includes: Based on the relaxation vector, the third position is extended with the first boundary and the second boundary of the first region to obtain the second region; When the third position is outside the first region but within the second region, the fifth penalty value is calculated based on the first distance between the third position and the first boundary of the first region, the second distance between the third position and the second boundary of the first region, and the sum of the relaxation vector.
6. The vehicle hook docking method according to claim 3, characterized in that, The method further includes: Based on the first position of the first hook, a first pose is predicted, wherein the first pose is the pose of the tractor when the fourth position of the second hook coincides with the position of the first hook. The deviation vector between the current second pose of the tractor and the first pose is determined as the difference between the first position of the first hook and the third position of the second hook; The calculation of the third penalty value based on the difference between the first position of the first hook and the third position of the second hook includes: The difference between the first position of the first hook and the third position of the second hook is converted into a scalar, and the scalar is used as the third penalty value.
7. A vehicle hook-and-connection device, characterized in that, The device includes: The determination module is used to determine a first region based on the position of the first hook in the trailer, wherein the first region is a sector with the position of the first hook as the vertex; The prediction module is used to determine a control sequence based on a first position of the first hook and a second position of the second hook in the tractor, wherein the control sequence includes at least one control command for controlling the tractor to move within the first area to move the second hook to the position of the first hook; An iterative module is configured to perform the following iterative process for moving the second hook to a first position of the first hook: executing the first control instruction in the control sequence, and generating a control sequence for the next iteration based on the first position of the first hook and the third position of the second hook in the tractor after the movement; The docking module is used to dock the first hook and the second hook.
8. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the method described in any one of claims 1 to 6.
10. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the method according to any one of claims 1 to 6.