Ship directional navigation method, device, equipment and storage medium
Analyze the current route status through the ship's course positioning model, calculate and optimize the target course, solve the problem of poor ship positioning, and improve navigation accuracy and efficiency.
Patent Information
- Application Number
- CN202410556514.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-07
- Publication Date
- 2024-09-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology cannot be combined with the actual navigation status, resulting in poor ship target course positioning and affecting the navigation effect.
The ship course positioning model is adopted, including the actor network layer, commentator network layer and target course output layer. By obtaining the own ship, target ship and terminal information, the current route status is analyzed, the target course is calculated, and the main line reward function and auxiliary line are used Reward function optimizes heading control.
It improves the accuracy and efficiency of ship navigation, reduces unreasonable movements, and achieves more accurate directional navigation.
Smart Images

Figure CN118654672A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of ship navigation technology, and in particular to a ship directional navigation method, device, equipment and storage medium. Background Art
[0002] In recent years, my country's deep-sea aquaculture industry has developed rapidly. Large-scale aquaculture equipment such as cages and workboats are located in deep sea areas far away from land. The transportation distance is long and the sea conditions are relatively complex. The existing deep-sea aquaculture fishery allocation mostly relies on experience and judgment, lacks consideration of multiple factors, resulting in high costs and low efficiency for marine material replenishment and allocation. Ocean transportation plays an extremely important role in the current trade between countries. The path planning problem of ships has always had a profound impact on the development of ocean transportation, and it has gradually developed in the direction of intelligence. In recent years, with the proposal and widespread application of various intelligent algorithms, the research on path planning has achieved good results, but there are also some problems. In the traditional aquaculture process, feed feeding, dead fish recovery and other tasks basically rely on manual labor, which not only has a large workload, but also has inaccurate feeding amount and feeding time, making it difficult to achieve efficient precision farming.
[0003] Smart aquaculture has now become an important development direction, especially deep-sea aquaculture, which has put forward higher requirements for the informatization, automation, and intelligence of aquaculture equipment. By applying the Internet of Things, big data, and refined control systems to the aquaculture process, the manpower input in the offshore fishery aquaculture process can be greatly reduced, and highly automated refined aquaculture can be achieved. Smart aquaculture technology is particularly important for the development of deep-sea marine aquaculture industry. However, based on the actual operation of smart ships, the existing technology cannot be combined with the actual navigation status, resulting in poor navigation effect due to poor ship target heading positioning. Summary of the invention
[0004] The main purpose of the present invention is to provide a method, device, equipment and storage medium for ship directional navigation, aiming to solve the technical problem that the existing technology cannot be combined with the actual navigation status, resulting in poor navigation effect due to poor ship target heading positioning.
[0005] To achieve the above object, the present invention provides a method for ship directional navigation, the method comprising the following steps: Obtaining own ship information, target ship information and destination information, and obtaining the current route status according to the own ship information, target ship information and destination information; The current route state is analyzed by a ship heading positioning model to obtain a target heading, wherein the ship heading positioning model includes an actor network layer, a commentator network layer and a target heading output layer, and the commentator network layer includes a main line reward function, an auxiliary line reward function and an advantage function; The self-ship is controlled to perform directional navigation according to the target heading.
[0006] Optionally, the acquiring the own ship information, the target ship information and the destination information, and obtaining the current route status according to the own ship information, the target ship information and the destination information, includes: Obtaining own ship information, wherein the own ship information includes longitudinal axis speed, transverse axis speed, angular velocity, latitude coordinate, longitude coordinate and rudder angle; Acquire target ship information, wherein the target ship information includes the target ship longitude coordinates, the target ship latitude coordinates, the target ship heading, and the target ship speed; Acquire the destination information, wherein the destination information includes the destination longitude coordinate and the destination latitude coordinate; The current route status is obtained according to the longitudinal axis speed, the transverse axis speed, the angular velocity, the latitude coordinate, the longitude coordinate, the rudder angle, the target ship longitude coordinate, the target ship latitude coordinate, the target ship heading, the target ship speed, the end point longitude coordinate and the end point latitude coordinate.
[0007] Optionally, before acquiring the target ship information, wherein the target ship information includes the target ship longitude coordinates, the target ship latitude coordinates, the target ship heading and the target ship speed, the method further includes: Divide the space around the ship into multiple detection areas; Get the number of other ships within the preset range in each detection area; When the number of the other ships is greater than or equal to 2, calculating the collision risk between each other ship and the own ship; The other ships with the greatest collision risk are taken as target ships.
[0008] Optionally, the current route status includes the own ship status, the target ship status and the destination status; The current route state is obtained according to the longitudinal axis speed, the transverse axis speed, the angular velocity, the latitude coordinate, the longitude coordinate, the rudder angle, the longitude coordinate of the target ship, the latitude coordinate of the target ship, the heading of the target ship, the speed of the target ship, the longitude coordinate of the end point and the latitude coordinate of the end point, including: Obtain the ship state according to the longitudinal axis speed, the transverse axis speed, the angular velocity, the latitude coordinate, the longitude coordinate and the rudder angle; According to the longitude coordinates, latitude coordinates, heading and speed of the target ship, the relative direction, heading, closest encounter distance, closest encounter time and relative collision risk between the target ship and the own ship are obtained; The state of the target ship is obtained according to the relative direction, relative heading, closest encounter distance, closest encounter time and relative collision risk between the target ship and the own ship; According to the longitude coordinates and latitude of the end point, the relative distance and relative direction between the ship and the end point are obtained; The terminal state is obtained according to the relative distance and the relative orientation.
[0009] Optionally, before analyzing the current route state by using the ship heading positioning model to obtain the target heading, the method further includes: Set the initial actor network parameters and initial critic network parameters for the preset model and obtain the ship training status; Generate a ship training prediction action according to the ship training state, and generate a ship training state and a ship training reward at the next moment according to the prediction action; Repeatedly generate the predicted action of ship training at the next moment and the reward of ship training at the next moment according to the ship training state at the next moment, to obtain multiple sets of training data; constructing an advantage function according to the training states of adjacent time steps in the plurality of sets of training data; Adjusting the initial actor network parameters and the initial commentator network parameters in the preset model according to the advantage function to obtain a ship heading positioning model; The analyzing the current route state by the ship heading positioning model to obtain the target heading includes: The action mean of the current route state is obtained through the actor network, the action normal distribution is obtained based on the action mean, and the target heading is obtained according to the action normal distribution.
[0010] Optionally, generating a ship training prediction action according to the ship training state, and generating a ship training state and a ship training reward at a next moment according to the prediction action, comprises: generating a ship training prediction action according to the ship training state; Obtaining the ship training state at the next moment according to the ship training prediction action; The main line reward and the auxiliary line reward of the ship training prediction action are calculated according to the ship training state at the next moment, and the ship training reward is obtained according to the main line reward and the auxiliary line reward.
[0011] Optionally, the calculating the main line reward and the auxiliary line reward of the ship training prediction action according to the ship training state at the next moment, and obtaining the ship training reward according to the main line reward and the auxiliary line reward, includes: According to the ship training state at the next moment, the relative distance between the ship and the end point and the relative distance between the ship and the target ship are obtained; A main line reward is obtained according to the relative distance between the own ship and the end point and the relative distance between the own ship and the target ship; According to the ship training status at the next moment, the comprehensive collision risk between the own ship and the target ship, the distance between the own ship and the destination, the distance deviation and course deviation between the own ship and the preset planned route, the transverse axis speed of the own ship, the number of turns of the own ship and the collision avoidance score are obtained; Auxiliary line rewards are obtained based on the comprehensive collision risk between the own ship and the target ship, the distance between the own ship and the destination, the distance deviation and course deviation between the own ship and the preset planned route, the transverse axis speed of the own ship, the number of turns of the own ship and the collision avoidance score; The ship training reward is obtained according to the main line reward and the auxiliary line reward.
[0012] In addition, in order to achieve the above-mentioned purpose, the present invention also proposes a ship directional navigation device, the ship directional navigation device comprising: A parameter acquisition module is used to acquire the own ship information, the target ship information and the destination information, and obtain the current route status according to the own ship information, the target ship information and the destination information; A directional navigation module, used for analyzing the current route state through a ship heading positioning model to obtain a target heading, wherein the ship heading positioning model includes an actor network layer, a commentator network layer and a target heading output layer, and the commentator network layer includes a main line reward function, an auxiliary line reward function and an advantage function; The directional navigation module is also used to control the ship to perform directional navigation according to the target heading.
[0013] In addition, to achieve the above-mentioned purpose, the present invention also proposes a ship orientation navigation device, which includes: a memory, a processor, and a ship orientation navigation program stored in the memory and executable on the processor, and the ship orientation navigation program is configured to implement the steps of the ship orientation navigation method described above.
[0014] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a ship directional navigation program is stored, and when the ship directional navigation program is executed by a processor, the steps of the ship directional navigation method as described above are implemented.
[0015] The present invention obtains the real-time state of the self-ship during its travel through the information of the self-ship, the target ship information and the destination information, and then analyzes the real-time state according to the trained ship heading positioning model to obtain the target heading at the next moment, and controls the self-ship to travel according to the target heading. The prediction of the target heading is obtained after continuous training in the commentator network and continuous optimization through the main line reward function and the auxiliary line reward function. Based on the self-ship's travel route, the unreasonable actions of the self-ship during its navigation are reduced, and the accuracy and efficiency of the self-ship navigation are effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a structural schematic diagram of a ship directional navigation device in a hardware operating environment involved in an embodiment of the present invention; Figure 2 It is a schematic diagram of the flow chart of the first embodiment of the ship directional navigation method of the present invention; Figure 3 A schematic diagram of the detection area division of an embodiment of a ship directional navigation method of the present invention; Figure 4 It is a schematic flow chart of a second embodiment of the ship directional navigation method of the present invention; Figure 5 A schematic diagram of an actor neural network of an embodiment of a ship directional navigation method of the present invention; Figure 6 A schematic diagram of a critic neural network of an embodiment of a method for ship directional navigation of the present invention; Figure 7 It is a structural block diagram of the first embodiment of the ship directional navigation device of the present invention.
[0017] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0018] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0019] Reference Figure 1 , Figure 1 The present invention is a schematic diagram of the structure of a ship directional navigation device in the hardware operating environment involved in the embodiment of the present invention.
[0020] like Figure 1As shown, the ship directional navigation equipment may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RandomAccess Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0021] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the ship's directional navigation equipment, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0022] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a ship directional navigation program.
[0023] exist Figure 1 In the ship orientation navigation equipment shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the ship orientation navigation equipment of the present invention can be set in the ship orientation navigation equipment, and the ship orientation navigation equipment calls the ship orientation navigation program stored in the memory 1005 through the processor 1001, and executes the ship orientation navigation method provided by the embodiment of the present invention.
[0024] The embodiment of the present invention provides a method for ship directional navigation, referring to Figure 2 , Figure 2 It is a schematic flow chart of the first embodiment of the ship directional navigation method of the present invention.
[0025] In this embodiment, the ship directional navigation method includes the following steps: Step S10: Obtain the own ship information, the target ship information and the destination information, and obtain the current route status according to the own ship information, the target ship information and the destination information.
[0026] It can be understood that the self-ship information includes the longitudinal axis speed, the transverse axis speed, the angular velocity, the latitude coordinate, the longitude coordinate and the rudder angle; the target ship information includes the target ship longitude coordinate, the target ship latitude coordinate, the target ship heading and the target ship speed; the endpoint information includes the endpoint longitude coordinate and the endpoint latitude coordinate.
[0027] It should be understood that the current route status may include the own ship status, the target ship status and the destination status. The own ship status is obtained according to the own ship information, the target ship status is obtained according to the target ship information and the own ship information, and the destination status is obtained according to the destination information and the own ship information.
[0028] In a specific implementation, the state of the own ship can also be obtained according to the longitudinal axis speed, the transverse axis speed, the angular velocity, the latitude coordinate, the longitude coordinate and the rudder angle; the relative direction, relative heading, closest encounter distance, closest encounter time and relative collision time between the target ship and the own ship can be obtained according to the target ship longitude coordinate, the target ship latitude coordinate, the target ship heading and the target ship speed; the state of the target ship can be obtained according to the relative direction, relative heading, closest encounter distance, closest encounter time and relative collision risk between the target ship and the own ship; the relative distance and relative direction between the own ship and the end point can be obtained according to the end point longitude coordinate and the end point latitude; the end point state can be obtained according to the relative distance and the relative direction.
[0029] It is understandable that the current route status can also be understood as directly obtaining the current route status based on the longitudinal axis speed, transverse axis speed, angular velocity, latitude coordinate, longitude coordinate, rudder angle, target ship longitude coordinate, target ship latitude coordinate, target ship heading, target ship speed, endpoint longitude coordinate and endpoint latitude coordinate.
[0030] In the specific implementation, the state space design is mainly divided into three parts: the ship state S os , target ship status S ts And the endpoint information S goal . The state space S of the ship os It contains 7 elements, which are the dynamic parameters of the ship's motion, namely the longitudinal velocity u, the transverse velocity v, the angular velocity r, the latitude coordinate x, the longitude coordinate y, and the rudder angle delta. The state space S of the end point goal Contains 2 elements, namely ||P goal -P|| and B goal . Among them ||P goal -P|| represents the distance between the ship and the end point at this time, B goal is the relative position of the end point relative to the ego ship; the state space S of the i-th target shipi ts Contains 6 elements, which are the relative motion parameters between the target ship and the ego ship. Among them, the distance D of the target ship relative to the ego ship R , relative position B R , relative heading C R , the closest encounter distance d dcpa (Distance at Closest Point of Approach), the closest encounter time t tcpa (Time to Closest Point of Approach), r risk is the collision risk of the target ship relative to the own ship.
[0031] In the specific implementation, the ship state S os , target ship status S ts And the endpoint information S goal The expression of can refer to the series formula:
[0032] It should be emphasized that since the output of the self-ship decision action is the target heading, this will cause changes in the ship's dynamic parameters. Therefore, the longitudinal axis speed u, transverse axis speed v, angular velocity r, latitude coordinate x, longitude coordinate y, and rudder angle delta are mainly selected as the state information of the self-ship.
[0033] It should be further explained that, before obtaining the target ship information, the target ship information includes the target ship longitude coordinates, the target ship latitude coordinates, the target ship heading and the target ship speed, it also includes: The space around the own ship is divided into multiple detection areas; the number of other ships within a preset range in each detection area is obtained; when the number of other ships is greater than or equal to 2, the collision risk of each other ship and the own ship is calculated; and the other ship with the greatest collision risk is taken as the target ship.
[0034] It is understandable that the area around the ship can be evenly divided into 12 detection areas, and the number of ships in each area can be detected with 6nm as the preset range. The number of areas and the detection range can be adjusted according to actual conditions, and this embodiment does not limit this.
[0035] In the specific implementation, since the number of target ships is uncertain, different number of target ships state spaces need to be adopted in different encounter scenarios, which is inconsistent with the fixed dimension of the neural network input layer network nodes. Therefore, in order to solve the problem of fixed dimension, the present invention divides 12 monitoring areas with the ship as the center and 30° as the interval size. The distance range of each monitoring area is 6nm, such as Figure 3In each area, the present invention selects a ship with the greatest collision risk with the own ship as the monitoring object, and records the state information of the target ship as input; when there is no ship in an area, the state information is set to 0, and the state space information of the target ship can refer to the following formula:
[0036] Among them, it should be emphasized that the total state space information can be expressed as: , the number of information inputs is 7+12*6+2=81. Before converting the own ship state, the target ship state and the end point state into the current route state, the own ship state, the target ship state and the end point state can be normalized.
[0037] It is worth noting that with the ship as the center, the area around the ship is reasonably divided, and the most dangerous ship in each area is taken as the target ship, which overcomes the problem of fixed input dimension of deep neural network in the algorithm.
[0038] It should be noted that the executor of this embodiment is the ship's directional navigation equipment, wherein the ship's directional navigation equipment has functions such as data processing, data communication and program running. The ship's directional navigation equipment can be an integrated controller, a control computer and other devices, and of course it can also be other devices with similar functions, and this embodiment does not limit this.
[0039] Step S20: Analyze the current route state through the ship heading positioning model to obtain the target heading, the ship heading positioning model includes an actor network layer, a commentator network layer and a target heading output layer, and the commentator network layer includes a main line reward function, an auxiliary line reward function and an advantage function.
[0040] It is understandable that the ship navigation positioning model can be an algorithmic model built based on the Markov decision process. The Markov decision process (MDP) is a mathematical model of sequential decision-making, which is used to simulate the random strategies and returns that can be achieved by intelligent agents in an environment where the system state has Markov properties. Markov property refers to the property that the probability law of the future development of a random process is independent of the history before observation, which can also be simply described as the lack of aftereffect of the state transition probability. A random process with Markov property of state transition probability is called Markov process.
[0041] It should be noted that the Markov decision process is built on a set of interacting objects, namely the agent and the environment, and its elements include state, action, strategy and reward. In the simulation of MDP, the agent will perceive the current system state, take actions on the environment according to the strategy, thereby changing the state of the environment and getting rewards. The accumulation of rewards over time is called return. The Markov decision process requires the ability to detect the ideal state and can be tried multiple times. The next state of the system is only related to the current state information, not to the earlier state, and is also related to the current action taken during the decision-making process.
[0042] It is worth noting that the Markov decision process has many important properties, such as the Markov property (i.e., the future state depends only on the current state and the action currently performed, and has nothing to do with the past state and action) and the optimal property (i.e., there is an optimal strategy that maximizes the long-term accumulated rewards). These properties enable the Markov decision process to concisely describe random decision problems, have good solvability, and provide a method for optimizing decisions.
[0043] It can be understood that, based on the Markov decision process, the current route state is taken as the element-state of the Markov decision process, and the target heading is taken as the element-action, wherein the critic network layer includes the main line reward function and the auxiliary line reward function as the element-reward; and the process of generating actions according to the advantage function, the parameters of the actor network layer, and the parameters of the critic network layer is taken as the element-strategy.
[0044] It should be noted that the reward function includes the main line reward function and the auxiliary line reward function. The reward function can be understood as scoring the action at each moment. The scoring can be based on whether the action is conducive to the determination of the final goal. For example, is the target heading A at time t closer or farther than the end point, and whether the target heading increases the risk of collision between the self-ship and the target ship.
[0045] It is understandable that based on the main line reward function and the auxiliary line reward function, the target heading of the self-ship at each moment can be evaluated more comprehensively, so that the ship heading positioning model can obtain a target heading that is more conducive to the navigation of the self-ship based on the current navigation state of the ship.
[0046] Step S30: Control the ship to perform directional navigation according to the target heading.
[0047] It is understandable that the action at each moment is connected with the state at the next moment based on Markov decision, and the subsequent target heading is continuously obtained, thereby avoiding the problem of discreteness of the self-ship driving action.
[0048] It should be understood that the target heading may be the ship's travel direction at the next moment that is more conducive to the ship sailing to the destination based on the current navigation status after analysis by the ship's heading positioning model.
[0049] This embodiment obtains the real-time status of the self-ship during its driving process through the information of the self-ship, the target ship information and the destination information, and then analyzes the real-time status according to the trained ship heading positioning model to obtain the target heading at the next moment, and controls the self-ship to travel according to the target heading. The prediction of the target heading is obtained after continuous training in the commentator network and continuous optimization through the main line reward function and the auxiliary line reward function. Based on the self-ship's driving route, the unreasonable actions of the self-ship during its navigation are reduced, and the accuracy and efficiency of the self-ship navigation are effectively improved.
[0050] refer to Figure 4 , Figure 4 It is a flow chart of the second embodiment of the ship directional navigation method of the present invention.
[0051] Based on the first embodiment, the ship directional navigation method of this embodiment further includes, before step S20: Step S201: setting initial actor network parameters and initial commentator network parameters for a preset model, and obtaining a ship training state.
[0052] It is understandable that the ship training state can be the state of the ship at a certain moment in history, the state of the target ship at the same moment, and the state of the destination at the same moment, and the state of the target ship, the ship and the destination at that moment are used as training data.
[0053] It should be understood that the preset model can be a model constructed according to the Markov decision process, which includes an actor network layer, a critic network layer and a target heading output layer, wherein the critic network layer includes a main line reward function, an auxiliary line reward function and an advantage function, and the parameters of the actor network layer and the critic parameters are initialized or randomly set.
[0054] It should be noted that Proximal policy optimization (PPO) is a deep reinforcement learning method based on the actor-critic framework proposed by Schulman et al. in 2017. In the actor-critic framework, the agent generates corresponding actions in the actor network according to different states and strategies. The critic network will comment on the quality of the action and give feedback to the actor network, thereby continuously and repeatedly optimizing and updating the actor-critic network. PPO, as an approximation of the TRPO (Trust Region Policy Optimization) method, uses a surrogate function to solve the step size problem. According to the policy gradient method, the parameter update equation is:
[0055] where θ old and θ new are the policy parameters before and after the update, α is the update step size, and J is the objective function gradient.
[0056] The policy gradient method uses gradients to update parameters, but faces a problem with the update step size. When the step size is not appropriate, the policy corresponding to the updated parameters will be a bad policy, and when this policy is used for sampling learning, the parameters updated again will be worse, resulting in poor learning results. One problem with a fixed step size is that monotonicity cannot be guaranteed, so choosing a suitable step size, a step size that can continuously improve the value of the reward function, is a problem that the PPO algorithm needs to solve.
[0057] In order to improve the efficiency of using online collected samples, PPO divides the same batch of samples into Mini-Batch and reuses them multiple times. At the same time, it limits the parameter update amplitude when calculating the policy gradient to avoid training instability. To achieve this, PPO inherits the idea of TRPO confidence region while avoiding the complexity of the latter's conjugate gradient calculation. Therefore, the objective function of PPO is:
[0058] For further information, see Actor Neural Networks. Figure 6 , the critic neural network model can be referenced Figure 6 .
[0059] Step S202: Generate a ship training prediction action according to the ship training state, and generate a ship training state and a ship training reward at the next moment according to the prediction action.
[0060] It is understandable that the action in this embodiment is an action in the training process. When the ship heading positioning model is actually used, the predicted action at the next moment, that is, the target heading, can be generated according to the current ship driving state based on the trained actor network parameters and commentator network parameters.
[0061] It should be noted that generating a ship training prediction action according to the ship training status, and generating the ship training status and ship training reward at the next moment according to the prediction action may be generating a ship training prediction action according to the ship training status; obtaining the ship training status at the next moment according to the ship training prediction action; calculating the main line reward and the auxiliary line reward of the ship training prediction action according to the ship training status at the next moment, and obtaining the ship training reward according to the main line reward and the auxiliary line reward.
[0062] In the specific implementation, the actor network is based on the current state S of the ship at time t tGenerate an action mean, and form a normal distribution with the variance of the algorithm, and select an action a near the mean from the normal distribution t , thus generating the next state S t+1 and reward r t , get the sampling data {S t , a t , r t}, and repeat this process continuously.
[0063] It is understandable that the reward for the action at the current moment needs to be calculated based on the state at the next moment.
[0064] It should be understood that the variance of the algorithm can be obtained based on the advantage function, which outputs a probability distribution of an action based on the current state. Then, an action is sampled from this probability distribution to be executed.
[0065] It should be noted that the main line reward and the auxiliary line reward of the ship training prediction action are calculated according to the ship training state at the next moment, and the ship training reward is obtained according to the main line reward and the auxiliary line reward, including: According to the ship training status at the next moment, the relative distance between the own ship and the end point and the relative distance between the own ship and the target ship are obtained; according to the relative distance between the own ship and the end point and the relative distance between the own ship and the target ship, the main line reward is obtained; according to the ship training status at the next moment, the comprehensive collision risk between the own ship and the target ship, the distance between the own ship and the end point, the distance deviation and heading deviation between the own ship and the preset planned route, the transverse axis speed of the own ship, the number of turns of the own ship and the collision avoidance score are obtained; according to the comprehensive collision risk between the own ship and the target ship, the distance between the own ship and the end point, the distance deviation and heading deviation between the own ship and the preset planned route, the transverse axis speed of the own ship, the number of turns of the own ship and the collision avoidance score, the auxiliary line reward is obtained; according to the main line reward and the auxiliary line reward, the ship training reward is obtained.
[0066] It should be emphasized that the reward function setting of the present invention is an important part of the whole system. In the present invention, the task of ship driving is divided into two parts: the main line task and the auxiliary line task. The main line task is for the ship to arrive at the destination safely, which includes two tasks: avoiding the target ship and arriving at the destination; the auxiliary line task is a sub-goal other than the main line task, such as making the total collision risk small, the detour distance short, the number of turns small, and the horizontal axis speed small.
[0067] The main line return is as follows:
[0068] in Represents the current distance between the ship and the destination. When the ship is 200 meters away from the destination, it means that the ship has arrived at the destination. Indicates that the relative distance between the ship and any target ship is less than , the algorithm believes that the two ships have collided and the algorithm's collision avoidance mission fails.
[0069] Auxiliary rewards are a kind of immediate feedback rewards. Changes in state information can often reflect changes in the reward function, which is more conducive to the convergence of the algorithm. The auxiliary line reward can refer to the following formula:
[0070] R risk is the collision risk reward value, which is an important parameter to avoid collision risk of ships. The specific calculation method is as follows:
[0071] in, is the sum of the collision risks between the ship and all target ships at the current time t, is the sum of the collision risks between the ship and all target ships at the last time t-1, R risk is the difference between the sum of the collision risks of the ship at the current moment and all target ships and the sum of the collision risks at the previous moment, which is a positive reward value. risk The larger the value, the greater the risk of collision with other ships. risk is 5.
[0072] R goal and R bear They are the distance and direction bonus between the ship and the destination. The two are composed of:
[0073] Among them, P t-1 is the distance between the ship and the destination at time t-1, For the current The distance between the ship and the destination at this moment, P t-1 -P t The larger the value, the closer the ship is to the destination. goal is the weight value, which is 0.2, representing the importance of being close to the end point. ori is the distance between the ship at the initial time and the end point, P t / P ori It means the ratio of the distance between the ship and the destination at the current moment to the distance at the initial moment. As a penalty term, the smaller the value, the better. goal is the relative position between the ship and the end point. For the sub-goal of approaching the end point, B goal As a penalty term, the smaller the better, and λ bear The value is 1.
[0074] Rcross and R head They are the penalty items for the distance deviation and heading deviation between the ship and the planned route, and their compositions are:
[0075] |x j -x os | is the difference between the ship and the planned route on the horizontal axis. It is used to prevent the ship from sailing too far away from the planned route, which will consume a lot of fuel and increase unknown dangers, and does not meet the requirements of good seamanship. |psi os -k| is the difference between the ship's bow direction and the slope of the planned route, which prevents the ship's bow direction from deviating too much from the planned route, which will cause the ship to deviate from the planned route and cause difficulties in resuming navigation. cross , head are weight values, 2 and 1 respectively.
[0076] R drift is the penalty item for excessive transverse speed of the ship. In order to avoid the ship taking too large a heading angle when making decisions, that is, to avoid the ship's speed on the transverse axis being too fast, which does not meet the requirements of good seamanship and will reduce the rudder efficiency, which is not conducive to collision avoidance. The calculation formula is as follows:
[0077] where v os is the ship's transverse axis speed, r os is the angular acceleration of own ship.
[0078] R n is the penalty item for excessive steering of the ship. In actual ship collision avoidance, considering that the ship is a large rigid body with large inertia, in order to maintain a good steering effect, the number of decisions taken by the ship during collision avoidance will not be too many. Therefore, in order to reduce the number of ship decisions, the present invention adds a penalty item for the number of ship steering, which is:
[0079] in Decide the number of turns for the ship at the current moment.
[0080] As the international maritime collision avoidance rules that guide ships to navigate safely at sea and avoid collisions, the algorithm also needs to consider whether the decision-making behavior meets the collision avoidance rules when making decisions. Therefore, the algorithm designs an evaluation function for the collision avoidance rules, and the calculation formula is as follows:
[0081] In summary, the reward function of the algorithm is designed to be the sum of the main line reward and the auxiliary line reward, that is:
[0082] Step S203: repeatedly generating the predicted action of ship training at the next moment and the reward of ship training at the next moment according to the ship training state at the next moment, to obtain multiple sets of training data.
[0083] It is understandable that the training data includes ship training status, ship training predicted actions and ship training rewards.
[0084] It should be understood that the time between multiple sets of training data is continuous, with a single data set being one time step.
[0085] Step S204: constructing an advantage function according to the training states of adjacent time steps in the multiple sets of training data.
[0086] It is understandable that in each time step, the advantage function is constructed by calculating the previous and next states in each time step .
[0087] Step S205: adjusting the initial actor network parameters and the initial commentator network parameters in the preset model according to the advantage function to obtain a ship heading positioning model.
[0088] It is understandable that the actor network and the critic network are updated using Mini-Batch data.
[0089] It should be understood that mini-batch data refers to a small subset of data divided from the entire training data set, which is used for iterative updates during the training process of the machine learning model. When training the model, the entire training data set is usually divided into multiple mini-batches, each mini-batch contains a certain number of training samples, and the number of these samples is usually a power of 2, such as 32, 64, or 128. Using the mini-batch method, the model uses a small batch of data samples for forward propagation, loss calculation, and back propagation at each iteration, and then updates the model parameters according to the gradients of these samples. The main advantage of this method is that it can reduce computational overhead and memory usage, and improve the efficiency of training. At the same time, since each batch provides some different information to the model, this method can also enhance the generalization ability of the model.
[0090] It should be noted that adjusting the initial actor network parameters and the initial commentator network parameters in the preset model according to the advantage function may be to construct a loss function according to the advantage function, as follows:
[0091] Furthermore, Adam back propagation is used to update the parameter value w of the critic network based on the loss function; the objective function L(θ) of the actor network can be calculated in the same way, and Adam back propagation is used to update the parameter value θ of the actor network.
[0092] Among them, using the Adam optimization algorithm based on the loss function for back propagation to update the parameters of the critic network (CriticNetwork) is a commonly used technique in the fields of deep learning and reinforcement learning. The critic network is usually used to estimate the value function or advantage function and guide the behavior of the agent in reinforcement learning. The basic steps for updating the critic network parameters using the Adam optimization algorithm based on the loss function can be first, taking the state or state-action pair as input, forward propagating through the critic network, and obtaining the output of the network (i.e., the estimate of the value function), and calculating the loss function based on the output of the critic network and the true value (or target value). In reinforcement learning, this typically involves computing the difference between the predicted value and the actual return, backpropagating using the gradient of the loss function, computing the gradient of each parameter in the network, initializing the parameters of the Adam optimizer (such as the learning rate, the exponential decay rate of the first-order moment estimate, the exponential decay rate of the second-order moment estimate, etc.) if they have not yet been initialized, exponentially averaging the gradients to smooth out the fluctuations in the gradients, exponentially averaging the squares of the gradients to estimate the scale of the gradients, performing bias correction on the first-order moment estimate and the second-order moment estimate to provide better estimates in the early stages of training, using the first-order moment estimate and the second-order moment estimate to adjust the learning rate of each parameter and update the parameters of the critic network accordingly, and repeating the above steps until a predetermined number of training rounds is reached or other stopping conditions are met, completing the parameter optimization adjustment.
[0093] It is worth emphasizing that the new actor network is assigned to the old actor network and the data collection and model update phases are repeated until the model converges or the maximum time step is reached.
[0094] It should be further explained that after the ship heading positioning model training is completed, the action mean of the current route state is obtained through the actor network, the action normal distribution is obtained based on the action mean, and the target heading is obtained according to the action normal distribution.
[0095] This embodiment is designed by analyzing the Markov decision process by combining the state space, action space, and reward function. A deep neural network is used to perceive the navigation environment information and continuously control the target heading of the ship. The speed remains unchanged, and the movement of the rudder is controlled by the control algorithm in the ship dynamics model. The ship travels to the destination while ensuring the completeness and efficiency of the action space.
[0096] Reference Figure 7 , Figure 7It is a structural block diagram of the first embodiment of the ship directional navigation device of the present invention.
[0097] like Figure 7 As shown, the ship directional navigation device proposed in the embodiment of the present invention includes: The parameter acquisition module 10 is used to acquire the own ship information, the target ship information and the destination information, and obtain the current route status according to the own ship information, the target ship information and the destination information; A directional navigation module 20 is used to analyze the current route state through a ship heading positioning model to obtain a target heading, wherein the ship heading positioning model includes an actor network layer, a commentator network layer and a target heading output layer, and the commentator network layer includes a main line reward function, an auxiliary line reward function and an advantage function; The directional navigation module 20 is also used to control the ship to perform directional navigation according to the target heading.
[0098] This embodiment obtains the real-time status of the self-ship during its driving process through the information of the self-ship, the target ship information and the destination information, and then analyzes the real-time status according to the trained ship heading positioning model to obtain the target heading at the next moment, and controls the self-ship to travel according to the target heading. The prediction of the target heading is obtained after continuous training in the commentator network and continuous optimization through the main line reward function and the auxiliary line reward function. Based on the self-ship's driving route, the unreasonable actions of the self-ship during its navigation are reduced, and the accuracy and efficiency of the self-ship's navigation are effectively improved.
[0099] In one embodiment, the parameter acquisition module 10 is further used to acquire the own ship information, wherein the own ship information includes longitudinal axis speed, transverse axis speed, angular velocity, latitude coordinate, longitude coordinate and rudder angle; Acquire target ship information, wherein the target ship information includes the target ship longitude coordinates, the target ship latitude coordinates, the target ship heading, and the target ship speed; Acquire the destination information, wherein the destination information includes the destination longitude coordinate and the destination latitude coordinate; The current route status is obtained according to the longitudinal axis speed, the transverse axis speed, the angular velocity, the latitude coordinate, the longitude coordinate, the rudder angle, the target ship longitude coordinate, the target ship latitude coordinate, the target ship heading, the target ship speed, the end point longitude coordinate and the end point latitude coordinate.
[0100] In one embodiment, the parameter acquisition module 10 is further used to divide the space around the ship into a plurality of detection areas; Get the number of other ships within the preset range in each detection area; When the number of other ships is greater than or equal to 2, calculating the collision risk between each other ship and the own ship; The other ships with the greatest collision risk are taken as target ships.
[0101] In one embodiment, the parameter acquisition module 10 is further used to obtain the ship state according to the longitudinal axis speed, the transverse axis speed, the angular velocity, the latitude coordinate, the longitude coordinate and the rudder angle; According to the longitude coordinates, latitude coordinates, heading and speed of the target ship, the relative direction, heading, closest encounter distance, closest encounter time and relative collision time between the target ship and the self-ship are obtained; The state of the target ship is obtained according to the relative direction, relative heading, closest encounter distance, closest encounter time and relative collision time between the target ship and the own ship; According to the longitude coordinates and latitude of the end point, the relative distance and relative direction between the ship and the end point are obtained; An end state is obtained according to the relative distance and the relative direction.
[0102] In one embodiment, the directional navigation module 20 is further used to set initial actor network parameters and initial commentator network parameters for a preset model to obtain a ship training state; Generate a ship training prediction action according to the ship training state, and generate a ship training state and a ship training reward at the next moment according to the prediction action; Repeatedly generate the predicted action of ship training at the next moment and the reward of ship training at the next moment according to the ship training state at the next moment, to obtain multiple sets of training data; constructing an advantage function according to the training states of adjacent time steps in the plurality of sets of training data; Adjusting the initial actor network parameters and the initial commentator network parameters in the preset model according to the advantage function to obtain a ship heading positioning model; The analyzing the current route state by the ship heading positioning model to obtain the target heading includes: The action mean of the current route state is obtained through the actor network, the action normal distribution is obtained based on the action mean, and the target heading is obtained according to the action normal distribution.
[0103] In one embodiment, the directional navigation module 20 is further used to generate a ship training prediction action according to the ship training state; Obtaining the ship training state at the next moment according to the ship training prediction action; The main line reward and the auxiliary line reward of the ship training prediction action are calculated according to the ship training state at the next moment, and the ship training reward is obtained according to the main line reward and the auxiliary line reward.
[0104] In one embodiment, the directional navigation module 20 is further used to obtain the relative distance between the ship and the end point and the relative distance between the ship and the target ship according to the ship training state at the next moment; A main line reward is obtained according to the relative distance between the own ship and the end point and the relative distance between the own ship and the target ship; According to the ship training status at the next moment, the comprehensive collision risk between the own ship and the target ship, the distance between the own ship and the destination, the distance deviation and course deviation between the own ship and the preset planned route, the transverse axis speed of the own ship, the number of turns of the own ship and the collision avoidance score are obtained; Auxiliary line rewards are obtained based on the comprehensive collision risk between the own ship and the target ship, the distance between the own ship and the destination, the distance deviation and course deviation between the own ship and the preset planned route, the transverse axis speed of the own ship, the number of turns of the own ship and the collision avoidance score; The ship training reward is obtained according to the main line reward and the auxiliary line reward.
[0105] In addition, to achieve the above-mentioned purpose, the present invention also proposes a ship orientation navigation device, which includes: a memory, a processor, and a ship orientation navigation program stored in the memory and executable on the processor, and the ship orientation navigation program is configured to implement the steps of the ship orientation navigation method described above.
[0106] Since the self-orienting navigation equipment for a ship adopts all the technical solutions of all the above-mentioned embodiments, it has at least all the beneficial effects brought by the technical solutions of the above-mentioned embodiments, which will not be described one by one here.
[0107] In addition, an embodiment of the present invention further proposes a storage medium, on which a ship directional navigation program is stored, and when the ship directional navigation program is executed by a processor, the steps of the ship directional navigation method as described above are implemented.
[0108] Since the storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be described one by one here.
[0109] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.
[0110] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0111] In addition, for technical details not fully described in this embodiment, reference can be made to the ship directional navigation method provided in any embodiment of the present invention, and they will not be described in detail here.
[0112] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0113] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0114] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0115] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0116] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for ship directional navigation, characterized in that: The ship directional navigation method comprises: Obtaining own ship information, target ship information and destination information, and obtaining the current route status according to the own ship information, target ship information and destination information; The current route state is analyzed by a ship heading positioning model to obtain a target heading, wherein the ship heading positioning model includes an actor network layer, a commentator network layer and a target heading output layer, and the commentator network layer includes a main line reward function, an auxiliary line reward function and an advantage function; The self-ship is controlled to perform directional navigation according to the target heading.
2. The ship directional navigation method according to claim 1, characterized in that: The acquiring of the own ship information, the target ship information and the destination information, and obtaining the current route status according to the own ship information, the target ship information and the destination information, includes: Obtaining own ship information, wherein the own ship information includes longitudinal axis speed, transverse axis speed, angular velocity, latitude coordinate, longitude coordinate and rudder angle; Acquire target ship information, wherein the target ship information includes the target ship longitude coordinates, the target ship latitude coordinates, the target ship heading, and the target ship speed; Acquire the destination information, wherein the destination information includes the destination longitude coordinate and the destination latitude coordinate; The current route status is obtained according to the longitudinal axis speed, the transverse axis speed, the angular velocity, the latitude coordinate, the longitude coordinate, the rudder angle, the target ship longitude coordinate, the target ship latitude coordinate, the target ship heading, the target ship speed, the end point longitude coordinate and the end point latitude coordinate.
3. The ship directional navigation method according to claim 2, characterized in that: The acquiring of target ship information, wherein the target ship information includes the target ship longitude coordinates, the target ship latitude coordinates, the target ship heading and the target ship speed, further includes: Divide the space around the ship into multiple detection areas; Get the number of other ships within the preset range in each detection area; When the number of the other ships is greater than or equal to 2, calculating the collision risk between each other ship and the own ship; The other ships with the greatest collision risk are taken as target ships.
4. The ship directional navigation method according to claim 2, characterized in that: The current route status includes the own ship status, the target ship status and the destination status; The current route state is obtained according to the longitudinal axis speed, the transverse axis speed, the angular velocity, the latitude coordinate, the longitude coordinate, the rudder angle, the longitude coordinate of the target ship, the latitude coordinate of the target ship, the heading of the target ship, the speed of the target ship, the longitude coordinate of the end point and the latitude coordinate of the end point, including: Obtain the ship state according to the longitudinal axis speed, the transverse axis speed, the angular velocity, the latitude coordinate, the longitude coordinate and the rudder angle; According to the longitude coordinates, latitude coordinates, heading and speed of the target ship, the relative direction, heading, closest encounter distance, closest encounter time and relative collision risk between the target ship and the own ship are obtained; The state of the target ship is obtained according to the relative position, relative heading, closest encounter distance, closest encounter time and relative collision risk between the target ship and the own ship; According to the longitude coordinates and latitude of the end point, the relative distance and relative direction between the ship and the end point are obtained; The terminal state is obtained according to the relative distance and the relative orientation.
5. The ship directional navigation method according to claim 1, characterized in that: Before analyzing the current route state by the ship heading positioning model to obtain the target heading, the method further includes: Set the initial actor network parameters and initial critic network parameters for the preset model and obtain the ship training status; Generate a ship training prediction action according to the ship training state, and generate a ship training state and a ship training reward at the next moment according to the prediction action; Repeatedly generate the predicted action of ship training at the next moment and the reward of ship training at the next moment according to the ship training state at the next moment, to obtain multiple sets of training data; constructing an advantage function according to the training states of adjacent time steps in the plurality of sets of training data; Adjusting the initial actor network parameters and the initial commentator network parameters in the preset model according to the advantage function to obtain a ship heading positioning model; The analyzing the current route state by the ship heading positioning model to obtain the target heading includes: The action mean of the current route state is obtained through the actor network, the action normal distribution is obtained based on the action mean, and the target heading is obtained according to the action normal distribution.
6. The ship directional navigation method according to claim 5, characterized in that: The generating of the ship training prediction action according to the ship training state, and generating the ship training state and the ship training reward at the next moment according to the prediction action, comprises: generating a ship training prediction action according to the ship training state; Obtaining the ship training state at the next moment according to the ship training prediction action; The main line reward and the auxiliary line reward of the ship training prediction action are calculated according to the ship training state at the next moment, and the ship training reward is obtained according to the main line reward and the auxiliary line reward.
7. The ship directional navigation method according to claim 6, characterized in that: The calculating the main line reward and the auxiliary line reward of the ship training prediction action according to the ship training state at the next moment, and obtaining the ship training reward according to the main line reward and the auxiliary line reward, comprises: According to the ship training state at the next moment, the relative distance between the ship and the end point and the relative distance between the ship and the target ship are obtained; A main line reward is obtained according to the relative distance between the own ship and the end point and the relative distance between the own ship and the target ship; According to the ship training status at the next moment, the comprehensive collision risk between the own ship and the target ship, the distance between the own ship and the destination, the distance deviation and course deviation between the own ship and the preset planned route, the transverse axis speed of the own ship, the number of turns of the own ship and the collision avoidance score are obtained; Auxiliary line rewards are obtained based on the comprehensive collision risk between the own ship and the target ship, the distance between the own ship and the destination, the distance deviation and course deviation between the own ship and the preset planned route, the transverse axis speed of the own ship, the number of turns of the own ship and the collision avoidance score; The ship training reward is obtained according to the main line reward and the auxiliary line reward.
8. A ship directional navigation device, characterized in that: The ship directional navigation device comprises: A parameter acquisition module is used to acquire the own ship information, the target ship information and the destination information, and obtain the current route status according to the own ship information, the target ship information and the destination information; A directional navigation module, used for analyzing the current route state through a ship heading positioning model to obtain a target heading, wherein the ship heading positioning model includes an actor network layer, a commentator network layer and a target heading output layer, and the commentator network layer includes a main line reward function, an auxiliary line reward function and an advantage function; The directional navigation module is also used to control the ship to perform directional navigation according to the target heading.
9. A ship directional navigation device, characterized in that: The device comprises: a memory, a processor and a ship orientation navigation program stored in the memory and executable on the processor, wherein the ship orientation navigation program is configured to implement the ship orientation navigation method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a ship orientation navigation program, and when the ship orientation navigation program is executed by the processor, the ship orientation navigation method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Ship berthing collision early warning method and system and storage medium
CN116110255A
Obstacle avoidance path planning method and system of intelligent ship
CN116300906A
Ship path planning method based on improved CSAC-APF algorithm
CN116360434A
Unmanned ship multi-ship collision avoidance decision-making method and system based on reinforcement learning
CN116954232A
A method and system of navigational decision support in the process of safe vessel navigation
WO2011065848A1
