Harbor tug collision avoidance method based on model prediction path integration and related equipment
By using model-predicted path integral and local weighted projection regression algorithms, a tugboat state prediction model was constructed, and the collision avoidance command sequence was optimized. This solved the problems of real-time performance and feasibility of tugboat collision avoidance in complex dynamic environments, and achieved efficient coordination of obstacle avoidance path planning and control, thereby improving collision avoidance capability and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN UNIV OF TECH
- Filing Date
- 2025-12-23
- Publication Date
- 2026-04-21
AI Technical Summary
In existing technologies, the real-time performance and feasibility of collision avoidance control for tugboats in complex and dynamic maritime environments are poor. Traditional methods are computationally complex and cannot effectively take into account the uncertainties of the actual environment.
A tugboat state prediction model is constructed by using a model-based path integral prediction method combined with a local weighted projection regression algorithm. By simulating control sequences and evaluating trajectory costs, the collision avoidance command sequence is optimized to achieve rapid response and efficient planning.
It improves the real-time performance and reliability of tugboat collision avoidance control, effectively copes with uncertainties in complex dynamic environments, achieves a high degree of coordination between planning and control, and improves obstacle avoidance reliability.
Smart Images

Figure CN121900401A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of ship automation and intelligent navigation technology, and in particular to a collision avoidance method and related equipment for port tugboats based on model predicted path integral. Background Technology
[0002] The booming development of the shipping industry has led to increasing attention being paid to the research of ship intelligence. As the most common type of vessel in ports, the azimuth-turning stern-propulsion tugboat, equipped with a dual 360° omnidirectional propulsion system, can simultaneously achieve dynamic adjustment of propulsion direction and thrust through differential control strategies, providing multi-dimensional execution freedom for control algorithm research. Currently, tugboats operate frequently in port areas. Besides assisting large vessels in berthing and unberthing, they often face complex collision avoidance challenges during escort or return journeys, and must cope with both dynamic and static obstacles. In terms of dynamic collision avoidance, considering the high flexibility of tugboats, they typically need to actively avoid other vessels maintaining a constant course and speed within the port area; in terms of static collision avoidance, they must avoid navigation marks, shorelines, and vessels in berths.
[0003] In related technologies, ship obstacle avoidance methods can optimize the ship's actual control sequence based on the random sampled control sequence corresponding to the ship's current optimal simulated trajectory using the path integral method. The first control input in the optimized actual control sequence is used as the control command at the current moment to drive the system towards the desired state. Then, at the next time step, the latest state of the system is used as the new initial state, and all collision avoidance tasks are iteratively completed. This approach is suitable for solving planning and control problems in complex dynamic environments and has a certain response speed. However, this method usually uses computationally complex and fixed neural network algorithms or simulation software to solve the simulated trajectory, resulting in slow simulation trajectory solution speed and inability to consider uncertainties in the actual environment. Consequently, the real-time performance and feasibility of tugboat collision avoidance control in complex dynamic maritime environments are poor. Summary of the Invention
[0004] The main objective of this application is to propose a collision avoidance method and related equipment for tugboats based on model-predicted path integrals, aiming to improve the real-time performance and reliability of tugboat collision avoidance control.
[0005] To achieve the above objectives, one aspect of this application proposes a collision avoidance method for harbor tugboats based on model predicted path integrals, comprising the following steps: The actual control sequence of the previous control cycle is simulated and sampled to obtain at least one simulated control sequence; the simulated control sequence includes a simulated control command for the tugboat in the predicted time domain; For each time step in the prediction time domain, the tugboat state prediction model, constructed based on the local weighted projection regression algorithm, predicts the future state based on the tugboat state at the current time step and the corresponding simulation control command in the simulation control sequence, to obtain the tugboat state at the next time step; the tugboat state at the current time step is determined based on the actual observed tugboat state or the predicted tugboat state. The tugboat state is predicted at each time step, and the simulated trajectory corresponding to the simulated control sequence is obtained. Cost evaluation is performed on the simulated trajectory corresponding to each of the simulated control sequences to obtain the trajectory cost of each simulated trajectory; the trajectory cost includes collision cost. The path integral of the multiple simulated control sequences is performed based on the trajectory costs of the multiple simulated trajectories to obtain the optimal control sequence, and the optimal control sequence is applied to the tugboat.
[0006] In some embodiments, the tugboat condition prediction model is trained through the following steps: Acquire tugboat maneuvering data sequences and corresponding tugboat status observation sequences; The tugboat maneuvering data sequence and the tugboat state observation sequence are subjected to input feature vector extraction and data preprocessing to obtain a training sample sequence. The training sample sequence is used to initialize multiple local linear models of the tugboat state prediction model, and local weighting and projection dimension reduction regression are performed on the local linear models to obtain the activation weights and model regression parameters of each local linear model. The regression parameters of each model in the tugboat state prediction model are incrementally updated according to the activation weights to obtain the trained tugboat state prediction model.
[0007] In some embodiments, the step of incrementally updating the regression parameters of each model of the tugboat state prediction model according to the activation weights to obtain the trained tugboat state prediction model includes the following steps: The regression parameters of each model in the tugboat state prediction model are incrementally updated according to the activation weights to obtain the incrementally updated local linear model. The distance metric matrix and the number of projection directions of the local linear model are updated based on the verification error during the incremental update process of the local linear model; the distance metric matrix is used to perform local weighting on the local linear model, and the projection directions are used to perform projection dimensionality reduction regression on the local linear model; The next batch of training is performed based on the incrementally updated local linear model, the distance metric matrix, and the projection direction until the iteration condition is met, resulting in a well-trained tugboat state prediction model.
[0008] In some embodiments, the cost evaluation process for the simulated trajectory includes the following steps: The set of obstacle territory points is determined based on the obstacle's motion state and shape; The collision cost is obtained by calculating the distance between the set of points in the domain and the simulated trajectory. The trajectory cost of the simulated trajectory is determined based on the collision cost.
[0009] In some embodiments, the obstacle motion state includes obstacle velocity, obstacle heading angle, and obstacle center position, and the obstacle shape includes obstacle length; determining the obstacle's territory point set based on the obstacle motion state and obstacle shape includes the following steps: The speed of the obstacle is mapped using empirical formulas for forward distance and lateral distance, respectively, to obtain the forward distance coefficient and lateral distance coefficient. The encounter situation is determined based on the heading angle of the obstacle and the heading angle of the tugboat in the tugboat's state; Adjust the radius coefficient of the obstacle on different directional surfaces according to the encounter situation; The radius of the domain on different directional surfaces is determined based on multiple radius coefficients, the obstacle length, the forward distance coefficient, and the lateral distance coefficient. Based on the obstacle's heading angle, the obstacle's center position, and multiple domain radii, a geometric analysis is performed to obtain a set of domain points characterizing the domain boundary features.
[0010] In some embodiments, determining the trajectory cost of the simulated trajectory based on the collision cost includes the following steps: The instantaneous state cost is obtained by calculating the deviation between the trajectory points and the endpoint in the simulated trajectory. The control cost is determined based on the superimposed noise in the actual control sequence and the simulated control sequence corresponding to the simulated trajectory from the previous control cycle. The terminal state cost is obtained by calculating the deviation between the trajectory endpoint state indicated by the simulated trajectory and the expected endpoint state. The trajectory cost is obtained by weighting the instantaneous state cost, the collision cost, the control cost, and the terminal state cost.
[0011] In some embodiments, the step of performing path integration on multiple simulated control sequences based on the trajectory costs of multiple simulated trajectories to obtain the optimal control sequence includes the following steps: The corresponding simulated control sequences are weighted according to the trajectory cost of the simulated trajectory to obtain the control sequence weights; The optimal control sequence is obtained by weighting all the simulated control sequences according to their respective weights.
[0012] To achieve the above objectives, another aspect of this application proposes a port tugboat collision avoidance system based on model predicted path integral, comprising: The first module is used to simulate and sample the actual control sequence of the previous control cycle to obtain at least one simulated control sequence; the simulated control sequence includes a simulated control command for the tugboat in the predicted time domain; The second module is used to predict the future state of the tugboat at each time step in the prediction time domain by using a tugboat state prediction model constructed based on a local weighted projection regression algorithm, based on the tugboat state at the current time step and the corresponding simulation control command in the simulation control sequence, so as to obtain the tugboat state at the next time step; the tugboat state at the current time step is determined based on the actual observed tugboat state or the predicted tugboat state. The third module is used to predict the tugboat state based on each time step and obtain the simulated trajectory corresponding to the simulated control sequence. The fourth module is used to evaluate the cost of each simulated trajectory corresponding to each of the simulated control sequences, and to obtain the trajectory cost of each simulated trajectory; the trajectory cost includes collision cost. The fifth module is used to perform path integration on multiple simulated control sequences based on the trajectory costs of multiple simulated trajectories to obtain an optimal control sequence, and to apply the optimal control sequence to the tugboat.
[0013] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0014] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0015] The embodiments of this application include at least the following beneficial effects: This application provides a collision avoidance method, system, electronic device, and program product for harbor tugboats based on model predicted path integral. This solution directly plans obstacle avoidance paths in the control space using the model predicted path integral method, eliminating the need for a back-end tracker and achieving a high degree of coordination between planning and control, thereby improving obstacle avoidance reliability. Secondly, a tugboat state prediction model is constructed using a locally weighted projection regression algorithm, and multiple simulated trajectories are determined based on the prediction results using this model. The model not only has high budget efficiency but also supports online incremental learning, effectively addressing uncertainties in the real-world environment. This allows for rapid optimization of collision avoidance command sequences in complex scenarios, improving real-time collision avoidance capabilities and reliability in complex dynamic environments. Attached Figure Description
[0016] Figure 1 This is a flowchart of a port tugboat collision avoidance method based on model predicted path integral provided in an embodiment of this application; Figure 2 This is a schematic flowchart of the collision avoidance method for harbor tugboats provided in the embodiments of this application; Figure 3 This is a schematic diagram of the training and application process of the tugboat state prediction model provided in the embodiments of this application; Figure 4 This is a schematic diagram of the LWPR model structure provided in the embodiments of this application; Figure 5 This is a flowchart illustrating the construction of a set of domain points provided in an embodiment of this application; Figure 6 This is a flowchart of the MPPI control process provided in the embodiments of this application; Figure 7 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0019] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.
[0020] LWPR (Locally Weighted Projection Regression) is a fully incremental online learning algorithm for approximating nonlinear functions in high-dimensional spaces. LWPR uses multiple locally linear models to fit the data, each effective only within its local region. During prediction, LWPR assigns different weights to training samples, with samples closer to the query point receiving greater weights, thus ensuring the locality of the model. LWPR incorporates a locally weighted variant of partial least squares for dimensionality reduction; that is, for each local model, the algorithm adaptively selects a small number of the most important directions (projections) in the input space and performs univariate regression along these directions, effectively handling potentially redundant and irrelevant input dimensions in high-dimensional data.
[0021] MPPI (Model Predictive Path Integral) is a nonlinear model predictive control algorithm based on random sampling. It generates multiple future trajectories by randomly perturbing the control sequence, and uses a system dynamics model to perform forward simulation and cost evaluation on these trajectories. The weight of each trajectory is calculated based on its cost, with higher weights for trajectories with lower costs. Finally, the optimal control sequence is updated by weighted averaging of all perturbed trajectories.
[0022] Path planning methods in related technologies, such as graph search-based algorithms or sampling-based methods, have significant limitations when applied to tugboats operating in harbors. These methods often focus on finding the geometrically optimal path, frequently simplifying the tugboat to a point mass and failing to fully consider the complex dynamics and kinematic constraints of the tugboat. This results in planned paths that are often tortuous and discontinuous, with poor executability and difficulty in being directly tracked by the ship's control system. Furthermore, in scenarios with numerous dynamic obstacles and complex environments within port areas, traditional algorithms suffer from high computational costs and difficulty in guaranteeing real-time performance, failing to meet the real-time collision avoidance requirements of tugboats. On the other hand, while existing trajectory optimization methods can partially consider dynamic constraints, such as the dynamic window method or some constrained optimization algorithms, they face bottlenecks in the solution process due to large constraints and slow computation speed, making it difficult to balance real-time performance and feasibility under high-performance requirements.
[0023] By employing the path integral method to optimize the ship's actual control sequence based on the randomly sampled control sequence corresponding to its current optimal simulated trajectory, and using the first control input in the optimized actual control sequence as the control command at the current moment to drive the system toward the desired state, this approach is suitable for solving planning and control problems in complex dynamic environments and has a certain response speed. However, this method typically uses computationally complex and fixed neural network algorithms or simulation software to solve the simulated trajectory, resulting in slow simulation trajectory solution speed and an inability to consider uncertainties in the actual environment. Consequently, the real-time performance and feasibility of tugboat collision avoidance control in complex dynamic maritime environments are poor.
[0024] In view of this, this application provides a collision avoidance method and related equipment for harbor tugboats based on model predicted path integral. This scheme directly plans obstacle avoidance paths in the control space using the model predicted path integral method, eliminating the need for a backend tracker and achieving a high degree of coordination between planning and control, thereby improving obstacle avoidance reliability. Secondly, a tugboat state prediction model is constructed using a locally weighted projection regression algorithm. Based on this model, multiple simulated trajectories are determined from the prediction results. The model not only has high budget efficiency but also supports online incremental learning, effectively addressing uncertainties in the real-world environment. This allows for rapid optimization of collision avoidance command sequences in complex scenarios, improving real-time collision avoidance capabilities and reliability in complex dynamic environments.
[0025] The collision avoidance method for port tugboats based on model predicted path integrals provided in this application relates to the field of ship automation and intelligent navigation technology. This method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or shipborne terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing the collision avoidance method for port tugboats based on model predicted path integrals, but is not limited to the above forms.
[0026] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0027] Figure 1 This is an optional flowchart of a collision avoidance method for harbor tugboats based on model-predicted path integrals provided in this application embodiment. Figure 1 The method may include, but is not limited to, steps S101 to S105.
[0028] S101, simulate and sample the actual control sequence of the previous control cycle to obtain at least one simulated control sequence; the simulated control sequence includes a simulated control command for the tugboat in the predicted time domain; S102, For each time step in the prediction time domain, the tug state prediction model, constructed based on the local weighted projection regression algorithm, predicts the future state based on the tug state at the current time step and the corresponding simulation control commands in the simulation control sequence, and obtains the tug state at the next time step; the tug state at the current time step is determined based on the actual observed tug state or the predicted tug state. S103, based on the predicted state of the tugboat at each time step, the simulated trajectory corresponding to the simulated control sequence is obtained; S104, cost evaluation is performed on the simulated trajectory corresponding to each simulated control sequence to obtain the trajectory cost of each simulated trajectory; the trajectory cost includes collision cost; S105: Based on the trajectory cost of multiple simulated trajectories, perform path integration on multiple simulated control sequences to obtain the optimal control sequence, and apply the optimal control sequence to the tugboat.
[0029] Steps S101 to S105, as illustrated in the embodiments of this application, directly plan obstacle avoidance paths in the control space using the model prediction path integral method, eliminating the need for a backend tracker. This achieves a high degree of coordination between planning and control, improving obstacle avoidance reliability. Secondly, a tugboat state prediction model is constructed using a locally weighted projection regression algorithm. Based on this model, multiple simulated trajectories are determined from the prediction results. The model not only boasts high budget efficiency but also supports online incremental learning, effectively addressing uncertainties in real-world environments. This allows for rapid optimization of collision avoidance command sequences in complex scenarios, enhancing real-time collision avoidance capabilities and reliability in complex dynamic environments.
[0030] Below, please refer to the following: Figure 2 The flowchart illustrating the collision avoidance method for harbor tugboats shows a detailed explanation of the method in this application embodiment: In step S101 of some embodiments, this embodiment performs obstacle avoidance control on the tugboat based on the MPPI controller. The MPPI controller can utilize Gaussian sampling of the tugboat control sequence. Then, based on the constructed LWPR model, forward sampling trajectories are performed, and the sampling trajectory is evaluated using the trajectory cost function. Based on the evaluation results, the control sequence is optimized using path integral. To achieve dynamic collision avoidance.
[0031] In this embodiment, the tugboat control sequence can be defined as the left rudder angle. right rudder angle Left rotation speed Right rotation speed In this embodiment, the tugboat control sequence is divided into an actual control sequence and a simulated control sequence. The actual control sequence refers to the historically applied tugboat control sequence, while the simulated control sequence refers to the tugboat control sequence obtained by simulating and sampling the most recent actual control sequence within the prediction time domain. Simulated sampling can be implemented based on Gaussian sampling and other sampling methods. The specific sampling process for the simulated control sequence is as follows: Generate using Gaussian sampling method The simulation control sequence for the bar tugboat is shown below: ; One of them is an analog control sequence. It contains a simulated control command for the tugboat within a predicted time domain T. The analog control commands are represented as follows: ; Each analog control sequence Based on the actual control sequence of the previous control cycle That is, a historical control sequence superimposed with a Gaussian noise sequence. The generation is represented as follows: ; Among them, the initial Zero, actual control sequence It is the final control instruction sequence optimized from the previous control cycle, an instruction with a prediction step size (i.e., one time step). It can include the left rudder angle right rudder angle Left rotation speed and right rotation speed Four control variables; Gaussian noise sequence It also includes a prediction time domain. The left rudder angle is given separately. right rudder angle Left rotation speed and right rotation speed Superimposed Gaussian noise This forms analog control commands. ,Right now ; Secondly, considering that differential propeller speed control is rarely used in actual tugboat operation ( ),make That is, the noise sequence of the thruster rotation speed adopts the same Gaussian distribution, as defined by the following formula: ; In the formula, These are the variance coefficients of a one-dimensional Gaussian distribution for the left rudder angle, right rudder angle, and propeller speed, respectively. After sampling, for Each control quantity in To limit the amplitude of the analog control command (i.e., the analog control quantity) to within the physically feasible range of the tugboat, the amplitude limiting process is as follows: ; in, , , and The specific values are determined based on the actual performance of the tugboat.
[0032] In steps S102 to S103 of some embodiments, for Analog control sequence obtained by sampling The tugboat status observed at the current moment Starting from the beginning, using the LWPR tugboat motion model trained above, time step by time... Forward simulation, generation simulated trajectory ,in Specifically, the tugboat's state includes its motion state and its position state. The motion state includes its sway speed. sway speed and bow roll rate Constant velocity state. At the initial time step (i.e. Based on the current observed status of the tugboat In and analog control commands = The LWPR model (i.e., tugboat state prediction model) is called to predict the next time step. motion state The position state is calculated using the Euler integral of the LWPR model. By integrating the motion state and the position state, we obtain The tugboat's state at the time step, i.e., the tugboat's position at... The status of the trajectory points at each time step: ; Will As the next time step The starting point of the simulated sampling is thus obtained. =2 tugboat status , and so on until The time step yields a time step-by-time sequence. Simulated trajectories generated by forward simulation .
[0033] This embodiment constructs a three-degree-of-freedom motion data-driven model of a tugboat using locally weighted projection regression. This model is used for forward simulation trajectory sampling of the predicted path integral. The locally weighted projection regression employed is a fully incremental learning model, capable of online parameter updates to address model uncertainties. Furthermore, the proposed path integral method covers uncertainties through sampling and is naturally adaptable to noise and model errors, making it suitable for solving collision avoidance planning and control problems in complex dynamic environments.
[0034] According to some embodiments of this application, the tugboat state prediction model in step S102 is trained through the following steps: S201, acquire the tugboat maneuvering data sequence and the corresponding tugboat status observation sequence; S202, Input feature vector extraction and data preprocessing are performed on the tugboat manipulation data sequence and the tugboat state observation sequence to obtain a training sample sequence; S203. Initialize multiple local linear models of the tugboat state prediction model using training sample sequences, and perform local weighting and projection dimension reduction regression on the local linear models to obtain the activation weights and model regression parameters of each local linear model. S204. Based on the activation weights, incrementally update the regression parameters of each model in the tugboat state prediction model to obtain the trained tugboat state prediction model.
[0035] In this embodiment, the LWPR model (i.e., tugboat state prediction model) constructed is a data-driven three-degree-of-freedom motion model encompassing sway, roll, and pitch. It employs an incremental online learning method, continuously processing new data samples to construct and update a series of local linear models, i.e., receptive fields, thereby approximating the complex nonlinear dynamic characteristics of the tugboat. Compared to traditional nonlinear models such as neural networks, it offers higher computational efficiency. Specifically, please refer to... Figure 3 The diagram shows the training and application process of the tugboat state prediction model. The specific training process of the tugboat state prediction model is as follows: S21, Collect tugboat maneuvering data sequences and tugboat state observation sequences for model training: This embodiment takes into account that azimuth-rotor stern-propulsion tugboats often employ differential rudder angle control in actual operation. Therefore, this embodiment designs a single-sided Z-shaped control experiment. During the experiment, while maintaining the propeller speeds on both sides... A constant operating temperature, such as 400, 450, 500, and 550 rpm, achieved by adjusting the left rudder angle on one side. right rudder angle or right rudder angle Left rudder angle To execute steering maneuvers. During the experiment, the tugboat's steering commands were continuously recorded at 1-second sampling intervals. and the state of motion of the tugboat This yields the tugboat maneuvering data sequence and the tugboat status observation sequence.
[0036] S22, Feature Engineering and Data Preprocessing: To construct a tugboat state prediction model, the model's input and output are first defined. The model's prediction target is the next time step. The motion state of the tugboat, i.e., the output feature vector. : ; in These represent the sway velocity, roll velocity, and bow roll rate, respectively.
[0037] The input feature vector of the model From the current moment The tugboat's motion state and operating commands together constitute the following: ; To eliminate the influence of different physical dimensions, the input feature vector is... and output feature vector Each dimension is Z-score standardized separately. Specifically, for any feature column that needs to be standardized, such as the input features... or output features Let the column be The data points are .
[0038] Calculate and save the standardized parameters of this feature, i.e., the mean. and standard deviation .
[0039] ; ; in, Represents that specific characteristic, such as The Data points.
[0040] Then, the Z-score transformation is applied to each value in this column. Convert to standardized values : ; The above standardization process is for and All feature dimensions are executed independently and repeatedly, and the results of all dimensions are saved. and The parameters are used for prediction and destandardization in subsequent steps. Step S22 extracts input feature vectors and preprocesses the tugboat maneuvering data sequence and tugboat state observation sequence to form a training sample sequence, which is a preprocessed sequence of input feature vectors ordered chronologically.
[0041] S23, Generate a new receptive field (i.e., a local linear model): Please refer to Figure 4 The diagram shows the LWPR model structure. In this embodiment, the LWPR model consists of multiple locally linear models, i.e., receptive fields (RFs). The locally linear models are trained incrementally, processing the standardized data points in the training set one by one. When a new data point Upon input, the local linear model first calculates its relationship with all existing... A sensory field activation weight The activation weights are determined by the Gaussian kernel function, as follows: ; in, It is the first The center vector of each receptive field It is a positive definite distance metric matrix that determines the size and shape of the local region of the receptive field.
[0042] Calculate the maximum activation weight .like Below a preset generation threshold This indicates that the sample If the area is in an unknown region not yet covered by the LWPR model, a new receptive field will be automatically created. The center of the new sensory field Initialize to Distance metric matrix Initialize to preset .
[0043] The new receptive field (i.e., the new local linear model) Partial least squares (PLS) regression is used to achieve projective dimensionality reduction regression, specifically, local prediction. Follow the regression formula below: ; in, It is the model's bias, initialized to ; This is a vector of local regression coefficients, consisting of regression coefficients from multiple projection directions. The vector is composed of elements and initialized to zero. For input The score vector along the projection direction of the receptive field measures how much residual is explained by that projection direction.
[0044] It is 3D vector The number of projection directions represents the high-dimensional input. exist Local optimal projection direction Projection value on, projection direction It is a high-dimensional input A specific linear combination of the included features, such as: ; In the formula, The coefficients of the linear combination, the number of projection directions The projection direction does not exceed the number of dimensions of the input features. The projection direction reduces the dimensionality of the high-dimensional regression problem to a low-dimensional space, and the projection score... The calculation is a recursive process. Specifically, this recursive process involves: calculating... Compared to the center of the receptive field The residuals, i.e., the residuals of the local mean: ; For the first projection direction The residual. Then, for the first... Calculate projection score for each projection. : ; The residual in the next projection direction is updated using the following formula: ; in It is the first Each projection direction vector Is with The relevant regression vectors are both learned by the PLS algorithm during the update.
[0045] In addition, for When it is first created, its projection direction and regression coefficients All are initialized to zero vectors. Therefore, the calculated vectors at this time... The vector is also zero, indicating local prediction. That is, equal to its bias term. . and The vector is assigned a non-zero value through an incremental update process.
[0046] S24, Incrementally update the local regression model: For all activation weights If the receptive field exceeds the threshold, use the current data point. The model is updated online. This process employs an incremental partial least squares (PLS) algorithm, which achieves incremental learning of the model by updating a series of necessary and sufficient statistics. The incremental learning process is as follows:
[0047] a. Update necessary but insufficient statistics: First, iteratively update the receptive field. Cumulative activation weight , center vector and bias terms This series of parameters is used to perform local centering on the input and output data points. The update formulas for each parameter are as follows: ; Initial cumulative weights Initial activation weights ; This is the current data point. right Activation weights; It is a preset global forgetting factor used to control the rate at which the model forgets old data and prevent catastrophic forgetting.
[0048] ; ; initial For the initial data points The initial For the initial data points , These represent the cumulative weights before and after the update, respectively.
[0049] b. Calculate the initial residual: Next, the updated mean is used to calculate the current data point. initial input residual Initial output residual As the starting point for PLS iteration, the residual update formula is as follows:
[0050] ; ; Then, for of Each projection direction, from arrive The PLS parameters are updated iteratively in a loop.
[0051] c. Update sufficient statistics: Similar to calculating the projection score in step S23, the first step is to use the second step. The previously updated projection direction vector and the current input residual calculate: ; The three core sufficient statistics used for PLS regression have been updated, all with forgetting factors. The recursive update method is as follows: ; ; ; in, It is the weighted sum of squares of the projection scores, representing the energy in that projection direction, and is used to normalize the regression coefficients; It is the weighted covariance of the projected score and the output residual, representing the correlation between the projected score and the output residual, and is used to calculate the output regression coefficient; It is the weighted covariance of the projected score and the input residual, representing the correlation between the projected score and the input residual, and is used to calculate the input regression vector.
[0052] d. Update regression parameters: Update using the updated sufficient statistics. The Local regression coefficients and input regression vector .
[0053] ; ; e. Update projection orientation: The projection direction is also updated recursively. This statistic represents the correlation direction between the input residual and the output residual. The projection direction update process is as follows: ; f. Update residuals: Subtract the amount already deducted from the current residual. The components of each projection interpretation are for the next iteration. Prepare: ; ; g. Update the cross-validation statistics: Calculate and recursively update the statistics used for subsequent local linear model complexity evaluation. First, calculate the... Cumulative prediction output of each projection and cross-validation error : ; in, The initial value is zero, that is .
[0054] ; ; in, This is a correction factor used to amplify the standard prediction error. .
[0055] Based on this, the projection cumulative activation weights are updated recursively. and cumulative cross-validation error sum of squares : ; ; in, and All initial values are zero.
[0056] According to some embodiments of this application, step S203 may include, but is not limited to, the following steps: S301, Based on the activation weights, the regression parameters of each model in the tugboat state prediction model are incrementally updated to obtain the incrementally updated local linear model. S302, update the distance metric matrix and projection direction of the local linear model based on the verification error during the incremental update process of the local linear model; the distance metric matrix is used to perform local weighting on the local linear model, and the projection direction is used to perform projection dimension reduction regression on the local linear model; S303, based on the incrementally updated local linear model, distance metric matrix and projection direction, perform the next batch of training until the iteration condition is met, and obtain the trained tugboat state prediction model.
[0057] In this embodiment, please continue to refer to Figure 3 The process shown involves updating the parameters of the local linear model through the incremental learning process described above, in order to increase the receptive field... The shape and size are better adapted to the distribution of local data points, allowing for further online adjustment of the distance metric matrix. This improves the accuracy and efficiency of feature processing for locally linear models. The update of the distance metric matrix can be achieved through a gradient-based meta-learning method (Delta-Bar-Delta, DBD), aiming to minimize validation error (e.g., leave-one-out cross-validation error). Local cost function .Should It is calculated based on the PRESS residual concept during the incremental PLS update process. The verification error calculation formula is as follows: ; For use The cumulative predicted output residuals for each projection direction.
[0058] Based on this Cost function Defined as: ; For the current feeling of wild The total number of accumulated data points traversed, i.e. the number of data points that have been incrementally updated in the receptive field; Representing the The data points are in The activation weights are as follows; for Without using the first When training on the nth data point, for the nth data point... The error generated by predicting from 100 data points is the leave-one-out cross-validation error.
[0059] a. Calculate the gradient: Solving the cost function right Before the gradient, in order to achieve online incremental updates, the algorithm adopts a series of approximations and simplifications.
[0060] Using a single data point Instantaneous costs generated The gradient is used to approximate the total gradient calculation: ; therefore, The definition is simplified to molecules .
[0061] neglect right Dependencies: ; use replace As an error signal: ; In conclusion, right The gradient simplifies to: ; After a series of chain rule derivatives: ; in, Indicates the first There are 100 input data points.
[0062] To ensure the gradient optimization update Positive definiteness; this embodiment uses Cholesky matrix decomposition. ,Right now By solving right gradient Optimization and Update Complete the entire distance metric matrix The update. Differentiation is performed using the chain rule. The formula is expressed as follows: ; Substitution ,have to: ; b. Update the adaptive learning rate: Using the DBD algorithm Each element of the matrix calculates an independent adaptive learning rate. The algorithm needs to maintain two state variables: gradient history. Initialize as a zero matrix; logarithm of the learning rate The initial value is determined by the initial learning rate. Logarithmic definition.
[0063] Update using exponential moving averages to smooth the gradient and capture its long-term trend: ; Among them, the coefficients 0.9 and 0.1 are hyperparameters of the DBD algorithm, which need to be adjusted in real time according to the model training effect.
[0064] By comparing the current gradient and gradient history The sign consistency of corresponding elements determines the update direction.
[0065] like and If corresponding elements have the same sign, it indicates that the gradient direction is stable, so the learning rate should be increased. ; In the formula, The meta-learning rate of the DBD algorithm is a hyperparameter.
[0066] like and If corresponding elements have the same sign, it indicates that the gradient direction oscillates, so the learning rate should be reduced. At the same time, The value of this element is reset to zero so that the gradient accumulation history can be restarted.
[0067] ; c. Calculate the learning rate: To prevent learning rate Explosion or disappearance requires first adjusting the logarithm of the learning rate. Perform boundary clipping: ; In the formula, coefficients 5 and -5 are boundary values and belong to hyperparameters.
[0068] Then, an exponential transformation is performed to obtain the final learning rate. : ; d. Update the distance metric matrix: Using adaptive learning rate right Perform gradient descent: ; Recalculate the distance metric matrix : .
[0069] In this embodiment, please continue to refer to Figure 3 The process shown involves updating the parameters of the local linear model through the incremental learning process described above. To prevent overfitting of the local linear model and improve computational efficiency, for each... Number of projection directions used Adaptive adjustments are performed. Specifically, after incremental updates of the local linear model, it is determined whether a new projection direction needs to be added. The determination method is: comparing the results... Mean square cross-validation error in each projection direction and use Error during projection : ; judge compared to Does the resulting reduction in mean squared cross-validation error meet the preset level, i.e., does it satisfy: ; In the formula, The preset threshold is used to measure the magnitude of the error reduction.
[0070] If the above conditions are met (i.e.) If the error decrease meets the preset level, it indicates that the first... The projection is valid; the model will include the number of projection directions. Increase by 1. At the same time, initialize all relevant statistics for this new projection direction.
[0071] The next batch of training is performed based on the incrementally updated local linear model, distance metric matrix, and projection direction. That is, steps S202 to S203 (i.e. steps S301 to S302) are repeated until the iteration condition is met, and the trained tugboat state prediction model is obtained.
[0072] Based on some embodiments of this application, please continue to refer to Figure 2 For a well-trained LWPR tugboat state prediction model, when a new input feature vector is needed... Perform three-degree-of-freedom motion During prediction, the forward propagation process of the model is as follows: Data saved using the above preprocessing procedure and The parameters are standardized to obtain .
[0073] calculate For all A sensory field activation weight For activation weights Greater than The feeling of wild The algorithm will first compute the centered input: ; Then Projected sequentially to of Projection directions The projected score vector is obtained from the above. : ; Based on this, calculate Local predicted values: ; For all activation weights Greater than of Assuming there are M local predictions, the final prediction is obtained by weighted averaging of these M local predictions: ; Use the above-mentioned saved and Parameter pair Perform destandardization to obtain the next-moment state prediction value with tugboat. .
[0074] In summary, the constructed LWPR prediction model can be expressed as follows: ; In addition, to facilitate the subsequent sampling of the tugboat's forward simulated trajectory by the MPPI controller, the predicted values are... Euler integrals yield the next moment. The tugboat's position status, including its eastward position. Northward position and heading angle The calculation formulas are as follows: ; In the formula, This is the integration time step, usually set to 1 second.
[0075] To facilitate the description of subsequent steps, the LWPR-based tugboat condition prediction model is expressed by the following formula: .
[0076] In step S104 of some embodiments, the cost of each simulated trajectory corresponding to each simulated control sequence is evaluated to obtain the trajectory cost of each simulated trajectory. Specifically, the trajectory cost is generated using a trajectory cost function. simulated trajectory Conduct an evaluation and calculate the total cost for each trajectory. The trajectory cost function achieves obstacle avoidance path planning for tugboats by considering collision costs. Furthermore, the trajectory cost function can also improve the practical operational feasibility of tugboats by taking into account factors such as target tracking performance and control smoothness.
[0077] According to some embodiments of this application, in step S104, the cost evaluation process for the simulated trajectory may include, but is not limited to, the following steps: S401, Determine the set of obstacle territory points based on the obstacle's motion state and obstacle shape; S402, calculates the distance between the set of neighborhood points and the simulated trajectory to obtain the collision cost; S403, determine the trajectory cost of the simulated trajectory based on the collision cost.
[0078] In this embodiment, obstacles can refer to static obstacles in a port and dynamically moving berthed vessels or other tugboats. The obstacle's motion state can include, but is not limited to, obstacle speed, obstacle heading angle, and obstacle center position; the obstacle's shape can include, but is not limited to, obstacle length. This embodiment considers both the obstacle's motion state and shape to determine the obstacle's domain point set, and then calculates the trajectory obstacle avoidance cost based on this domain point set. Compared to treating obstacles as static points, this improves the redundancy and accuracy of obstacle avoidance assessment, thereby enhancing the tugboat obstacle avoidance performance.
[0079] In some embodiments of this application, step S401 may include, but is not limited to, the following steps: S501, the obstacle speed is mapped using empirical formulas for forward distance and lateral distance respectively, and the forward distance coefficient and lateral distance coefficient are obtained accordingly; S502, determine the encounter situation based on the heading angle of the obstacle and the heading angle of the tugboat in its current state; S503, adjust the radius coefficient of the obstacle on different directional surfaces according to the encounter situation; S504 determines the radius of the domain on different directional surfaces based on multiple radius coefficients, obstacle length, forward distance coefficient, and lateral distance coefficient; S505, based on the obstacle heading angle, obstacle center position and multiple domain radii, performs geometric analysis to obtain a set of domain points that characterize the domain boundary features.
[0080] In this embodiment, considering the maneuverability of tugboats, even if the obstructing vessel is defined as an obstruction vessel according to general collision avoidance rules, the tugboat still needs to actively avoid it. Furthermore, during a cross-encounter, the tugboat should avoid the obstructing vessel from its bow and instead avoid it from its stern. To achieve effective collision avoidance, this embodiment employs a ship dynamic domain model. The core purpose of this ship dynamic domain model is to provide a geometric point set description of the obstructing vessel's danger zone (i.e., a set of domain points characterizing the boundary features of the obstructing vessel's domain) for the trajectory cost function of the subsequent MPPI controller, so that MPPI can evaluate the safety and avoidance preference of the sampled trajectory. Please refer to... Figure 5 The specific process of constructing the domain point set is as follows: S31, Calculation of domain parameters (including forward distance coefficient and lateral distance coefficient): For dynamic obstacle vessels, this embodiment adopts a method based on the length of the obstacle vessel. and speed An extended quaternion-based ship dynamics domain model is proposed. The ship dynamics domain model first uses empirical formulas to calculate the forward distance coefficient. and lateral distance coefficient The following are examples: ; ; S32, Calculation of the radius of the area considering the encounter situation: Based on the condition of this tugboat Status of the obstacle vessel Calculate the relative heading angle and normalized to Interval.
[0081] according to This is used to differentiate encounter situations and dynamically adjust the domain range. The ship dynamic domain model uses empirical formulas to calculate the domain range at the bow of the obstacle vessel. Stern , starboard and port side The radii of the domain on the four directional planes are represented as follows: ; in, The radius coefficient is dynamically adjustable and needs to be adjusted according to the encounter situation. Specifically, when the relative bow angle is greater than a preset threshold (e.g., 40°), the encounter situation is considered a cross-encounter situation. The radius coefficient adjustment strategy is to relatively increase the radius coefficient in the bow direction and the side (starboard and port) directions, that is, to minimize the radius coefficient in the stern direction. For example, the relationship between the magnitudes of the various radius coefficients can be... When the relative bow angle is less than a preset threshold, the encounter attitude is considered to be a head-on or overtaking situation. The radius coefficients in the bow and stern directions are relatively increased, with the radius coefficient in the lateral direction being minimized. For example, the relationship between the magnitudes of these radius coefficients can be... It is understood that the embodiments of this application do not impose specific restrictions on the magnitude of the radius coefficients under different encounter situations, as long as the radius coefficient in the direction of the stern face is the smallest under the cross encounter situation, and the radius coefficient in the direction of the side face is the smallest under the face-to-face or overtaking situation.
[0082] S33, Calculation of neighborhood point set: Based on the radius of the domain in four directions Combined with the center position of the obstacle ship and bow angle Calculate the six key vertices of the ship's dynamic domain boundary to form the domain boundary and center point set. The set of neighborhood points is represented as follows: ; in, These are the bow apex, starboard bow shoulder, starboard stern shoulder, stern apex, port stern shoulder, and port bow shoulder, respectively. This parameter is a shape adjustment parameter used to determine the apex of the bow shoulder. Relative to the bow apex The longitudinal shift of the stern causes the area to taper at the bow, the coefficient of which is determined empirically.
[0083] According to some embodiments of this application, step S403 may include, but is not limited to, the following steps: S601, calculate the instantaneous state cost based on the deviation between the trajectory points and the endpoint in the simulated trajectory; S602, determine the control cost based on the superimposed noise in the actual control sequence and the analog control sequence corresponding to the simulated trajectory of the previous control cycle; S603, calculate the deviation between the trajectory endpoint state indicated by the simulated trajectory and the expected endpoint state to obtain the terminal state cost; S604 calculates the trajectory cost by weighting the instantaneous state cost, collision cost, control cost, and terminal state cost.
[0084] In this embodiment, the trajectory cost function It consists of the following weighted components: ; The terms in the trajectory cost function are explained below: For instantaneous state cost, penalize trajectory points and the finish line The deviation, in this embodiment, is the position. and heading With the final state The positional distance and heading deviation are used to "attract" the tugboat to approach the destination. The instantaneous state cost is expressed as follows: ; in, This is the state weight matrix, used to adjust the weight of the deviation between the trajectory point and the endpoint in the total cost.
[0085] Collision cost, used to penalize trajectories Obstacle vessel domain boundary and center point set calculated with ship dynamic domain model The degree of proximity. For each point on the trajectory. Calculate its position To the set of domain points The nearest Euclidean distance .when Less than the preset safe distance At this time, a cost is imposed that increases sharply with decreasing distance. The collision cost is expressed as follows: ; in, As a weight for collision cost, This is the distance difference amplification factor. Additionally, it can be combined with the bow direction of the obstacle vessel. and domain parameters Information such as these can be used to impose additional costs on trajectory points entering the bow area of an obstacle vessel, in order to encourage tugboats to avoid it from the stern.
[0086] It controls costs and is used to penalize excessive Gaussian noise. To encourage control smoothness, the control cost is expressed as follows: ; in, For historical control sequence A transpose of a control instruction with a predicted step size; , It is the inverse matrix of the variance coefficients of the one-dimensional Gaussian distributions of the left rudder angle, right rudder angle, and propeller speed; , The temperature coefficient is a hyperparameter of MPPI used to scale the impact of the cost function on the control sequence weights, controlling the balance between "exploration" and "exploitation" in MPPI. The higher the value, the "flatter" the weight distribution, and both high-cost and low-cost trajectories will receive certain weights, making MPPI more exploratory and controlling the sequence changes more dramatically; otherwise, the opposite is true. These are information-theoretic weighted parameters, belonging to the MPPI hyperparameters, used in... This section adjusts the noise item Its own costs.
[0087] For terminal state cost, the penalty trajectory endpoint With the final target state The deviation is similar in form. However, using different weight matrices .
[0088] In step S105 of some embodiments, path integration is performed on multiple simulated control sequences based on the trajectory costs of multiple simulated trajectories to obtain the optimal control sequence, and the optimal control sequence is applied to the tugboat. The tugboat obstacle avoidance method in this embodiment is implemented based on the MPPI planning and control process, as follows: Figure 6 As shown, the forward simulation trajectory generation and trajectory cost evaluation have been explained in the above embodiments and will not be repeated here. Path integration refers to calculating the control sequence weights (the lower the cost, the higher the weight) for each simulation trajectory based on its cost function, and then taking a weighted average of all control sequences to obtain the optimal control sequence. Determining the optimal control sequence through path integration (weighted averaging) can efficiently handle nonlinear, high-dimensional, and noisy real-time control problems, improving the real-time performance of tugboat obstacle avoidance. Furthermore, in this embodiment, the collision avoidance planning using the model predictive path integral method is implicitly included in the forward simulation trajectory sampling and path integral optimization, which is equivalent to the steps of handling collision avoidance constraints in the traditional model predictive control method. Therefore, the model predictive path integral method can directly output the collision avoidance control command sequence, omitting the guiding law required for back-end trajectory tracking. Its planning and control are highly coordinated, thereby improving the feasibility and real-time performance of planning and control.
[0089] According to some embodiments of this application, step S105 may include, but is not limited to, the following steps: S701, based on the trajectory cost of the simulated trajectory, assign weights to the corresponding simulated control sequences to obtain the control sequence weights; S702, weighted calculation is performed on all simulated control sequences according to the weights of each control sequence to obtain the optimal control sequence.
[0090] In this embodiment, please continue to refer to Figure 6 The optimal control sequence analysis process is as follows: Based on the calculated trajectory cost The simulated trajectory for each sample is calculated using an exponential function. weight : ; ; Among them is The lowest cost among all sampled simulated trajectories will receive a higher weight. Trajectories with excessively high costs will have their weights reset to a minimum or zero.
[0091] Gaussian noise sequence of the simulated control sequence for all sampled trajectories. By performing a weighted average, the current optimal control correction is calculated. : ; Add this correction amount to the historical control sequence The updated optimal control sequence is obtained. : ; To improve control smoothness, the updated... Apply moving average filtering.
[0092] Furthermore, the updated optimal control sequence The first control command Applied to tugboat actuators. Then, Scroll forward one time step to obtain the historical control sequence for the next control cycle. Upon receiving the tugboat status for the next control cycle. Then, repeat steps 1 to 6 to achieve rolling optimization and real-time collision avoidance control.
[0093] According to some embodiments of this application, the beneficial effects of the methods described in these embodiments are as follows: The MPPI controller enables optimization directly within the control space, eliminating the need for a backend tracker and achieving a high degree of synergy between planning and control.
[0094] A data-driven tugboat motion model is constructed using LWPR, which supports online incremental learning and effectively addresses model uncertainties. MPPI utilizes this model for large-scale parallel trajectory sampling, enabling rapid optimization of collision avoidance command sequences in complex scenarios and ensuring real-time collision avoidance capabilities in complex dynamic environments.
[0095] By combining a dynamic ship domain model that considers the encounter situation with a cost function that includes avoidance preferences, a collision avoidance command sequence that highly conforms to the dynamic characteristics and maneuverability of tugboats can be generated while ensuring safety. This effectively solves the problem of balancing real-time performance and feasibility of collision avoidance in the complex environment of port areas.
[0096] This application also provides a port tugboat collision avoidance system based on model predicted path integral, including: The first module is used to simulate and sample the actual control sequence of the previous control cycle to obtain at least one simulated control sequence; the simulated control sequence includes a simulated control command for the tugboat in the predicted time domain; The second module is used to predict the future state of the tugboat at each time step in the prediction time domain by using a tugboat state prediction model built based on a local weighted projection regression algorithm, based on the tugboat state at the current time step and the corresponding simulation control commands in the simulation control sequence, so as to obtain the tugboat state at the next time step; the tugboat state at the current time step is determined based on the actual observed tugboat state or the predicted tugboat state. The third module is used to predict the tugboat state based on each time step and obtain the simulation trajectory corresponding to the simulation control sequence. The fourth module is used to evaluate the cost of each simulated trajectory corresponding to each simulated control sequence, and obtain the trajectory cost of each simulated trajectory; the trajectory cost includes collision cost. The fifth module is used to perform path integration on multiple simulated control sequences based on the trajectory costs of multiple simulated trajectories to obtain the optimal control sequence, and then apply the optimal control sequence to the tugboat.
[0097] It is understood that the methods described in the above method embodiments are applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0098] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method. This electronic device can be any smart terminal, including a tablet computer, a shipboard computer, or similar device.
[0099] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0100] Please see Figure 7 , Figure 7 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 902 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901. The input / output interface 903 is used to implement information input and output; The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904); The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.
[0101] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0102] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0103] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0104] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0105] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0106] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0107] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0108] The system embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0109] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0110] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion.
[0111] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A collision avoidance method for harbor tugboats based on model-predicted path integrals, characterized in that, Includes the following steps: The actual control sequence of the previous control cycle is simulated and sampled to obtain at least one simulated control sequence; the simulated control sequence includes a simulated control command for the tugboat in the predicted time domain; For each time step in the prediction time domain, the tugboat state prediction model, constructed based on the local weighted projection regression algorithm, predicts the future state based on the tugboat state at the current time step and the corresponding simulation control command in the simulation control sequence, to obtain the tugboat state at the next time step; the tugboat state at the current time step is determined based on the actual observed tugboat state or the predicted tugboat state. The tugboat state is predicted at each time step, and the simulated trajectory corresponding to the simulated control sequence is obtained. Cost evaluation is performed on the simulated trajectory corresponding to each of the simulated control sequences to obtain the trajectory cost of each simulated trajectory; the trajectory cost includes collision cost. The path integral of the multiple simulated control sequences is performed based on the trajectory costs of the multiple simulated trajectories to obtain the optimal control sequence, and the optimal control sequence is applied to the tugboat.
2. The collision avoidance method for port tugboats based on model predicted path integral as described in claim 1, characterized in that, The tugboat condition prediction model is trained through the following steps: Acquire tugboat maneuvering data sequences and corresponding tugboat status observation sequences; The tugboat maneuvering data sequence and the tugboat state observation sequence are subjected to input feature vector extraction and data preprocessing to obtain a training sample sequence. The training sample sequence is used to initialize multiple local linear models of the tugboat state prediction model, and local weighting and projection dimension reduction regression are performed on the local linear models to obtain the activation weights and model regression parameters of each local linear model. The regression parameters of each model in the tugboat state prediction model are incrementally updated according to the activation weights to obtain the trained tugboat state prediction model.
3. The collision avoidance method for port tugboats based on model predicted path integral as described in claim 2, characterized in that, The step of incrementally updating the regression parameters of each model in the tugboat state prediction model according to the activation weights to obtain the trained tugboat state prediction model includes the following steps: The regression parameters of each model in the tugboat state prediction model are incrementally updated according to the activation weights to obtain the incrementally updated local linear model. The distance metric matrix and the number of projection directions of the local linear model are updated based on the verification error during the incremental update process of the local linear model; the distance metric matrix is used to perform local weighting on the local linear model, and the projection directions are used to perform projection dimensionality reduction regression on the local linear model; The next batch of training is performed based on the incrementally updated local linear model, the distance metric matrix, and the projection direction until the iteration condition is met, resulting in a well-trained tugboat state prediction model.
4. The collision avoidance method for port tugboats based on model predicted path integral as described in claim 1, characterized in that, The cost evaluation process for the simulated trajectory includes the following steps: The set of obstacle territory points is determined based on the obstacle's motion state and shape; The collision cost is obtained by calculating the distance between the set of points in the domain and the simulated trajectory. The trajectory cost of the simulated trajectory is determined based on the collision cost.
5. The collision avoidance method for port tugboats based on model predicted path integral as described in claim 4, characterized in that, The obstacle's motion state includes the obstacle's velocity, obstacle's heading angle, and obstacle's center position; the obstacle's shape includes the obstacle's length. Determining the set of obstacle territory points based on the obstacle's motion state and shape includes the following steps: The speed of the obstacle is mapped using empirical formulas for forward distance and lateral distance, respectively, to obtain the forward distance coefficient and lateral distance coefficient. The encounter situation is determined based on the heading angle of the obstacle and the heading angle of the tugboat in the tugboat's state; Adjust the radius coefficient of the obstacle on different directional surfaces according to the encounter situation; The radius of the domain on different directional surfaces is determined based on multiple radius coefficients, the obstacle length, the forward distance coefficient, and the lateral distance coefficient. Based on the obstacle's heading angle, the obstacle's center position, and multiple domain radii, a geometric analysis is performed to obtain a set of domain points characterizing the domain boundary features.
6. The collision avoidance method for port tugboats based on model predicted path integral as described in claim 4, characterized in that, Determining the trajectory cost of the simulated trajectory based on the collision cost includes the following steps: The instantaneous state cost is obtained by calculating the deviation between the trajectory points and the endpoint in the simulated trajectory. The control cost is determined based on the superimposed noise in the actual control sequence and the simulated control sequence corresponding to the simulated trajectory from the previous control cycle. The terminal state cost is obtained by calculating the deviation between the trajectory endpoint state indicated by the simulated trajectory and the expected endpoint state. The trajectory cost is obtained by weighting the instantaneous state cost, the collision cost, the control cost, and the terminal state cost.
7. The collision avoidance method for port tugboats based on model predicted path integral as described in claim 1, characterized in that, The step of performing path integration on multiple simulated control sequences based on the trajectory costs of multiple simulated trajectories to obtain the optimal control sequence includes the following steps: The corresponding simulated control sequences are weighted according to the trajectory cost of the simulated trajectory to obtain the control sequence weights; The optimal control sequence is obtained by weighting all the simulated control sequences according to their respective weights.
8. A collision avoidance system for harbor tugboats based on model-predicted path integrals, characterized in that, include: The first module is used to simulate and sample the actual control sequence of the previous control cycle to obtain at least one simulated control sequence; the simulated control sequence includes a simulated control command for the tugboat in the predicted time domain; The second module is used to predict the future state of the tugboat at each time step in the prediction time domain by using a tugboat state prediction model constructed based on a local weighted projection regression algorithm, based on the tugboat state at the current time step and the corresponding simulation control command in the simulation control sequence, so as to obtain the tugboat state at the next time step; the tugboat state at the current time step is determined based on the actual observed tugboat state or the predicted tugboat state. The third module is used to predict the tugboat state based on each time step and obtain the simulated trajectory corresponding to the simulated control sequence. The fourth module is used to evaluate the cost of each simulated trajectory corresponding to each of the simulated control sequences, and to obtain the trajectory cost of each simulated trajectory; the trajectory cost includes collision cost. The fifth module is used to perform path integration on multiple simulated control sequences based on the trajectory costs of multiple simulated trajectories to obtain an optimal control sequence, and to apply the optimal control sequence to the tugboat.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.